1 | /* |
1 | /* |
2 | error.h - Part of psiconv, a PSION 5 file formats converter |
2 | error.h - Part of psiconv, a PSION 5 file formats converter |
3 | Copyright (c) 1999, 2000 Frodo Looijaard <frodol@dds.nl> |
3 | Copyright (c) 1999-2004 Frodo Looijaard <frodol@dds.nl> |
4 | |
4 | |
5 | This program is free software; you can redistribute it and/or modify |
5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by |
6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or |
7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. |
8 | (at your option) any later version. |
… | |
… | |
25 | |
25 | |
26 | #ifdef __cplusplus |
26 | #ifdef __cplusplus |
27 | extern "C" { |
27 | extern "C" { |
28 | #endif /* __cplusplus */ |
28 | #endif /* __cplusplus */ |
29 | |
29 | |
30 | typedef void (*psiconv_error_handler_t) (int kind, psiconv_u32 off, |
|
|
31 | const char *message); |
|
|
32 | |
|
|
33 | extern psiconv_error_handler_t psiconv_error_handler; |
|
|
34 | |
|
|
35 | /* These functions print error, warning, progress and debug information to |
30 | /* These functions print error, warning, progress and debug information to |
36 | * stderr */ |
31 | * stderr */ |
37 | extern void psiconv_fatal(psiconv_config config,int level, psiconv_u32 off, |
32 | extern void psiconv_fatal(psiconv_config config,int level, psiconv_u32 off, |
|
|
33 | const char *format,...); |
|
|
34 | extern void psiconv_error(psiconv_config config,int level, psiconv_u32 off, |
38 | const char *format,...); |
35 | const char *format,...); |
39 | extern void psiconv_warn(psiconv_config config,int level, psiconv_u32 off, |
36 | extern void psiconv_warn(psiconv_config config,int level, psiconv_u32 off, |
40 | const char *format,...); |
37 | const char *format,...); |
41 | extern void psiconv_progress(psiconv_config config,int level, psiconv_u32 off, |
38 | extern void psiconv_progress(psiconv_config config,int level, psiconv_u32 off, |
42 | const char *format,...); |
39 | const char *format,...); |
43 | extern void psiconv_debug(psiconv_config config,int level, psiconv_u32 off, |
40 | extern void psiconv_debug(psiconv_config config,int level, psiconv_u32 off, |
44 | const char *format,...); |
41 | const char *format,...); |
45 | |
42 | |
46 | #define PSICONV_VERB_DEBUG 4 |
43 | #define PSICONV_VERB_DEBUG 5 |
47 | #define PSICONV_VERB_PROGRESS 3 |
44 | #define PSICONV_VERB_PROGRESS 4 |
48 | #define PSICONV_VERB_WARN 2 |
45 | #define PSICONV_VERB_WARN 3 |
|
|
46 | #define PSICONV_VERB_ERROR 2 |
49 | #define PSICONV_VERB_FATAL 1 |
47 | #define PSICONV_VERB_FATAL 1 |
50 | |
48 | |
51 | #define PSICONV_E_OK 0 |
49 | #define PSICONV_E_OK 0 |
52 | #define PSICONV_E_OTHER 1 |
50 | #define PSICONV_E_OTHER 1 |
53 | #define PSICONV_E_NOMEM 2 |
51 | #define PSICONV_E_NOMEM 2 |