libxrdeveloper's documentation
xr-lib.h
Go to the documentation of this file.
1 /*
2  * Copyright 2006-2008 Ondrej Jirman <ondrej.jirman@zonio.net>
3  *
4  * This file is part of libxr.
5  *
6  * Libxr is free software: you can redistribute it and/or modify it under the
7  * terms of the GNU Lesser General Public License as published by the Free
8  * Software Foundation, either version 2 of the License, or (at your option) any
9  * later version.
10  *
11  * Libxr is distributed in the hope that it will be useful, but WITHOUT ANY
12  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13  * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14  * details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with libxr. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
27 #ifndef __XR_LIB_H__
28 #define __XR_LIB_H__
29 
30 #include <glib.h>
31 #include "xr-config.h"
32 
33 enum
34 {
35  XR_DEBUG_HTTP = (1 << 0),
36  XR_DEBUG_HTTP_TRACE = (1 << 1),
37  XR_DEBUG_SERVER = (1 << 2),
38  XR_DEBUG_SERVER_TRACE = (1 << 3),
39  XR_DEBUG_CLIENT = (1 << 4),
40  XR_DEBUG_CLIENT_TRACE = (1 << 5),
41  XR_DEBUG_SERVLET = (1 << 6),
43  XR_DEBUG_CALL = (1 << 8),
44  XR_DEBUG_CALL_TRACE = (1 << 9),
45  XR_DEBUG_VALUE = (1 << 10),
46  XR_DEBUG_LIB = (1 << 11),
47  XR_DEBUG_ALL = 0xffffffff
48 };
49 
52 extern int xr_debug_enabled;
53 
60 #define xr_debug(mask, fmt, args...) \
61  do { if (G_UNLIKELY(xr_debug_enabled & mask)) _xr_debug(G_STRLOC ": ", fmt, ## args); } while(0)
62 
69 #define xr_trace(mask, fmt, args...) \
70  do { if (G_UNLIKELY(xr_debug_enabled & mask)) _xr_debug(G_STRFUNC, fmt, ## args); } while(0)
71 
72 G_BEGIN_DECLS
73 
81 void _xr_debug(const char* loc, const char* fmt, ...);
82 
85 void xr_init();
86 
91 void xr_fini();
92 
93 G_END_DECLS
94 
95 #endif
Dump HTTP requests/responses.
Definition: xr-lib.h:35
int xr_debug_enabled
Global variable used to enable debugging messages.
Trace xr-server.c code.
Definition: xr-lib.h:38
Trace xr-call.c code.
Definition: xr-lib.h:44
Debug xr_value parser/builder code.
Definition: xr-lib.h:45
Not implemented.
Definition: xr-lib.h:42
G_BEGIN_DECLS void _xr_debug(const char *loc, const char *fmt,...)
Log message.
Trace xr-client.c code.
Definition: xr-lib.h:40
void xr_init()
Initialize libxr.
Not implemented.
Definition: xr-lib.h:37
Not implemented.
Definition: xr-lib.h:39
Not implemented.
Definition: xr-lib.h:41
void xr_fini()
Finalize libxr.
Not implemented.
Definition: xr-lib.h:46
Dump RPC calls.
Definition: xr-lib.h:43
Trace HTTP calls.
Definition: xr-lib.h:36
Documentation for libxr, Wed Apr 27 2016 22:07:49.