~noskcaj/ubuntu/saucy/xfce4-power-manager/1.2.0-2ubuntu1

« back to all changes in this revision

Viewing changes to common/xfpm-debug.h

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc
  • Date: 2010-12-09 18:28:34 UTC
  • mfrom: (2.3.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20101209182834-efb7dinmf9ssp3es
Tags: 1.0.1-0ubuntu1
Upload to natty (pkg-xfce svn r4665), no Ubuntu changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * * Copyright (C) 2008-2009 Ali <aliov@xfce.org>
 
3
 *
 
4
 * Licensed under the GNU General Public License Version 2
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; either version 2 of the License, or
 
9
 * (at your option) any later version.
 
10
 *
 
11
 * This program 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
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
19
 */
 
20
 
 
21
#ifndef __XFPM_DEBUG_H
 
22
#define __XFPM_DEBUG_H
 
23
 
 
24
#ifdef HAVE_CONFIG_H
 
25
#include <config.h>
 
26
#endif
 
27
 
 
28
#include <stdarg.h>
 
29
#include <glib.h>
 
30
 
 
31
G_BEGIN_DECLS
 
32
 
 
33
#if defined(G_HAVE_ISO_VARARGS)
 
34
 
 
35
#define XFPM_DEBUG(...)\
 
36
    xfpm_debug (__func__, __FILE__, __LINE__, __VA_ARGS__)
 
37
 
 
38
#define XFPM_WARNING(...)\
 
39
    xfpm_warn (__func__, __FILE__, __LINE__, __VA_ARGS__)
 
40
 
 
41
#define XFPM_DEBUG_ENUM(_value, _type, ...)\
 
42
    xfpm_debug_enum (__func__, __FILE__, __LINE__, _value, _type, __VA_ARGS__)
 
43
 
 
44
                                         
 
45
void            xfpm_debug_enum         (const gchar *func,
 
46
                                         const gchar *file,
 
47
                                         gint line,
 
48
                                         gint v_enum,
 
49
                                         GType type,
 
50
                                         const gchar *format,
 
51
                                         ...) __attribute__((format (printf,6,7)));
 
52
 
 
53
void            xfpm_debug              (const char *func,
 
54
                                         const char *file,
 
55
                                         int line,
 
56
                                         const char *format,
 
57
                                         ...) __attribute__((format (printf,4,5)));
 
58
 
 
59
void            xfpm_warn               (const char *func,
 
60
                                         const char *file,
 
61
                                         int line,
 
62
                                         const char *format,
 
63
                                         ...) __attribute__((format (printf,4,5)));
 
64
 
 
65
#else
 
66
 
 
67
#define XFPM_DEBUG(...)
 
68
#define XFPM_WARNING(...)
 
69
#define XFPM_DEBUG_ENUM(_value, _type, ...)
 
70
 
 
71
#endif
 
72
 
 
73
void            xfpm_debug_init         (gboolean debug);
 
74
 
 
75
G_END_DECLS
 
76
 
 
77
#endif /* __XFPM_DEBUG_H */