Path: blob/main/crypto/krb5/src/util/verto/ev_vars.h
34907 views
/*1* loop member variable declarations2*3* Copyright (c) 2007,2008,2009,2010,2011,2012,2013 Marc Alexander Lehmann <[email protected]>4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without modifica-7* tion, are permitted provided that the following conditions are met:8*9* 1. Redistributions of source code must retain the above copyright notice,10* this list of conditions and the following disclaimer.11*12* 2. Redistributions in binary form must reproduce the above copyright13* notice, this list of conditions and the following disclaimer in the14* documentation and/or other materials provided with the distribution.15*16* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED17* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER-18* CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO19* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-20* CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,21* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;22* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,23* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTH-24* ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED25* OF THE POSSIBILITY OF SUCH DAMAGE.26*27* Alternatively, the contents of this file may be used under the terms of28* the GNU General Public License ("GPL") version 2 or any later version,29* in which case the provisions of the GPL are applicable instead of30* the above. If you wish to allow the use of your version of this file31* only under the terms of the GPL and not to allow others to use your32* version of this file under the BSD license, indicate your decision33* by deleting the provisions above and replace them with the notice34* and other provisions required by the GPL. If you do not delete the35* provisions above, a recipient may use your version of this file under36* either the BSD or the GPL.37*/3839#define VARx(type,name) VAR(name, type name)4041VARx(ev_tstamp, now_floor) /* last time we refreshed rt_time */42VARx(ev_tstamp, mn_now) /* monotonic clock "now" */43VARx(ev_tstamp, rtmn_diff) /* difference realtime - monotonic time */4445/* for reverse feeding of events */46VARx(W *, rfeeds)47VARx(int, rfeedmax)48VARx(int, rfeedcnt)4950VAR (pendings, ANPENDING *pendings [NUMPRI])51VAR (pendingmax, int pendingmax [NUMPRI])52VAR (pendingcnt, int pendingcnt [NUMPRI])53VARx(int, pendingpri) /* highest priority currently pending */54VARx(ev_prepare, pending_w) /* dummy pending watcher */5556VARx(ev_tstamp, io_blocktime)57VARx(ev_tstamp, timeout_blocktime)5859VARx(int, backend)60VARx(int, activecnt) /* total number of active events ("refcount") */61VARx(EV_ATOMIC_T, loop_done) /* signal by ev_break */6263VARx(int, backend_fd)64VARx(ev_tstamp, backend_mintime) /* assumed typical timer resolution */65VAR (backend_modify, void (*backend_modify)(EV_P_ int fd, int oev, int nev))66VAR (backend_poll , void (*backend_poll)(EV_P_ ev_tstamp timeout))6768VARx(ANFD *, anfds)69VARx(int, anfdmax)7071VAR (evpipe, int evpipe [2])72VARx(ev_io, pipe_w)73VARx(EV_ATOMIC_T, pipe_write_wanted)74VARx(EV_ATOMIC_T, pipe_write_skipped)7576#if !defined(_WIN32) || EV_GENWRAP77VARx(pid_t, curpid)78#endif7980VARx(char, postfork) /* true if we need to recreate kernel state after fork */8182#if EV_USE_SELECT || EV_GENWRAP83VARx(void *, vec_ri)84VARx(void *, vec_ro)85VARx(void *, vec_wi)86VARx(void *, vec_wo)87#if defined(_WIN32) || EV_GENWRAP88VARx(void *, vec_eo)89#endif90VARx(int, vec_max)91#endif9293#if EV_USE_POLL || EV_GENWRAP94VARx(struct pollfd *, polls)95VARx(int, pollmax)96VARx(int, pollcnt)97VARx(int *, pollidxs) /* maps fds into structure indices */98VARx(int, pollidxmax)99#endif100101#if EV_USE_EPOLL || EV_GENWRAP102VARx(struct epoll_event *, epoll_events)103VARx(int, epoll_eventmax)104VARx(int *, epoll_eperms)105VARx(int, epoll_epermcnt)106VARx(int, epoll_epermmax)107#endif108109#if EV_USE_KQUEUE || EV_GENWRAP110VARx(pid_t, kqueue_fd_pid)111VARx(struct kevent *, kqueue_changes)112VARx(int, kqueue_changemax)113VARx(int, kqueue_changecnt)114VARx(struct kevent *, kqueue_events)115VARx(int, kqueue_eventmax)116#endif117118#if EV_USE_PORT || EV_GENWRAP119VARx(struct port_event *, port_events)120VARx(int, port_eventmax)121#endif122123#if EV_USE_IOCP || EV_GENWRAP124VARx(HANDLE, iocp)125#endif126127VARx(int *, fdchanges)128VARx(int, fdchangemax)129VARx(int, fdchangecnt)130131VARx(ANHE *, timers)132VARx(int, timermax)133VARx(int, timercnt)134135#if EV_PERIODIC_ENABLE || EV_GENWRAP136VARx(ANHE *, periodics)137VARx(int, periodicmax)138VARx(int, periodiccnt)139#endif140141#if EV_IDLE_ENABLE || EV_GENWRAP142VAR (idles, ev_idle **idles [NUMPRI])143VAR (idlemax, int idlemax [NUMPRI])144VAR (idlecnt, int idlecnt [NUMPRI])145#endif146VARx(int, idleall) /* total number */147148VARx(struct ev_prepare **, prepares)149VARx(int, preparemax)150VARx(int, preparecnt)151152VARx(struct ev_check **, checks)153VARx(int, checkmax)154VARx(int, checkcnt)155156#if EV_FORK_ENABLE || EV_GENWRAP157VARx(struct ev_fork **, forks)158VARx(int, forkmax)159VARx(int, forkcnt)160#endif161162#if EV_CLEANUP_ENABLE || EV_GENWRAP163VARx(struct ev_cleanup **, cleanups)164VARx(int, cleanupmax)165VARx(int, cleanupcnt)166#endif167168#if EV_ASYNC_ENABLE || EV_GENWRAP169VARx(EV_ATOMIC_T, async_pending)170VARx(struct ev_async **, asyncs)171VARx(int, asyncmax)172VARx(int, asynccnt)173#endif174175#if EV_USE_INOTIFY || EV_GENWRAP176VARx(int, fs_fd)177VARx(ev_io, fs_w)178VARx(char, fs_2625) /* whether we are running in linux 2.6.25 or newer */179VAR (fs_hash, ANFS fs_hash [EV_INOTIFY_HASHSIZE])180#endif181182VARx(EV_ATOMIC_T, sig_pending)183#if EV_USE_SIGNALFD || EV_GENWRAP184VARx(int, sigfd)185VARx(ev_io, sigfd_w)186VARx(sigset_t, sigfd_set)187#endif188189VARx(unsigned int, origflags) /* original loop flags */190191#if EV_FEATURE_API || EV_GENWRAP192VARx(unsigned int, loop_count) /* total number of loop iterations/blocks */193VARx(unsigned int, loop_depth) /* #ev_run enters - #ev_run leaves */194195VARx(void *, userdata)196/* C++ doesn't support the ev_loop_callback typedef here. stinks. */197VAR (release_cb, void (*release_cb)(EV_P) EV_THROW)198VAR (acquire_cb, void (*acquire_cb)(EV_P) EV_THROW)199VAR (invoke_cb , ev_loop_callback invoke_cb)200#endif201202#undef VARx203204205206