summaryrefslogtreecommitdiff
path: root/jerror.c
diff options
context:
space:
mode:
Diffstat (limited to 'jerror.c')
-rw-r--r--jerror.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/jerror.c b/jerror.c
index 2302312..0256f56 100644
--- a/jerror.c
+++ b/jerror.c
@@ -48,7 +48,7 @@ trace_message (const char *msgtext)
METHODDEF void
error_exit (const char *msgtext)
{
- trace_message(msgtext);
+ (*methods->trace_message) (msgtext);
(*methods->free_all) (); /* clean up memory allocation */
exit(EXIT_FAILURE);
}
@@ -69,4 +69,13 @@ jselerror (external_methods_ptr emethods)
emethods->trace_message = trace_message;
emethods->trace_level = 0; /* default = no tracing */
+
+ emethods->num_warnings = 0; /* no warnings emitted yet */
+ /* By default, the first corrupt-data warning will be displayed,
+ * but additional ones will appear only if trace level is at least 3.
+ * A corrupt data file could generate many warnings, so it's a good idea
+ * to suppress additional messages except at high tracing levels.
+ */
+ emethods->first_warning_level = 0;
+ emethods->more_warning_level = 3;
}