42 #define CHECK_PRINTF_FORMAT
44 #define CPLUSPLUS_ONLY
45 #if defined(__GNUC__) && (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ > 4))
46 #define CHECK_PRINTF_FORMAT __attribute__ ((format (printf, 2, 3)))
48 #define CHECK_PRINTF_FORMAT
67 #define BDI_LOG_MAX_CALLBACKS (8)
68 #define BDI_LOG_BAD_CALLBACK_HANDLE (-1)
75 #define BDI_LOG_NOTHING (-1)
76 #define BDI_LOG_ALWAYS (0)
77 #define BDI_LOG_FATAL (1)
78 #define BDI_LOG_ERROR (2)
79 #define BDI_LOG_WARN (3)
80 #define BDI_LOG_INFO (4)
81 #define BDI_LOG_DEBUG (5)
82 #define BDI_LOG_DEBUG_LV1 (6)
83 #define BDI_LOG_DEBUG_LV2 (7)
84 #define BDI_LOG_DEBUG_LV3 (8)
85 #define BDI_LOG_DEBUG_LV4 (9)
86 #define BDI_LOG_DEBUG_LV5 (10)
87 #define BDI_LOG_DEBUG_LV6 (11)
88 #define BDI_LOG_DEBUG_LV7 (12)
89 #define BDI_LOG_DEBUG_LV8 (13)
90 #define BDI_LOG_DEBUG_LV9 (14)
91 #define BDI_LOG_EVERYTHING (15)
228 #ifdef CPLUSPLUS_ONLY
300 #ifdef CPLUSPLUS_ONLY
319 #ifdef CPLUSPLUS_ONLY
335 #ifdef CPLUSPLUS_ONLY
384 int result_buf_size);
396 #ifdef CPLUSPLUS_ONLY
440 #ifdef CPLUSPLUS_ONLY
443 #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__);}
444 #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);}
445 #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__);}
446 #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__);}
447 #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__);}
449 #define bdi_log_debug(string) bdi_log_print(BDI_LOG_DEBUG, string)
450 #define bdi_log_debug_arg0(string) bdi_log_print(BDI_LOG_DEBUG, string)
451 #define bdi_log_debug_arg1(string, arg1) bdi_log_printf(BDI_LOG_DEBUG, string, arg1)
452 #define bdi_log_debug_arg2(string, arg1, arg2) bdi_log_printf(BDI_LOG_DEBUG, string, arg1, arg2)
453 #define bdi_log_debug_arg3(string, arg1, arg2, arg3) bdi_log_printf(BDI_LOG_DEBUG, string, arg1, arg2, arg3)
454 #define bdi_log_debug_arg4(string, arg1, arg2, arg3, arg4) bdi_log_printf(BDI_LOG_DEBUG, string, arg1, arg2, arg3, arg4)
455 #define bdi_log_debug_arg5(string, arg1, arg2, arg3, arg4, arg5) bdi_log_printf(BDI_LOG_DEBUG, string, arg1, arg2, arg3, arg4, arg5)
456 #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)
458 #define bdi_log_debug_lvn(level, string) bdi_log_print(BDI_LOG_DEBUG_LV##level, string)
459 #define bdi_log_debug_lvn_arg0(level, string) bdi_log_print(BDI_LOG_DEBUG_LV##level, string)
460 #define bdi_log_debug_lvn_arg1(level, string, arg1) bdi_log_printf(BDI_LOG_DEBUG_LV##level, string, arg1)
461 #define bdi_log_debug_lvn_arg2(level, string, arg1, arg2) bdi_log_printf(BDI_LOG_DEBUG_LV##level, string, arg1, arg2)
462 #define bdi_log_debug_lvn_arg3(level, string, arg1, arg2, arg3) bdi_log_printf(BDI_LOG_DEBUG_LV##level, string, arg1, arg2, arg3)
463 #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)
464 #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)
465 #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)
469 #define bdi_log_assert(assertion)
470 #define bdi_log_assert_fatal(assertion)
471 #define bdi_log_assert_warn(assertion)
472 #define bdi_log_assert_info(assertion)
473 #define bdi_log_assert_debug(assertion)
475 #define bdi_log_debug(string)
476 #define bdi_log_debug_arg0(string)
477 #define bdi_log_debug_arg1(string, arg1)
478 #define bdi_log_debug_arg2(string, arg1, arg2)
479 #define bdi_log_debug_arg3(string, arg1, arg2, arg3)
480 #define bdi_log_debug_arg4(string, arg1, arg2, arg3, arg4)
481 #define bdi_log_debug_arg5(string, arg1, arg2, arg3, arg4, arg5)
482 #define bdi_log_debug_arg6(string, arg1, arg2, arg3, arg4, arg5, arg6)
484 #define bdi_log_debug_lvn(level, string)
485 #define bdi_log_debug_lvn_arg0(level, string)
486 #define bdi_log_debug_lvn_arg1(level, string, arg1)
487 #define bdi_log_debug_lvn_arg2(level, string, arg1, arg2)
488 #define bdi_log_debug_lvn_arg3(level, string, arg1, arg2, arg3)
489 #define bdi_log_debug_lvn_arg4(level, string, arg1, arg2, arg3, arg4)
490 #define bdi_log_debug_lvn_arg5(level, string, arg1, arg2, arg3, arg4, arg5)
491 #define bdi_log_debug_lvn_arg6(level, string, arg1, arg2, arg3, arg4, arg5, arg6)