ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/event.c
(Generate patch)

Comparing libev/event.c (file contents):
Revision 1.4 by root, Fri Nov 2 13:08:51 2007 UTC vs.
Revision 1.5 by root, Sat Nov 3 19:41:56 2007 UTC

88int event_dispatch (void) 88int event_dispatch (void)
89{ 89{
90 return event_base_dispatch (x_cur); 90 return event_base_dispatch (x_cur);
91} 91}
92 92
93#ifdef EV_STANDALONE
93void event_set_log_callback (event_log_cb cb) 94void event_set_log_callback (event_log_cb cb)
94{ 95{
95 /* nop */ 96 /* nop */
96} 97}
98#endif
97 99
98int event_loop (int flags) 100int event_loop (int flags)
99{ 101{
100 return event_base_loop (x_cur, flags); 102 return event_base_loop (x_cur, flags);
101} 103}
102 104
103int event_loopexit (struct timeval *tv) 105int event_loopexit (struct timeval *tv)
104{ 106{
105 event_base_loopexit (x_cur, tv); 107 return event_base_loopexit (x_cur, tv);
106} 108}
107 109
108static void 110static void
109x_cb (struct event *ev, int revents) 111x_cb (struct event *ev, int revents)
110{ 112{
172 ev->ev_res = 0; 174 ev->ev_res = 0;
173} 175}
174 176
175int event_once (int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv) 177int event_once (int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv)
176{ 178{
177 event_base_once (x_cur, fd, events, cb, arg, tv); 179 return event_base_once (x_cur, fd, events, cb, arg, tv);
178} 180}
179 181
180int event_add (struct event *ev, struct timeval *tv) 182int event_add (struct event *ev, struct timeval *tv)
181{ 183{
182 /* disable all watchers */ 184 /* disable all watchers */
235 return 0; 237 return 0;
236} 238}
237 239
238int event_pending (struct event *ev, short events, struct timeval *tv) 240int event_pending (struct event *ev, short events, struct timeval *tv)
239{ 241{
240 short revents; 242 short revents = 0;
241 243
242 if (ev->ev_events & EV_SIGNAL) 244 if (ev->ev_events & EV_SIGNAL)
243 { 245 {
244 /* sig */ 246 /* sig */
245 if (ev->iosig.sig.pending) 247 if (ev->iosig.sig.pending)
307int event_base_loopexit (struct event_base *base, struct timeval *tv) 309int event_base_loopexit (struct event_base *base, struct timeval *tv)
308{ 310{
309 ev_tstamp after = tv_get (tv); 311 ev_tstamp after = tv_get (tv);
310 312
311 ev_once (-1, 0, after >= 0. ? after : 0., x_loopexit_cb, (void *)base); 313 ev_once (-1, 0, after >= 0. ? after : 0., x_loopexit_cb, (void *)base);
314
315 return -1;
312} 316}
313 317
314struct x_once 318struct x_once
315{ 319{
316 int fd; 320 int fd;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines