Updated Macedonian Translation <arangela@cvs.gnome.org>
[rhythmbox.git] / lib / rb-debug.h
blobffd19d98f900d539f9636a055c06064ea19cc7b2
1 /*
2 * arch-tag: Header for simple Rhythmbox debugging interface
4 * Copyright (C) 2002 Jorn Baayen
5 * Copyright (C) 2003 Colin Walters <walters@verbum.org>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
10 * any later version.
12 * This program 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
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
23 #ifndef __RB_DEBUG_H
24 #define __RB_DEBUG_H
26 #include <stdarg.h>
27 #include <glib.h>
29 G_BEGIN_DECLS
31 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
32 #define rb_debug(...) rb_debug_real (__func__, __FILE__, __LINE__, __VA_ARGS__)
33 #elif defined(__GNUC__) && __GNUC__ >= 3
34 #define rb_debug(...) rb_debug_real (__FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
35 #else
36 #define rb_debug
37 #endif
39 void rb_debug_init (gboolean debug);
40 void rb_debug_init_match (const char *match);
42 void rb_debug_real (const char *func,
43 const char *file,
44 int line,
45 const char *format, ...);
47 void rb_debug_stop_in_debugger (void);
49 typedef struct RBProfiler RBProfiler;
51 RBProfiler *rb_profiler_new (const char *name);
52 void rb_profiler_dump (RBProfiler *profiler);
53 void rb_profiler_reset (RBProfiler *profiler);
54 void rb_profiler_free (RBProfiler *profiler);
56 void _rb_profile_log (const char *func,
57 const char *file,
58 int line,
59 int indent,
60 const char *msg1,
61 const char *msg2);
62 #define ENABLE_PROFILING 1
63 #ifdef ENABLE_PROFILING
64 #define RB_PROFILE_INDENTATION 4
65 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
66 #define rb_profile_start(msg) _rb_profile_log (__func__, __FILE__, __LINE__, RB_PROFILE_INDENTATION, "START", msg)
67 #define rb_profile_end(msg) _rb_profile_log (__func__, __FILE__, __LINE__, -RB_PROFILE_INDENTATION, "END", msg)
68 #elif defined(__GNUC__) && __GNUC__ >= 3
69 #define rb_profile_start(msg) _rb_profile_log (__FUNCTION__, __FILE__, __LINE__, RB_PROFILE_INDENTATION, "START", msg)
70 #define rb_profile_end(msg) _rb_profile_log (__FUNCTION__, __FILE__, __LINE__, -RB_PROFILE_INDENTATION, "END", msg)
71 #else
72 #define rb_profile_start(msg)
73 #define rb_profile_end(msg)
74 #endif
75 #else
76 #define rb_profile_start(msg)
77 #define rb_profile_end(msg)
78 #endif
80 G_END_DECLS
82 #endif /* __RB_DEBUG_H */