|
|
1 | /* |
|
|
2 | * loop member variable declarations |
|
|
3 | * |
|
|
4 | * Copyright (c) 2007,2008,2009,2010 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 */ |
… | |
… | |
7 | VARx(ev_tstamp, io_blocktime) |
46 | VARx(ev_tstamp, io_blocktime) |
8 | VARx(ev_tstamp, timeout_blocktime) |
47 | VARx(ev_tstamp, timeout_blocktime) |
9 | |
48 | |
10 | VARx(int, backend) |
49 | VARx(int, backend) |
11 | VARx(int, activecnt) /* total number of active events ("refcount") */ |
50 | VARx(int, activecnt) /* total number of active events ("refcount") */ |
12 | VARx(unsigned int, loop_count) /* total number of loop iterations/blocks */ |
51 | VARx(unsigned char, loop_done) /* signal by ev_unloop */ |
13 | |
52 | |
14 | VARx(int, backend_fd) |
53 | VARx(int, backend_fd) |
15 | VARx(ev_tstamp, backend_fudge) /* assumed typical timer resolution */ |
54 | VARx(ev_tstamp, backend_fudge) /* assumed typical timer resolution */ |
16 | VAR (backend_modify, void (*backend_modify)(EV_P_ int fd, int oev, int nev)) |
55 | 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)) |
56 | VAR (backend_poll , void (*backend_poll)(EV_P_ ev_tstamp timeout)) |
18 | |
57 | |
|
|
58 | VARx(ANFD *, anfds) |
|
|
59 | VARx(int, anfdmax) |
|
|
60 | |
|
|
61 | VAR (pendings, ANPENDING *pendings [NUMPRI]) |
|
|
62 | VAR (pendingmax, int pendingmax [NUMPRI]) |
|
|
63 | VAR (pendingcnt, int pendingcnt [NUMPRI]) |
|
|
64 | VARx(ev_prepare, pending_w) /* dummy pending watcher */ |
|
|
65 | |
|
|
66 | /* for reverse feeding of events */ |
|
|
67 | VARx(W *, rfeeds) |
|
|
68 | VARx(int, rfeedmax) |
|
|
69 | VARx(int, rfeedcnt) |
|
|
70 | |
|
|
71 | #if EV_USE_EVENTFD || EV_GENWRAP |
|
|
72 | VARx(int, evfd) |
|
|
73 | #endif |
|
|
74 | VAR (evpipe, int evpipe [2]) |
|
|
75 | VARx(ev_io, pipe_w) |
|
|
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) |
… | |
… | |
54 | #if EV_USE_PORT || EV_GENWRAP |
115 | #if EV_USE_PORT || EV_GENWRAP |
55 | VARx(struct port_event *, port_events) |
116 | VARx(struct port_event *, port_events) |
56 | VARx(int, port_eventmax) |
117 | VARx(int, port_eventmax) |
57 | #endif |
118 | #endif |
58 | |
119 | |
59 | VARx(ANFD *, anfds) |
|
|
60 | VARx(int, anfdmax) |
|
|
61 | |
|
|
62 | VAR (pendings, ANPENDING *pendings [NUMPRI]) |
|
|
63 | VAR (pendingmax, int pendingmax [NUMPRI]) |
|
|
64 | VAR (pendingcnt, int pendingcnt [NUMPRI]) |
|
|
65 | |
|
|
66 | VARx(int *, fdchanges) |
120 | VARx(int *, fdchanges) |
67 | VARx(int, fdchangemax) |
121 | VARx(int, fdchangemax) |
68 | VARx(int, fdchangecnt) |
122 | VARx(int, fdchangecnt) |
69 | |
123 | |
70 | VARx(WT *, timers) |
124 | VARx(ANHE *, timers) |
71 | VARx(int, timermax) |
125 | VARx(int, timermax) |
72 | VARx(int, timercnt) |
126 | VARx(int, timercnt) |
73 | |
127 | |
74 | #if EV_PERIODIC_ENABLE || EV_GENWRAP |
128 | #if EV_PERIODIC_ENABLE || EV_GENWRAP |
75 | VARx(WT *, periodics) |
129 | VARx(ANHE *, periodics) |
76 | VARx(int, periodicmax) |
130 | VARx(int, periodicmax) |
77 | VARx(int, periodiccnt) |
131 | VARx(int, periodiccnt) |
78 | #endif |
132 | #endif |
79 | |
133 | |
80 | #if EV_IDLE_ENABLE || EV_GENWRAP |
134 | #if EV_IDLE_ENABLE || EV_GENWRAP |
… | |
… | |
96 | VARx(struct ev_fork **, forks) |
150 | VARx(struct ev_fork **, forks) |
97 | VARx(int, forkmax) |
151 | VARx(int, forkmax) |
98 | VARx(int, forkcnt) |
152 | VARx(int, forkcnt) |
99 | #endif |
153 | #endif |
100 | |
154 | |
|
|
155 | #if EV_ASYNC_ENABLE || EV_GENWRAP |
|
|
156 | VARx(EV_ATOMIC_T, async_pending) |
|
|
157 | VARx(struct ev_async **, asyncs) |
|
|
158 | VARx(int, asyncmax) |
|
|
159 | VARx(int, asynccnt) |
|
|
160 | #endif |
|
|
161 | |
101 | #if EV_USE_INOTIFY || EV_GENWRAP |
162 | #if EV_USE_INOTIFY || EV_GENWRAP |
102 | VARx(int, fs_fd) |
163 | VARx(int, fs_fd) |
103 | VARx(ev_io, fs_w) |
164 | VARx(ev_io, fs_w) |
|
|
165 | 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]) |
166 | VAR (fs_hash, ANFS fs_hash [EV_INOTIFY_HASHSIZE]) |
|
|
167 | #endif |
|
|
168 | |
|
|
169 | VARx(EV_ATOMIC_T, sig_pending) |
|
|
170 | #if EV_USE_SIGNALFD || EV_GENWRAP |
|
|
171 | VARx(int, sigfd) |
|
|
172 | VARx(ev_io, sigfd_w) |
|
|
173 | VARx(sigset_t, sigfd_set) |
|
|
174 | #endif |
|
|
175 | |
|
|
176 | #if EV_FEATURE_API || EV_GENWRAP |
|
|
177 | VARx(unsigned int, loop_count) /* total number of loop iterations/blocks */ |
|
|
178 | VARx(unsigned int, loop_depth) /* #ev_loop enters - #ev_loop leaves */ |
|
|
179 | |
|
|
180 | VARx(void *, userdata) |
|
|
181 | VAR (release_cb, void (*release_cb)(EV_P)) |
|
|
182 | VAR (acquire_cb, void (*acquire_cb)(EV_P)) |
|
|
183 | VAR (invoke_cb , void (*invoke_cb) (EV_P)) |
105 | #endif |
184 | #endif |
106 | |
185 | |
107 | #undef VARx |
186 | #undef VARx |
108 | |
187 | |