… | |
… | |
31 | #define EV_H |
31 | #define EV_H |
32 | |
32 | |
33 | typedef double ev_tstamp; |
33 | typedef double ev_tstamp; |
34 | |
34 | |
35 | /* eventmask, revents, events... */ |
35 | /* eventmask, revents, events... */ |
36 | #define EV_UNDEF -1 /* guaranteed to be invalid */ |
36 | #define EV_UNDEF -1 /* guaranteed to be invalid */ |
37 | #define EV_NONE 0x00 |
37 | #define EV_NONE 0x00 |
38 | #define EV_READ 0x01 |
38 | #define EV_READ 0x01 |
39 | #define EV_WRITE 0x02 |
39 | #define EV_WRITE 0x02 |
|
|
40 | #define EV_REIFY 0x04 /* private */ |
40 | #define EV_TIMEOUT 0x04 |
41 | #define EV_TIMEOUT 0x000100 |
41 | #define EV_SIGNAL 0x08 |
42 | #define EV_SIGNAL 0x000200 |
42 | #define EV_IDLE 0x10 |
43 | #define EV_IDLE 0x000400 |
43 | #define EV_CHECK 0x20 |
44 | #define EV_CHECK 0x000800 |
44 | #define EV_PREPARE 0x40 |
45 | #define EV_PREPARE 0x001000 |
45 | #define EV_CHILD 0x80 |
46 | #define EV_CHILD 0x002000 |
46 | #define EV_ERROR (0xff|0x8000) |
47 | #define EV_ERROR 0x800000 /* sent when an error occurs */ |
47 | |
48 | |
48 | /* can be used to add custom fields to all watchers */ |
49 | /* can be used to add custom fields to all watchers */ |
49 | #ifndef EV_COMMON |
50 | #ifndef EV_COMMON |
50 | # define EV_COMMON void *data |
51 | # define EV_COMMON void *data |
51 | #endif |
52 | #endif |
52 | #ifndef EV_PROTOTYPES |
53 | #ifndef EV_PROTOTYPES |
53 | # define EV_PROTOTYPES 1 |
54 | # define EV_PROTOTYPES 1 |
54 | #endif |
55 | #endif |
|
|
56 | |
|
|
57 | #define EV_VERSION_MAJOR 1 |
|
|
58 | #define EV_VERSION_MINOR 1 |
55 | |
59 | |
56 | /* |
60 | /* |
57 | * struct member types: |
61 | * struct member types: |
58 | * private: you can look at them, but not change them, and they might not mean anything to you. |
62 | * private: you can look at them, but not change them, and they might not mean anything to you. |
59 | * ro: can be read anytime, but only changed when the watcher isn't active |
63 | * ro: can be read anytime, but only changed when the watcher isn't active |
… | |
… | |
155 | #define EVMETHOD_SELECT 1 |
159 | #define EVMETHOD_SELECT 1 |
156 | #define EVMETHOD_EPOLL 2 |
160 | #define EVMETHOD_EPOLL 2 |
157 | #if EV_PROTOTYPES |
161 | #if EV_PROTOTYPES |
158 | extern int ev_method; |
162 | extern int ev_method; |
159 | int ev_init (int flags); /* returns ev_method */ |
163 | int ev_init (int flags); /* returns ev_method */ |
|
|
164 | int ev_version_major (void); |
|
|
165 | int ev_version_minor (void); |
160 | |
166 | |
161 | /* these three calls are suitable for plugging into pthread_atfork */ |
167 | /* these three calls are suitable for plugging into pthread_atfork */ |
162 | void ev_prefork (void); |
168 | void ev_prefork (void); |
163 | void ev_postfork_parent (void); |
169 | void ev_postfork_parent (void); |
164 | void ev_postfork_child (void); |
170 | void ev_postfork_child (void); |