1: #ifndef lint
2: static char sccsid[] = "@(#)te.c 4.2 8/11/83";
3: #endif
4:
5: /* te.c: error message control, input line count */
6: # include "t..c"
7: error(s)
8: char *s;
9: {
10: fprintf(stderr, "\n%s: line %d: %s\n", ifile, iline, s);
11: # ifdef unix
12: fprintf(stderr, "tbl quits\n");
13: exit(1);
14: # endif
15: # ifdef gcos
16: fprintf(stderr, "run terminated due to error condition detected by tbl preprocessor\n");
17: exit(0);
18: # endif
19: }
20: gets1(s)
21: char *s;
22: {
23: char *p;
24: int nbl = 0;
25: iline++;
26: p=fgets(s,BUFSIZ,tabin);
27: while (p==0)
28: {
29: if (swapin()==0)
30: return(0);
31: p = fgets(s,BUFSIZ,tabin);
32: }
33:
34: while (*s) s++;
35: s--;
36: if (*s == '\n') *s-- =0;
37: for(nbl=0; *s == '\\' && s>p; s--)
38: nbl++;
39: if (linstart && nbl % 2) /* fold escaped nl if in table */
40: gets1(s+1);
41:
42: return(p);
43: }
44: # define BACKMAX 500
45: char backup[BACKMAX];
46: char *backp = backup;
47: un1getc(c)
48: {
49: if (c=='\n')
50: iline--;
51: *backp++ = c;
52: if (backp >= backup+BACKMAX)
53: error("too much backup");
54: }
55: get1char()
56: {
57: int c;
58: if (backp>backup)
59: c = *--backp;
60: else
61: c=getc(tabin);
62: if (c== EOF) /* EOF */
63: {
64: if (swapin() ==0)
65: error("unexpected EOF");
66: c = getc(tabin);
67: }
68: if (c== '\n')
69: iline++;
70: return(c);
71: }
Defined functions
error
defined in line
7; used 27 times
- in line 53,
65
- in /usr/src/usr.bin/tbl/t1.c line
99
- in /usr/src/usr.bin/tbl/t3.c line
57,
82
- in /usr/src/usr.bin/tbl/t4.c line
45,
57-65(3),
73,
86,
99-101(2),
140,
158-162(2),
181,
212,
236
- in /usr/src/usr.bin/tbl/t5.c line
139
- in /usr/src/usr.bin/tbl/t9.c line
12-16(2)
- in /usr/src/usr.bin/tbl/tb.c line
51-54(2),
75
- in /usr/src/usr.bin/tbl/tc.c line
58
- in /usr/src/usr.bin/tbl/tg.c line
14
gets1
defined in line
20; used 6 times
Defined variables
backp
defined in line
46; used 4 times
sccsid
defined in line
2;
never used
Defined macros