Mirror of :pserver:anonymous@cvs.schmorp.de/schmorpforge libev http://software.schmorp.de/pkg/libev.html
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.

180 lines
5.4 KiB

14 years ago
14 years ago
14 years ago
  1. /*
  2. * loop member variable declarations
  3. *
  4. * Copyright (c) 2007,2008,2009 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. VARx(ev_tstamp, io_blocktime)
  44. VARx(ev_tstamp, timeout_blocktime)
  45. VARx(int, backend)
  46. VARx(int, activecnt) /* total number of active events ("refcount") */
  47. VARx(unsigned char, loop_done) /* signal by ev_unloop */
  48. VARx(int, backend_fd)
  49. VARx(ev_tstamp, backend_fudge) /* assumed typical timer resolution */
  50. VAR (backend_modify, void (*backend_modify)(EV_P_ int fd, int oev, int nev))
  51. VAR (backend_poll , void (*backend_poll)(EV_P_ ev_tstamp timeout))
  52. VARx(ANFD *, anfds)
  53. VARx(int, anfdmax)
  54. VAR (pendings, ANPENDING *pendings [NUMPRI])
  55. VAR (pendingmax, int pendingmax [NUMPRI])
  56. VAR (pendingcnt, int pendingcnt [NUMPRI])
  57. VARx(ev_prepare, pending_w) /* dummy pending watcher */
  58. /* for reverse feeding of events */
  59. VARx(W *, rfeeds)
  60. VARx(int, rfeedmax)
  61. VARx(int, rfeedcnt)
  62. #if EV_USE_EVENTFD || EV_GENWRAP
  63. VARx(int, evfd)
  64. #endif
  65. VAR (evpipe, int evpipe [2])
  66. VARx(ev_io, pipe_w)
  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. #endif
  92. #if EV_USE_KQUEUE || EV_GENWRAP
  93. VARx(struct kevent *, kqueue_changes)
  94. VARx(int, kqueue_changemax)
  95. VARx(int, kqueue_changecnt)
  96. VARx(struct kevent *, kqueue_events)
  97. VARx(int, kqueue_eventmax)
  98. #endif
  99. #if EV_USE_PORT || EV_GENWRAP
  100. VARx(struct port_event *, port_events)
  101. VARx(int, port_eventmax)
  102. #endif
  103. VARx(int *, fdchanges)
  104. VARx(int, fdchangemax)
  105. VARx(int, fdchangecnt)
  106. VARx(ANHE *, timers)
  107. VARx(int, timermax)
  108. VARx(int, timercnt)
  109. #if EV_PERIODIC_ENABLE || EV_GENWRAP
  110. VARx(ANHE *, periodics)
  111. VARx(int, periodicmax)
  112. VARx(int, periodiccnt)
  113. #endif
  114. #if EV_IDLE_ENABLE || EV_GENWRAP
  115. VAR (idles, ev_idle **idles [NUMPRI])
  116. VAR (idlemax, int idlemax [NUMPRI])
  117. VAR (idlecnt, int idlecnt [NUMPRI])
  118. #endif
  119. VARx(int, idleall) /* total number */
  120. VARx(struct ev_prepare **, prepares)
  121. VARx(int, preparemax)
  122. VARx(int, preparecnt)
  123. VARx(struct ev_check **, checks)
  124. VARx(int, checkmax)
  125. VARx(int, checkcnt)
  126. #if EV_FORK_ENABLE || EV_GENWRAP
  127. VARx(struct ev_fork **, forks)
  128. VARx(int, forkmax)
  129. VARx(int, forkcnt)
  130. #endif
  131. VARx(EV_ATOMIC_T, gotasync)
  132. #if EV_ASYNC_ENABLE || EV_GENWRAP
  133. VARx(struct ev_async **, asyncs)
  134. VARx(int, asyncmax)
  135. VARx(int, asynccnt)
  136. #endif
  137. #if EV_USE_INOTIFY || EV_GENWRAP
  138. VARx(int, fs_fd)
  139. VARx(ev_io, fs_w)
  140. VARx(char, fs_2625) /* whether we are running in linux 2.6.25 or newer */
  141. VAR (fs_hash, ANFS fs_hash [EV_INOTIFY_HASHSIZE])
  142. #endif
  143. #if EV_MINIMAL < 2 || EV_GENWRAP
  144. VARx(unsigned int, loop_count) /* total number of loop iterations/blocks */
  145. VARx(unsigned int, loop_depth) /* #ev_loop enters - #ev_loop leaves */
  146. VARx(void *, userdata)
  147. VAR (release_cb, void (*release_cb)(EV_P))
  148. VAR (acquire_cb, void (*acquire_cb)(EV_P))
  149. VAR (invoke_cb , void (*invoke_cb) (EV_P))
  150. #endif
  151. #undef VARx