40 #define SPF_error(errmsg) SPF_errorx( __FILE__, __LINE__, "%s", errmsg )
45 #define SPF_warning(errmsg) SPF_warningx( __FILE__, __LINE__, "%s", errmsg )
50 #define SPF_info(errmsg) SPF_infox( __FILE__, __LINE__, "%s", errmsg )
51 void SPF_infox(
const char *file,
int line,
const char *format, ... )
__attribute__ ((format (printf, 3, 4)));
53 void SPF_infov( const
char *file,
int line, const
char *format, va_list ap )
__attribute__ ((format (printf, 3, 0)));
55 #define SPF_debug(errmsg) SPF_debugx( __FILE__, __LINE__, "%s", errmsg )
58 void SPF_debugv( const
char *file,
int line, const
char *format, va_list ap )
__attribute__ ((format (printf, 3, 0)));
61 #if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L
63 #define SPF_errorf(format, ... ) SPF_errorx( __FILE__, __LINE__, format, __VA_ARGS__ )
64 #define SPF_warningf(format, ... ) SPF_warningx( __FILE__, __LINE__, format, __VA_ARGS__ )
65 #define SPF_infof(format, ... ) SPF_infox( __FILE__, __LINE__, format, __VA_ARGS__ )
66 #define SPF_debugf(format, ... ) SPF_debugx( __FILE__, __LINE__, format, __VA_ARGS__ )
68 #elif defined( __GNUC__ )
70 #define SPF_errorf(format... ) SPF_errorx( __FILE__, __LINE__, format )
71 #define SPF_warningf(format... ) SPF_warningx( __FILE__, __LINE__, format )
72 #define SPF_infof(format... ) SPF_infox( __FILE__, __LINE__, format )
73 #define SPF_debugf(format... ) SPF_debugx( __FILE__, __LINE__, format )
77 #define SPF_errorf SPF_errorx2
78 #define SPF_warningf SPF_warningx2
79 #define SPF_infof SPF_infox2
80 #define SPF_debugf SPF_debugx2
101 #define SPF_DEFAULT_ERROR_HANDLER SPF_error_stdio
102 #define SPF_DEFAULT_WARNING_HANDLER SPF_warning_stdio
103 #define SPF_DEFAULT_INFO_HANDLER SPF_info_stdio
104 #define SPF_DEFAULT_DEBUG_HANDLER SPF_debug_stdio
118 #define SPF_ASSERT_NOTNULL(x) \
119 do { if ((x) == NULL) SPF_error(#x " is NULL"); } while(0)
void SPF_warning_stdio(const char *file, int line, const char *errmsg)
void void SPF_errorx2(const char *format,...)
void SPF_warningv(const char *file, int line, const char *format, va_list ap) __attribute__((format(printf
void(* SPF_warning_handler)(const char *, int, const char *)
void SPF_infov(const char *file, int line, const char *format, va_list ap) __attribute__((format(printf
void void SPF_debugx2(const char *format,...)
void SPF_error_stdio(const char *file, int line, const char *errmsg) __attribute__((noreturn))
void SPF_warning_syslog(const char *file, int line, const char *errmsg)
void SPF_debugx(const char *file, int line, const char *format,...) __attribute__((format(printf
void SPF_warningx(const char *file, int line, const char *format,...) __attribute__((format(printf
void void SPF_warningx2(const char *format,...)
void SPF_debug_stdio(const char *file, int line, const char *errmsg)
void void SPF_infox2(const char *format,...)
void SPF_errorv(const char *file, int line, const char *format, va_list ap) __attribute__((noreturn)) __attribute__((format(printf
void(* SPF_error_handler)(const char *, int, const char *) __attribute__((noreturn))
void SPF_info_syslog(const char *file __attribute__((unused)), int line __attribute__((unused)), const char *errmsg)
void(* SPF_info_handler)(const char *, int, const char *)
void SPF_errorx(const char *file, int line, const char *format,...) __attribute__((noreturn)) __attribute__((format(printf
void SPF_debugv(const char *file, int line, const char *format, va_list ap) __attribute__((format(printf
void SPF_info_stdio(const char *file __attribute__((unused)), int line __attribute__((unused)), const char *errmsg)
void(* SPF_debug_handler)(const char *, int, const char *)
void SPF_debug_syslog(const char *file, int line, const char *errmsg)
void SPF_infox(const char *file, int line, const char *format,...) __attribute__((format(printf
void SPF_error_syslog(const char *file, int line, const char *errmsg) __attribute__((noreturn))