home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c005 / 5.ddi / C / STCSUB.C < prev    next >
Encoding:
C/C++ Source or Header  |  1986-08-05  |  1.1 KB  |  37 lines

  1. /**
  2. *
  3. * Name        stcsub -- Extract a substring
  4. *
  5. * Synopsis    amov = stcsub(ptarget,psource,cpos,cnt,tarsize);
  6. *
  7. *        int amov      Actual number of characters extracted
  8. *        char *ptarget      Pointer to returned string
  9. *        char *psource      Pointer to source string
  10. *        int cpos      Starting position in source string
  11. *        int cnt       Number of characters to extract
  12. *        int tarsize      Maximum length of the target string
  13. *
  14. * Description    This function extracts a substring of length cnt from
  15. *        the source string starting at position cpos and returns
  16. *        the result in the target string.  Successive calls are
  17. *        made to STCRIGHT and STCLEFT so that cpos and cnt are
  18. *        guaranteed to produce meaningful results.
  19. *
  20. * Returns    amov          Number of characters extracted
  21. *        ptarget       Pointer to extracted string.
  22. *
  23. * Version    3.0 (C)Copyright Blaise Computing Inc.    1983, 1984, 1986
  24. *
  25. **/
  26.  
  27. #include <bstring.h>
  28.  
  29. int stcsub(ptarget,psource,cpos,cnt,tarsize)
  30. char *ptarget,*psource;
  31. int  cpos,cnt,tarsize;
  32. {
  33.      stcright(ptarget,psource,cpos,tarsize);
  34.  
  35.      return(stcleft(ptarget,ptarget,cnt,tarsize));
  36. }
  37.