1: /*
2: * Copyright (c) 1980 Regents of the University of California.
3: * All rights reserved. The Berkeley software License Agreement
4: * specifies the terms and conditions for redistribution.
5: *
6: * @(#)error.h 5.1.1 (2.11BSD) 1996/10/23
7: */
8:
9: typedef int boolean;
10: #define reg register
11:
12: #define TRUE 1
13: #define FALSE 0
14:
15: #define true 1
16: #define false 0
17: /*
18: * Descriptors for the various languages we know about.
19: * If you touch these, also touch lang_table
20: */
21: #define INUNKNOWN 0
22: #define INCPP 1
23: #define INCC 2
24: #define INAS 3
25: #define INLD 4
26: #define INLINT 5
27: #define INF77 6
28: #define INPI 7
29: #define INPC 8
30: #define INFRANZ 9
31: #define INLISP 10
32: #define INVAXIMA 11
33: #define INRATFOR 12
34: #define INLEX 13
35: #define INYACC 14
36: #define INAPL 15
37: #define INMAKE 16
38: #define INRI 17
39: #define INTROFF 18
40: #define INMOD2 19
41:
42: extern int language;
43: /*
44: * We analyze each line in the error message file, and
45: * attempt to categorize it by type, as well as language.
46: * Here are the type descriptors.
47: */
48: typedef int Errorclass;
49:
50: #define C_FIRST 0 /* first error category */
51: #define C_UNKNOWN 0 /* must be zero */
52: #define C_IGNORE 1 /* ignore the message; used for pi */
53: #define C_SYNC 2 /* synchronization errors */
54: #define C_DISCARD 3 /* touches dangerous files, so discard */
55: #define C_NONSPEC 4 /* not specific to any file */
56: #define C_THISFILE 5 /* specific to this file, but at no line */
57: #define C_NULLED 6 /* refers to special func; so null */
58: #define C_TRUE 7 /* fits into true error format */
59: #define C_DUPL 8 /* sub class only; duplicated error message */
60: #define C_LAST 9 /* last error category */
61:
62: #define SORTABLE(x) (!(NOTSORTABLE(x)))
63: #define NOTSORTABLE(x) (x <= C_NONSPEC)
64: /*
65: * Resources to count and print out the error categories
66: */
67: extern char *class_table[];
68: extern int class_count[];
69:
70: #define nunknown class_count[C_UNKNOWN]
71: #define nignore class_count[C_IGNORE]
72: #define nsyncerrors class_count[C_SYNC]
73: #define ndiscard class_count[C_DISCARD]
74: #define nnonspec class_count[C_NONSPEC]
75: #define nthisfile class_count[C_THISFILE]
76: #define nnulled class_count[C_NULLED]
77: #define ntrue class_count[C_TRUE]
78: #define ndupl class_count[C_DUPL]
79:
80: /* places to put the error complaints */
81:
82: #define TOTHEFILE 1 /* touch the file */
83: #define TOSTDOUT 2 /* just print them out (ho-hum) */
84:
85: FILE *errorfile; /* where error file comes from */
86: FILE *queryfile; /* where the query responses from the user come from*/
87:
88: extern char *currentfilename;
89: extern char *processname;
90: extern char *scriptname;
91:
92: extern boolean query;
93: extern boolean terse;
94: int inquire(); /* inquire for yes/no */
95: /*
96: * codes for inquire() to return
97: */
98: #define Q_NO 1 /* 'N' */
99: #define Q_no 2 /* 'n' */
100: #define Q_YES 3 /* 'Y' */
101: #define Q_yes 4 /* 'y' */
102:
103: int probethisfile();
104: /*
105: * codes for probethisfile to return
106: */
107: #define F_NOTEXIST 1
108: #define F_NOTREAD 2
109: #define F_NOTWRITE 3
110: #define F_TOUCHIT 4
111:
112: /*
113: * Describes attributes about a language
114: */
115: struct lang_desc{
116: char *lang_name;
117: char *lang_incomment; /* one of the following defines */
118: char *lang_outcomment; /* one of the following defines */
119: };
120: extern struct lang_desc lang_table[];
121:
122: #define "/*###"
123: #define "%%%*/\n"
124: #define "C###"
125: #define "%%%\n"
126: #define NEWLINE "%%%\n"
127: #define "(*###"
128: #define "%%%*)\n"
129: #define ";###"
130: #define "####"
131: #define CINCOMMENT
132: #define COUTCOMMENT
133: #define ".\\\"###"
134: #define NEWLINE
135: #define "(*###"
136: #define "%%%*)\n"
137: /*
138: * Defines and resources for determing if a given line
139: * is to be discarded because it refers to a file not to
140: * be touched, or if the function reference is to a
141: * function the user doesn't want recorded.
142: */
143: #define IG_FILE1 "llib-lc"
144: #define IG_FILE2 "llib-port"
145: #define IG_FILE3 "/usr/share/lint/llib-lc"
146: #define IG_FILE4 "/usr/share/lint/llib-port"
147:
148: #define ERRORNAME "/.errorrc"
149: int nignored;
150: char **names_ignored;
151: /*
152: * Structure definition for a full error
153: */
154: typedef struct edesc Edesc;
155: typedef Edesc *Eptr;
156:
157: struct edesc{
158: Eptr error_next; /*linked together*/
159: int error_lgtext; /* how many on the right hand side*/
160: char **error_text; /* the right hand side proper*/
161: Errorclass error_e_class; /* error category of this error*/
162: Errorclass error_s_class; /* sub descriptor of error_e_class*/
163: int error_language; /* the language for this error*/
164: int error_position; /* oridinal position */
165: int error_line; /* discovered line number*/
166: int error_no; /* sequence number on input */
167: };
168: /*
169: * Resources for the true errors
170: */
171: extern int nerrors;
172: extern Eptr er_head;
173: extern Eptr *errors;
174: /*
175: * Resources for each of the files mentioned
176: */
177: extern int nfiles;
178: extern Eptr **files; /* array of pointers into errors*/
179: boolean *touchedfiles; /* which files we touched */
180: /*
181: * The langauge the compilation is in, as intuited from
182: * the flavor of error messages analyzed.
183: */
184: extern int langauge;
185: extern char *currentfilename;
186: /*
187: * Functional forwards
188: */
189: char *Calloc();
190: char *strsave();
191: char *clobberfirst();
192: char lastchar();
193: char firstchar();
194: char next_lastchar();
195: char **wordvsplice();
196: int wordvcmp();
197: boolean persperdexplode();
198: /*
199: * Printing hacks
200: */
201: char *plural(), *verbform();
Defined variables
Defined struct's
Defined typedef's
Eptr
defined in line
155; used 47 times
- in line 172-158(4)
- in /usr/src/ucb/error/errorfilter.c line
131
- in /usr/src/ucb/error/errorinput.c line
43,
93,
108
- in /usr/src/ucb/error/errormain.c line
20-24(3),
155,
229-231(2)
- in /usr/src/ucb/error/errorsubr.c line
19-23(4),
30(2),
37,
258-261(2)
- in /usr/src/ucb/error/errortouch.c line
29-43(6),
81-85(2),
116,
153-158(3),
188-195(3),
247,
280-284(2),
358,
364-365(2),
456,
532,
689
Errorclass
defined in line
48; used 35 times
- in line 161-162(2)
- in /usr/src/ucb/error/errorfilter.c line
130-135(2)
- in /usr/src/ucb/error/errorinput.c line
21-34(14),
46,
90-91(2),
132,
178,
200,
237,
264,
294,
331,
361,
417,
429,
464,
473,
497
- in /usr/src/ucb/error/errorpi.c line
177
boolean
defined in line
9; used 35 times
- in line 92-93(2),
179,
197
- in /usr/src/ucb/error/errorinput.c line
45
- in /usr/src/ucb/error/errormain.c line
31-34(4),
91-94(4)
- in /usr/src/ucb/error/errorpi.c line
116,
129,
136,
147,
159,
187,
272
- in /usr/src/ucb/error/errorsubr.c line
157,
188,
256
- in /usr/src/ucb/error/errortouch.c line
44(2),
184-186(2),
197,
250,
277,
360,
490-495(2),
533,
690
Defined macros
defined in line
130; used 2 times
defined in line
122; used 2 times
defined in line
123; used 2 times
C_SYNC
defined in line
53; used 13 times
C_TRUE
defined in line
58; used 27 times
- in line 77
- in /usr/src/ucb/error/errorinput.c line
96-102(3),
112,
195,
224,
258,
286,
321-325(2),
353,
410,
459,
493,
516
- in /usr/src/ucb/error/errorpi.c line
225,
246,
288-292(2),
316,
369-373(3)
- in /usr/src/ucb/error/errortouch.c line
66,
216,
379
C_UNKNOWN
defined in line
51; used 35 times
- in line 70
- in /usr/src/ucb/error/errorinput.c line
58-76(15),
175,
197,
226,
261,
291,
328,
356,
368,
396,
412,
427,
461,
495,
518
- in /usr/src/ucb/error/errorpi.c line
182,
288,
370-375(2)
- in /usr/src/ucb/error/errortouch.c line
162
FALSE
defined in line
13; used 25 times
- in /usr/src/ucb/error/errormain.c line
31-34(4),
91-94(4),
157
- in /usr/src/ucb/error/errorpi.c line
144,
163-167(2)
- in /usr/src/ucb/error/errorsubr.c line
182,
213
- in /usr/src/ucb/error/errortouch.c line
61,
69,
226,
241,
254,
287-288(2),
393,
490,
514,
609
defined in line
124; used 1 times
defined in line
125; used 1 times
INAPL
defined in line
36;
never used
INAS
defined in line
24; used 1 times
INCC
defined in line
23; used 4 times
INCPP
defined in line
22; used 1 times
INF77
defined in line
27; used 1 times
INLD
defined in line
25; used 4 times
INLEX
defined in line
34;
never used
INPC
defined in line
29;
never used
INPI
defined in line
28; used 8 times
INRI
defined in line
38; used 1 times
defined in line
129; used 1 times
defined in line
135; used 1 times
defined in line
136; used 1 times
defined in line
127; used 1 times
defined in line
128; used 1 times
Q_NO
defined in line
98; used 3 times
Q_no
defined in line
99; used 1 times
defined in line
131; used 1 times
defined in line
132; used 1 times
defined in line
133; used 1 times
defined in line
134; used 1 times
TRUE
defined in line
12; used 21 times
- in /usr/src/ucb/error/errormain.c line
106-111(6),
154
- in /usr/src/ucb/error/errorpi.c line
142
- in /usr/src/ucb/error/errorsubr.c line
179,
210
- in /usr/src/ucb/error/errortouch.c line
176,
237,
262,
295-297(2),
382,
389,
502,
509-511(2),
610
false
defined in line
16;
never used
ndupl
defined in line
78;
never used
ntrue
defined in line
77; used 3 times
reg
defined in line
10; used 48 times
- in /usr/src/ucb/error/errorfilter.c line
33,
105-106(2),
131-134(2)
- in /usr/src/ucb/error/errorinput.c line
93-94(2),
239-240(2),
266
- in /usr/src/ucb/error/errormain.c line
231
- in /usr/src/ucb/error/errorpi.c line
130,
138,
160
- in /usr/src/ucb/error/errorsubr.c line
22-25(4),
79-82(3),
97,
161,
192,
260-261(2),
301,
346,
367-369(2)
- in /usr/src/ucb/error/errortouch.c line
37-39(2),
85,
118,
157-158(2),
193-195(3),
284,
364-365(2),
403-404(2),
532,
553-555(3)
true
defined in line
15;
never used
Usage of this include