Changeset 4164e62 for protocols/purple
- Timestamp:
- 2009-10-11T10:40:40Z (15 years ago)
- Branches:
- master
- Children:
- 4f103ea
- Parents:
- c5c18c1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/purple/purple.c
rc5c18c1 r4164e62 29 29 GSList *purple_connections; 30 30 31 #undef g_io_add_watch32 #undef g_io_add_watch_full33 #undef g_timeout_add34 #undef g_source_remove35 36 /**37 * The following eventloop functions are used in both pidgin and purple-text. If your38 * application uses glib mainloop, you can safely use this verbatim.39 */40 #define PURPLE_GLIB_READ_COND (G_IO_IN | G_IO_HUP | G_IO_ERR)41 #define PURPLE_GLIB_WRITE_COND (G_IO_OUT | G_IO_HUP | G_IO_ERR | G_IO_NVAL)42 43 typedef struct _PurpleGLibIOClosure {44 PurpleInputFunction function;45 guint result;46 gpointer data;47 } PurpleGLibIOClosure;48 49 31 static struct im_connection *purple_ic_by_pa( PurpleAccount *pa ) 50 32 { … … 62 44 return purple_ic_by_pa( purple_connection_get_account( gc ) ); 63 45 } 64 65 static guint prplcb_ev_timeout_add( guint interval, GSourceFunc func, gpointer udata )66 {67 return b_timeout_add( interval, (b_event_handler) func, udata );68 }69 70 static guint prplcb_ev_input_add( int fd, PurpleInputCondition cond, PurpleInputFunction func, gpointer udata )71 {72 return (guint) b_input_add( fd, cond | B_EV_FLAG_FORCE_REPEAT, (b_event_handler) func, udata );73 }74 75 static PurpleEventLoopUiOps glib_eventloops =76 {77 prplcb_ev_timeout_add,78 b_event_remove,79 prplcb_ev_input_add,80 b_event_remove,81 };82 46 83 47 static void purple_init( account_t *acc ) … … 323 287 { 324 288 prplcb_debug_print, 289 }; 290 291 static guint prplcb_ev_timeout_add( guint interval, GSourceFunc func, gpointer udata ) 292 { 293 return b_timeout_add( interval, (b_event_handler) func, udata ); 294 } 295 296 static guint prplcb_ev_input_add( int fd, PurpleInputCondition cond, PurpleInputFunction func, gpointer udata ) 297 { 298 return b_input_add( fd, cond | B_EV_FLAG_FORCE_REPEAT, (b_event_handler) func, udata ); 299 } 300 301 static gboolean prplcb_ev_remove( guint id ) 302 { 303 b_event_remove( (gint) id ); 304 return TRUE; 305 } 306 307 static PurpleEventLoopUiOps glib_eventloops = 308 { 309 prplcb_ev_timeout_add, 310 prplcb_ev_remove, 311 prplcb_ev_input_add, 312 prplcb_ev_remove, 325 313 }; 326 314
Note: See TracChangeset
for help on using the changeset viewer.