|
|
1.1 root 1: /*
2: * MWC K&R C version of error message functions.
3: */
4: #include <asm.h>
5: #include <errno.h>
6:
7: /*
8: * Show line numbers if no listing.
9: */
10: static void
11: showLine()
12: {
13: if (!((NULL == inpc) || lswitchX))
14: fprintf(errdev, "%d: %s: ", inpc->lineNo, inpc->name);
15: }
16:
17: /*
18: * Print error msg and die.
19: */
20: /*VARARGS1*/
21: void
22: fatal(s)
23: char *s;
24: {
25: int save = errno;
26:
27: if (Qswitch)
28: exit(1);
29:
30: showLine();
31: fprintf(errdev, "%r\n", &s);
32:
33: if (0 != (errno = save))
34: perror("errno reports");
35:
36: exit(1);
37: }
38:
39: /*
40: * Print error msg to listing.
41: */
42: /*VARARGS1*/
43: void
44: yyerror(s)
45: char *s;
46: {
47: if (2 != pass)
48: return;
49: errCt++;
50: sTitle();
51:
52: if (Qswitch)
53: return;
54:
55: showLine();
56: fprintf(errdev, "%r\n", &s);
57: }
58:
59: /*
60: * Print warning msg to listing.
61: */
62: /*VARARGS1*/
63: void
64: yywarn(s)
65: char *s;
66: {
67: if ((2 != pass) || wswitch || Qswitch)
68: return;
69: sTitle();
70:
71: showLine();
72: fprintf(errdev, "Warning %r\n", &s);
73: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.