1987-03-09 19:15:41 +00:00
|
|
|
/*
|
|
|
|
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
|
|
*/
|
1985-01-10 13:17:22 +00:00
|
|
|
#ifndef lint
|
1994-06-24 11:31:16 +00:00
|
|
|
static char rcsid[] = "$Id$";
|
1985-01-10 13:17:22 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdio.h>
|
1986-10-20 10:17:57 +00:00
|
|
|
#include <out.h>
|
1985-01-10 13:17:22 +00:00
|
|
|
#include "const.h"
|
|
|
|
|
|
|
|
static short nerrors = 0;
|
1985-06-10 10:48:49 +00:00
|
|
|
static diag();
|
1985-01-10 13:17:22 +00:00
|
|
|
|
|
|
|
stop()
|
|
|
|
{
|
|
|
|
extern char *outputname;
|
1986-10-20 10:17:57 +00:00
|
|
|
extern int exitstatus;
|
1985-01-10 13:17:22 +00:00
|
|
|
|
1986-10-20 10:17:57 +00:00
|
|
|
if (nerrors) {
|
1985-01-10 13:17:22 +00:00
|
|
|
unlink(outputname);
|
1986-10-20 10:17:57 +00:00
|
|
|
exit(nerrors);
|
|
|
|
}
|
1985-01-10 13:17:22 +00:00
|
|
|
|
1986-10-20 10:17:57 +00:00
|
|
|
exit(exitstatus);
|
1985-01-10 13:17:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* VARARGS1 */
|
|
|
|
fatal(format, a1, a2, a3, a4)
|
|
|
|
char *format;
|
|
|
|
{
|
|
|
|
nerrors++;
|
|
|
|
diag("fatal", format, a1, a2, a3, a4);
|
|
|
|
stop();
|
|
|
|
}
|
|
|
|
|
|
|
|
/* VARARGS1 */
|
|
|
|
warning(format, a1, a2, a3, a4)
|
|
|
|
char *format;
|
|
|
|
{
|
|
|
|
diag("warning", format, a1, a2, a3, a4);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* VARARGS1 */
|
|
|
|
error(format, a1, a2, a3, a4)
|
|
|
|
char *format;
|
|
|
|
{
|
|
|
|
nerrors++;
|
|
|
|
diag("error", format, a1, a2, a3, a4);
|
|
|
|
}
|
|
|
|
|
1990-03-15 10:44:14 +00:00
|
|
|
/* VARARGS1 */
|
|
|
|
do_verbose(format, a1, a2, a3, a4)
|
|
|
|
char *format;
|
|
|
|
{
|
|
|
|
diag((char *) 0, format, a1, a2, a3, a4);
|
|
|
|
}
|
|
|
|
|
1985-01-10 13:17:22 +00:00
|
|
|
static
|
|
|
|
diag(tail, format, a1, a2, a3, a4)
|
|
|
|
char *tail;
|
|
|
|
char *format;
|
|
|
|
{
|
|
|
|
extern char *progname, *archname, *modulname;
|
|
|
|
|
|
|
|
fprintf(stderr, "%s: ", progname);
|
1990-03-15 10:44:14 +00:00
|
|
|
if (archname && modulname)
|
1990-07-30 11:56:28 +00:00
|
|
|
fprintf(stderr, "%s(%.14s): ", archname, modulname);
|
1990-03-15 10:44:14 +00:00
|
|
|
else if (archname)
|
1985-01-10 13:17:22 +00:00
|
|
|
fprintf(stderr, "%s: ", archname);
|
1990-03-15 10:44:14 +00:00
|
|
|
else if (modulname)
|
1990-11-27 09:39:52 +00:00
|
|
|
fprintf(stderr, "%s: ", modulname);
|
1985-01-10 13:17:22 +00:00
|
|
|
fprintf(stderr, format, a1, a2, a3, a4);
|
1990-03-15 10:44:14 +00:00
|
|
|
if (tail) fprintf(stderr, " (%s)\n", tail);
|
|
|
|
else putc('\n', stderr);
|
1985-01-10 13:17:22 +00:00
|
|
|
}
|