Bug 22803 - Make header conform to implementation
[swfdec.git] / swfdec / swfdec_debug.h
blob9d0963b3f39b826428e641af07382af092424472
1 /* Swfdec
2 * Copyright (C) 2003-2006 David Schleef <ds@schleef.org>
3 * 2005-2006 Eric Anholt <eric@anholt.net>
4 * 2006-2007 Benjamin Otte <otte@gnome.org>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301 USA
22 #ifndef __SWFDEC_DEBUG_H__
23 #define __SWFDEC_DEBUG_H__
25 #include <glib.h>
27 G_BEGIN_DECLS
29 enum {
30 SWFDEC_LEVEL_NONE = 0,
31 SWFDEC_LEVEL_ERROR,
32 SWFDEC_LEVEL_FIXME,
33 SWFDEC_LEVEL_WARNING,
34 SWFDEC_LEVEL_INFO,
35 SWFDEC_LEVEL_DEBUG,
36 SWFDEC_LEVEL_LOG
39 #define SWFDEC_ERROR(...) \
40 SWFDEC_DEBUG_LEVEL(SWFDEC_LEVEL_ERROR, __VA_ARGS__)
41 #define SWFDEC_FIXME(...) \
42 SWFDEC_DEBUG_LEVEL(SWFDEC_LEVEL_FIXME, __VA_ARGS__)
43 #define SWFDEC_WARNING(...) \
44 SWFDEC_DEBUG_LEVEL(SWFDEC_LEVEL_WARNING, __VA_ARGS__)
45 #define SWFDEC_INFO(...) \
46 SWFDEC_DEBUG_LEVEL(SWFDEC_LEVEL_INFO, __VA_ARGS__)
47 #define SWFDEC_DEBUG(...) \
48 SWFDEC_DEBUG_LEVEL(SWFDEC_LEVEL_DEBUG, __VA_ARGS__)
49 #define SWFDEC_LOG(...) \
50 SWFDEC_DEBUG_LEVEL(SWFDEC_LEVEL_LOG, __VA_ARGS__)
52 #define SWFDEC_STUB(fun) \
53 SWFDEC_DEBUG_LEVEL (SWFDEC_LEVEL_FIXME, "%s %s", fun, "is not implemented yet")
55 #ifdef SWFDEC_DISABLE_DEBUG
56 #define SWFDEC_DEBUG_LEVEL(level,...) (void) 0
57 #else
58 #define SWFDEC_DEBUG_LEVEL(level,...) \
59 swfdec_debug_log ((level), __FILE__, G_STRFUNC, __LINE__, __VA_ARGS__)
60 #endif
62 void swfdec_debug_log (guint level, const char *file, const char *function,
63 int line, const char *format, ...) G_GNUC_PRINTF (5, 6);
64 void swfdec_debug_set_level (guint level);
65 int swfdec_debug_get_level (void);
67 G_END_DECLS
68 #endif