From 691ff6d0d32c60f66a03079376110c1371614ef2 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 8 Nov 2007 21:14:15 +0000 Subject: implement event_activate, might opt to replace it by a stright call to the callback? --- event.c | 12 ++++++++++++ event.h | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/event.c b/event.c index 520e336..b374e68 100644 --- a/event.c +++ b/event.c @@ -248,6 +248,18 @@ int event_del (struct event *ev) return 0; } +void event_active (struct event *ev, int res, short ncalls) +{ + if (res & EV_TIMEOUT) + ev_feed_event (&iosig.to, res & EV_TIMEOUT); + + if (res & EV_SIGNAL) + ev_feed_event (&iosig.sig, res & EV_SIGNAL); + + if (res & (EV_READ | EV_WRITE)) + ev_feed_event (&iosig.io, res & (EV_READ | EV_WRITE)); +} + int event_pending (struct event *ev, short events, struct timeval *tv) { short revents = 0; diff --git a/event.h b/event.h index 76a521a..87ad318 100644 --- a/event.h +++ b/event.h @@ -104,7 +104,7 @@ int event_once (int fd, short events, void (*cb)(int, short, void *), void *arg, int event_add (struct event *ev, struct timeval *tv); int event_del (struct event *ev); -void event_active(struct event *ev, int res, short ncalls); /* ncalls is being ignored */ +void event_active (struct event *ev, int res, short ncalls); /* ncalls is being ignored */ int event_pending (struct event *ev, short, struct timeval *tv); -- cgit v1.2.3