1 #ifndef _WIMLIB_ERROR_H
2 #define _WIMLIB_ERROR_H
6 #include "wimlib.h" /* Get error code definitions */
7 #include "wimlib/compiler.h"
8 #include "wimlib/types.h"
10 void _format_attribute(printf, 1, 2) __attribute__((cold))
11 wimlib_error(const tchar *format, ...);
13 void _format_attribute(printf, 1, 2) __attribute__((cold))
14 wimlib_error_with_errno(const tchar *format, ...);
16 void _format_attribute(printf, 1, 2) __attribute__((cold))
17 wimlib_warning(const tchar *format, ...);
19 void _format_attribute(printf, 1, 2) __attribute__((cold))
20 wimlib_warning_with_errno(const tchar *format, ...);
22 #define ERROR(format, ...) wimlib_error(T(format), ## __VA_ARGS__)
23 #define ERROR_WITH_ERRNO(format, ...) wimlib_error_with_errno(T(format), ## __VA_ARGS__)
24 #define WARNING(format, ...) wimlib_warning(T(format), ## __VA_ARGS__)
25 #define WARNING_WITH_ERRNO(format, ...) wimlib_warning_with_errno(T(format), ## __VA_ARGS__)
27 extern bool wimlib_print_errors;
28 extern FILE *wimlib_error_file;
31 print_byte_field(const u8 *field, size_t len, FILE *out);
33 #endif /* _WIMLIB_ERROR_H */