… | |
… | |
37 | struct type *next /* private */ |
37 | struct type *next /* private */ |
38 | |
38 | |
39 | #define EV_WATCHER_TIME(type) \ |
39 | #define EV_WATCHER_TIME(type) \ |
40 | EV_WATCHER (type); \ |
40 | EV_WATCHER (type); \ |
41 | ev_tstamp at /* private */ |
41 | ev_tstamp at /* private */ |
|
|
42 | |
|
|
43 | /* base class, nothing to see here unless you subclass */ |
|
|
44 | struct ev_watcher { |
|
|
45 | EV_WATCHER (ev_watcher); |
|
|
46 | }; |
|
|
47 | |
|
|
48 | /* base class, nothing to see here unless you subclass */ |
|
|
49 | struct ev_watcher_list { |
|
|
50 | EV_WATCHER_LIST (ev_watcher_list); |
|
|
51 | }; |
|
|
52 | |
|
|
53 | /* base class, nothing to see here unless you subclass */ |
|
|
54 | struct ev_watcher_time { |
|
|
55 | EV_WATCHER_TIME (ev_watcher_time); |
|
|
56 | }; |
42 | |
57 | |
43 | /* invoked after a specific time, repeatable (based on monotonic clock) */ |
58 | /* invoked after a specific time, repeatable (based on monotonic clock) */ |
44 | struct ev_timer |
59 | struct ev_timer |
45 | { |
60 | { |
46 | EV_WATCHER_TIME (ev_timer); |
61 | EV_WATCHER_TIME (ev_timer); |
… | |
… | |
100 | ev_tstamp ev_time (void); |
115 | ev_tstamp ev_time (void); |
101 | |
116 | |
102 | #define EVLOOP_NONBLOCK 1 /* do not block/wait */ |
117 | #define EVLOOP_NONBLOCK 1 /* do not block/wait */ |
103 | #define EVLOOP_ONESHOT 2 /* block *once* only */ |
118 | #define EVLOOP_ONESHOT 2 /* block *once* only */ |
104 | void ev_loop (int flags); |
119 | void ev_loop (int flags); |
105 | extern int ev_loop_done; /* set to 1 to break out of event loop */ |
120 | extern int ev_loop_done; /* set to 1 to break out of event loop, set to 2 to break out of all event loops */ |
106 | |
121 | |
107 | /* these may evaluate ev multiple times, and the other arguments at most once */ |
122 | /* these may evaluate ev multiple times, and the other arguments at most once */ |
108 | /* either use evw_init + evXXX_set, or the evXXX_init macro, below, to first initialise a watcher */ |
123 | /* either use evw_init + evXXX_set, or the evXXX_init macro, below, to first initialise a watcher */ |
109 | #define evw_init(ev,cb_) do { (ev)->active = 0; (ev)->cb = (cb_); } while (0) |
124 | #define evw_init(ev,cb_) do { (ev)->active = 0; (ev)->cb = (cb_); } while (0) |
110 | |
125 | |