- Timestamp:
- 2006-05-12T18:31:44Z (19 years ago)
- Branches:
- master
- Children:
- b642f381
- Parents:
- 13cc96c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/events_libevent.c
r13cc96c r09f8cd1 39 39 static GHashTable *id_hash; 40 40 41 42 41 struct b_event_data 43 42 { … … 73 72 struct b_event_data *b_ev = data; 74 73 b_input_condition cond = 0; 75 76 if( event & EV_READ ) 77 cond |= GAIM_INPUT_READ; 78 if( event & EV_WRITE ) 79 cond |= GAIM_INPUT_WRITE; 80 74 75 if( fd >= 0 ) 76 { 77 if( event & EV_READ ) 78 cond |= GAIM_INPUT_READ; 79 if( event & EV_WRITE ) 80 cond |= GAIM_INPUT_WRITE; 81 } 82 81 83 if( !b_ev->function( b_ev->data, fd, cond ) ) 82 84 b_event_remove( b_ev->id ); … … 88 90 GIOCondition cond; 89 91 90 b_ev->id = =id_next++;92 b_ev->id = id_next++; 91 93 b_ev->function = function; 92 94 b_ev->data = data; … … 106 108 } 107 109 110 /* TODO: Persistence for timers! */ 108 111 gint b_timeout_add( gint timeout, b_event_handler function, gpointer data ) 109 112 { … … 111 114 struct timeval tv; 112 115 113 b_ev->id = =id_next++;116 b_ev->id = id_next++; 114 117 b_ev->function = function; 115 118 b_ev->data = data; … … 119 122 120 123 evtimer_set( &b_ev->evinfo, b_event_passthrough, b_ev ); 121 evtimer_add( &b_ev->evinfo, &tv );124 evtimer_add( &b_ev->evinfo, &tv ); 122 125 123 126 g_hash_table_insert( id_hash, &b_ev->id, b_ev ); … … 133 136 { 134 137 event_del( &b_ev->evinfo ); 135 g_hash_table_remove( id_hash, & tag);138 g_hash_table_remove( id_hash, &b_ev->id ); 136 139 g_free( b_ev ); 137 140 }
Note: See TracChangeset
for help on using the changeset viewer.