Changeset 4164e62 for protocols/purple


Ignore:
Timestamp:
2009-10-11T10:40:40Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
4f103ea
Parents:
c5c18c1
Message:

Fixing a few compiler warnings and cleaning up the last remains of
GLib-specific code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/purple/purple.c

    rc5c18c1 r4164e62  
    2929GSList *purple_connections;
    3030
    31 #undef g_io_add_watch
    32 #undef g_io_add_watch_full
    33 #undef g_timeout_add
    34 #undef g_source_remove
    35 
    36 /**
    37  * The following eventloop functions are used in both pidgin and purple-text. If your
    38  * 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 
    4931static struct im_connection *purple_ic_by_pa( PurpleAccount *pa )
    5032{
     
    6244        return purple_ic_by_pa( purple_connection_get_account( gc ) );
    6345}
    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 };
    8246
    8347static void purple_init( account_t *acc )
     
    323287{
    324288        prplcb_debug_print,
     289};
     290
     291static 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
     296static 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
     301static gboolean prplcb_ev_remove( guint id )
     302{
     303        b_event_remove( (gint) id );
     304        return TRUE;
     305}
     306
     307static PurpleEventLoopUiOps glib_eventloops =
     308{
     309        prplcb_ev_timeout_add,
     310        prplcb_ev_remove,
     311        prplcb_ev_input_add,
     312        prplcb_ev_remove,
    325313};
    326314
Note: See TracChangeset for help on using the changeset viewer.