libyasm/errwarn.h

Go to the documentation of this file.
00001 
00034 #ifndef YASM_ERRWARN_H
00035 #define YASM_ERRWARN_H
00036 
00037 #ifndef YASM_LIB_DECL
00038 #define YASM_LIB_DECL
00039 #endif
00040 
00042 typedef enum yasm_warn_class {
00043     YASM_WARN_NONE = 0,     
00044     YASM_WARN_GENERAL,      
00045     YASM_WARN_UNREC_CHAR,   
00046     YASM_WARN_PREPROC,      
00047     YASM_WARN_ORPHAN_LABEL, 
00048     YASM_WARN_UNINIT_CONTENTS, 
00049     YASM_WARN_SIZE_OVERRIDE 
00050 } yasm_warn_class;
00051 
00053 typedef enum yasm_error_class {
00054     YASM_ERROR_NONE             = 0x0000, 
00055     YASM_ERROR_GENERAL          = 0xFFFF, 
00056     YASM_ERROR_ARITHMETIC       = 0x0001, 
00057     YASM_ERROR_OVERFLOW         = 0x8001, 
00058     YASM_ERROR_FLOATING_POINT   = 0x4001, 
00059     YASM_ERROR_ZERO_DIVISION    = 0x2001, 
00060     YASM_ERROR_ASSERTION        = 0x0002, 
00061     YASM_ERROR_VALUE            = 0x0004, 
00063     YASM_ERROR_NOT_ABSOLUTE     = 0x8004, 
00064     YASM_ERROR_TOO_COMPLEX      = 0x4004, 
00065     YASM_ERROR_NOT_CONSTANT     = 0x2004, 
00066     YASM_ERROR_IO               = 0x0008, 
00067     YASM_ERROR_NOT_IMPLEMENTED  = 0x0010, 
00068     YASM_ERROR_TYPE             = 0x0020, 
00069     YASM_ERROR_SYNTAX           = 0x0040, 
00070     YASM_ERROR_PARSE            = 0x8040  
00071 } yasm_error_class;
00072 
00074 YASM_LIB_DECL
00075 void yasm_errwarn_initialize(void);
00076 
00080 YASM_LIB_DECL
00081 void yasm_errwarn_cleanup(void);
00082 
00091 YASM_LIB_DECL
00092 extern /*@exits@*/ void (*yasm_internal_error_)
00093     (const char *file, unsigned int line, const char *message);
00094 
00099 #define yasm_internal_error(message) \
00100     yasm_internal_error_(__FILE__, __LINE__, message)
00101 
00108 YASM_LIB_DECL
00109 extern /*@exits@*/ void (*yasm_fatal) (const char *message, va_list va);
00110 
00117 YASM_LIB_DECL
00118 /*@exits@*/ void yasm__fatal(const char *message, ...);
00119 
00123 YASM_LIB_DECL
00124 void yasm_error_clear(void);
00125 
00131 yasm_error_class yasm_error_occurred(void);
00132 
00140 YASM_LIB_DECL
00141 int yasm_error_matches(yasm_error_class eclass);
00142 
00143 #ifndef YASM_DOXYGEN
00144 YASM_LIB_DECL
00145 extern yasm_error_class yasm_eclass;
00146 #define yasm_error_occurred()       yasm_eclass
00147 #endif
00148 
00155 YASM_LIB_DECL
00156 void yasm_error_set_va(yasm_error_class eclass, const char *format, va_list va);
00157 
00164 YASM_LIB_DECL
00165 void yasm_error_set(yasm_error_class eclass, const char *format, ...)
00166     /*@printflike@*/;
00167 
00175 YASM_LIB_DECL
00176 void yasm_error_set_xref_va(unsigned long xrefline, const char *format,
00177                             va_list va);
00178 
00186 YASM_LIB_DECL
00187 void yasm_error_set_xref(unsigned long xrefline, const char *format, ...)
00188     /*@printflike@*/;
00189 
00202 YASM_LIB_DECL
00203 void yasm_error_fetch(/*@out@*/ yasm_error_class *eclass,
00204                       /*@out@*/ /*@only@*/ /*@null@*/ char **str,
00205                       /*@out@*/ unsigned long *xrefline,
00206                       /*@out@*/ /*@only@*/ /*@null@*/ char **xrefstr);
00207 
00211 YASM_LIB_DECL
00212 void yasm_warn_clear(void);
00213 
00219 YASM_LIB_DECL
00220 yasm_warn_class yasm_warn_occurred(void);
00221 
00227 YASM_LIB_DECL
00228 void yasm_warn_set_va(yasm_warn_class wclass, const char *format, va_list va);
00229 
00235 YASM_LIB_DECL
00236 void yasm_warn_set(yasm_warn_class wclass, const char *format, ...)
00237     /*@printflike@*/;
00238 
00249 YASM_LIB_DECL
00250 void yasm_warn_fetch(/*@out@*/ yasm_warn_class *wclass,
00251                      /*@out@*/ /*@only@*/ char **str);
00252 
00256 YASM_LIB_DECL
00257 void yasm_warn_enable(yasm_warn_class wclass);
00258 
00262 YASM_LIB_DECL
00263 void yasm_warn_disable(yasm_warn_class wclass);
00264 
00266 YASM_LIB_DECL
00267 void yasm_warn_disable_all(void);
00268 
00272 YASM_LIB_DECL
00273 /*@only@*/ yasm_errwarns *yasm_errwarns_create(void);
00274 
00278 YASM_LIB_DECL
00279 void yasm_errwarns_destroy(/*@only@*/ yasm_errwarns *errwarns);
00280 
00291 YASM_LIB_DECL
00292 void yasm_errwarn_propagate(yasm_errwarns *errwarns, unsigned long line);
00293 
00299 YASM_LIB_DECL
00300 unsigned int yasm_errwarns_num_errors(yasm_errwarns *errwarns,
00301                                       int warning_as_error);
00302 
00311 typedef void (*yasm_print_error_func)
00312     (const char *fn, unsigned long line, const char *msg,
00313      /*@null@*/ const char *xref_fn, unsigned long xref_line,
00314      /*@null@*/ const char *xref_msg);
00315 
00321 typedef void (*yasm_print_warning_func)
00322     (const char *fn, unsigned long line, const char *msg);
00323 
00331 YASM_LIB_DECL
00332 void yasm_errwarns_output_all
00333     (yasm_errwarns *errwarns, yasm_linemap *lm, int warning_as_error,
00334      yasm_print_error_func print_error, yasm_print_warning_func print_warning);
00335 
00341 YASM_LIB_DECL
00342 char *yasm__conv_unprint(int ch);
00343 
00348 YASM_LIB_DECL
00349 extern const char * (*yasm_gettext_hook) (const char *msgid);
00350 
00351 #endif

Generated on Thu Jul 24 01:23:31 2008 for libyasm by  doxygen 1.5.2