home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / OS2_LEX.ZIP / GETTOK.C < prev    next >
C/C++ Source or Header  |  1989-10-06  |  432b  |  21 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.  */
  5.  
  6. #include <lex.h>
  7.  
  8. extern char *llend, llbuf[];
  9.  
  10. int gettoken(char *lltb, int lltbsiz)
  11. {
  12.         register char *lp, *tp, *ep;
  13.  
  14.         tp = lltb;
  15.         ep = tp+lltbsiz-1;
  16.         for (lp = llbuf; lp < llend && tp < ep;)
  17.                 *tp++ = *lp++;
  18.         *tp = 0;
  19.         return(tp-lltb);
  20. }
  21.