… | |
… | |
46 | |
46 | |
47 | #ifndef EV_MULTIPLICITY |
47 | #ifndef EV_MULTIPLICITY |
48 | # define EV_MULTIPLICITY 1 |
48 | # define EV_MULTIPLICITY 1 |
49 | #endif |
49 | #endif |
50 | |
50 | |
|
|
51 | #ifndef EV_PERIODICS |
|
|
52 | # define EV_PERIODICS 1 |
|
|
53 | #endif |
|
|
54 | |
51 | /* support multiple event loops? */ |
55 | /* support multiple event loops? */ |
52 | #if EV_MULTIPLICITY |
56 | #if EV_MULTIPLICITY |
53 | struct ev_loop; |
57 | struct ev_loop; |
54 | # define EV_P struct ev_loop *loop |
58 | # define EV_P struct ev_loop *loop |
55 | # define EV_P_ EV_P, |
59 | # define EV_P_ EV_P, |
… | |
… | |
67 | #endif |
71 | #endif |
68 | |
72 | |
69 | /* eventmask, revents, events... */ |
73 | /* eventmask, revents, events... */ |
70 | #define EV_UNDEF -1 /* guaranteed to be invalid */ |
74 | #define EV_UNDEF -1 /* guaranteed to be invalid */ |
71 | #define EV_NONE 0x00 |
75 | #define EV_NONE 0x00 |
72 | #define EV_READ 0x01 |
76 | #define EV_READ 0x01 /* io only */ |
73 | #define EV_WRITE 0x02 |
77 | #define EV_WRITE 0x02 /* io only */ |
74 | #define EV_TIMEOUT 0x000100 |
78 | #define EV_TIMEOUT 0x000100 /* timer only */ |
75 | #define EV_PERIODIC 0x000200 |
79 | #define EV_PERIODIC 0x000200 /* periodic timer only */ |
76 | #define EV_SIGNAL 0x000400 |
80 | #define EV_SIGNAL 0x000400 /* signal only */ |
77 | #define EV_IDLE 0x000800 |
81 | #define EV_IDLE 0x000800 /* idle only */ |
78 | #define EV_CHECK 0x001000 |
82 | #define EV_CHECK 0x001000 /* check only */ |
79 | #define EV_PREPARE 0x002000 |
83 | #define EV_PREPARE 0x002000 /* prepare only */ |
80 | #define EV_CHILD 0x004000 |
84 | #define EV_CHILD 0x004000 /* child/pid only */ |
81 | #define EV_ERROR 0x800000 /* sent when an error occurs */ |
85 | #define EV_ERROR 0x800000 /* sent when an error occurs */ |
82 | |
86 | |
83 | /* can be used to add custom fields to all watchers */ |
87 | /* can be used to add custom fields to all watchers, while losing binary compatibility */ |
84 | #ifndef EV_COMMON |
88 | #ifndef EV_COMMON |
85 | # define EV_COMMON void *data |
89 | # define EV_COMMON void *data |
86 | #endif |
90 | #endif |
87 | #ifndef EV_PROTOTYPES |
91 | #ifndef EV_PROTOTYPES |
88 | # define EV_PROTOTYPES 1 |
92 | # define EV_PROTOTYPES 1 |
… | |
… | |
368 | void ev_timer_start (EV_P_ struct ev_timer *w); |
372 | void ev_timer_start (EV_P_ struct ev_timer *w); |
369 | void ev_timer_stop (EV_P_ struct ev_timer *w); |
373 | void ev_timer_stop (EV_P_ struct ev_timer *w); |
370 | /* stops if active and no repeat, restarts if active and repeating, starts if inactive and repeating */ |
374 | /* stops if active and no repeat, restarts if active and repeating, starts if inactive and repeating */ |
371 | void ev_timer_again (EV_P_ struct ev_timer *w); |
375 | void ev_timer_again (EV_P_ struct ev_timer *w); |
372 | |
376 | |
|
|
377 | #if EV_PERIODICS |
373 | void ev_periodic_start (EV_P_ struct ev_periodic *w); |
378 | void ev_periodic_start (EV_P_ struct ev_periodic *w); |
374 | void ev_periodic_stop (EV_P_ struct ev_periodic *w); |
379 | void ev_periodic_stop (EV_P_ struct ev_periodic *w); |
375 | void ev_periodic_again (EV_P_ struct ev_periodic *w); |
380 | void ev_periodic_again (EV_P_ struct ev_periodic *w); |
|
|
381 | #endif |
376 | |
382 | |
377 | void ev_idle_start (EV_P_ struct ev_idle *w); |
383 | void ev_idle_start (EV_P_ struct ev_idle *w); |
378 | void ev_idle_stop (EV_P_ struct ev_idle *w); |
384 | void ev_idle_stop (EV_P_ struct ev_idle *w); |
379 | |
385 | |
380 | void ev_prepare_start (EV_P_ struct ev_prepare *w); |
386 | void ev_prepare_start (EV_P_ struct ev_prepare *w); |