--- psiconv/trunk/lib/psiconv/error.c 2003/11/23 21:47:24 167 +++ psiconv/trunk/lib/psiconv/error.c 2003/11/25 17:57:05 168 @@ -22,8 +22,10 @@ #include #include #include +#include #include "error.h" +#include "config.h" #ifdef DMALLOC #include @@ -35,14 +37,13 @@ fprintf(stderr,"%s\n",message); } -int psiconv_verbosity = PSICONV_VERB_WARN; - psiconv_error_handler_t psiconv_error_handler = psiconv_default_error_handler; #define MAX_MESSAGE 160 -void psiconv_fatal(int level, psiconv_u32 off, const char *format,...) +void psiconv_fatal(psiconv_config config, int level, psiconv_u32 off, + const char *format,...) { char buffer[MAX_MESSAGE]; va_list ap; @@ -59,7 +60,8 @@ exit(1); } -void psiconv_warn(int level, psiconv_u32 off, const char *format,...) +void psiconv_warn(psiconv_config config, int level, psiconv_u32 off, + const char *format,...) { char buffer[MAX_MESSAGE]; va_list ap; @@ -67,7 +69,7 @@ va_start(ap,format); - if (psiconv_verbosity >= PSICONV_VERB_WARN) { + if (config->verbosity >= PSICONV_VERB_WARN) { snprintf(buffer,MAX_MESSAGE,"WARNING (offset %08x): ",off); curlen = strlen(buffer); @@ -77,7 +79,8 @@ va_end(ap); } -void psiconv_progress(int level, psiconv_u32 off, const char *format,...) +void psiconv_progress(psiconv_config config,int level, psiconv_u32 off, + const char *format,...) { char buffer[MAX_MESSAGE]; va_list ap; @@ -85,7 +88,7 @@ int i; va_start(ap,format); - if (psiconv_verbosity >= PSICONV_VERB_PROGRESS) { + if (config->verbosity >= PSICONV_VERB_PROGRESS) { snprintf(buffer,MAX_MESSAGE,"%08x ",off); curlen = strlen(buffer); @@ -107,7 +110,8 @@ } -void psiconv_debug(int level, psiconv_u32 off, const char *format,...) +void psiconv_debug(psiconv_config config, int level, psiconv_u32 off, + const char *format,...) { char buffer[MAX_MESSAGE]; va_list ap; @@ -115,7 +119,7 @@ int i; va_start(ap,format); - if (psiconv_verbosity >= PSICONV_VERB_DEBUG) { + if (config->verbosity >= PSICONV_VERB_DEBUG) { snprintf(buffer,MAX_MESSAGE,"%08x ",off); curlen = strlen(buffer);