libxr — developer's documentation

- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

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),
42 XR_DEBUG_SERVLET_TRACE = (1 << 7),
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
XR_DEBUG_HTTP
Dump HTTP requests/responses.
Definition: xr-lib.h:35
xr_debug_enabled
int xr_debug_enabled
Global variable used to enable debugging messages.
XR_DEBUG_SERVER_TRACE
Trace xr-server.c code.
Definition: xr-lib.h:38
XR_DEBUG_CALL_TRACE
Trace xr-call.c code.
Definition: xr-lib.h:44
XR_DEBUG_VALUE
Debug xr_value parser/builder code.
Definition: xr-lib.h:45
XR_DEBUG_SERVLET_TRACE
Not implemented.
Definition: xr-lib.h:42
_xr_debug
G_BEGIN_DECLS void _xr_debug(const char *loc, const char *fmt,...)
Log message.
XR_DEBUG_CLIENT_TRACE
Trace xr-client.c code.
Definition: xr-lib.h:40
xr_init
void xr_init()
Initialize libxr.
XR_DEBUG_SERVER
Not implemented.
Definition: xr-lib.h:37
XR_DEBUG_CLIENT
Not implemented.
Definition: xr-lib.h:39
XR_DEBUG_SERVLET
Not implemented.
Definition: xr-lib.h:41
xr_fini
void xr_fini()
Finalize libxr.
XR_DEBUG_LIB
Not implemented.
Definition: xr-lib.h:46
XR_DEBUG_CALL
Dump RPC calls.
Definition: xr-lib.h:43
XR_DEBUG_HTTP_TRACE
Trace HTTP calls.
Definition: xr-lib.h:36
Documentation for libxr, Mon Jan 6 2014 07:32:37.