--- psiconv/trunk/lib/psiconv/error.c 2004/01/04 22:20:43 183 +++ psiconv/trunk/lib/psiconv/error.c 2004/01/06 20:15:01 184 @@ -60,6 +60,28 @@ exit(1); } +void psiconv_error(psiconv_config config, int level, psiconv_u32 off, + const char *format,...) +{ + char buffer[MAX_MESSAGE]; + va_list ap; + size_t curlen; + + va_start(ap,format); + + if (config->verbosity >= PSICONV_VERB_ERROR) { + snprintf(buffer,MAX_MESSAGE,"ERROR (offset %08x): ",off); + curlen = strlen(buffer); + + vsnprintf(buffer+curlen,MAX_MESSAGE-curlen,format,ap); + if (config->error_handler) + config->error_handler(PSICONV_VERB_ERROR,off,buffer); + else + psiconv_default_error_handler(PSICONV_VERB_ERROR,off,buffer); + } + va_end(ap); +} + void psiconv_warn(psiconv_config config, int level, psiconv_u32 off, const char *format,...) {