0001
0002 #ifndef __API_DEBUG_INTERNAL_H__
0003 #define __API_DEBUG_INTERNAL_H__
0004
0005 #include "debug.h"
0006
0007 #define __pr(func, fmt, ...) \
0008 do { \
0009 if ((func)) \
0010 (func)("libapi: " fmt, ##__VA_ARGS__); \
0011 } while (0)
0012
0013 extern libapi_print_fn_t __pr_warn;
0014 extern libapi_print_fn_t __pr_info;
0015 extern libapi_print_fn_t __pr_debug;
0016
0017 #define pr_warn(fmt, ...) __pr(__pr_warn, fmt, ##__VA_ARGS__)
0018 #define pr_info(fmt, ...) __pr(__pr_info, fmt, ##__VA_ARGS__)
0019 #define pr_debug(fmt, ...) __pr(__pr_debug, fmt, ##__VA_ARGS__)
0020
0021 #endif