… | |
… | |
56 | else |
56 | else |
57 | psiconv_default_error_handler(PSICONV_VERB_FATAL,off,buffer); |
57 | psiconv_default_error_handler(PSICONV_VERB_FATAL,off,buffer); |
58 | va_end(ap); |
58 | va_end(ap); |
59 | |
59 | |
60 | exit(1); |
60 | exit(1); |
|
|
61 | } |
|
|
62 | |
|
|
63 | void psiconv_error(psiconv_config config, int level, psiconv_u32 off, |
|
|
64 | const char *format,...) |
|
|
65 | { |
|
|
66 | char buffer[MAX_MESSAGE]; |
|
|
67 | va_list ap; |
|
|
68 | size_t curlen; |
|
|
69 | |
|
|
70 | va_start(ap,format); |
|
|
71 | |
|
|
72 | if (config->verbosity >= PSICONV_VERB_ERROR) { |
|
|
73 | snprintf(buffer,MAX_MESSAGE,"ERROR (offset %08x): ",off); |
|
|
74 | curlen = strlen(buffer); |
|
|
75 | |
|
|
76 | vsnprintf(buffer+curlen,MAX_MESSAGE-curlen,format,ap); |
|
|
77 | if (config->error_handler) |
|
|
78 | config->error_handler(PSICONV_VERB_ERROR,off,buffer); |
|
|
79 | else |
|
|
80 | psiconv_default_error_handler(PSICONV_VERB_ERROR,off,buffer); |
|
|
81 | } |
|
|
82 | va_end(ap); |
61 | } |
83 | } |
62 | |
84 | |
63 | void psiconv_warn(psiconv_config config, int level, psiconv_u32 off, |
85 | void psiconv_warn(psiconv_config config, int level, psiconv_u32 off, |
64 | const char *format,...) |
86 | const char *format,...) |
65 | { |
87 | { |