libpurple/protocols/gg/lib/debug.c

changeset 31826
0f6ab56fbf9d
parent 31609
d67fbc90b28a
child 33285
32cbdbf016bd
child 35617
c9069e0e3c36
equal deleted inserted replaced
31825:92996c775af3 31826:0f6ab56fbf9d
30 #include <stdarg.h> 30 #include <stdarg.h>
31 #include <stdio.h> 31 #include <stdio.h>
32 #include <string.h> 32 #include <string.h>
33 33
34 #include "libgadu.h" 34 #include "libgadu.h"
35 #include "debug.h" 35 #include "libgadu-debug.h"
36 36
37 /** 37 /**
38 * Poziom rejestracji informacji odpluskwiających. Zmienna jest maską bitową 38 * Poziom rejestracji informacji odpluskwiających. Zmienna jest maską bitową
39 * składającą się ze stałych \c GG_DEBUG_... 39 * składającą się ze stałych \c GG_DEBUG_...
40 * 40 *
263 GG_DEBUG_STATE(GG_STATE_RESOLVING_GG) 263 GG_DEBUG_STATE(GG_STATE_RESOLVING_GG)
264 GG_DEBUG_STATE(GG_STATE_RESOLVING_RELAY) 264 GG_DEBUG_STATE(GG_STATE_RESOLVING_RELAY)
265 GG_DEBUG_STATE(GG_STATE_CONNECTING_RELAY) 265 GG_DEBUG_STATE(GG_STATE_CONNECTING_RELAY)
266 GG_DEBUG_STATE(GG_STATE_READING_RELAY) 266 GG_DEBUG_STATE(GG_STATE_READING_RELAY)
267 GG_DEBUG_STATE(GG_STATE_DISCONNECTING) 267 GG_DEBUG_STATE(GG_STATE_DISCONNECTING)
268 268 #undef GG_DEBUG_STATE
269 // Celowo nie ma default, żeby kompilator wyłapał brakujące stany 269
270 /* Celowo nie ma default, żeby kompilator wyłapał brakujące stany */
270 271
271 } 272 }
272 273
273 return NULL; 274 return NULL;
274 } 275 }
275 276
277 /**
278 * \internal Zwraca ciąg z nazwą podanego zdarzenia.
279 *
280 * \param event Zdarzenie.
281 *
282 * \return Ciąg z nazwą zdarzenia
283 *
284 * \ingroup debug
285 */
286 const char *gg_debug_event(enum gg_event_t event)
287 {
288 switch (event) {
289 #define GG_DEBUG_EVENT(x) case x: return #x;
290 GG_DEBUG_EVENT(GG_EVENT_NONE)
291 GG_DEBUG_EVENT(GG_EVENT_MSG)
292 GG_DEBUG_EVENT(GG_EVENT_NOTIFY)
293 GG_DEBUG_EVENT(GG_EVENT_NOTIFY_DESCR)
294 GG_DEBUG_EVENT(GG_EVENT_STATUS)
295 GG_DEBUG_EVENT(GG_EVENT_ACK)
296 GG_DEBUG_EVENT(GG_EVENT_PONG)
297 GG_DEBUG_EVENT(GG_EVENT_CONN_FAILED)
298 GG_DEBUG_EVENT(GG_EVENT_CONN_SUCCESS)
299 GG_DEBUG_EVENT(GG_EVENT_DISCONNECT)
300 GG_DEBUG_EVENT(GG_EVENT_DCC_NEW)
301 GG_DEBUG_EVENT(GG_EVENT_DCC_ERROR)
302 GG_DEBUG_EVENT(GG_EVENT_DCC_DONE)
303 GG_DEBUG_EVENT(GG_EVENT_DCC_CLIENT_ACCEPT)
304 GG_DEBUG_EVENT(GG_EVENT_DCC_CALLBACK)
305 GG_DEBUG_EVENT(GG_EVENT_DCC_NEED_FILE_INFO)
306 GG_DEBUG_EVENT(GG_EVENT_DCC_NEED_FILE_ACK)
307 GG_DEBUG_EVENT(GG_EVENT_DCC_NEED_VOICE_ACK)
308 GG_DEBUG_EVENT(GG_EVENT_DCC_VOICE_DATA)
309 GG_DEBUG_EVENT(GG_EVENT_PUBDIR50_SEARCH_REPLY)
310 GG_DEBUG_EVENT(GG_EVENT_PUBDIR50_READ)
311 GG_DEBUG_EVENT(GG_EVENT_PUBDIR50_WRITE)
312 GG_DEBUG_EVENT(GG_EVENT_STATUS60)
313 GG_DEBUG_EVENT(GG_EVENT_NOTIFY60)
314 GG_DEBUG_EVENT(GG_EVENT_USERLIST)
315 GG_DEBUG_EVENT(GG_EVENT_IMAGE_REQUEST)
316 GG_DEBUG_EVENT(GG_EVENT_IMAGE_REPLY)
317 GG_DEBUG_EVENT(GG_EVENT_DCC_ACK)
318 GG_DEBUG_EVENT(GG_EVENT_DCC7_NEW)
319 GG_DEBUG_EVENT(GG_EVENT_DCC7_ACCEPT)
320 GG_DEBUG_EVENT(GG_EVENT_DCC7_REJECT)
321 GG_DEBUG_EVENT(GG_EVENT_DCC7_CONNECTED)
322 GG_DEBUG_EVENT(GG_EVENT_DCC7_ERROR)
323 GG_DEBUG_EVENT(GG_EVENT_DCC7_DONE)
324 GG_DEBUG_EVENT(GG_EVENT_DCC7_PENDING)
325 GG_DEBUG_EVENT(GG_EVENT_XML_EVENT)
326 GG_DEBUG_EVENT(GG_EVENT_DISCONNECT_ACK)
327 GG_DEBUG_EVENT(GG_EVENT_TYPING_NOTIFICATION)
328 GG_DEBUG_EVENT(GG_EVENT_USER_DATA)
329 GG_DEBUG_EVENT(GG_EVENT_MULTILOGON_MSG)
330 GG_DEBUG_EVENT(GG_EVENT_MULTILOGON_INFO)
331 GG_DEBUG_EVENT(GG_EVENT_USERLIST100_VERSION)
332 GG_DEBUG_EVENT(GG_EVENT_USERLIST100_REPLY)
333 #undef GG_DEBUG_EVENT
334
335 /* Celowo nie ma default, żeby kompilator wyłapał brakujące zdarzenia */
336
337 }
338
339 return NULL;
340 }
341
276 #else 342 #else
277 343
278 #undef gg_debug_common 344 #undef gg_debug_common
279 void gg_debug_common(struct gg_session *sess, int level, const char *format, va_list ap) 345 void gg_debug_common(struct gg_session *sess, int level, const char *format, va_list ap)
280 { 346 {
289 void gg_debug_session(struct gg_session *gs, int level, const char *format, ...) 355 void gg_debug_session(struct gg_session *gs, int level, const char *format, ...)
290 { 356 {
291 } 357 }
292 358
293 #undef gg_debug_dump 359 #undef gg_debug_dump
294 void gg_debug_dump(struct gg_session *gs, int level, const char *buf, int len) 360 void gg_debug_dump(struct gg_session *gs, int level, const char *buf, size_t len)
295 { 361 {
296 } 362 }
297 363
298 #endif 364 #endif

mercurial