1: /*
2: * @(#)error.h 1.2 (Berkeley) 1/22/82
3: */
4: typedef int boolean;
5: #define reg register
6:
7: #define TRUE 1
8: #define FALSE 0
9:
10: #define true 1
11: #define false 0
12: /*
13: * Descriptors for the various languages we know about.
14: * If you touch these, also touch lang_table
15: */
16: #define INUNKNOWN 0
17: #define INCPP 1
18: #define INCC 2
19: #define INAS 3
20: #define INLD 4
21: #define INLINT 5
22: #define INF77 6
23: #define INPI 7
24: #define INPC 8
25: #define INFRANZ 9
26: #define INLISP 10
27: #define INVAXIMA 11
28: #define INRATFOR 12
29: #define INLEX 13
30: #define INYACC 14
31: #define INAPL 15
32: #define INMAKE 16
33: #define INRI 17
34:
35: extern int language;
36: /*
37: * We analyze each line in the error message file, and
38: * attempt to categorize it by type, as well as language.
39: * Here are the type descriptors.
40: */
41: typedef int Errorclass;
42:
43: #define C_FIRST 0 /* first error category */
44: #define C_UNKNOWN 0 /* must be zero */
45: #define C_IGNORE 1 /* ignore the message; used for pi */
46: #define C_SYNC 2 /* synchronization errors */
47: #define C_DISCARD 3 /* touches dangerous files, so discard */
48: #define C_NONSPEC 4 /* not specific to any file */
49: #define C_THISFILE 5 /* specific to this file, but at no line */
50: #define C_NULLED 6 /* refers to special func; so null */
51: #define C_TRUE 7 /* fits into true error format */
52: #define C_DUPL 8 /* sub class only; duplicated error message */
53: #define C_LAST 9 /* last error category */
54:
55: #define SORTABLE(x) (!(NOTSORTABLE(x)))
56: #define NOTSORTABLE(x) (x <= C_NONSPEC)
57: /*
58: * Resources to count and print out the error categories
59: */
60: extern char *class_table[];
61: extern int class_count[];
62:
63: #define nunknown class_count[C_UNKNOWN]
64: #define nignore class_count[C_IGNORE]
65: #define nsyncerrors class_count[C_SYNC]
66: #define ndiscard class_count[C_DISCARD]
67: #define nnonspec class_count[C_NONSPEC]
68: #define nthisfile class_count[C_THISFILE]
69: #define nnulled class_count[C_NULLED]
70: #define ntrue class_count[C_TRUE]
71: #define ndupl class_count[C_DUPL]
72:
73: /* places to put the error complaints */
74:
75: #define TOTHEFILE 1 /* touch the file */
76: #define TOSTDOUT 2 /* just print them out (ho-hum) */
77:
78: FILE *errorfile; /* where error file comes from */
79: FILE *queryfile; /* where the query responses from the user come from*/
80:
81: extern char *currentfilename;
82: extern char *processname;
83: extern char *scriptname;
84:
85: extern boolean query;
86: extern boolean terse;
87: int inquire(); /* inquire for yes/no */
88: /*
89: * codes for inquire() to return
90: */
91: #define Q_NO 1 /* 'N' */
92: #define Q_no 2 /* 'n' */
93: #define Q_YES 3 /* 'Y' */
94: #define Q_yes 4 /* 'y' */
95:
96: int probethisfile();
97: /*
98: * codes for probethisfile to return
99: */
100: #define F_NOTEXIST 1
101: #define F_NOTREAD 2
102: #define F_NOTWRITE 3
103: #define F_TOUCHIT 4
104:
105: /*
106: * Describes attributes about a language
107: */
108: struct lang_desc{
109: char *lang_name;
110: char *lang_incomment; /* one of the following defines */
111: char *lang_outcomment; /* one of the following defines */
112: };
113: extern struct lang_desc lang_table[];
114:
115: #define "/*###"
116: #define "%%%*/\n"
117: #define "C###"
118: #define "%%%\n"
119: #define NEWLINE "%%%\n"
120: #define "(*###"
121: #define "%%%*)\n"
122: #define ";###"
123: #define "####"
124: #define CINCOMMENT
125: #define COUTCOMMENT
126: /*
127: * Defines and resources for determing if a given line
128: * is to be discarded because it refers to a file not to
129: * be touched, or if the function reference is to a
130: * function the user doesn't want recorded.
131: */
132: #define IG_FILE1 "llib-lc"
133: #define IG_FILE2 "llib-port"
134: #define IG_FILE3 "/usr/lib/llib-lc"
135: #define IG_FILE4 "/usr/lib/llib-port"
136:
137: #define ERRORNAME "/.errorrc"
138: int nignored;
139: char **names_ignored;
140: /*
141: * Structure definition for a full error
142: */
143: typedef struct edesc Edesc;
144: typedef Edesc *Eptr;
145:
146: struct edesc{
147: Eptr error_next; /*linked together*/
148: int error_lgtext; /* how many on the right hand side*/
149: char **error_text; /* the right hand side proper*/
150: Errorclass error_e_class; /* error category of this error*/
151: Errorclass error_s_class; /* sub descriptor of error_e_class*/
152: int error_language; /* the language for this error*/
153: int error_position; /* oridinal position */
154: int error_line; /* discovered line number*/
155: int error_no; /* sequence number on input */
156: };
157: /*
158: * Resources for the true errors
159: */
160: extern int nerrors;
161: extern Eptr er_head;
162: extern Eptr *errors;
163: /*
164: * Resources for each of the files mentioned
165: */
166: extern int nfiles;
167: extern Eptr **files; /* array of pointers into errors*/
168: boolean *touchedfiles; /* which files we touched */
169: /*
170: * The langauge the compilation is in, as intuited from
171: * the flavor of error messages analyzed.
172: */
173: extern int langauge;
174: extern char *currentfilename;
175: /*
176: * Functional forwards
177: */
178: char *Calloc();
179: char *strsave();
180: char *clobberfirst();
181: char lastchar();
182: char firstchar();
183: char next_lastchar();
184: char **wordvsplice();
185: int wordvcmp();
186: boolean persperdexplode();
187: /*
188: * Printing hacks
189: */
190: char *plural(), *verbform();
Defined variables
Defined struct's
Defined typedef's
Eptr
defined in line
144; used 47 times
- in line 161-147(4)
- in /usr/src/ucb/error/errorfilter.c line
117
- in /usr/src/ucb/error/errorinput.c line
33,
81,
96
- in /usr/src/ucb/error/errormain.c line
9-13(3),
142,
216-218(2)
- in /usr/src/ucb/error/errorsubr.c line
11-15(4),
22(2),
29,
244-247(2)
- in /usr/src/ucb/error/errortouch.c line
20-34(6),
72-76(2),
107,
144-149(3),
179-186(3),
238,
267-271(2),
347,
353-354(2),
445,
521,
676
Errorclass
defined in line
41; used 31 times
- in line 150-151(2)
- in /usr/src/ucb/error/errorfilter.c line
116-121(2)
- in /usr/src/ucb/error/errorinput.c line
13-24(12),
36,
78-79(2),
120,
166,
188,
224,
251,
282,
321,
352,
402,
414,
449
- in /usr/src/ucb/error/errorpi.c line
169
boolean
defined in line
4; used 35 times
- in line 85-86(2),
168,
186
- in /usr/src/ucb/error/errorinput.c line
35
- in /usr/src/ucb/error/errormain.c line
20-23(4),
80-83(4)
- in /usr/src/ucb/error/errorpi.c line
108,
121,
128,
139,
151,
177,
262
- in /usr/src/ucb/error/errorsubr.c line
149,
180,
242
- in /usr/src/ucb/error/errortouch.c line
35(2),
175-177(2),
188,
241,
264,
349,
479-484(2),
522,
677
Defined macros
defined in line
123; used 2 times
defined in line
115; used 2 times
defined in line
116; used 2 times
C_SYNC
defined in line
46; used 12 times
C_TRUE
defined in line
51; used 25 times
- in line 70
- in /usr/src/ucb/error/errorinput.c line
84-90(3),
100,
183,
211,
245,
274,
310-315(2),
344,
395,
444
- in /usr/src/ucb/error/errorpi.c line
215,
236,
278-282(2),
306,
359-363(3)
- in /usr/src/ucb/error/errortouch.c line
57,
207,
368
C_UNKNOWN
defined in line
44; used 30 times
- in line 63
- in /usr/src/ucb/error/errorinput.c line
48-64(13),
163,
185,
213,
248,
279,
318,
347,
359,
381,
397,
412,
446
- in /usr/src/ucb/error/errorpi.c line
278,
360-365(2)
- in /usr/src/ucb/error/errortouch.c line
153
FALSE
defined in line
8; used 22 times
- in /usr/src/ucb/error/errormain.c line
20-23(4),
80-83(4),
144
- in /usr/src/ucb/error/errorpi.c line
136,
155-159(2)
- in /usr/src/ucb/error/errorsubr.c line
174,
205
- in /usr/src/ucb/error/errortouch.c line
52,
60,
217,
232,
382,
479,
503,
598
defined in line
117; used 1 times
defined in line
118; used 1 times
INAPL
defined in line
31;
never used
INAS
defined in line
19; used 1 times
INCC
defined in line
18; used 4 times
INCPP
defined in line
17; used 1 times
INF77
defined in line
22; used 1 times
INLD
defined in line
20; used 4 times
INLEX
defined in line
29;
never used
INPC
defined in line
24;
never used
INPI
defined in line
23; used 8 times
INRI
defined in line
33; used 1 times
defined in line
122; used 1 times
defined in line
120; used 1 times
defined in line
121; used 1 times
Q_NO
defined in line
91; used 3 times
Q_YES
defined in line
93; used 2 times
Q_no
defined in line
92; used 1 times
Q_yes
defined in line
94; used 1 times
defined in line
124; used 1 times
defined in line
125; used 1 times
TRUE
defined in line
7; used 20 times
- in /usr/src/ucb/error/errormain.c line
95-100(6),
141
- in /usr/src/ucb/error/errorpi.c line
134
- in /usr/src/ucb/error/errorsubr.c line
171,
202
- in /usr/src/ucb/error/errortouch.c line
167,
228,
249,
286,
371,
378,
491,
498-500(2),
599
false
defined in line
11; used 3 times
ndupl
defined in line
71;
never used
ntrue
defined in line
70; used 3 times
reg
defined in line
5; used 51 times
- in /usr/src/ucb/error/errorfilter.c line
24,
91-92(2),
117-120(2)
- in /usr/src/ucb/error/errorinput.c line
81-82(2),
226-227(2),
253
- in /usr/src/ucb/error/errormain.c line
218
- in /usr/src/ucb/error/errorpi.c line
122,
130,
152
- in /usr/src/ucb/error/errorsubr.c line
14-17(4),
71-74(3),
89,
153,
184,
246-247(2),
286,
331,
352-354(2),
384-387(3)
- in /usr/src/ucb/error/errortouch.c line
28-30(2),
76,
109,
148-149(2),
184-186(3),
271,
353-354(2),
392-393(2),
521,
542-544(3)
true
defined in line
10; used 1 times
Usage of this include