… | |
… | |
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 0x000000 |
38 | #define EV_READ 0x01 |
38 | #define EV_READ 0x000001 |
39 | #define EV_WRITE 0x02 |
39 | #define EV_WRITE 0x000002 |
40 | #define EV_TIMEOUT 0x04 |
40 | #define EV_TIMEOUT 0x000004 |
41 | #define EV_SIGNAL 0x08 |
41 | #define EV_SIGNAL 0x000008 |
42 | #define EV_IDLE 0x10 |
42 | #define EV_IDLE 0x000010 |
43 | #define EV_CHECK 0x20 |
43 | #define EV_CHECK 0x000020 |
44 | #define EV_PREPARE 0x40 |
44 | #define EV_PREPARE 0x000040 |
45 | #define EV_CHILD 0x80 |
45 | #define EV_CHILD 0x000080 |
46 | #define EV_ERROR (0xff|0x8000) |
46 | #define EV_ERROR 0x800000 |
47 | |
47 | |
48 | /* can be used to add custom fields to all watchers */ |
48 | /* can be used to add custom fields to all watchers */ |
49 | #ifndef EV_COMMON |
49 | #ifndef EV_COMMON |
50 | # define EV_COMMON void *data |
50 | # define EV_COMMON void *data |
51 | #endif |
51 | #endif |
52 | #ifndef EV_PROTOTYPES |
52 | #ifndef EV_PROTOTYPES |
53 | # define EV_PROTOTYPES 1 |
53 | # define EV_PROTOTYPES 1 |
54 | #endif |
54 | #endif |
|
|
55 | |
|
|
56 | #define EV_VERSION_MAJOR 1 |
|
|
57 | #define EV_VERSION_MINOR 1 |
55 | |
58 | |
56 | /* |
59 | /* |
57 | * struct member types: |
60 | * struct member types: |
58 | * private: you can look at them, but not change them, and they might not mean anything to you. |
61 | * 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 |
62 | * ro: can be read anytime, but only changed when the watcher isn't active |
… | |
… | |
155 | #define EVMETHOD_SELECT 1 |
158 | #define EVMETHOD_SELECT 1 |
156 | #define EVMETHOD_EPOLL 2 |
159 | #define EVMETHOD_EPOLL 2 |
157 | #if EV_PROTOTYPES |
160 | #if EV_PROTOTYPES |
158 | extern int ev_method; |
161 | extern int ev_method; |
159 | int ev_init (int flags); /* returns ev_method */ |
162 | int ev_init (int flags); /* returns ev_method */ |
|
|
163 | int ev_version_major (void); |
|
|
164 | int ev_version_minor (void); |
160 | |
165 | |
161 | /* these three calls are suitable for plugging into pthread_atfork */ |
166 | /* these three calls are suitable for plugging into pthread_atfork */ |
162 | void ev_prefork (void); |
167 | void ev_prefork (void); |
163 | void ev_postfork_parent (void); |
168 | void ev_postfork_parent (void); |
164 | void ev_postfork_child (void); |
169 | void ev_postfork_child (void); |