diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/debug.c | 13 | ||||
-rw-r--r-- | src/debug.h | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/debug.c b/src/debug.c index cf93e01..8912b3a 100644 --- a/src/debug.c +++ b/src/debug.c @@ -134,3 +134,16 @@ inline void debug_buffer_to_file(const char *file, const char *data, const int l } #endif } + +inline void debug_plist(plist_t plist) +{ + if (!plist) + return; + + char *buffer = NULL; + uint32_t length = 0; + plist_to_xml(plist, &buffer, &length); + debug_info("plist size: %i\nbuffer :\n%s", length, buffer); + free(buffer); +} + diff --git a/src/debug.h b/src/debug.h index f99089d..0a29be3 100644 --- a/src/debug.h +++ b/src/debug.h @@ -22,6 +22,7 @@ #ifndef DEBUG_H #define DEBUG_H +#include <plist/plist.h> #include <glib.h> #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && !defined(STRIP_DEBUG_CODE) @@ -39,5 +40,6 @@ G_GNUC_INTERNAL inline void debug_info_real(const char *func, G_GNUC_INTERNAL inline void debug_buffer(const char *data, const int length); G_GNUC_INTERNAL inline void debug_buffer_to_file(const char *file, const char *data, const int length); +G_GNUC_INTERNAL inline void debug_plist(plist_t plist); #endif |