… | |
… | |
19 | |
19 | |
20 | #ifndef PSICONV_ERROR_H |
20 | #ifndef PSICONV_ERROR_H |
21 | #define PSICONV_ERROR_H |
21 | #define PSICONV_ERROR_H |
22 | |
22 | |
23 | #include <psiconv/general.h> |
23 | #include <psiconv/general.h> |
|
|
24 | #include <psiconv/configuration.h> |
24 | |
25 | |
25 | #ifdef __cplusplus |
26 | #ifdef __cplusplus |
26 | extern "C" { |
27 | extern "C" { |
27 | #endif /* __cplusplus */ |
28 | #endif /* __cplusplus */ |
28 | |
|
|
29 | extern int psiconv_verbosity; |
|
|
30 | |
29 | |
31 | typedef void (*psiconv_error_handler_t) (int kind, psiconv_u32 off, |
30 | typedef void (*psiconv_error_handler_t) (int kind, psiconv_u32 off, |
32 | const char *message); |
31 | const char *message); |
33 | |
32 | |
34 | extern psiconv_error_handler_t psiconv_error_handler; |
33 | extern psiconv_error_handler_t psiconv_error_handler; |
35 | |
34 | |
36 | /* These functions print error, warning, progress and debug information to |
35 | /* These functions print error, warning, progress and debug information to |
37 | * stderr */ |
36 | * stderr */ |
38 | extern void psiconv_fatal(int level, psiconv_u32 off, const char *format,...); |
37 | extern void psiconv_fatal(psiconv_config config,int level, psiconv_u32 off, |
39 | extern void psiconv_warn(int level, psiconv_u32 off, const char *format,...); |
38 | const char *format,...); |
|
|
39 | extern void psiconv_warn(psiconv_config config,int level, psiconv_u32 off, |
|
|
40 | const char *format,...); |
40 | extern void psiconv_progress(int level, psiconv_u32 off, |
41 | extern void psiconv_progress(psiconv_config config,int level, psiconv_u32 off, |
41 | const char *format,...); |
42 | const char *format,...); |
42 | extern void psiconv_debug(int level, psiconv_u32 off, const char *format,...); |
43 | extern void psiconv_debug(psiconv_config config,int level, psiconv_u32 off, |
|
|
44 | const char *format,...); |
43 | |
45 | |
44 | #define PSICONV_VERB_DEBUG 4 |
46 | #define PSICONV_VERB_DEBUG 4 |
45 | #define PSICONV_VERB_PROGRESS 3 |
47 | #define PSICONV_VERB_PROGRESS 3 |
46 | #define PSICONV_VERB_WARN 2 |
48 | #define PSICONV_VERB_WARN 2 |
47 | #define PSICONV_VERB_FATAL 1 |
49 | #define PSICONV_VERB_FATAL 1 |
48 | |
50 | |
|
|
51 | #define PSICONV_E_OK 0 |
49 | #define PSICONV_E_OTHER 1 |
52 | #define PSICONV_E_OTHER 1 |
50 | #define PSICONV_E_NOMEM 2 |
53 | #define PSICONV_E_NOMEM 2 |
51 | #define PSICONV_E_PARSE 3 |
54 | #define PSICONV_E_PARSE 3 |
|
|
55 | #define PSICONV_E_GENERATE 4 |
52 | |
56 | |
53 | #ifdef __cplusplus |
57 | #ifdef __cplusplus |
54 | } |
58 | } |
55 | #endif /* __cplusplus */ |
59 | #endif /* __cplusplus */ |
56 | |
60 | |