[imbus commit] r54 - in trunk/imbus: daemon src

0 views
Skip to first unread message

codesite...@google.com

unread,
Sep 11, 2008, 3:27:57 AM9/11/08
to imbus...@googlegroups.com
Author: peterzhoulei
Date: Thu Sep 11 00:27:41 2008
New Revision: 54

Modified:
trunk/imbus/daemon/main.c
trunk/imbus/src/im_debug.h

Log:
debug++

Modified: trunk/imbus/daemon/main.c
==============================================================================
--- trunk/imbus/daemon/main.c (original)
+++ trunk/imbus/daemon/main.c Thu Sep 11 00:27:41 2008
@@ -5,6 +5,8 @@

IMBool on_receive_callback( IMMainLoop *loop, IMInt watch_id, IMPointer
data )
{
+ im_debug_block_start( "on_receive_callback" );
+
IMPointer obj;
IMInt timeout = -1;
IMInt ret;
@@ -43,12 +45,16 @@
printf ( "%d, error = %d\n", watch_id, error );
return FALSE;
}
+
+ im_debug_block_end( "on_receive_callback" );
return TRUE;
}

void on_new_connection_handler( IMServer *server, IMIOChannel *io_channel,
IMPointer data )
{
+ im_debug_block_start( "on_new_connection_handler" );
+
IMMainLoop *main_loop = im_server_get_main_loop( server );
IMConnection *connection = im_connection_new ( io_channel );
IMInt watch_id;
@@ -61,10 +67,14 @@

im_print_log( "New IO read watch was added for fd: " );
printf ( "%d, watch id: %d\n", im_io_channel_unix_get_fd( io_channel
), watch_id );
+
+ im_debug_block_end( "on_new_connection_handler" );
}

int main ( int argc, char *argv [] )
{
+ im_debug_block_start( "main" );
+
IMMainLoop *loop;
IMConnection *conn;
IMServer *server;
@@ -96,5 +106,6 @@
im_object_unref( loop );
im_object_unref( server );

+ im_debug_block_end( "main" );
return 0;
}

Modified: trunk/imbus/src/im_debug.h
==============================================================================
--- trunk/imbus/src/im_debug.h (original)
+++ trunk/imbus/src/im_debug.h Thu Sep 11 00:27:41 2008
@@ -36,6 +36,20 @@
printf( "%s", data );
}

+void im_debug_block_start( const IMChar* data )
+{
+#if IM_ENABLE_DEBUG
+ printf( "[FUNCTION: %s INIT]: \n", data );
+#endif
+}
+
+void im_debug_block_end( const IMChar* data )
+{
+#if IM_ENABLE_DEBUG
+ printf( "[FUNCTION: %s END]: \n", data );
+#endif
+}
+
#endif
/** @} */
/*

Reply all
Reply to author
Forward
0 new messages