… | |
… | |
69 | # define EV_DEFAULT_A |
69 | # define EV_DEFAULT_A |
70 | # define EV_DEFAULT_A_ |
70 | # define EV_DEFAULT_A_ |
71 | #endif |
71 | #endif |
72 | |
72 | |
73 | /* eventmask, revents, events... */ |
73 | /* eventmask, revents, events... */ |
74 | #define EV_UNDEF -1 /* guaranteed to be invalid */ |
74 | #define EV_UNDEF -1L /* guaranteed to be invalid */ |
75 | #define EV_NONE 0x00 |
75 | #define EV_NONE 0x00L |
76 | #define EV_READ 0x01 /* io only */ |
76 | #define EV_READ 0x01L /* io only */ |
77 | #define EV_WRITE 0x02 /* io only */ |
77 | #define EV_WRITE 0x02L /* io only */ |
78 | #define EV_TIMEOUT 0x000100 /* timer only */ |
78 | #define EV_TIMEOUT 0x000100L /* timer only */ |
79 | #define EV_PERIODIC 0x000200 /* periodic timer only */ |
79 | #define EV_PERIODIC 0x000200L /* periodic timer only */ |
80 | #define EV_SIGNAL 0x000400 /* signal only */ |
80 | #define EV_SIGNAL 0x000400L /* signal only */ |
81 | #define EV_IDLE 0x000800 /* idle only */ |
81 | #define EV_IDLE 0x000800L /* idle only */ |
82 | #define EV_CHECK 0x001000 /* check only */ |
82 | #define EV_CHECK 0x001000L /* check only */ |
83 | #define EV_PREPARE 0x002000 /* prepare only */ |
83 | #define EV_PREPARE 0x002000L /* prepare only */ |
84 | #define EV_CHILD 0x004000 /* child/pid only */ |
84 | #define EV_CHILD 0x004000L /* child/pid only */ |
85 | #define EV_ERROR 0x800000 /* sent when an error occurs */ |
85 | #define EV_ERROR 0x800000L /* sent when an error occurs */ |
86 | |
86 | |
87 | /* can be used to add custom fields to all watchers, while losing binary compatibility */ |
87 | /* can be used to add custom fields to all watchers, while losing binary compatibility */ |
88 | #ifndef EV_COMMON |
88 | #ifndef EV_COMMON |
89 | # define EV_COMMON void *data; |
89 | # define EV_COMMON void *data; |
90 | #endif |
90 | #endif |
… | |
… | |
231 | struct ev_child child; |
231 | struct ev_child child; |
232 | }; |
232 | }; |
233 | |
233 | |
234 | /* bits for ev_default_loop and ev_loop_new */ |
234 | /* bits for ev_default_loop and ev_loop_new */ |
235 | /* the default */ |
235 | /* the default */ |
236 | #define EVFLAG_AUTO 0x00000000 /* not quite a mask */ |
236 | #define EVFLAG_AUTO 0x00000000UL /* not quite a mask */ |
237 | |
237 | /* flag bits */ |
|
|
238 | #define EVFLAG_NOENV 0x01000000UL /* do NOT consult environment */ |
238 | /* method bits to be ored together */ |
239 | /* method bits to be ored together */ |
239 | #define EVMETHOD_SELECT 0x00000001 /* about anywhere */ |
240 | #define EVBACKEND_SELECT 0x00000001UL /* about anywhere */ |
240 | #define EVMETHOD_POLL 0x00000002 /* !win */ |
241 | #define EVBACKEND_POLL 0x00000002UL /* !win */ |
241 | #define EVMETHOD_EPOLL 0x00000004 /* linux */ |
242 | #define EVBACKEND_EPOLL 0x00000004UL /* linux */ |
242 | #define EVMETHOD_KQUEUE 0x00000008 /* bsd */ |
243 | #define EVBACKEND_KQUEUE 0x00000008UL /* bsd */ |
243 | #define EVMETHOD_DEVPOLL 0x00000010 /* solaris 8 */ /* NYI */ |
244 | #define EVBACKEND_DEVPOLL 0x00000010UL /* solaris 8 */ /* NYI */ |
244 | #define EVMETHOD_PORT 0x00000020 /* solaris 10 */ |
245 | #define EVBACKEND_PORT 0x00000020UL /* solaris 10 */ |
245 | #define EVMETHOD_ALL 0x0000ffff /* all methods, also future ones, or so */ |
|
|
246 | |
|
|
247 | /* flag bits */ |
|
|
248 | #define EVFLAG_NOENV 0x01000000 /* do NOT consult environment */ |
|
|
249 | |
246 | |
250 | #if EV_PROTOTYPES |
247 | #if EV_PROTOTYPES |
251 | int ev_version_major (void); |
248 | int ev_version_major (void); |
252 | int ev_version_minor (void); |
249 | int ev_version_minor (void); |
|
|
250 | |
|
|
251 | unsigned int ev_supported_backends (void); |
|
|
252 | unsigned int ev_recommended_backends (void); |
253 | |
253 | |
254 | ev_tstamp ev_time (void); |
254 | ev_tstamp ev_time (void); |
255 | |
255 | |
256 | /* Sets the allocation function to use, works like realloc. |
256 | /* Sets the allocation function to use, works like realloc. |
257 | * It is used to allocate and free memory. |
257 | * It is used to allocate and free memory. |
… | |
… | |
307 | /* if you create alternative loops you have to call ev_loop_fork on them */ |
307 | /* if you create alternative loops you have to call ev_loop_fork on them */ |
308 | /* you can call it in either the parent or the child */ |
308 | /* you can call it in either the parent or the child */ |
309 | /* you can actually call it at any time, anywhere :) */ |
309 | /* you can actually call it at any time, anywhere :) */ |
310 | void ev_default_fork (void); |
310 | void ev_default_fork (void); |
311 | |
311 | |
312 | unsigned int ev_method (EV_P); |
312 | unsigned int ev_backend (EV_P); |
313 | #endif |
313 | #endif |
314 | |
314 | |
315 | #define EVLOOP_NONBLOCK 1 /* do not block/wait */ |
315 | #define EVLOOP_NONBLOCK 1 /* do not block/wait */ |
316 | #define EVLOOP_ONESHOT 2 /* block *once* only */ |
316 | #define EVLOOP_ONESHOT 2 /* block *once* only */ |
317 | #define EVUNLOOP_ONE 1 /* unloop once */ |
317 | #define EVUNLOOP_ONE 1 /* unloop once */ |