udapted vi.po
[rhythmbox.git] / lib / rb-debug.h
blob00573d99e3de2bc517dfafb1f82e4249642e59d4
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__, TRUE, __VA_ARGS__)
33 #elif defined(__GNUC__) && __GNUC__ >= 3
34 #define rb_debug(...) rb_debug_real (__FUNCTION__, __FILE__, __LINE__, TRUE, __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 gboolean newline,
46 const char *format, ...) G_GNUC_PRINTF (5, 6);
48 void rb_debug_stop_in_debugger (void);
50 typedef struct RBProfiler RBProfiler;
52 RBProfiler *rb_profiler_new (const char *name);
53 void rb_profiler_dump (RBProfiler *profiler);
54 void rb_profiler_reset (RBProfiler *profiler);
55 void rb_profiler_free (RBProfiler *profiler);
57 void _rb_profile_log (const char *func,
58 const char *file,
59 int line,
60 int indent,
61 const char *msg1,
62 const char *msg2);
63 #define ENABLE_PROFILING 1
64 #ifdef ENABLE_PROFILING
65 #define RB_PROFILE_INDENTATION 4
66 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
67 #define rb_profile_start(msg) _rb_profile_log (__func__, __FILE__, __LINE__, RB_PROFILE_INDENTATION, "START", msg)
68 #define rb_profile_end(msg) _rb_profile_log (__func__, __FILE__, __LINE__, -RB_PROFILE_INDENTATION, "END", msg)
69 #elif defined(__GNUC__) && __GNUC__ >= 3
70 #define rb_profile_start(msg) _rb_profile_log (__FUNCTION__, __FILE__, __LINE__, RB_PROFILE_INDENTATION, "START", msg)
71 #define rb_profile_end(msg) _rb_profile_log (__FUNCTION__, __FILE__, __LINE__, -RB_PROFILE_INDENTATION, "END", msg)
72 #else
73 #define rb_profile_start(msg)
74 #define rb_profile_end(msg)
75 #endif
76 #else
77 #define rb_profile_start(msg)
78 #define rb_profile_end(msg)
79 #endif
81 G_END_DECLS
83 #endif /* __RB_DEBUG_H */