… | |
… | |
287 | # endif |
287 | # endif |
288 | #endif |
288 | #endif |
289 | |
289 | |
290 | #if EV_USE_INOTIFY |
290 | #if EV_USE_INOTIFY |
291 | # include <sys/inotify.h> |
291 | # include <sys/inotify.h> |
|
|
292 | /* some very old inotify.h headers don't have IN_DONT_FOLLOW */ |
|
|
293 | # ifndef IN_DONT_FOLLOW |
|
|
294 | # undef EV_USE_INOTIFY |
|
|
295 | # define EV_USE_INOTIFY 0 |
|
|
296 | # endif |
292 | #endif |
297 | #endif |
293 | |
298 | |
294 | #if EV_SELECT_IS_WINSOCKET |
299 | #if EV_SELECT_IS_WINSOCKET |
295 | # include <winsock.h> |
300 | # include <winsock.h> |
296 | #endif |
301 | #endif |
… | |
… | |
3012 | } |
3017 | } |
3013 | |
3018 | |
3014 | static void |
3019 | static void |
3015 | once_cb_io (EV_P_ ev_io *w, int revents) |
3020 | once_cb_io (EV_P_ ev_io *w, int revents) |
3016 | { |
3021 | { |
3017 | once_cb (EV_A_ (struct ev_once *)(((char *)w) - offsetof (struct ev_once, io)), revents); |
3022 | struct ev_once *once = (struct ev_once *)(((char *)w) - offsetof (struct ev_once, io)); |
|
|
3023 | |
|
|
3024 | once_cb (EV_A_ once, revents | ev_clear_pending (EV_A_ &once->to)); |
3018 | } |
3025 | } |
3019 | |
3026 | |
3020 | static void |
3027 | static void |
3021 | once_cb_to (EV_P_ ev_timer *w, int revents) |
3028 | once_cb_to (EV_P_ ev_timer *w, int revents) |
3022 | { |
3029 | { |
3023 | once_cb (EV_A_ (struct ev_once *)(((char *)w) - offsetof (struct ev_once, to)), revents); |
3030 | struct ev_once *once = (struct ev_once *)(((char *)w) - offsetof (struct ev_once, to)); |
|
|
3031 | |
|
|
3032 | once_cb (EV_A_ once, revents | ev_clear_pending (EV_A_ &once->io)); |
3024 | } |
3033 | } |
3025 | |
3034 | |
3026 | void |
3035 | void |
3027 | ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg) |
3036 | ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg) |
3028 | { |
3037 | { |