libyasm
errwarn.h
Go to the documentation of this file.
1 
30 #ifndef YASM_ERRWARN_H
31 #define YASM_ERRWARN_H
32 
33 #ifndef YASM_LIB_DECL
34 #define YASM_LIB_DECL
35 #endif
36 
38 typedef enum yasm_warn_class {
48 
50 typedef enum yasm_error_class {
51  YASM_ERROR_NONE = 0x0000,
52  YASM_ERROR_GENERAL = 0xFFFF,
58  YASM_ERROR_VALUE = 0x0004,
63  YASM_ERROR_IO = 0x0008,
65  YASM_ERROR_TYPE = 0x0020,
66  YASM_ERROR_SYNTAX = 0x0040,
67  YASM_ERROR_PARSE = 0x8040
69 
71 YASM_LIB_DECL
72 void yasm_errwarn_initialize(void);
73 
77 YASM_LIB_DECL
78 void yasm_errwarn_cleanup(void);
79 
88 YASM_LIB_DECL
89 extern /*@exits@*/ void (*yasm_internal_error_)
90  (const char *file, unsigned int line, const char *message);
91 
96 #define yasm_internal_error(message) \
97  yasm_internal_error_(__FILE__, __LINE__, message)
98 
105 YASM_LIB_DECL
106 extern /*@exits@*/ void (*yasm_fatal) (const char *message, va_list va);
107 
114 YASM_LIB_DECL
115 /*@exits@*/ void yasm__fatal(const char *message, ...);
116 
120 YASM_LIB_DECL
121 void yasm_error_clear(void);
122 
129 
137 YASM_LIB_DECL
139 
140 #ifndef YASM_DOXYGEN
141 YASM_LIB_DECL
142 extern yasm_error_class yasm_eclass;
143 #define yasm_error_occurred() yasm_eclass
144 #endif
145 
152 YASM_LIB_DECL
153 void yasm_error_set_va(yasm_error_class eclass, const char *format, va_list va);
154 
161 YASM_LIB_DECL
162 void yasm_error_set(yasm_error_class eclass, const char *format, ...)
163  /*@printflike@*/;
164 
172 YASM_LIB_DECL
173 void yasm_error_set_xref_va(unsigned long xrefline, const char *format,
174  va_list va);
175 
183 YASM_LIB_DECL
184 void yasm_error_set_xref(unsigned long xrefline, const char *format, ...)
185  /*@printflike@*/;
186 
199 YASM_LIB_DECL
200 void yasm_error_fetch(/*@out@*/ yasm_error_class *eclass,
201  /*@out@*/ /*@only@*/ /*@null@*/ char **str,
202  /*@out@*/ unsigned long *xrefline,
203  /*@out@*/ /*@only@*/ /*@null@*/ char **xrefstr);
204 
208 YASM_LIB_DECL
209 void yasm_warn_clear(void);
210 
216 YASM_LIB_DECL
218 
224 YASM_LIB_DECL
225 void yasm_warn_set_va(yasm_warn_class wclass, const char *format, va_list va);
226 
232 YASM_LIB_DECL
233 void yasm_warn_set(yasm_warn_class wclass, const char *format, ...)
234  /*@printflike@*/;
235 
246 YASM_LIB_DECL
247 void yasm_warn_fetch(/*@out@*/ yasm_warn_class *wclass,
248  /*@out@*/ /*@only@*/ char **str);
249 
253 YASM_LIB_DECL
254 void yasm_warn_enable(yasm_warn_class wclass);
255 
259 YASM_LIB_DECL
261 
263 YASM_LIB_DECL
264 void yasm_warn_disable_all(void);
265 
269 YASM_LIB_DECL
270 /*@only@*/ yasm_errwarns *yasm_errwarns_create(void);
271 
275 YASM_LIB_DECL
276 void yasm_errwarns_destroy(/*@only@*/ yasm_errwarns *errwarns);
277 
288 YASM_LIB_DECL
289 void yasm_errwarn_propagate(yasm_errwarns *errwarns, unsigned long line);
290 
296 YASM_LIB_DECL
297 unsigned int yasm_errwarns_num_errors(yasm_errwarns *errwarns,
298  int warning_as_error);
299 
308 typedef void (*yasm_print_error_func)
309  (const char *fn, unsigned long line, const char *msg,
310  /*@null@*/ const char *xref_fn, unsigned long xref_line,
311  /*@null@*/ const char *xref_msg);
312 
318 typedef void (*yasm_print_warning_func)
319  (const char *fn, unsigned long line, const char *msg);
320 
328 YASM_LIB_DECL
330  (yasm_errwarns *errwarns, yasm_linemap *lm, int warning_as_error,
331  yasm_print_error_func print_error, yasm_print_warning_func print_warning);
332 
338 YASM_LIB_DECL
339 char *yasm__conv_unprint(int ch);
340 
345 YASM_LIB_DECL
346 extern const char * (*yasm_gettext_hook) (const char *msgid);
347 
348 #endif