]> www.fi.muni.cz Git - evince.git/blob - lib/ev-debug.h
Do not include ev-poppler.h when pdf is disabled.
[evince.git] / lib / ev-debug.h
1 /*
2  *  Copyright (C) 2003 Marco Pesenti Gritti
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2, or (at your option)
7  *  any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  *  $Id$
19  */
20
21 #ifndef EV_DEBUG_H
22 #define EV_DEBUG_H
23
24 #include "config.h"
25
26 #include <glib.h>
27
28 G_BEGIN_DECLS
29
30 #ifndef GNOME_ENABLE_DEBUG
31 #define DISABLE_LOGGING
32 #define DISABLE_PROFILING
33 #endif
34
35 #if defined(G_HAVE_GNUC_VARARGS)
36
37 #ifdef DISABLE_LOGGING
38 #define LOG(msg, args...) G_STMT_START { } G_STMT_END
39 #else
40 #define LOG(msg, args...)                       \
41 g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG,         \
42        "[ %s ] " msg,                           \
43        __FILE__ , ## args)
44 #endif
45
46 #elif defined(G_HAVE_ISO_VARARGS)
47
48 #define LOG(...) G_STMT_START { } G_STMT_END
49
50 #else /* no varargs macros */
51
52 static void LOG(const char *format, ...) {}
53
54 #endif
55
56 #ifdef DISABLE_PROFILING
57 #define START_PROFILER(name)
58 #define STOP_PROFILER(name)
59 #else
60 #define START_PROFILER(name)    \
61 ev_profiler_start (name, __FILE__);
62 #define STOP_PROFILER(name)     \
63 ev_profiler_stop (name);
64 #endif
65
66 typedef struct
67 {
68         GTimer *timer;
69         char *name;
70         char *module;
71 } EvProfiler;
72
73 void            ev_debug_init           (void);
74
75 #ifndef DISABLE_PROFILING
76
77 void            ev_profiler_start       (const char *name,
78                                          const char *module);
79
80 void            ev_profiler_stop        (const char *name);
81
82 #endif
83
84 G_END_DECLS
85
86 #endif