Changeset fc2ee0f
- Timestamp:
- 2006-05-13T10:29:53Z (18 years ago)
- Branches:
- master
- Children:
- 2b7d2d1
- Parents:
- b642f381
- Location:
- protocols
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/Makefile
rb642f381 rfc2ee0f 11 11 # [SH] Program variables 12 12 objects = events_libevent.o http_client.o md5.o nogaim.o proxy.o sha.o $(SSL_CLIENT) 13 #objects = events_glib.o http_client.o md5.o nogaim.o proxy.o sha.o $(SSL_CLIENT) 13 14 14 15 # [SH] The next two lines should contain the directory name (in $(subdirs)) -
protocols/events.h
rb642f381 rfc2ee0f 49 49 #define GAIM_ERR_COND (G_IO_HUP | G_IO_ERR | G_IO_NVAL) 50 50 51 #define event_debug( x... ) printf( x ) 52 51 53 G_MODULE_EXPORT void b_main_init(); 52 54 G_MODULE_EXPORT void b_main_run(); -
protocols/events_glib.c
rb642f381 rfc2ee0f 73 73 GaimIOClosure *closure = data; 74 74 b_input_condition gaim_cond = 0; 75 gboolean st; 75 76 76 77 if (condition & GAIM_READ_COND) … … 78 79 if (condition & GAIM_WRITE_COND) 79 80 gaim_cond |= GAIM_INPUT_WRITE; 81 82 event_debug( "gaim_io_invoke( %d, %d, 0x%x )\n", g_io_channel_unix_get_fd(source), condition, data ); 80 83 81 return closure->function(closure->data, g_io_channel_unix_get_fd(source), gaim_cond); 84 st = closure->function(closure->data, g_io_channel_unix_get_fd(source), gaim_cond); 85 86 if( !st ) 87 event_debug( "Returned FALSE, cancelling.\n" ); 88 89 return st; 82 90 } 83 91 84 92 static void gaim_io_destroy(gpointer data) 85 93 { 94 event_debug( "gaim_io_destroy( 0x%x )\n", data ); 86 95 g_free(data); 87 96 } … … 105 114 gaim_io_invoke, closure, gaim_io_destroy); 106 115 116 event_debug( "b_input_add( %d, %d, 0x%x, 0x%x ) = %d (0x%x)\n", source, condition, function, data, closure->result, closure ); 117 107 118 g_io_channel_unref(channel); 108 119 return closure->result; … … 111 122 gint b_timeout_add(gint timeout, b_event_handler func, gpointer data) 112 123 { 113 return g_timeout_add(timeout, func, data); 124 gint st = g_timeout_add(timeout, func, data); 125 126 event_debug( "b_timeout_add( %d, %d, %d ) = %d\n", timeout, func, data, st ); 127 128 return st; 114 129 } 115 130 116 131 void b_event_remove(gint tag) 117 132 { 133 event_debug( "g_source_remove( %d )\n", tag ); 134 118 135 if (tag > 0) 119 136 g_source_remove(tag); -
protocols/events_libevent.c
rb642f381 rfc2ee0f 72 72 struct b_event_data *b_ev = data; 73 73 b_input_condition cond = 0; 74 int id; 74 75 75 76 if( fd >= 0 ) … … 83 84 event_debug( "b_event_passthrough( %d, %d, 0x%x ) (%d)\n", fd, event, (int) data, b_ev->id ); 84 85 86 /* Since the called function might cancel this handler already 87 (which free()s b_ev, we have to remember the ID here. */ 88 id = b_ev->id; 89 85 90 if( !b_ev->function( b_ev->data, fd, cond ) ) 86 91 { 87 92 event_debug( "Handler returned FALSE: " ); 88 b_event_remove( b_ev->id );93 b_event_remove( id ); 89 94 } 90 95 } … … 151 156 else 152 157 { 153 event_debug( " Invalid?\n" );158 event_debug( "Double remove?\n" ); 154 159 } 155 160 }
Note: See TracChangeset
for help on using the changeset viewer.