diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-06-07 15:31:07 +0100 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-06-07 15:31:07 +0100 | 
| commit | 4aa0f6bc5645e124738ab15ad1eb65d4147dba25 (patch) | |
| tree | 0f15a76a814c33c8759c9d97253423ed12c0e1cc /lib/events_glib.c | |
| parent | 0d9d53ed0b3eb068cf57355a4d1465beaf191f8a (diff) | |
| parent | 1fdb0a48438d6dc4a4795d195737890ed3e46a96 (diff) | |
Merging killerbee stuff, bringing all the bleeding-edge stuff together.
Diffstat (limited to 'lib/events_glib.c')
| -rw-r--r-- | lib/events_glib.c | 17 | 
1 files changed, 12 insertions, 5 deletions
| diff --git a/lib/events_glib.c b/lib/events_glib.c index 3e194e98..d6ac82cc 100644 --- a/lib/events_glib.c +++ b/lib/events_glib.c @@ -48,6 +48,7 @@  typedef struct _GaimIOClosure {  	b_event_handler function;  	gpointer data; +	guint flags;  } GaimIOClosure;  static GMainLoop *loop = NULL; @@ -75,9 +76,9 @@ static gboolean gaim_io_invoke(GIOChannel *source, GIOCondition condition, gpoin  	gboolean st;  	if (condition & GAIM_READ_COND) -		gaim_cond |= GAIM_INPUT_READ; +		gaim_cond |= B_EV_IO_READ;  	if (condition & GAIM_WRITE_COND) -		gaim_cond |= GAIM_INPUT_WRITE; +		gaim_cond |= B_EV_IO_WRITE;  	event_debug( "gaim_io_invoke( %d, %d, 0x%x )\n", g_io_channel_unix_get_fd(source), condition, data ); @@ -86,7 +87,12 @@ static gboolean gaim_io_invoke(GIOChannel *source, GIOCondition condition, gpoin  	if( !st )  		event_debug( "Returned FALSE, cancelling.\n" ); -	return st; +	if (closure->flags & B_EV_FLAG_FORCE_ONCE) +		return FALSE; +	else if (closure->flags & B_EV_FLAG_FORCE_REPEAT) +		return TRUE; +	else +		return st;  }  static void gaim_io_destroy(gpointer data) @@ -104,10 +110,11 @@ gint b_input_add(gint source, b_input_condition condition, b_event_handler funct  	closure->function = function;  	closure->data = data; +	closure->flags = condition; -	if (condition & GAIM_INPUT_READ) +	if (condition & B_EV_IO_READ)  		cond |= GAIM_READ_COND; -	if (condition & GAIM_INPUT_WRITE) +	if (condition & B_EV_IO_WRITE)  		cond |= GAIM_WRITE_COND;  	channel = g_io_channel_unix_new(source); | 
