]> git.samba.org - metze/wireshark/wip.git/blob - epan/conversation_debug.h
Add debug printing functions for conversations, sip, sdp, rtp
[metze/wireshark/wip.git] / epan / conversation_debug.h
1
2 /* a file of debug printing stuff for conversation-related things,
3  * although really anything can use this so long as it includes this
4  *
5  * define DEBUG_CONVERSATION before including this file to turn on printing
6  * and also define it in conversation.c (because it has the indent variable)
7  */
8
9 #ifndef _CONVERSATION_DEBUG_H
10 #define _CONVERSATION_DEBUG_H
11
12 #ifdef DEBUG_CONVERSATION
13
14 #include <stdio.h>
15 #include "to_str.h"
16
17 extern int _debug_conversation_indent; /* the instance is in conversation.c */
18
19 #define DINDENT() _debug_conversation_indent += 4
20 #define DENDENT() _debug_conversation_indent -= 4
21
22 #define DPRINT(arg) \
23           g_printerr("%*.*s%s: ", \
24                      _debug_conversation_indent,_debug_conversation_indent," ", \
25                      G_STRLOC); \
26           g_printerr arg; \
27           g_printerr("\n")
28
29 #define DPRINT2(arg) \
30           g_printerr("%*.*s", \
31                      _debug_conversation_indent,_debug_conversation_indent," "); \
32           g_printerr arg; \
33           g_printerr("\n")
34
35 #else /* !DEBUG_CONVERSATION */
36
37 /* a hack to let these defines be used with trailing semi-colon and not
38  * cause gcc extra-check pedantic warnings for extra colons
39  */
40 #define DINDENT() (void)0
41 #define DENDENT() (void)0
42 #define DPRINT(arg) (void)0
43 #define DPRINT2(arg) (void)0
44
45 #endif /* DEBUG_CONVERSATION */
46
47 #endif /* _CONVERSATION_DEBUG_H */