22 #define CHECK_PRINTF_FORMAT
24 #define CPLUSPLUS_ONLY
25 #if defined(__GNUC__) && (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ > 4))
26 #define CHECK_PRINTF_FORMAT __attribute__ ((format (printf, 2, 3)))
28 #define CHECK_PRINTF_FORMAT
47 #define BDI_LOG_MAX_CALLBACKS (8)
48 #define BDI_LOG_BAD_CALLBACK_HANDLE (-1)
55 #define BDI_LOG_NOTHING (-1)
56 #define BDI_LOG_ALWAYS (0)
57 #define BDI_LOG_FATAL (1)
58 #define BDI_LOG_ERROR (2)
59 #define BDI_LOG_WARN (3)
60 #define BDI_LOG_INFO (4)
61 #define BDI_LOG_DEBUG (5)
62 #define BDI_LOG_DEBUG_LV1 (6)
63 #define BDI_LOG_DEBUG_LV2 (7)
64 #define BDI_LOG_DEBUG_LV3 (8)
65 #define BDI_LOG_DEBUG_LV4 (9)
66 #define BDI_LOG_DEBUG_LV5 (10)
67 #define BDI_LOG_DEBUG_LV6 (11)
68 #define BDI_LOG_DEBUG_LV7 (12)
69 #define BDI_LOG_DEBUG_LV8 (13)
70 #define BDI_LOG_DEBUG_LV9 (14)
71 #define BDI_LOG_EVERYTHING (15)
208 #ifdef CPLUSPLUS_ONLY
280 #ifdef CPLUSPLUS_ONLY
299 #ifdef CPLUSPLUS_ONLY
315 #ifdef CPLUSPLUS_ONLY
364 int result_buf_size);
376 #ifdef CPLUSPLUS_ONLY
420 #ifdef CPLUSPLUS_ONLY
423 #define bdi_log_assert(assertion) if (!(assertion)) {bdi_log_printf(BDI_LOG_ERROR, "ERROR: Assertion '%s' failed in file %s line %d\n", #assertion, __FILE__, __LINE__);}
424 #define bdi_log_assert_fatal(assertion) if (!(assertion)) {bdi_log_printf(BDI_LOG_FATAL, "FATAL: Assertion '%s' failed in file %s line %d\n", #assertion, __FILE__, __LINE__); exit(EXIT_FAILURE);}
425 #define bdi_log_assert_warn(assertion) if (!(assertion)) {bdi_log_printf(BDI_LOG_WARN, "WARNING: Assertion '%s' failed in file %s line %d\n", #assertion, __FILE__, __LINE__);}
426 #define bdi_log_assert_info(assertion) if (!(assertion)) {bdi_log_printf(BDI_LOG_INFO, "INFO: Assertion '%s' failed in file %s line %d\n", #assertion, __FILE__, __LINE__);}
427 #define bdi_log_assert_debug(assertion) if (!(assertion)) {bdi_log_printf(BDI_LOG_DEBUG, "DEBUG: Assertion '%s' failed in file %s line %d\n", #assertion, __FILE__, __LINE__);}
429 #define bdi_log_debug(string) bdi_log_print(BDI_LOG_DEBUG, string)
430 #define bdi_log_debug_arg0(string) bdi_log_print(BDI_LOG_DEBUG, string)
431 #define bdi_log_debug_arg1(string, arg1) bdi_log_printf(BDI_LOG_DEBUG, string, arg1)
432 #define bdi_log_debug_arg2(string, arg1, arg2) bdi_log_printf(BDI_LOG_DEBUG, string, arg1, arg2)
433 #define bdi_log_debug_arg3(string, arg1, arg2, arg3) bdi_log_printf(BDI_LOG_DEBUG, string, arg1, arg2, arg3)
434 #define bdi_log_debug_arg4(string, arg1, arg2, arg3, arg4) bdi_log_printf(BDI_LOG_DEBUG, string, arg1, arg2, arg3, arg4)
435 #define bdi_log_debug_arg5(string, arg1, arg2, arg3, arg4, arg5) bdi_log_printf(BDI_LOG_DEBUG, string, arg1, arg2, arg3, arg4, arg5)
436 #define bdi_log_debug_arg6(string, arg1, arg2, arg3, arg4, arg5, arg6) bdi_log_printf(BDI_LOG_DEBUG, string, arg1, arg2, arg3, arg4, arg5, arg6)
438 #define bdi_log_debug_lvn(level, string) bdi_log_print(BDI_LOG_DEBUG_LV##level, string)
439 #define bdi_log_debug_lvn_arg0(level, string) bdi_log_print(BDI_LOG_DEBUG_LV##level, string)
440 #define bdi_log_debug_lvn_arg1(level, string, arg1) bdi_log_printf(BDI_LOG_DEBUG_LV##level, string, arg1)
441 #define bdi_log_debug_lvn_arg2(level, string, arg1, arg2) bdi_log_printf(BDI_LOG_DEBUG_LV##level, string, arg1, arg2)
442 #define bdi_log_debug_lvn_arg3(level, string, arg1, arg2, arg3) bdi_log_printf(BDI_LOG_DEBUG_LV##level, string, arg1, arg2, arg3)
443 #define bdi_log_debug_lvn_arg4(level, string, arg1, arg2, arg3, arg4) bdi_log_printf(BDI_LOG_DEBUG_LV##level, string, arg1, arg2, arg3, arg4)
444 #define bdi_log_debug_lvn_arg5(level, string, arg1, arg2, arg3, arg4, arg5) bdi_log_printf(BDI_LOG_DEBUG_LV##level, string, arg1, arg2, arg3, arg4, arg5)
445 #define bdi_log_debug_lvn_arg6(level, string, arg1, arg2, arg3, arg4, arg5, arg6) bdi_log_printf(BDI_LOG_DEBUG_LV##level, string, arg1, arg2, arg3, arg4, arg5, arg6)
449 #define bdi_log_assert(assertion)
450 #define bdi_log_assert_fatal(assertion)
451 #define bdi_log_assert_warn(assertion)
452 #define bdi_log_assert_info(assertion)
453 #define bdi_log_assert_debug(assertion)
455 #define bdi_log_debug(string)
456 #define bdi_log_debug_arg0(string)
457 #define bdi_log_debug_arg1(string, arg1)
458 #define bdi_log_debug_arg2(string, arg1, arg2)
459 #define bdi_log_debug_arg3(string, arg1, arg2, arg3)
460 #define bdi_log_debug_arg4(string, arg1, arg2, arg3, arg4)
461 #define bdi_log_debug_arg5(string, arg1, arg2, arg3, arg4, arg5)
462 #define bdi_log_debug_arg6(string, arg1, arg2, arg3, arg4, arg5, arg6)
464 #define bdi_log_debug_lvn(level, string)
465 #define bdi_log_debug_lvn_arg0(level, string)
466 #define bdi_log_debug_lvn_arg1(level, string, arg1)
467 #define bdi_log_debug_lvn_arg2(level, string, arg1, arg2)
468 #define bdi_log_debug_lvn_arg3(level, string, arg1, arg2, arg3)
469 #define bdi_log_debug_lvn_arg4(level, string, arg1, arg2, arg3, arg4)
470 #define bdi_log_debug_lvn_arg5(level, string, arg1, arg2, arg3, arg4, arg5)
471 #define bdi_log_debug_lvn_arg6(level, string, arg1, arg2, arg3, arg4, arg5, arg6)