home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_progs / fileutil / scan.lha / src / gettoken.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-05-21  |  484 b   |  23 lines

  1. /*
  2.  * Bob Denny     28-Aug-82  Remove reference to stdio.h
  3.  * Scott Guthery 20-Nov-83    Adapt for IBM PC & DeSmet C
  4.  * William Lee   28-Dec-86  Adapt for Commodore-Amiga 1000 and Lattice C.
  5.  */
  6.  
  7. #include "lex.h"
  8.  
  9. extern char *llend, llbuf[];
  10.  
  11. gettoken(lltb, lltbsiz)
  12. char *lltb;
  13. {
  14.         register char *lp, *tp, *ep;
  15.  
  16.         tp = lltb;
  17.         ep = tp+lltbsiz-1;
  18.         for (lp = llbuf; lp < llend && tp < ep;)
  19.                 *tp++ = *lp++;
  20.         *tp = 0;
  21.         return(tp-lltb);
  22. }
  23.