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

@@ -28,6 +28,7 @@ Boston, MA 02111-1307, USA. */
#include "alloc.h"
#include "gram.h"
#include "state.h"
#include "complain.h"
extern char *nullable;
@@ -58,7 +59,6 @@ void insert_start_shift PARAMS((void));
extern void initialize_closure PARAMS((int));
extern void closure PARAMS((short *, int));
extern void finalize_closure PARAMS((void));
extern void toomany PARAMS((char *));
static core *this_state;
static core *last_state;
@@ -374,7 +374,7 @@ new_state (int symbol)
#endif
if (nstates >= MAXSHORT)
toomany("states");
fatal (_("too many states (max %d)"), MAXSHORT);
isp1 = kernel_base[symbol];
iend = kernel_end[symbol];