home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / OS2_LEX.ZIP / LMOVI.C < prev    next >
C/C++ Source or Header  |  1989-10-05  |  732b  |  26 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. int _lmovi(register struct lextab *lp, register int c, register int st)
  9. {
  10.         int base;
  11.  
  12.         while ((base = lp->llbase[st]+c) > lp->llnxtmax ||
  13.                         ((int *)lp->llcheck)[base]!=st)
  14.                 if (st != lp->llendst) {
  15. /*
  16.  * This miscompiled on Decus C many years ago
  17.  *                      st = ((int *)lp->lldefault)[st];
  18.  */
  19.                         base = ((int *)lp->lldefault)[st];
  20.                         st = base;
  21.                 }
  22.                 else
  23.                         return(-1);
  24.         return(((int *)lp->llnext)[base]);
  25. }
  26.