gobex: add initial support for debug
Subsystems (2)
Luiz Augusto von Dentz
maintainerPATCH v4 1/7 gobex: add initial support for debug
From: Luiz Augusto von Dentz <[email protected]>
This adds support for debug using GOBEX_DEBUG environment variable.
--- Makefile.am | 2 +- gobex/gobex-debug.h | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++ gobex/gobex.c | 20 +++++++++++++ 3 files changed, 97 insertions(+), 1 deletions(-) create mode 100644 gobex/gobex-debug.h
Makefile.am +1 -1
@@ -20,7 +20,7 @@ gobex_sources = gobex/gobex.h gobex/gobex.c \ gobex/gobex-defs.h gobex/gobex-defs.c \ gobex/gobex-packet.c gobex/gobex-packet.h \ gobex/gobex-header.c gobex/gobex-header.h \ - gobex/gobex-transfer.c + gobex/gobex-transfer.c gobex/gobex-debug.h noinst_PROGRAMS = libexec_PROGRAMS =
gobex/gobex-debug.h new file +76 -0
76 lines not on this page · raw message
gobex/gobex.c +20 -0
@@ -29,6 +29,7 @@#include "gobex.h" #include "glib-helper.h" +#include "gobex-debug.h" #define G_OBEX_DEFAULT_MTU 4096#define G_OBEX_MINIMUM_MTU 255
@@ -43,6 +44,8 @@#define CONNID_INVALID 0xffffffff +guint gobex_debug =0 ; +struct _GObex {gint ref_count;GIOChannel *io;
@@ -864,12 +867,29 @@ failed:return FALSE; } +static GDebugKey keys[] = { + {"error" ,G_OBEX_DEBUG_ERROR }, + {"command" ,G_OBEX_DEBUG_COMMAND }, + {"transfer" ,G_OBEX_DEBUG_TRANSFER }, + {"header" ,G_OBEX_DEBUG_HEADER }, + {"packet" ,G_OBEX_DEBUG_PACKET }, + {"data" ,G_OBEX_DEBUG_DATA }, +}; +GObex *g_obex_new (GIOChannel *io,GObexTransportType transport_type,gssize io_rx_mtu,gssize io_tx_mtu) {GObex *obex;GIOCondition cond; +if (gobex_debug ==0 ) { +const char *env =g_getenv ("GOBEX_DEBUG" ); +if (env) + gobex_debug =g_parse_debug_string (env, keys,6 ); +else + gobex_debug =G_OBEX_DEBUG_NONE ; + } +if (io ==NULL )return NULL ;
Signature · 1 line
1.7.6.4
Hi Luiz,
Quoted 9 lines · Luiz Augusto von Dentz
From: Luiz Augusto von Dentz <[email protected]>
This adds support for debug using
GOBEX_DEBUGenvironment variable.--- Makefile.am | 2 +- gobex/gobex-debug.h | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++ gobex/gobex.c | 20 +++++++++++++ 3 files changed, 97 insertions(+), 1 deletions(-) create mode 100644 gobex/gobex-debug.h
Thanks. All seven patches have been applied.
Johan