home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / C / LEX / GETTOK.C < prev    next >
C/C++ Source or Header  |  1993-12-01  |  431b  |  22 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. gettoken(lltb, lltbsiz)
  11. char *lltb;
  12. {
  13.         register char *lp, *tp, *ep;
  14.  
  15.         tp = lltb;
  16.         ep = tp+lltbsiz-1;
  17.         for (lp = llbuf; lp < llend && tp < ep;)
  18.                 *tp++ = *lp++;
  19.         *tp = 0;
  20.         return(tp-lltb);
  21. }
  22.