1:  /* te.c: error message control, input line count */
   2: # include "t..c"
   3: error(s)
   4:     char *s;
   5: {
   6: fprintf(stderr, "\n%s: line %d: %s\n", ifile, iline, s);
   7: # ifdef unix
   8: fprintf(stderr, "tbl quits\n");
   9: exit(1);
  10: # endif
  11: # ifdef gcos
  12: fprintf(stderr, "run terminated due to error condition detected by tbl preprocessor\n");
  13: exit(0);
  14: # endif
  15: }
  16: gets1(s)
  17:     char *s;
  18: {
  19: char *p;
  20: int nbl = 0;
  21: iline++;
  22: p=fgets(s,512,tabin);
  23: while (p==0)
  24:     {
  25:     if (swapin()==0)
  26:         return(0);
  27:     p = fgets(s,512,tabin);
  28:     }
  29: 
  30: while (*s) s++;
  31: s--;
  32: if (*s == '\n') *s-- =0;
  33: for(nbl=0; *s == '\\' && s>p; s--)
  34:     nbl++;
  35: if (linstart && nbl % 2) /* fold escaped nl if in table */
  36:     gets1(s+1);
  37: 
  38: return(p);
  39: }
  40: # define BACKMAX 500
  41: char backup[BACKMAX];
  42: char *backp = backup;
  43: un1getc(c)
  44: {
  45: if (c=='\n')
  46:     iline--;
  47: *backp++ = c;
  48: if (backp >= backup+BACKMAX)
  49:     error("too much backup");
  50: }
  51: get1char()
  52: {
  53: int c;
  54: if (backp>backup)
  55:     c = *--backp;
  56: else
  57:     c=getc(tabin);
  58: if (c== EOF) /* EOF */
  59:     {
  60:     if (swapin() ==0)
  61:         error("unexpected EOF");
  62:     c = getc(tabin);
  63:     }
  64: if (c== '\n')
  65:     iline++;
  66: return(c);
  67: }

Defined functions

error defined in line 3; used 27 times
get1char defined in line 51; used 9 times
gets1 defined in line 16; used 6 times
un1getc defined in line 43; used 7 times

Defined variables

backp defined in line 42; used 4 times
backup defined in line 41; used 3 times

Defined macros

BACKMAX defined in line 40; used 2 times
Last modified: 1981-07-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 794
Valid CSS Valid XHTML 1.0 Strict