Clean the error reporting functions.

* src/report.c: New file.
* src/report.h: Likewise.
* src/Makefile.am: Adjust.
* m4/error.m4: New file.
* m4/Makefile.am: Adjust.
* configure.in (jm_PREREQ_ERROR): Call it.
* src/main.c (int_to_string, banner, fatal_banner, warn_banner):
Remove.
(fatal, fatals): Remove.  All callers use complain.c::fatal.
(warn, warni, warns, warnss, warnss): Remove.  All callers use
complain.c::complain.
(toomany): Remove, use fatal instead.
* src/files.c (done): No argument, use complain_message_count.
* src/main.c (main): Register `done' to `atexit'.

* src/getargs.c (usage): More `fputs', less `fprintf'.
This commit is contained in:
Akim Demaille
2000-03-31 13:54:30 +00:00
parent 10a9273b34
commit a0f6b07611
24 changed files with 1235 additions and 890 deletions

View File

@@ -110,6 +110,7 @@ YYNTBASE = ntokens.
#include "files.h"
#include "gram.h"
#include "state.h"
#include "complain.h"
extern int debugflag;
@@ -133,7 +134,6 @@ extern char *consistent;
extern short *goto_map;
extern short *from_state;
extern short *to_state;
extern int lineno;
void output_headers PARAMS((void));
void output_trailers PARAMS((void));
@@ -164,8 +164,6 @@ int matching_state PARAMS((int));
int pack_vector PARAMS((int));
extern void berror PARAMS((char *));
extern void fatals PARAMS((char *, char *));
extern char *int_to_string PARAMS((int));
extern void reader_output_yylsp PARAMS((FILE *));
static int nvectors;
@@ -1198,7 +1196,7 @@ pack_vector (int vector)
{
loc = j + from[k];
if (loc > MAXTABLE)
fatals(_("maximum table size (%s) exceeded"), int_to_string(MAXTABLE));
fatal (_("maximum table size (%d) exceeded"), MAXTABLE);
if (table[loc] != 0)
ok = 0;