Minor syntactical changes for readability.
[xuni.git] / src / error.h
blobbb8c0acb65210fa13060d4f7a798547f0a60cc59
1 /*! \file error.h
3 */
5 #ifndef XUNI_GUARD_ERROR_H
6 #define XUNI_GUARD_ERROR_H
8 #include <stdio.h>
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
14 /*! The type of error being reported. This only affects a phrase used in the
15 header of the error message.
17 The order of these enumerated values affects the following arrays:
18 - \c get_error_type::type_name
20 enum error_type_t {
21 ERROR_TYPE_LOG,
22 ERROR_TYPE_WARNING,
23 ERROR_TYPE_FATAL, /*!< Note: this does not actually exit the program. */
24 ERROR_TYPE_SETTING,
25 ERROR_TYPE_RESOURCE,
26 ERROR_TYPE_MEMORY,
27 ERROR_TYPE_DATASTRUCT,
28 ERROR_TYPE_LOOKUP_TABLE,
29 ERROR_TYPES
32 enum error_flag_t {
33 ERROR_FLAG_NONE = 0,
34 ERROR_FLAG_CONTINUED = 1 << 0,
35 ERROR_FLAG_SDL = 1 << 1
38 void xuni_error_initialize(void);
39 void xuni_error_add_stream(const char *filename, FILE *fp);
40 void xuni_error_quit(void);
42 void log_message(enum error_type_t type, enum error_flag_t flag,
43 const char *file, int line, const char *format, ...)
44 #ifdef __GNUC__ /* enables printf()-style format string checking */
45 __attribute__ ((__format__ (__printf__, 5, 6)))
46 #endif
49 #ifdef __cplusplus
51 #endif
53 #endif