16 /* void error_where(path, line, text)
24 /* The routines in this file print a diagnostic (text). Some also
25 /* terminate the program. Upon each error*() call, the errcount variable
28 /* error() provides a default context, i.e. the source-file
29 /* coordinate of the last read token.
31 /* error_where() allows the caller to explicitly specify context: path
32 /* is a source-file name, and line is a line number.
34 /* fatal() is like error() but terminates the program with a non-zero
37 /* context is ignored if the line number is zero or if the path
38 /* is an empty string.
41 /* Eindhoven University of Technology
42 /* Department of Mathematics and Computer Science
43 /* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
50 static char error_sccsid[] = "@(#) error.c 1.2 92/01/15 21:53:10";
58 /* Application-specific stuff */
63 int errcount = 0; /* error counter */
65 /* error - report problem (implicit context) */
70 error_where(in_path, in_line, text);
73 /* error_where - report problem (explicit context) */
75 void error_where(path, line, text)
82 /* Suppress context info if there is none. */
85 fprintf(stderr, "%s, line %d: ", path, line);
87 fprintf(stderr, "%s\n", text);
90 /* fatal - report problem and terminate unsuccessfully */