Mercurial > pidgin
comparison libpurple/debug.h @ 15822:32c366eeeb99
sed -ie 's/gaim/purple/g'
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Mon, 19 Mar 2007 07:01:17 +0000 |
parents | 5fe8042783c1 |
children | 6dc5dc83a61b |
comparison
equal
deleted
inserted
replaced
15821:84b0f9b23ede | 15822:32c366eeeb99 |
---|---|
1 /** | 1 /** |
2 * @file debug.h Debug API | 2 * @file debug.h Debug API |
3 * @ingroup core | 3 * @ingroup core |
4 * | 4 * |
5 * gaim | 5 * purple |
6 * | 6 * |
7 * Gaim is the legal property of its developers, whose names are too numerous | 7 * Purple is the legal property of its developers, whose names are too numerous |
8 * to list here. Please refer to the COPYRIGHT file distributed with this | 8 * to list here. Please refer to the COPYRIGHT file distributed with this |
9 * source distribution. | 9 * source distribution. |
10 * | 10 * |
11 * This program is free software; you can redistribute it and/or modify | 11 * This program is free software; you can redistribute it and/or modify |
12 * it under the terms of the GNU General Public License as published by | 12 * it under the terms of the GNU General Public License as published by |
20 * | 20 * |
21 * You should have received a copy of the GNU General Public License | 21 * You should have received a copy of the GNU General Public License |
22 * along with this program; if not, write to the Free Software | 22 * along with this program; if not, write to the Free Software |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
24 */ | 24 */ |
25 #ifndef _GAIM_DEBUG_H_ | 25 #ifndef _PURPLE_DEBUG_H_ |
26 #define _GAIM_DEBUG_H_ | 26 #define _PURPLE_DEBUG_H_ |
27 | 27 |
28 #include <glib.h> | 28 #include <glib.h> |
29 #include <stdarg.h> | 29 #include <stdarg.h> |
30 | 30 |
31 /** | 31 /** |
32 * Debug levels. | 32 * Debug levels. |
33 */ | 33 */ |
34 typedef enum | 34 typedef enum |
35 { | 35 { |
36 GAIM_DEBUG_ALL = 0, /**< All debug levels. */ | 36 PURPLE_DEBUG_ALL = 0, /**< All debug levels. */ |
37 GAIM_DEBUG_MISC, /**< General chatter. */ | 37 PURPLE_DEBUG_MISC, /**< General chatter. */ |
38 GAIM_DEBUG_INFO, /**< General operation Information. */ | 38 PURPLE_DEBUG_INFO, /**< General operation Information. */ |
39 GAIM_DEBUG_WARNING, /**< Warnings. */ | 39 PURPLE_DEBUG_WARNING, /**< Warnings. */ |
40 GAIM_DEBUG_ERROR, /**< Errors. */ | 40 PURPLE_DEBUG_ERROR, /**< Errors. */ |
41 GAIM_DEBUG_FATAL /**< Fatal errors. */ | 41 PURPLE_DEBUG_FATAL /**< Fatal errors. */ |
42 | 42 |
43 } GaimDebugLevel; | 43 } PurpleDebugLevel; |
44 | 44 |
45 /** | 45 /** |
46 * Debug UI operations. | 46 * Debug UI operations. |
47 */ | 47 */ |
48 typedef struct | 48 typedef struct |
49 { | 49 { |
50 void (*print)(GaimDebugLevel level, const char *category, | 50 void (*print)(PurpleDebugLevel level, const char *category, |
51 const char *arg_s); | 51 const char *arg_s); |
52 } GaimDebugUiOps; | 52 } PurpleDebugUiOps; |
53 | 53 |
54 #ifdef __cplusplus | 54 #ifdef __cplusplus |
55 extern "C" { | 55 extern "C" { |
56 #endif | 56 #endif |
57 | 57 |
63 * | 63 * |
64 * @param level The debug level. | 64 * @param level The debug level. |
65 * @param category The category (or @c NULL). | 65 * @param category The category (or @c NULL). |
66 * @param format The format string. | 66 * @param format The format string. |
67 */ | 67 */ |
68 void gaim_debug(GaimDebugLevel level, const char *category, | 68 void purple_debug(PurpleDebugLevel level, const char *category, |
69 const char *format, ...); | 69 const char *format, ...); |
70 | 70 |
71 /** | 71 /** |
72 * Outputs misc. level debug information. | 72 * Outputs misc. level debug information. |
73 * | 73 * |
74 * This is a wrapper for gaim_debug(), and uses GAIM_DEBUG_MISC as | 74 * This is a wrapper for purple_debug(), and uses PURPLE_DEBUG_MISC as |
75 * the level. | 75 * the level. |
76 * | 76 * |
77 * @param category The category (or @c NULL). | 77 * @param category The category (or @c NULL). |
78 * @param format The format string. | 78 * @param format The format string. |
79 * | 79 * |
80 * @see gaim_debug() | 80 * @see purple_debug() |
81 */ | 81 */ |
82 void gaim_debug_misc(const char *category, const char *format, ...); | 82 void purple_debug_misc(const char *category, const char *format, ...); |
83 | 83 |
84 /** | 84 /** |
85 * Outputs info level debug information. | 85 * Outputs info level debug information. |
86 * | 86 * |
87 * This is a wrapper for gaim_debug(), and uses GAIM_DEBUG_INFO as | 87 * This is a wrapper for purple_debug(), and uses PURPLE_DEBUG_INFO as |
88 * the level. | 88 * the level. |
89 * | 89 * |
90 * @param category The category (or @c NULL). | 90 * @param category The category (or @c NULL). |
91 * @param format The format string. | 91 * @param format The format string. |
92 * | 92 * |
93 * @see gaim_debug() | 93 * @see purple_debug() |
94 */ | 94 */ |
95 void gaim_debug_info(const char *category, const char *format, ...); | 95 void purple_debug_info(const char *category, const char *format, ...); |
96 | 96 |
97 /** | 97 /** |
98 * Outputs warning level debug information. | 98 * Outputs warning level debug information. |
99 * | 99 * |
100 * This is a wrapper for gaim_debug(), and uses GAIM_DEBUG_WARNING as | 100 * This is a wrapper for purple_debug(), and uses PURPLE_DEBUG_WARNING as |
101 * the level. | 101 * the level. |
102 * | 102 * |
103 * @param category The category (or @c NULL). | 103 * @param category The category (or @c NULL). |
104 * @param format The format string. | 104 * @param format The format string. |
105 * | 105 * |
106 * @see gaim_debug() | 106 * @see purple_debug() |
107 */ | 107 */ |
108 void gaim_debug_warning(const char *category, const char *format, ...); | 108 void purple_debug_warning(const char *category, const char *format, ...); |
109 | 109 |
110 /** | 110 /** |
111 * Outputs error level debug information. | 111 * Outputs error level debug information. |
112 * | 112 * |
113 * This is a wrapper for gaim_debug(), and uses GAIM_DEBUG_ERROR as | 113 * This is a wrapper for purple_debug(), and uses PURPLE_DEBUG_ERROR as |
114 * the level. | 114 * the level. |
115 * | 115 * |
116 * @param category The category (or @c NULL). | 116 * @param category The category (or @c NULL). |
117 * @param format The format string. | 117 * @param format The format string. |
118 * | 118 * |
119 * @see gaim_debug() | 119 * @see purple_debug() |
120 */ | 120 */ |
121 void gaim_debug_error(const char *category, const char *format, ...); | 121 void purple_debug_error(const char *category, const char *format, ...); |
122 | 122 |
123 /** | 123 /** |
124 * Outputs fatal error level debug information. | 124 * Outputs fatal error level debug information. |
125 * | 125 * |
126 * This is a wrapper for gaim_debug(), and uses GAIM_DEBUG_ERROR as | 126 * This is a wrapper for purple_debug(), and uses PURPLE_DEBUG_ERROR as |
127 * the level. | 127 * the level. |
128 * | 128 * |
129 * @param category The category (or @c NULL). | 129 * @param category The category (or @c NULL). |
130 * @param format The format string. | 130 * @param format The format string. |
131 * | 131 * |
132 * @see gaim_debug() | 132 * @see purple_debug() |
133 */ | 133 */ |
134 void gaim_debug_fatal(const char *category, const char *format, ...); | 134 void purple_debug_fatal(const char *category, const char *format, ...); |
135 | 135 |
136 /** | 136 /** |
137 * Enable or disable printing debug output to the console. | 137 * Enable or disable printing debug output to the console. |
138 * | 138 * |
139 * @param enabled TRUE to enable debug output or FALSE to disable it. | 139 * @param enabled TRUE to enable debug output or FALSE to disable it. |
140 */ | 140 */ |
141 void gaim_debug_set_enabled(gboolean enabled); | 141 void purple_debug_set_enabled(gboolean enabled); |
142 | 142 |
143 /** | 143 /** |
144 * Check if console debug output is enabled. | 144 * Check if console debug output is enabled. |
145 * | 145 * |
146 * @return TRUE if debuggin is enabled, FALSE if it is not. | 146 * @return TRUE if debuggin is enabled, FALSE if it is not. |
147 */ | 147 */ |
148 gboolean gaim_debug_is_enabled(void); | 148 gboolean purple_debug_is_enabled(void); |
149 | 149 |
150 /*@}*/ | 150 /*@}*/ |
151 | 151 |
152 /**************************************************************************/ | 152 /**************************************************************************/ |
153 /** @name UI Registration Functions */ | 153 /** @name UI Registration Functions */ |
158 * Sets the UI operations structure to be used when outputting debug | 158 * Sets the UI operations structure to be used when outputting debug |
159 * information. | 159 * information. |
160 * | 160 * |
161 * @param ops The UI operations structure. | 161 * @param ops The UI operations structure. |
162 */ | 162 */ |
163 void gaim_debug_set_ui_ops(GaimDebugUiOps *ops); | 163 void purple_debug_set_ui_ops(PurpleDebugUiOps *ops); |
164 | 164 |
165 /** | 165 /** |
166 * Returns the UI operations structure used when outputting debug | 166 * Returns the UI operations structure used when outputting debug |
167 * information. | 167 * information. |
168 * | 168 * |
169 * @return The UI operations structure in use. | 169 * @return The UI operations structure in use. |
170 */ | 170 */ |
171 GaimDebugUiOps *gaim_debug_get_ui_ops(void); | 171 PurpleDebugUiOps *purple_debug_get_ui_ops(void); |
172 | 172 |
173 /*@}*/ | 173 /*@}*/ |
174 | 174 |
175 /**************************************************************************/ | 175 /**************************************************************************/ |
176 /** @name Debug Subsystem */ | 176 /** @name Debug Subsystem */ |
178 /*@{*/ | 178 /*@{*/ |
179 | 179 |
180 /** | 180 /** |
181 * Initializes the debug subsystem. | 181 * Initializes the debug subsystem. |
182 */ | 182 */ |
183 void gaim_debug_init(void); | 183 void purple_debug_init(void); |
184 | 184 |
185 /*@}*/ | 185 /*@}*/ |
186 | 186 |
187 #ifdef __cplusplus | 187 #ifdef __cplusplus |
188 } | 188 } |
189 #endif | 189 #endif |
190 | 190 |
191 #endif /* _GAIM_DEBUG_H_ */ | 191 #endif /* _PURPLE_DEBUG_H_ */ |