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.

163 lines
4.9 KiB

14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
  1. /*
  2. * loop member variable declarations
  3. *
  4. * Copyright (c) 2007,2008 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 int, loop_count) /* total number of loop iterations/blocks */
  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. #if EV_USE_EVENTFD || EV_GENWRAP
  53. VARx(int, evfd)
  54. #endif
  55. VAR (evpipe, int evpipe [2])
  56. VARx(ev_io, pipeev)
  57. #if !defined(_WIN32) || EV_GENWRAP
  58. VARx(pid_t, curpid)
  59. #endif
  60. VARx(int, postfork) /* true if we need to recreate kernel state after fork */
  61. #if EV_USE_SELECT || EV_GENWRAP
  62. VARx(void *, vec_ri)
  63. VARx(void *, vec_ro)
  64. VARx(void *, vec_wi)
  65. VARx(void *, vec_wo)
  66. #if defined(_WIN32) || EV_GENWRAP
  67. VARx(void *, vec_eo)
  68. #endif
  69. VARx(int, vec_max)
  70. #endif
  71. #if EV_USE_POLL || EV_GENWRAP
  72. VARx(struct pollfd *, polls)
  73. VARx(int, pollmax)
  74. VARx(int, pollcnt)
  75. VARx(int *, pollidxs) /* maps fds into structure indices */
  76. VARx(int, pollidxmax)
  77. #endif
  78. #if EV_USE_EPOLL || EV_GENWRAP
  79. VARx(struct epoll_event *, epoll_events)
  80. VARx(int, epoll_eventmax)
  81. #endif
  82. #if EV_USE_KQUEUE || EV_GENWRAP
  83. VARx(struct kevent *, kqueue_changes)
  84. VARx(int, kqueue_changemax)
  85. VARx(int, kqueue_changecnt)
  86. VARx(struct kevent *, kqueue_events)
  87. VARx(int, kqueue_eventmax)
  88. #endif
  89. #if EV_USE_PORT || EV_GENWRAP
  90. VARx(struct port_event *, port_events)
  91. VARx(int, port_eventmax)
  92. #endif
  93. VARx(ANFD *, anfds)
  94. VARx(int, anfdmax)
  95. VAR (pendings, ANPENDING *pendings [NUMPRI])
  96. VAR (pendingmax, int pendingmax [NUMPRI])
  97. VAR (pendingcnt, int pendingcnt [NUMPRI])
  98. VARx(int *, fdchanges)
  99. VARx(int, fdchangemax)
  100. VARx(int, fdchangecnt)
  101. VARx(ANHE *, timers)
  102. VARx(int, timermax)
  103. VARx(int, timercnt)
  104. #if EV_PERIODIC_ENABLE || EV_GENWRAP
  105. VARx(ANHE *, periodics)
  106. VARx(int, periodicmax)
  107. VARx(int, periodiccnt)
  108. #endif
  109. #if EV_IDLE_ENABLE || EV_GENWRAP
  110. VAR (idles, ev_idle **idles [NUMPRI])
  111. VAR (idlemax, int idlemax [NUMPRI])
  112. VAR (idlecnt, int idlecnt [NUMPRI])
  113. #endif
  114. VARx(int, idleall) /* total number */
  115. VARx(struct ev_prepare **, prepares)
  116. VARx(int, preparemax)
  117. VARx(int, preparecnt)
  118. VARx(struct ev_check **, checks)
  119. VARx(int, checkmax)
  120. VARx(int, checkcnt)
  121. #if EV_FORK_ENABLE || EV_GENWRAP
  122. VARx(struct ev_fork **, forks)
  123. VARx(int, forkmax)
  124. VARx(int, forkcnt)
  125. #endif
  126. VARx(EV_ATOMIC_T, gotasync)
  127. #if EV_ASYNC_ENABLE || EV_GENWRAP
  128. VARx(struct ev_async **, asyncs)
  129. VARx(int, asyncmax)
  130. VARx(int, asynccnt)
  131. #endif
  132. #if EV_USE_INOTIFY || EV_GENWRAP
  133. VARx(int, fs_fd)
  134. VARx(ev_io, fs_w)
  135. VAR (fs_hash, ANFS fs_hash [EV_INOTIFY_HASHSIZE])
  136. #endif
  137. #undef VARx