libxrdeveloper's documentation
xr-lib.h
Go to the documentation of this file.
00001 /* 
00002  * Copyright 2006-2008 Ondrej Jirman <ondrej.jirman@zonio.net>
00003  * 
00004  * This file is part of libxr.
00005  *
00006  * Libxr is free software: you can redistribute it and/or modify it under the
00007  * terms of the GNU Lesser General Public License as published by the Free
00008  * Software Foundation, either version 2 of the License, or (at your option) any
00009  * later version.
00010  *
00011  * Libxr is distributed in the hope that it will be useful, but WITHOUT ANY
00012  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
00013  * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00014  * details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public License
00017  * along with libxr.  If not, see <http://www.gnu.org/licenses/>.
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
Documentation for libxr, Thu Jun 9 2011 22:32:44.