1
0

LMOVB.C 709 B

1234567891011121314151617181920212223242526272829
  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. #include <lex.h>
  6. _lmovb(lp, c, st)
  7. register int c, st;
  8. register struct lextab *lp;
  9. {
  10. int base;
  11. while ((base = lp->llbase[st]+c) > lp->llnxtmax ||
  12. (lp->llcheck[base] & 0377) != st) {
  13. if (st != lp->llendst) {
  14. /*
  15. * This miscompiled on Decus C many years ago:
  16. * st = lp->lldefault[st] & 0377;
  17. */
  18. base = lp->lldefault[st] & 0377;
  19. st = base;
  20. }
  21. else
  22. return(-1);
  23. }
  24. return(lp->llnext[base]&0377);
  25. }