Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00027 #ifndef __XR_LIB_H__
00028 #define __XR_LIB_H__
00029
00030 #include <glib.h>
00031 #include "xr-config.h"
00032
00033 enum
00034 {
00035 XR_DEBUG_HTTP = (1 << 0),
00036 XR_DEBUG_HTTP_TRACE = (1 << 1),
00037 XR_DEBUG_SERVER = (1 << 2),
00038 XR_DEBUG_SERVER_TRACE = (1 << 3),
00039 XR_DEBUG_CLIENT = (1 << 4),
00040 XR_DEBUG_CLIENT_TRACE = (1 << 5),
00041 XR_DEBUG_SERVLET = (1 << 6),
00042 XR_DEBUG_SERVLET_TRACE = (1 << 7),
00043 XR_DEBUG_CALL = (1 << 8),
00044 XR_DEBUG_CALL_TRACE = (1 << 9),
00045 XR_DEBUG_VALUE = (1 << 10),
00046 XR_DEBUG_LIB = (1 << 11),
00047 XR_DEBUG_ALL = 0xffffffff
00048 };
00049
00052 extern int xr_debug_enabled;
00053
00060 #define xr_debug(mask, fmt, args...) \
00061 do { if (G_UNLIKELY(xr_debug_enabled & mask)) _xr_debug(G_STRLOC ": ", fmt, ## args); } while(0)
00062
00069 #define xr_trace(mask, fmt, args...) \
00070 do { if (G_UNLIKELY(xr_debug_enabled & mask)) _xr_debug(G_STRFUNC, fmt, ## args); } while(0)
00071
00072 G_BEGIN_DECLS
00073
00081 void _xr_debug(const char* loc, const char* fmt, ...);
00082
00085 void xr_init();
00086
00091 void xr_fini();
00092
00093 G_END_DECLS
00094
00095 #endif