… | |
… | |
102 | #ifndef EV_FORK_ENABLE |
102 | #ifndef EV_FORK_ENABLE |
103 | # define EV_FORK_ENABLE EV_FEATURE_WATCHERS |
103 | # define EV_FORK_ENABLE EV_FEATURE_WATCHERS |
104 | #endif |
104 | #endif |
105 | |
105 | |
106 | #ifndef EV_CLEANUP_ENABLE |
106 | #ifndef EV_CLEANUP_ENABLE |
107 | # define EV_CLEANUP_ENABLE 0 /* not implemented */ |
107 | # define EV_CLEANUP_ENABLE EV_FEATURE_WATCHERS |
108 | #endif |
108 | #endif |
109 | |
109 | |
110 | #ifndef EV_SIGNAL_ENABLE |
110 | #ifndef EV_SIGNAL_ENABLE |
111 | # define EV_SIGNAL_ENABLE EV_FEATURE_WATCHERS |
111 | # define EV_SIGNAL_ENABLE EV_FEATURE_WATCHERS |
112 | #endif |
112 | #endif |
… | |
… | |
195 | #define EV_VERSION_MAJOR 4 |
195 | #define EV_VERSION_MAJOR 4 |
196 | #define EV_VERSION_MINOR 0 |
196 | #define EV_VERSION_MINOR 0 |
197 | |
197 | |
198 | /* eventmask, revents, events... */ |
198 | /* eventmask, revents, events... */ |
199 | enum { |
199 | enum { |
200 | EV_UNDEF = -1, /* guaranteed to be invalid */ |
200 | EV_UNDEF = 0xFFFFFFFF, /* guaranteed to be invalid */ |
201 | EV_NONE = 0x00, /* no events */ |
201 | EV_NONE = 0x00, /* no events */ |
202 | EV_READ = 0x01, /* ev_io detected read will not block */ |
202 | EV_READ = 0x01, /* ev_io detected read will not block */ |
203 | EV_WRITE = 0x02, /* ev_io detected write will not block */ |
203 | EV_WRITE = 0x02, /* ev_io detected write will not block */ |
204 | EV__IOFDSET = 0x80, /* internal use only */ |
204 | EV__IOFDSET = 0x80, /* internal use only */ |
205 | EV_IO = EV_READ, /* alias for type-detection */ |
205 | EV_IO = EV_READ, /* alias for type-detection */ |
… | |
… | |
550 | return EV_A == EV_DEFAULT_UC; |
550 | return EV_A == EV_DEFAULT_UC; |
551 | } |
551 | } |
552 | |
552 | |
553 | /* create and destroy alternative loops that don't handle signals */ |
553 | /* create and destroy alternative loops that don't handle signals */ |
554 | struct ev_loop *ev_loop_new (unsigned int flags EV_CPP (= 0)); |
554 | struct ev_loop *ev_loop_new (unsigned int flags EV_CPP (= 0)); |
555 | /* destroy event loops, also works for the default loop */ |
|
|
556 | void ev_loop_destroy (EV_P); |
|
|
557 | |
555 | |
558 | ev_tstamp ev_now (EV_P); /* time w.r.t. timers and the eventloop, updated after each poll */ |
556 | ev_tstamp ev_now (EV_P); /* time w.r.t. timers and the eventloop, updated after each poll */ |
559 | |
557 | |
560 | #else |
558 | #else |
561 | |
559 | |
… | |
… | |
575 | { |
573 | { |
576 | return 1; |
574 | return 1; |
577 | } |
575 | } |
578 | |
576 | |
579 | #endif /* multiplicity */ |
577 | #endif /* multiplicity */ |
|
|
578 | |
|
|
579 | /* destroy event loops, also works for the default loop */ |
|
|
580 | void ev_loop_destroy (EV_P); |
580 | |
581 | |
581 | /* this needs to be called after fork, to duplicate the loop */ |
582 | /* this needs to be called after fork, to duplicate the loop */ |
582 | /* when you want to re-use it in the child */ |
583 | /* when you want to re-use it in the child */ |
583 | /* you can call it in either the parent or the child */ |
584 | /* you can call it in either the parent or the child */ |
584 | /* you can actually call it at any time, anywhere :) */ |
585 | /* you can actually call it at any time, anywhere :) */ |