|
|
1 | /* |
|
|
2 | * loop member variable declarations |
|
|
3 | * |
|
|
4 | * Copyright (c) 2007,2008,2009,2010,2011,2012,2013,2019 Marc Alexander Lehmann <libev@schmorp.de> |
|
|
5 | * All rights reserved. |
|
|
6 | * |
|
|
7 | * Redistribution and use in source and binary forms, with or without modifica- |
|
|
8 | * tion, are permitted provided that the following conditions are met: |
|
|
9 | * |
|
|
10 | * 1. Redistributions of source code must retain the above copyright notice, |
|
|
11 | * this list of conditions and the following disclaimer. |
|
|
12 | * |
|
|
13 | * 2. Redistributions in binary form must reproduce the above copyright |
|
|
14 | * notice, this list of conditions and the following disclaimer in the |
|
|
15 | * documentation and/or other materials provided with the distribution. |
|
|
16 | * |
|
|
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
|
|
18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- |
|
|
19 | * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
|
|
20 | * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE- |
|
|
21 | * CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
|
|
22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
|
|
23 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
|
|
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTH- |
|
|
25 | * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
|
|
26 | * OF THE POSSIBILITY OF SUCH DAMAGE. |
|
|
27 | * |
|
|
28 | * Alternatively, the contents of this file may be used under the terms of |
|
|
29 | * the GNU General Public License ("GPL") version 2 or any later version, |
|
|
30 | * in which case the provisions of the GPL are applicable instead of |
|
|
31 | * the above. If you wish to allow the use of your version of this file |
|
|
32 | * only under the terms of the GPL and not to allow others to use your |
|
|
33 | * version of this file under the BSD license, indicate your decision |
|
|
34 | * by deleting the provisions above and replace them with the notice |
|
|
35 | * and other provisions required by the GPL. If you do not delete the |
|
|
36 | * provisions above, a recipient may use your version of this file under |
|
|
37 | * either the BSD or the GPL. |
|
|
38 | */ |
|
|
39 | |
1 | #define VARx(type,name) VAR(name, type name) |
40 | #define VARx(type,name) VAR(name, type name) |
2 | |
41 | |
3 | VARx(ev_tstamp, now_floor) /* last time we refreshed rt_time */ |
42 | VARx(ev_tstamp, now_floor) /* last time we refreshed rt_time */ |
4 | VARx(ev_tstamp, mn_now) /* monotonic clock "now" */ |
43 | VARx(ev_tstamp, mn_now) /* monotonic clock "now" */ |
5 | VARx(ev_tstamp, rtmn_diff) /* difference realtime - monotonic time */ |
44 | VARx(ev_tstamp, rtmn_diff) /* difference realtime - monotonic time */ |
6 | |
45 | |
|
|
46 | /* for reverse feeding of events */ |
|
|
47 | VARx(W *, rfeeds) |
|
|
48 | VARx(int, rfeedmax) |
|
|
49 | VARx(int, rfeedcnt) |
|
|
50 | |
|
|
51 | VAR (pendings, ANPENDING *pendings [NUMPRI]) |
|
|
52 | VAR (pendingmax, int pendingmax [NUMPRI]) |
|
|
53 | VAR (pendingcnt, int pendingcnt [NUMPRI]) |
|
|
54 | VARx(int, pendingpri) /* highest priority currently pending */ |
|
|
55 | VARx(ev_prepare, pending_w) /* dummy pending watcher */ |
|
|
56 | |
7 | VARx(ev_tstamp, io_blocktime) |
57 | VARx(ev_tstamp, io_blocktime) |
8 | VARx(ev_tstamp, timeout_blocktime) |
58 | VARx(ev_tstamp, timeout_blocktime) |
9 | |
59 | |
10 | VARx(int, backend) |
60 | VARx(int, backend) |
11 | VARx(int, activecnt) /* total number of active events ("refcount") */ |
61 | VARx(int, activecnt) /* total number of active events ("refcount") */ |
12 | VARx(unsigned int, loop_count); /* total number of loop iterations/blocks */ |
62 | VARx(EV_ATOMIC_T, loop_done) /* signal by ev_break */ |
13 | |
63 | |
14 | VARx(int, backend_fd) |
64 | VARx(int, backend_fd) |
15 | VARx(ev_tstamp, backend_fudge) /* assumed typical timer resolution */ |
65 | VARx(ev_tstamp, backend_mintime) /* assumed typical timer resolution */ |
16 | VAR (backend_modify, void (*backend_modify)(EV_P_ int fd, int oev, int nev)) |
66 | VAR (backend_modify, void (*backend_modify)(EV_P_ int fd, int oev, int nev)) |
17 | VAR (backend_poll , void (*backend_poll)(EV_P_ ev_tstamp timeout)) |
67 | VAR (backend_poll , void (*backend_poll)(EV_P_ ev_tstamp timeout)) |
18 | |
68 | |
|
|
69 | VARx(ANFD *, anfds) |
|
|
70 | VARx(int, anfdmax) |
|
|
71 | |
|
|
72 | VAR (evpipe, int evpipe [2]) |
|
|
73 | VARx(ev_io, pipe_w) |
|
|
74 | VARx(EV_ATOMIC_T, pipe_write_wanted) |
|
|
75 | VARx(EV_ATOMIC_T, pipe_write_skipped) |
|
|
76 | |
19 | #if !defined(_WIN32) || EV_GENWRAP |
77 | #if !defined(_WIN32) || EV_GENWRAP |
20 | VARx(pid_t, curpid) |
78 | VARx(pid_t, curpid) |
21 | #endif |
79 | #endif |
22 | |
80 | |
23 | VARx(int, postfork) /* true if we need to recreate kernel state after fork */ |
81 | VARx(char, postfork) /* true if we need to recreate kernel state after fork */ |
24 | |
82 | |
25 | #if EV_USE_SELECT || EV_GENWRAP |
83 | #if EV_USE_SELECT || EV_GENWRAP |
26 | VARx(void *, vec_ri) |
84 | VARx(void *, vec_ri) |
27 | VARx(void *, vec_ro) |
85 | VARx(void *, vec_ro) |
28 | VARx(void *, vec_wi) |
86 | VARx(void *, vec_wi) |
29 | VARx(void *, vec_wo) |
87 | VARx(void *, vec_wo) |
|
|
88 | #if defined(_WIN32) || EV_GENWRAP |
|
|
89 | VARx(void *, vec_eo) |
|
|
90 | #endif |
30 | VARx(int, vec_max) |
91 | VARx(int, vec_max) |
31 | #endif |
92 | #endif |
32 | |
93 | |
33 | #if EV_USE_POLL || EV_GENWRAP |
94 | #if EV_USE_POLL || EV_GENWRAP |
34 | VARx(struct pollfd *, polls) |
95 | VARx(struct pollfd *, polls) |
… | |
… | |
39 | #endif |
100 | #endif |
40 | |
101 | |
41 | #if EV_USE_EPOLL || EV_GENWRAP |
102 | #if EV_USE_EPOLL || EV_GENWRAP |
42 | VARx(struct epoll_event *, epoll_events) |
103 | VARx(struct epoll_event *, epoll_events) |
43 | VARx(int, epoll_eventmax) |
104 | VARx(int, epoll_eventmax) |
|
|
105 | VARx(int *, epoll_eperms) |
|
|
106 | VARx(int, epoll_epermcnt) |
|
|
107 | VARx(int, epoll_epermmax) |
|
|
108 | #endif |
|
|
109 | |
|
|
110 | #if EV_USE_LINUXAIO || EV_GENWRAP |
|
|
111 | VARx(aio_context_t, linuxaio_ctx) |
|
|
112 | VARx(struct aniocb **, linuxaio_iocbps) |
|
|
113 | VARx(int, linuxaio_iocbpmax) |
|
|
114 | VARx(struct iocb **, linuxaio_submits) |
|
|
115 | VARx(int, linuxaio_submitcnt) |
|
|
116 | VARx(int, linuxaio_submitmax) |
|
|
117 | VARx(ev_io, linuxaio_epoll_w) |
44 | #endif |
118 | #endif |
45 | |
119 | |
46 | #if EV_USE_KQUEUE || EV_GENWRAP |
120 | #if EV_USE_KQUEUE || EV_GENWRAP |
|
|
121 | VARx(pid_t, kqueue_fd_pid) |
47 | VARx(struct kevent *, kqueue_changes) |
122 | VARx(struct kevent *, kqueue_changes) |
48 | VARx(int, kqueue_changemax) |
123 | VARx(int, kqueue_changemax) |
49 | VARx(int, kqueue_changecnt) |
124 | VARx(int, kqueue_changecnt) |
50 | VARx(struct kevent *, kqueue_events) |
125 | VARx(struct kevent *, kqueue_events) |
51 | VARx(int, kqueue_eventmax) |
126 | VARx(int, kqueue_eventmax) |
… | |
… | |
54 | #if EV_USE_PORT || EV_GENWRAP |
129 | #if EV_USE_PORT || EV_GENWRAP |
55 | VARx(struct port_event *, port_events) |
130 | VARx(struct port_event *, port_events) |
56 | VARx(int, port_eventmax) |
131 | VARx(int, port_eventmax) |
57 | #endif |
132 | #endif |
58 | |
133 | |
59 | VARx(ANFD *, anfds) |
134 | #if EV_USE_IOCP || EV_GENWRAP |
60 | VARx(int, anfdmax) |
135 | VARx(HANDLE, iocp) |
61 | |
136 | #endif |
62 | VAR (pendings, ANPENDING *pendings [NUMPRI]) |
|
|
63 | VAR (pendingmax, int pendingmax [NUMPRI]) |
|
|
64 | VAR (pendingcnt, int pendingcnt [NUMPRI]) |
|
|
65 | |
137 | |
66 | VARx(int *, fdchanges) |
138 | VARx(int *, fdchanges) |
67 | VARx(int, fdchangemax) |
139 | VARx(int, fdchangemax) |
68 | VARx(int, fdchangecnt) |
140 | VARx(int, fdchangecnt) |
69 | |
141 | |
70 | VARx(WT *, timers) |
142 | VARx(ANHE *, timers) |
71 | VARx(int, timermax) |
143 | VARx(int, timermax) |
72 | VARx(int, timercnt) |
144 | VARx(int, timercnt) |
73 | |
145 | |
74 | #if EV_PERIODIC_ENABLE || EV_GENWRAP |
146 | #if EV_PERIODIC_ENABLE || EV_GENWRAP |
75 | VARx(WT *, periodics) |
147 | VARx(ANHE *, periodics) |
76 | VARx(int, periodicmax) |
148 | VARx(int, periodicmax) |
77 | VARx(int, periodiccnt) |
149 | VARx(int, periodiccnt) |
78 | #endif |
150 | #endif |
79 | |
151 | |
80 | #if EV_IDLE_ENABLE || EV_GENWRAP |
152 | #if EV_IDLE_ENABLE || EV_GENWRAP |
… | |
… | |
96 | VARx(struct ev_fork **, forks) |
168 | VARx(struct ev_fork **, forks) |
97 | VARx(int, forkmax) |
169 | VARx(int, forkmax) |
98 | VARx(int, forkcnt) |
170 | VARx(int, forkcnt) |
99 | #endif |
171 | #endif |
100 | |
172 | |
|
|
173 | #if EV_CLEANUP_ENABLE || EV_GENWRAP |
|
|
174 | VARx(struct ev_cleanup **, cleanups) |
|
|
175 | VARx(int, cleanupmax) |
|
|
176 | VARx(int, cleanupcnt) |
|
|
177 | #endif |
|
|
178 | |
|
|
179 | #if EV_ASYNC_ENABLE || EV_GENWRAP |
|
|
180 | VARx(EV_ATOMIC_T, async_pending) |
|
|
181 | VARx(struct ev_async **, asyncs) |
|
|
182 | VARx(int, asyncmax) |
|
|
183 | VARx(int, asynccnt) |
|
|
184 | #endif |
|
|
185 | |
101 | #if EV_USE_INOTIFY || EV_GENWRAP |
186 | #if EV_USE_INOTIFY || EV_GENWRAP |
102 | VARx(int, fs_fd) |
187 | VARx(int, fs_fd) |
103 | VARx(ev_io, fs_w) |
188 | VARx(ev_io, fs_w) |
|
|
189 | VARx(char, fs_2625) /* whether we are running in linux 2.6.25 or newer */ |
104 | VAR (fs_hash, ANFS fs_hash [EV_INOTIFY_HASHSIZE]) |
190 | VAR (fs_hash, ANFS fs_hash [EV_INOTIFY_HASHSIZE]) |
105 | #endif |
191 | #endif |
106 | |
192 | |
|
|
193 | VARx(EV_ATOMIC_T, sig_pending) |
|
|
194 | #if EV_USE_SIGNALFD || EV_GENWRAP |
|
|
195 | VARx(int, sigfd) |
|
|
196 | VARx(ev_io, sigfd_w) |
|
|
197 | VARx(sigset_t, sigfd_set) |
|
|
198 | #endif |
|
|
199 | |
|
|
200 | VARx(unsigned int, origflags) /* original loop flags */ |
|
|
201 | |
|
|
202 | #if EV_FEATURE_API || EV_GENWRAP |
|
|
203 | VARx(unsigned int, loop_count) /* total number of loop iterations/blocks */ |
|
|
204 | VARx(unsigned int, loop_depth) /* #ev_run enters - #ev_run leaves */ |
|
|
205 | |
|
|
206 | VARx(void *, userdata) |
|
|
207 | /* C++ doesn't support the ev_loop_callback typedef here. stinks. */ |
|
|
208 | VAR (release_cb, void (*release_cb)(EV_P) EV_NOEXCEPT) |
|
|
209 | VAR (acquire_cb, void (*acquire_cb)(EV_P) EV_NOEXCEPT) |
|
|
210 | VAR (invoke_cb , ev_loop_callback invoke_cb) |
|
|
211 | #endif |
|
|
212 | |
107 | #undef VARx |
213 | #undef VARx |
108 | |
214 | |