1 /* conversation_debug.h
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 * header file and defines DEBUG_CONVERSATION in conversation.c
6 * define DEBUG_CONVERSATION before including this file to turn on printing
7 * and also define it in conversation.c (because it has the indent variable)
9 * By Hadriel Kaplan <hadrielk at yahoo dot com>
10 * Copyright 2014 Hadriel Kaplan
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 #ifndef _CONVERSATION_DEBUG_H
28 #define _CONVERSATION_DEBUG_H
30 #ifdef DEBUG_CONVERSATION
35 extern int _debug_conversation_indent; /* the instance is in conversation.c */
37 #define DINDENT() _debug_conversation_indent += 4
38 #define DENDENT() _debug_conversation_indent -= 4
41 g_printerr("%*.*s%s: ", \
42 _debug_conversation_indent,_debug_conversation_indent," ", \
47 #define DPRINT2(arg) \
49 _debug_conversation_indent,_debug_conversation_indent," "); \
53 #else /* !DEBUG_CONVERSATION */
55 /* a hack to let these defines be used with trailing semi-colon and not
56 * cause gcc extra-check pedantic warnings for extra colons
58 #define DINDENT() (void)0
59 #define DENDENT() (void)0
60 #define DPRINT(arg) (void)0
61 #define DPRINT2(arg) (void)0
63 #endif /* DEBUG_CONVERSATION */
65 #endif /* _CONVERSATION_DEBUG_H */