Mercurial > pidgin
annotate src/protocols/sametime/meanwhile/mw_debug.h @ 11986:bfbb1798535e
[gaim-migrate @ 14279]
Switch to using the unicode character 0x25cf instead of an asterisk as
our password masking character.
In the words of the great Christian Hammond, "By the way, isn't it
about time we replace the asterisk in masked entries with that unicode
character for the round filled circle ("?")? The asterisk is so 1980s."
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Sat, 05 Nov 2005 23:42:35 +0000 |
| parents | 0110fc7c6a8a |
| children | a2ebf585d8c6 |
| rev | line source |
|---|---|
| 10969 | 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 | |
| 31 /** replaces NULL strings with "(null)". useful for printf where | |
| 32 you're unsure that the %s will be non-NULL. Note that while the | |
| 33 linux printf will do this automatically, not all will. The others | |
| 34 will instead segfault */ | |
| 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 /** email address used in mw_debug_mailme. */ | |
| 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 /** message used in mw_debug_mailme instructing user on what to do | |
| 66 with the debugging output produced from that function */ | |
| 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 | |
|
11943
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
77 void mw_debug_datav(const char *buf, gsize len, |
|
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
78 const char *info, va_list args); |
|
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
79 |
|
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
80 |
|
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
81 void mw_debug_data(const char *buf, gsize len, |
|
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
82 const char *info, ...); |
|
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
83 |
|
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
84 |
|
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
85 void mw_debug_opaquev(struct mwOpaque *o, const char *info, va_list args); |
|
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
86 |
|
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
87 |
|
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
88 void mw_debug_opaque(struct mwOpaque *o, const char *info, ...); |
|
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
89 |
|
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
90 |
|
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
91 void mw_mailme_datav(const char *buf, gsize len, |
|
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
92 const char *info, va_list args); |
|
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
93 |
|
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
94 void mw_mailme_data(const char *buf, gsize len, |
|
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
95 const char *info, ...); |
|
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
96 |
|
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
97 |
| 10969 | 98 /** Outputs a hex dump of a mwOpaque with debugging info and a |
|
11943
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
99 pre-defined message. Identical to mw_mailme_opaque, but taking a |
| 10969 | 100 va_list argument */ |
|
11943
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
101 void mw_mailme_opaquev(struct mwOpaque *o, const char *info, va_list args); |
|
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
102 |
| 10969 | 103 |
| 104 | |
| 105 /** Outputs a hex dump of a mwOpaque with debugging info and a | |
| 106 pre-defined message. | |
| 107 | |
|
11943
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
108 if MW_MAILME is undefined or false, this function acts the same as |
|
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
109 mw_mailme_opaque. |
|
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
110 |
| 10969 | 111 @arg block data to be printed in a hex block |
| 112 @arg info a printf-style format string | |
| 113 | |
| 114 The resulting message is in the following format: | |
| 115 @code | |
| 116 MW_MAILME_MESSAGE | |
| 117 " Please send mail to: " MW_MAILME_ADDRESS | |
| 118 MW_MAILME_CUT_START | |
| 119 info | |
| 120 block | |
| 121 MW_MAILME_CUT_STOP | |
| 122 @endcode | |
| 123 */ | |
|
11943
0110fc7c6a8a
[gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents:
10969
diff
changeset
|
124 void mw_mailme_opaque(struct mwOpaque *o, const char *info, ...); |
| 10969 | 125 |
| 126 | |
| 127 #endif | |
| 128 |
