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
- in line 49,
61
- in /usr/src/cmd/tbl/t1.c line
94
- in /usr/src/cmd/tbl/t3.c line
53,
78
- in /usr/src/cmd/tbl/t4.c line
41,
53-61(3),
69,
82,
95-97(2),
136,
154-158(2),
177,
208,
232
- in /usr/src/cmd/tbl/t5.c line
133
- in /usr/src/cmd/tbl/t9.c line
8-12(2)
- in /usr/src/cmd/tbl/tb.c line
45-48(2),
67
- in /usr/src/cmd/tbl/tc.c line
54
- in /usr/src/cmd/tbl/tg.c line
10
gets1
defined in line
16; used 6 times
Defined variables
backp
defined in line
42; used 4 times
Defined macros