summaryrefslogtreecommitdiffstats
path: root/src/debug.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/debug.h')
-rw-r--r--src/debug.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/debug.h b/src/debug.h
new file mode 100644
index 0000000..0a29be3
--- /dev/null
+++ b/src/debug.h
@@ -0,0 +1,45 @@
1/*
2 * debug.h
3 * contains utilitary functions for debugging
4 *
5 * Copyright (c) 2008 Jonathan Beck All Rights Reserved.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#ifndef DEBUG_H
23#define DEBUG_H
24
25#include <plist/plist.h>
26#include <glib.h>
27
28#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && !defined(STRIP_DEBUG_CODE)
29#define debug_info(...) debug_info_real (__func__, __FILE__, __LINE__, __VA_ARGS__)
30#elif defined(__GNUC__) && __GNUC__ >= 3 && !defined(STRIP_DEBUG_CODE)
31#define debug_info(...) debug_info_real (__FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
32#else
33#define debug_info(...)
34#endif
35
36G_GNUC_INTERNAL inline void debug_info_real(const char *func,
37 const char *file,
38 int line,
39 const char *format, ...);
40
41G_GNUC_INTERNAL inline void debug_buffer(const char *data, const int length);
42G_GNUC_INTERNAL inline void debug_buffer_to_file(const char *file, const char *data, const int length);
43G_GNUC_INTERNAL inline void debug_plist(plist_t plist);
44
45#endif