You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

203 lines
6.0 KiB

11 years ago
  1. /*
  2. * loop member variable declarations
  3. *
  4. * Copyright (c) 2007,2008,2009,2010,2011,2012 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. #define VARx(type,name) VAR(name, type name)
  40. VARx(ev_tstamp, now_floor) /* last time we refreshed rt_time */
  41. VARx(ev_tstamp, mn_now) /* monotonic clock "now" */
  42. VARx(ev_tstamp, rtmn_diff) /* difference realtime - monotonic time */
  43. /* for reverse feeding of events */
  44. VARx(W *, rfeeds)
  45. VARx(int, rfeedmax)
  46. VARx(int, rfeedcnt)
  47. VAR (pendings, ANPENDING *pendings [NUMPRI])
  48. VAR (pendingmax, int pendingmax [NUMPRI])
  49. VAR (pendingcnt, int pendingcnt [NUMPRI])
  50. VARx(int, pendingpri) /* highest priority currently pending */
  51. VARx(ev_prepare, pending_w) /* dummy pending watcher */
  52. VARx(ev_tstamp, io_blocktime)
  53. VARx(ev_tstamp, timeout_blocktime)
  54. VARx(int, backend)
  55. VARx(int, activecnt) /* total number of active events ("refcount") */
  56. VARx(EV_ATOMIC_T, loop_done) /* signal by ev_break */
  57. VARx(int, backend_fd)
  58. VARx(ev_tstamp, backend_mintime) /* assumed typical timer resolution */
  59. VAR (backend_modify, void (*backend_modify)(EV_P_ int fd, int oev, int nev))
  60. VAR (backend_poll , void (*backend_poll)(EV_P_ ev_tstamp timeout))
  61. VARx(ANFD *, anfds)
  62. VARx(int, anfdmax)
  63. VAR (evpipe, int evpipe [2])
  64. VARx(ev_io, pipe_w)
  65. VARx(EV_ATOMIC_T, pipe_write_wanted)
  66. VARx(EV_ATOMIC_T, pipe_write_skipped)
  67. #if !defined(_WIN32) || EV_GENWRAP
  68. VARx(pid_t, curpid)
  69. #endif
  70. VARx(char, postfork) /* true if we need to recreate kernel state after fork */
  71. #if EV_USE_SELECT || EV_GENWRAP
  72. VARx(void *, vec_ri)
  73. VARx(void *, vec_ro)
  74. VARx(void *, vec_wi)
  75. VARx(void *, vec_wo)
  76. #if defined(_WIN32) || EV_GENWRAP
  77. VARx(void *, vec_eo)
  78. #endif
  79. VARx(int, vec_max)
  80. #endif
  81. #if EV_USE_POLL || EV_GENWRAP
  82. VARx(struct pollfd *, polls)
  83. VARx(int, pollmax)
  84. VARx(int, pollcnt)
  85. VARx(int *, pollidxs) /* maps fds into structure indices */
  86. VARx(int, pollidxmax)
  87. #endif
  88. #if EV_USE_EPOLL || EV_GENWRAP
  89. VARx(struct epoll_event *, epoll_events)
  90. VARx(int, epoll_eventmax)
  91. VARx(int *, epoll_eperms)
  92. VARx(int, epoll_epermcnt)
  93. VARx(int, epoll_epermmax)
  94. #endif
  95. #if EV_USE_KQUEUE || EV_GENWRAP
  96. VARx(pid_t, kqueue_fd_pid)
  97. VARx(struct kevent *, kqueue_changes)
  98. VARx(int, kqueue_changemax)
  99. VARx(int, kqueue_changecnt)
  100. VARx(struct kevent *, kqueue_events)
  101. VARx(int, kqueue_eventmax)
  102. #endif
  103. #if EV_USE_PORT || EV_GENWRAP
  104. VARx(struct port_event *, port_events)
  105. VARx(int, port_eventmax)
  106. #endif
  107. #if EV_USE_IOCP || EV_GENWRAP
  108. VARx(HANDLE, iocp)
  109. #endif
  110. VARx(int *, fdchanges)
  111. VARx(int, fdchangemax)
  112. VARx(int, fdchangecnt)
  113. VARx(ANHE *, timers)
  114. VARx(int, timermax)
  115. VARx(int, timercnt)
  116. #if EV_PERIODIC_ENABLE || EV_GENWRAP
  117. VARx(ANHE *, periodics)
  118. VARx(int, periodicmax)
  119. VARx(int, periodiccnt)
  120. #endif
  121. #if EV_IDLE_ENABLE || EV_GENWRAP
  122. VAR (idles, ev_idle **idles [NUMPRI])
  123. VAR (idlemax, int idlemax [NUMPRI])
  124. VAR (idlecnt, int idlecnt [NUMPRI])
  125. #endif
  126. VARx(int, idleall) /* total number */
  127. VARx(struct ev_prepare **, prepares)
  128. VARx(int, preparemax)
  129. VARx(int, preparecnt)
  130. VARx(struct ev_check **, checks)
  131. VARx(int, checkmax)
  132. VARx(int, checkcnt)
  133. #if EV_FORK_ENABLE || EV_GENWRAP
  134. VARx(struct ev_fork **, forks)
  135. VARx(int, forkmax)
  136. VARx(int, forkcnt)
  137. #endif
  138. #if EV_CLEANUP_ENABLE || EV_GENWRAP
  139. VARx(struct ev_cleanup **, cleanups)
  140. VARx(int, cleanupmax)
  141. VARx(int, cleanupcnt)
  142. #endif
  143. #if EV_ASYNC_ENABLE || EV_GENWRAP
  144. VARx(EV_ATOMIC_T, async_pending)
  145. VARx(struct ev_async **, asyncs)
  146. VARx(int, asyncmax)
  147. VARx(int, asynccnt)
  148. #endif
  149. #if EV_USE_INOTIFY || EV_GENWRAP
  150. VARx(int, fs_fd)
  151. VARx(ev_io, fs_w)
  152. VARx(char, fs_2625) /* whether we are running in linux 2.6.25 or newer */
  153. VAR (fs_hash, ANFS fs_hash [EV_INOTIFY_HASHSIZE])
  154. #endif
  155. VARx(EV_ATOMIC_T, sig_pending)
  156. #if EV_USE_SIGNALFD || EV_GENWRAP
  157. VARx(int, sigfd)
  158. VARx(ev_io, sigfd_w)
  159. VARx(sigset_t, sigfd_set)
  160. #endif
  161. VARx(unsigned int, origflags) /* original loop flags */
  162. #if EV_FEATURE_API || EV_GENWRAP
  163. VARx(unsigned int, loop_count) /* total number of loop iterations/blocks */
  164. VARx(unsigned int, loop_depth) /* #ev_run enters - #ev_run leaves */
  165. VARx(void *, userdata)
  166. VAR (release_cb, void (*release_cb)(EV_P) EV_THROW)
  167. VAR (acquire_cb, void (*acquire_cb)(EV_P) EV_THROW)
  168. VAR (invoke_cb , void (*invoke_cb) (EV_P))
  169. #endif
  170. #undef VARx