meanwhile  1.0.2
mw_debug.h
Go to the documentation of this file.
1 
2 /*
3  Meanwhile - Unofficial Lotus Sametime Community Client Library
4  Copyright (C) 2004 Christopher (siege) O'Brien
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public
17  License along with this library; if not, write to the Free
18  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20 
21 #ifndef _MW_DEBUG_H
22 #define _MW_DEBUG_H
23 
24 
25 #include <stdarg.h>
26 #include <glib.h>
27 
28 #include "mw_common.h"
29 
30 
35 #define NSTR(str) ((str)? (str): "(null)")
36 
37 
38 #ifndef g_debug
39 #define g_debug(format...) g_log(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format)
40 #endif
41 
42 
43 #ifndef g_info
44 #define g_info(format...) g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format)
45 #endif
46 
47 
48 #ifndef MW_MAILME_ADDRESS
49 
50 #define MW_MAILME_ADDRESS "meanwhile-devel@lists.sourceforge.net"
51 #endif
52 
53 
54 #ifndef MW_MAILME_CUT_START
55 #define MW_MAILME_CUT_START "-------- begin copy --------"
56 #endif
57 
58 
59 #ifndef MW_MAILME_CUT_STOP
60 #define MW_MAILME_CUT_STOP "--------- end copy ---------"
61 #endif
62 
63 
64 #ifndef MW_MAILME_MESSAGE
65 
67 #define MW_MAILME_MESSAGE "\n" \
68  " Greetings! It seems that you've run across protocol data that the\n" \
69  "Meanwhile library does not yet know about. As such, there may be\n" \
70  "some unexpected behaviour in this session. If you'd like to help\n" \
71  "resolve this issue, please copy and paste the following block into\n" \
72  "an email to the address listed below with a brief explanation of\n" \
73  "what you were doing at the time of this message. Thanks a lot!"
74 #endif
75 
76 
77 void mw_debug_datav(const guchar *buf, gsize len,
78  const char *info, va_list args);
79 
80 
81 void mw_debug_data(const guchar *buf, gsize len,
82  const char *info, ...);
83 
84 
85 void mw_debug_opaquev(struct mwOpaque *o, const char *info, va_list args);
86 
87 
88 void mw_debug_opaque(struct mwOpaque *o, const char *info, ...);
89 
90 
91 void mw_mailme_datav(const guchar *buf, gsize len,
92  const char *info, va_list args);
93 
94 void mw_mailme_data(const guchar *buf, gsize len,
95  const char *info, ...);
96 
97 
101 void mw_mailme_opaquev(struct mwOpaque *o, const char *info, va_list args);
102 
103 
104 
124 void mw_mailme_opaque(struct mwOpaque *o, const char *info, ...);
125 
126 
127 #endif
128 
void mw_debug_datav(const guchar *buf, gsize len, const char *info, va_list args)
void mw_debug_data(const guchar *buf, gsize len, const char *info,...)
void mw_mailme_opaquev(struct mwOpaque *o, const char *info, va_list args)
Outputs a hex dump of a mwOpaque with debugging info and a pre-defined message.
void mw_debug_opaque(struct mwOpaque *o, const char *info,...)
void mw_mailme_datav(const guchar *buf, gsize len, const char *info, va_list args)
void mw_mailme_opaque(struct mwOpaque *o, const char *info,...)
Outputs a hex dump of a mwOpaque with debugging info and a pre-defined message.
Common data types and functions for handling those types.
void mw_mailme_data(const guchar *buf, gsize len, const char *info,...)
A length of binary data, not null-terminated.
Definition: mw_common.h:79
void mw_debug_opaquev(struct mwOpaque *o, const char *info, va_list args)