1987-03-10 11:49:39 +00:00
|
|
|
/* $Header$ */
|
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".
|
|
|
|
*/
|
1987-01-06 15:16:53 +00:00
|
|
|
/* E R R O R A N D D I A G N O S T I C R O U T I N E S */
|
|
|
|
|
|
|
|
#include <system.h>
|
|
|
|
|
|
|
|
#include "errout.h"
|
|
|
|
#include "LLlex.h"
|
|
|
|
|
|
|
|
/* This file contains the (non-portable) error-message and diagnostic
|
|
|
|
functions. Beware, they are called with a variable number of
|
|
|
|
arguments!
|
|
|
|
*/
|
|
|
|
|
|
|
|
int err_occurred;
|
|
|
|
|
|
|
|
err_hdr(s)
|
|
|
|
char *s;
|
|
|
|
{
|
|
|
|
fprint(ERROUT, "\"%s\", line %d: %s", FileName, LineNumber, s);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*VARARGS1*/
|
|
|
|
error(fmt, args)
|
|
|
|
char *fmt;
|
|
|
|
{
|
|
|
|
err_hdr("");
|
|
|
|
doprnt(ERROUT, fmt, &args);
|
|
|
|
fprint(ERROUT, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
/*VARARGS1*/
|
|
|
|
warning(fmt, args)
|
|
|
|
char *fmt;
|
|
|
|
{
|
1987-08-07 19:54:45 +00:00
|
|
|
err_hdr("(warning) ");
|
1987-01-06 15:16:53 +00:00
|
|
|
doprnt(ERROUT, fmt, &args);
|
|
|
|
fprint(ERROUT, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
/*VARARGS1*/
|
|
|
|
crash(fmt, args)
|
|
|
|
char *fmt;
|
|
|
|
int args;
|
|
|
|
{
|
1987-08-07 19:54:45 +00:00
|
|
|
err_hdr("CRASH\007 ");
|
1987-01-06 15:16:53 +00:00
|
|
|
doprnt(ERROUT, fmt, &args);
|
|
|
|
fprint(ERROUT, "\n");
|
|
|
|
sys_stop(S_ABORT);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*VARARGS1*/
|
|
|
|
fatal(fmt, args)
|
|
|
|
char *fmt;
|
|
|
|
int args;
|
|
|
|
{
|
1987-08-07 19:54:45 +00:00
|
|
|
err_hdr("fatal error -- ");
|
1987-01-06 15:16:53 +00:00
|
|
|
doprnt(ERROUT, fmt, &args);
|
|
|
|
fprint(ERROUT, "\n");
|
|
|
|
sys_stop(S_EXIT);
|
|
|
|
}
|