Changeset c5c18c1


Ignore:
Timestamp:
2009-10-10T23:57:26Z (15 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
4164e62
Parents:
e046390
Message:

Hacked up a B_EV_FLAG_FORCE_REPEAT event handler flag to make libpurple
happy.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • lib/events.h

    re046390 rc5c18c1  
    4949typedef enum {
    5050        B_EV_IO_READ = 1 << 0,
    51         B_EV_IO_WRITE = 1 << 1
     51        B_EV_IO_WRITE = 1 << 1,
     52        B_EV_FLAG_FORCE_ONCE = 1 << 16,
     53        B_EV_FLAG_FORCE_REPEAT = 1 << 17,
    5254} b_input_condition;
    5355typedef gboolean (*b_event_handler)(gpointer data, gint fd, b_input_condition cond);
  • lib/events_glib.c

    re046390 rc5c18c1  
    4949        b_event_handler function;
    5050        gpointer data;
     51        guint flags;
    5152} GaimIOClosure;
    5253
     
    8788                event_debug( "Returned FALSE, cancelling.\n" );
    8889       
    89         return st;
     90        if (closure->flags & B_EV_FLAG_FORCE_ONCE)
     91                return FALSE;
     92        else if (closure->flags & B_EV_FLAG_FORCE_REPEAT)
     93                return TRUE;
     94        else
     95                return st;
    9096}
    9197
     
    105111        closure->function = function;
    106112        closure->data = data;
     113        closure->flags = condition;
    107114       
    108115        if (condition & B_EV_IO_READ)
  • lib/events_libevent.c

    re046390 rc5c18c1  
    6060        b_event_handler function;
    6161        void *data;
     62        guint flags;
    6263};
    6364
     
    150151                return;
    151152        }
    152         else if( !st )
     153        else if( !st && !( b_ev->flags & B_EV_FLAG_FORCE_REPEAT ) )
    153154        {
    154155                event_debug( "Handler returned FALSE: " );
     
    212213        }
    213214       
     215        b_ev->flags = condition;
    214216        g_hash_table_insert( id_hash, &b_ev->id, b_ev );
    215217        return b_ev->id;
  • protocols/purple/purple.c

    re046390 rc5c18c1  
    7070static guint prplcb_ev_input_add( int fd, PurpleInputCondition cond, PurpleInputFunction func, gpointer udata )
    7171{
    72         return (guint) b_input_add( fd, cond, (b_event_handler) func, udata );
     72        return (guint) b_input_add( fd, cond | B_EV_FLAG_FORCE_REPEAT, (b_event_handler) func, udata );
    7373}
    7474
Note: See TracChangeset for help on using the changeset viewer.