diff options
Diffstat (limited to 'python/gevent/libev')
-rw-r--r-- | python/gevent/libev/__init__.py | 0 | ||||
-rw-r--r-- | python/gevent/libev/_corecffi_build.py | 75 | ||||
-rw-r--r-- | python/gevent/libev/_corecffi_cdef.c | 226 | ||||
-rw-r--r-- | python/gevent/libev/_corecffi_source.c | 45 | ||||
-rw-r--r-- | python/gevent/libev/callbacks.c | 225 | ||||
-rw-r--r-- | python/gevent/libev/callbacks.h | 43 | ||||
-rw-r--r-- | python/gevent/libev/corecext.ppyx | 1134 | ||||
-rw-r--r-- | python/gevent/libev/corecext.pyx | 2110 | ||||
-rw-r--r-- | python/gevent/libev/corecffi.py | 1132 | ||||
-rw-r--r-- | python/gevent/libev/gevent.corecext.c | 33465 | ||||
-rw-r--r-- | python/gevent/libev/libev.h | 66 | ||||
-rw-r--r-- | python/gevent/libev/libev.pxd | 208 | ||||
-rw-r--r-- | python/gevent/libev/libev_vfd.h | 223 | ||||
-rw-r--r-- | python/gevent/libev/stathelper.c | 187 |
14 files changed, 39139 insertions, 0 deletions
diff --git a/python/gevent/libev/__init__.py b/python/gevent/libev/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/python/gevent/libev/__init__.py diff --git a/python/gevent/libev/_corecffi_build.py b/python/gevent/libev/_corecffi_build.py new file mode 100644 index 0000000..a6025fc --- /dev/null +++ b/python/gevent/libev/_corecffi_build.py @@ -0,0 +1,75 @@ +# pylint: disable=no-member + +# This module is only used to create and compile the gevent._corecffi module; +# nothing should be directly imported from it except `ffi`, which should only be +# used for `ffi.compile()`; programs should import gevent._corecfffi. +# However, because we are using "out-of-line" mode, it is necessary to examine +# this file to know what functions are created and available on the generated +# module. +from __future__ import absolute_import, print_function +import sys +import os +import os.path # pylint:disable=no-name-in-module +import struct + +__all__ = [] + + +def system_bits(): + return struct.calcsize('P') * 8 + + +def st_nlink_type(): + if sys.platform == "darwin" or sys.platform.startswith("freebsd"): + return "short" + if system_bits() == 32: + return "unsigned long" + return "long long" + + +from cffi import FFI +ffi = FFI() + +thisdir = os.path.dirname(os.path.abspath(__file__)) +def read_source(name): + with open(os.path.join(thisdir, name), 'r') as f: + return f.read() + +_cdef = read_source('_corecffi_cdef.c') +_source = read_source('_corecffi_source.c') + +_cdef = _cdef.replace('#define GEVENT_ST_NLINK_T int', '') +_cdef = _cdef.replace('#define GEVENT_STRUCT_DONE int', '') +_cdef = _cdef.replace('GEVENT_ST_NLINK_T', st_nlink_type()) +_cdef = _cdef.replace("GEVENT_STRUCT_DONE _;", '...;') + + +if sys.platform.startswith('win'): + # We must have the vfd_open, etc, functions on + # Windows. But on other platforms, going through + # CFFI to just return the file-descriptor is slower + # than just doing it in Python, so we check for and + # workaround their absence in corecffi.py + _cdef += """ +typedef int... vfd_socket_t; +int vfd_open(vfd_socket_t); +vfd_socket_t vfd_get(int); +void vfd_free(int); +""" + + + +include_dirs = [ + thisdir, # libev_vfd.h + os.path.abspath(os.path.join(thisdir, '..', '..', '..', 'deps', 'libev')), +] +ffi.cdef(_cdef) +ffi.set_source('gevent.libev._corecffi', _source, include_dirs=include_dirs) + +if __name__ == '__main__': + # XXX: Note, on Windows, we would need to specify the external libraries + # that should be linked in, such as ws2_32 and (because libev_vfd.h makes + # Python.h calls) the proper Python library---at least for PyPy. I never got + # that to work though, and calling python functions is strongly discouraged + # from CFFI code. + ffi.compile() diff --git a/python/gevent/libev/_corecffi_cdef.c b/python/gevent/libev/_corecffi_cdef.c new file mode 100644 index 0000000..d212887 --- /dev/null +++ b/python/gevent/libev/_corecffi_cdef.c @@ -0,0 +1,226 @@ +/* libev interface */ + +#define EV_MINPRI ... +#define EV_MAXPRI ... + +#define EV_VERSION_MAJOR ... +#define EV_VERSION_MINOR ... + +#define EV_UNDEF ... +#define EV_NONE ... +#define EV_READ ... +#define EV_WRITE ... +#define EV__IOFDSET ... +#define EV_TIMER ... +#define EV_PERIODIC ... +#define EV_SIGNAL ... +#define EV_CHILD ... +#define EV_STAT ... +#define EV_IDLE ... +#define EV_PREPARE ... +#define EV_CHECK ... +#define EV_EMBED ... +#define EV_FORK ... +#define EV_CLEANUP ... +#define EV_ASYNC ... +#define EV_CUSTOM ... +#define EV_ERROR ... + +#define EVFLAG_AUTO ... +#define EVFLAG_NOENV ... +#define EVFLAG_FORKCHECK ... +#define EVFLAG_NOINOTIFY ... +#define EVFLAG_SIGNALFD ... +#define EVFLAG_NOSIGMASK ... + +#define EVBACKEND_SELECT ... +#define EVBACKEND_POLL ... +#define EVBACKEND_EPOLL ... +#define EVBACKEND_KQUEUE ... +#define EVBACKEND_DEVPOLL ... +#define EVBACKEND_PORT ... +/* #define EVBACKEND_IOCP ... */ + +#define EVBACKEND_ALL ... +#define EVBACKEND_MASK ... + +#define EVRUN_NOWAIT ... +#define EVRUN_ONCE ... + +#define EVBREAK_CANCEL ... +#define EVBREAK_ONE ... +#define EVBREAK_ALL ... + +/* markers for the CFFI parser. Replaced when the string is read. */ +#define GEVENT_STRUCT_DONE int +#define GEVENT_ST_NLINK_T int + +struct ev_loop { + int backend_fd; + int activecnt; + GEVENT_STRUCT_DONE _; +}; + +// Watcher types +// base for all watchers +struct ev_watcher{ + GEVENT_STRUCT_DONE _; +}; + +struct ev_io { + int fd; + int events; + void* data; + GEVENT_STRUCT_DONE _; +}; +struct ev_timer { + double at; + void* data; + GEVENT_STRUCT_DONE _; +}; +struct ev_signal { + void* data; + GEVENT_STRUCT_DONE _; +}; +struct ev_idle { + void* data; + GEVENT_STRUCT_DONE _; +}; +struct ev_prepare { + void* data; + GEVENT_STRUCT_DONE _; +}; +struct ev_check { + void* data; + GEVENT_STRUCT_DONE _; +}; +struct ev_fork { + void* data; + GEVENT_STRUCT_DONE _; +}; +struct ev_async { + void* data; + GEVENT_STRUCT_DONE _; +}; + +struct ev_child { + int pid; + int rpid; + int rstatus; + void* data; + GEVENT_STRUCT_DONE _; +}; + +struct stat { + GEVENT_ST_NLINK_T st_nlink; + GEVENT_STRUCT_DONE _; +}; + +struct ev_stat { + struct stat attr; + const char* path; + struct stat prev; + double interval; + void* data; + GEVENT_STRUCT_DONE _; +}; + +typedef double ev_tstamp; + +int ev_version_major(); +int ev_version_minor(); + +unsigned int ev_supported_backends (void); +unsigned int ev_recommended_backends (void); +unsigned int ev_embeddable_backends (void); + +ev_tstamp ev_time (void); +void ev_set_syserr_cb(void *); + +int ev_priority(void*); +void ev_set_priority(void*, int); + +int ev_is_pending(void*); +int ev_is_active(void*); +void ev_io_init(struct ev_io*, void* callback, int fd, int events); +void ev_io_start(struct ev_loop*, struct ev_io*); +void ev_io_stop(struct ev_loop*, struct ev_io*); +void ev_feed_event(struct ev_loop*, void*, int); + +void ev_timer_init(struct ev_timer*, void *callback, double, double); +void ev_timer_start(struct ev_loop*, struct ev_timer*); +void ev_timer_stop(struct ev_loop*, struct ev_timer*); +void ev_timer_again(struct ev_loop*, struct ev_timer*); + +void ev_signal_init(struct ev_signal*, void* callback, int); +void ev_signal_start(struct ev_loop*, struct ev_signal*); +void ev_signal_stop(struct ev_loop*, struct ev_signal*); + +void ev_idle_init(struct ev_idle*, void* callback); +void ev_idle_start(struct ev_loop*, struct ev_idle*); +void ev_idle_stop(struct ev_loop*, struct ev_idle*); + +void ev_prepare_init(struct ev_prepare*, void* callback); +void ev_prepare_start(struct ev_loop*, struct ev_prepare*); +void ev_prepare_stop(struct ev_loop*, struct ev_prepare*); + +void ev_check_init(struct ev_check*, void* callback); +void ev_check_start(struct ev_loop*, struct ev_check*); +void ev_check_stop(struct ev_loop*, struct ev_check*); + +void ev_fork_init(struct ev_fork*, void* callback); +void ev_fork_start(struct ev_loop*, struct ev_fork*); +void ev_fork_stop(struct ev_loop*, struct ev_fork*); + +void ev_async_init(struct ev_async*, void* callback); +void ev_async_start(struct ev_loop*, struct ev_async*); +void ev_async_stop(struct ev_loop*, struct ev_async*); +void ev_async_send(struct ev_loop*, struct ev_async*); +int ev_async_pending(struct ev_async*); + +void ev_child_init(struct ev_child*, void* callback, int, int); +void ev_child_start(struct ev_loop*, struct ev_child*); +void ev_child_stop(struct ev_loop*, struct ev_child*); + +void ev_stat_init(struct ev_stat*, void* callback, char*, double); +void ev_stat_start(struct ev_loop*, struct ev_stat*); +void ev_stat_stop(struct ev_loop*, struct ev_stat*); + +struct ev_loop *ev_default_loop (unsigned int flags); +struct ev_loop* ev_loop_new(unsigned int flags); +void ev_loop_destroy(struct ev_loop*); +void ev_loop_fork(struct ev_loop*); +int ev_is_default_loop (struct ev_loop *); +unsigned int ev_iteration(struct ev_loop*); +unsigned int ev_depth(struct ev_loop*); +unsigned int ev_backend(struct ev_loop*); +void ev_verify(struct ev_loop*); +void ev_run(struct ev_loop*, int flags); + +ev_tstamp ev_now (struct ev_loop *); +void ev_now_update (struct ev_loop *); /* update event loop time */ +void ev_ref(struct ev_loop*); +void ev_unref(struct ev_loop*); +void ev_break(struct ev_loop*, int); +unsigned int ev_pending_count(struct ev_loop*); + +struct ev_loop* gevent_ev_default_loop(unsigned int flags); +void gevent_install_sigchld_handler(); +void gevent_reset_sigchld_handler(); + +void (*gevent_noop)(struct ev_loop *_loop, struct ev_timer *w, int revents); +void ev_sleep (ev_tstamp delay); /* sleep for a while */ + +/* gevent callbacks */ +static int (*python_callback)(void* handle, int revents); +static void (*python_handle_error)(void* handle, int revents); +static void (*python_stop)(void* handle); + +/* + * We use a single C callback for every watcher type, which in turn calls the + * Python callbacks. The ev_watcher pointer type can be used for every watcher type + * because they all start with the same members---libev itself relies on this. Each + * watcher types has a 'void* data' that stores the CFFI handle to the Python watcher + * object. + */ +static void _gevent_generic_callback(struct ev_loop* loop, struct ev_watcher* watcher, int revents); diff --git a/python/gevent/libev/_corecffi_source.c b/python/gevent/libev/_corecffi_source.c new file mode 100644 index 0000000..d179ce6 --- /dev/null +++ b/python/gevent/libev/_corecffi_source.c @@ -0,0 +1,45 @@ +// passed to the real C compiler +#define LIBEV_EMBED 1 + +#ifdef _WIN32 +#define EV_STANDALONE 1 +#include "libev_vfd.h" +#endif + + +#include "libev.h" + +static void +_gevent_noop(struct ev_loop *_loop, struct ev_timer *w, int revents) { } + +void (*gevent_noop)(struct ev_loop *, struct ev_timer *, int) = &_gevent_noop; +static int (*python_callback)(void* handle, int revents); +static void (*python_handle_error)(void* handle, int revents); +static void (*python_stop)(void* handle); + +static void _gevent_generic_callback(struct ev_loop* loop, + struct ev_watcher* watcher, + int revents) +{ + void* handle = watcher->data; + int cb_result = python_callback(handle, revents); + switch(cb_result) { + case -1: + // in case of exception, call self.loop.handle_error; + // this function is also responsible for stopping the watcher + // and allowing memory to be freed + python_handle_error(handle, revents); + break; + case 0: + // Code to stop the event. Note that if python_callback + // has disposed of the last reference to the handle, + // `watcher` could now be invalid/disposed memory! + if (!ev_is_active(watcher)) { + python_stop(handle); + } + break; + default: + assert(cb_result == 1); + // watcher is already stopped and dead, nothing to do. + } +} diff --git a/python/gevent/libev/callbacks.c b/python/gevent/libev/callbacks.c new file mode 100644 index 0000000..f65c67f --- /dev/null +++ b/python/gevent/libev/callbacks.c @@ -0,0 +1,225 @@ +/* Copyright (c) 2011-2012 Denis Bilenko. See LICENSE for details. */ +#ifdef Py_PYTHON_H + +/* the name changes depending on our file layout and --module-name option */ +#define _GEVENTLOOP struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop + + +static void gevent_handle_error(struct PyGeventLoopObject* loop, PyObject* context) { + PyThreadState *tstate; + PyObject *type, *value, *traceback, *result; + tstate = PyThreadState_GET(); + type = tstate->curexc_type; + if (!type) + return; + value = tstate->curexc_value; + traceback = tstate->curexc_traceback; + if (!value) value = Py_None; + if (!traceback) traceback = Py_None; + + Py_INCREF(type); + Py_INCREF(value); + Py_INCREF(traceback); + + PyErr_Clear(); + + result = ((_GEVENTLOOP *)loop->__pyx_vtab)->handle_error(loop, context, type, value, traceback, 0); + + if (result) { + Py_DECREF(result); + } + else { + PyErr_Print(); + PyErr_Clear(); + } + + Py_DECREF(type); + Py_DECREF(value); + Py_DECREF(traceback); +} + + +static CYTHON_INLINE void gevent_check_signals(struct PyGeventLoopObject* loop) { + if (!ev_is_default_loop(loop->_ptr)) { + /* only reporting signals on the default loop */ + return; + } + PyErr_CheckSignals(); + if (PyErr_Occurred()) gevent_handle_error(loop, Py_None); +} + +#define GET_OBJECT(PY_TYPE, EV_PTR, MEMBER) \ + ((struct PY_TYPE *)(((char *)EV_PTR) - offsetof(struct PY_TYPE, MEMBER))) + + +#ifdef WITH_THREAD +#define GIL_DECLARE PyGILState_STATE ___save +#define GIL_ENSURE ___save = PyGILState_Ensure(); +#define GIL_RELEASE PyGILState_Release(___save); +#else +#define GIL_DECLARE +#define GIL_ENSURE +#define GIL_RELEASE +#endif + + +static void gevent_stop(PyObject* watcher, struct PyGeventLoopObject* loop) { + PyObject *result, *method; + int error; + error = 1; + method = PyObject_GetAttrString(watcher, "stop"); + if (method) { + result = PyObject_Call(method, __pyx_empty_tuple, NULL); + if (result) { + Py_DECREF(result); + error = 0; + } + Py_DECREF(method); + } + if (error) { + gevent_handle_error(loop, watcher); + } +} + + +static void gevent_callback(struct PyGeventLoopObject* loop, PyObject* callback, PyObject* args, PyObject* watcher, void *c_watcher, int revents) { + GIL_DECLARE; + PyObject *result, *py_events; + long length; + py_events = 0; + GIL_ENSURE; + Py_INCREF(loop); + Py_INCREF(callback); + Py_INCREF(args); + Py_INCREF(watcher); + gevent_check_signals(loop); + if (args == Py_None) { + args = __pyx_empty_tuple; + } + length = PyTuple_Size(args); + if (length < 0) { + gevent_handle_error(loop, watcher); + goto end; + } + if (length > 0 && PyTuple_GET_ITEM(args, 0) == GEVENT_CORE_EVENTS) { + py_events = PyInt_FromLong(revents); + if (!py_events) { + gevent_handle_error(loop, watcher); + goto end; + } + PyTuple_SET_ITEM(args, 0, py_events); + } + else { + py_events = NULL; + } + result = PyObject_Call(callback, args, NULL); + if (result) { + Py_DECREF(result); + } + else { + gevent_handle_error(loop, watcher); + if (revents & (EV_READ|EV_WRITE)) { + /* io watcher: not stopping it may cause the failing callback to be called repeatedly */ + gevent_stop(watcher, loop); + goto end; + } + } + if (!ev_is_active(c_watcher)) { + /* Watcher was stopped, maybe by libev. Let's call stop() to clean up + * 'callback' and 'args' properties, do Py_DECREF() and ev_ref() if necessary. + * BTW, we don't need to check for EV_ERROR, because libev stops the watcher in that case. */ + gevent_stop(watcher, loop); + } +end: + if (py_events) { + Py_DECREF(py_events); + PyTuple_SET_ITEM(args, 0, GEVENT_CORE_EVENTS); + } + Py_DECREF(watcher); + Py_DECREF(args); + Py_DECREF(callback); + Py_DECREF(loop); + GIL_RELEASE; +} + + +static void gevent_call(struct PyGeventLoopObject* loop, struct PyGeventCallbackObject* cb) { + /* no need for GIL here because it is only called from run_callbacks which already has GIL */ + PyObject *result, *callback, *args; + if (!loop || !cb) + return; + callback = cb->callback; + args = cb->args; + if (!callback || !args) + return; + if (callback == Py_None || args == Py_None) + return; + Py_INCREF(loop); + Py_INCREF(callback); + Py_INCREF(args); + + Py_INCREF(Py_None); + Py_DECREF(cb->callback); + cb->callback = Py_None; + + result = PyObject_Call(callback, args, NULL); + if (result) { + Py_DECREF(result); + } + else { + gevent_handle_error(loop, (PyObject*)cb); + } + + Py_INCREF(Py_None); + Py_DECREF(cb->args); + cb->args = Py_None; + + Py_DECREF(callback); + Py_DECREF(args); + Py_DECREF(loop); +} + + +#undef DEFINE_CALLBACK +#define DEFINE_CALLBACK(WATCHER_LC, WATCHER_TYPE) \ + static void gevent_callback_##WATCHER_LC(struct ev_loop *_loop, void *c_watcher, int revents) { \ + struct PyGevent##WATCHER_TYPE##Object* watcher = GET_OBJECT(PyGevent##WATCHER_TYPE##Object, c_watcher, _watcher); \ + gevent_callback(watcher->loop, watcher->_callback, watcher->args, (PyObject*)watcher, c_watcher, revents); \ + } + + +DEFINE_CALLBACKS + + +static void gevent_run_callbacks(struct ev_loop *_loop, void *watcher, int revents) { + struct PyGeventLoopObject* loop; + PyObject *result; + GIL_DECLARE; + GIL_ENSURE; + loop = GET_OBJECT(PyGeventLoopObject, watcher, _prepare); + Py_INCREF(loop); + gevent_check_signals(loop); + result = ((_GEVENTLOOP *)loop->__pyx_vtab)->_run_callbacks(loop); + if (result) { + Py_DECREF(result); + } + else { + PyErr_Print(); + PyErr_Clear(); + } + Py_DECREF(loop); + GIL_RELEASE; +} + +#if defined(_WIN32) + +static void gevent_periodic_signal_check(struct ev_loop *_loop, void *watcher, int revents) { + GIL_DECLARE; + GIL_ENSURE; + gevent_check_signals(GET_OBJECT(PyGeventLoopObject, watcher, _periodic_signal_checker)); + GIL_RELEASE; +} + +#endif /* _WIN32 */ + +#endif /* Py_PYTHON_H */ diff --git a/python/gevent/libev/callbacks.h b/python/gevent/libev/callbacks.h new file mode 100644 index 0000000..669ea9e --- /dev/null +++ b/python/gevent/libev/callbacks.h @@ -0,0 +1,43 @@ +#define DEFINE_CALLBACK(WATCHER_LC, WATCHER_TYPE) \ + static void gevent_callback_##WATCHER_LC(struct ev_loop *, void *, int); + + +#define DEFINE_CALLBACKS0 \ + DEFINE_CALLBACK(io, IO); \ + DEFINE_CALLBACK(timer, Timer); \ + DEFINE_CALLBACK(signal, Signal); \ + DEFINE_CALLBACK(idle, Idle); \ + DEFINE_CALLBACK(prepare, Prepare); \ + DEFINE_CALLBACK(check, Check); \ + DEFINE_CALLBACK(fork, Fork); \ + DEFINE_CALLBACK(async, Async); \ + DEFINE_CALLBACK(stat, Stat); + + +#ifndef _WIN32 + +#define DEFINE_CALLBACKS \ + DEFINE_CALLBACKS0 \ + DEFINE_CALLBACK(child, Child) + +#else + +#define DEFINE_CALLBACKS DEFINE_CALLBACKS0 + +#endif + + +DEFINE_CALLBACKS + + +static void gevent_run_callbacks(struct ev_loop *, void *, int); +struct PyGeventLoopObject; +static void gevent_handle_error(struct PyGeventLoopObject* loop, PyObject* context); +struct PyGeventCallbackObject; +static void gevent_call(struct PyGeventLoopObject* loop, struct PyGeventCallbackObject* cb); + +#if defined(_WIN32) +static void gevent_periodic_signal_check(struct ev_loop *, void *, int); +#endif + +static void gevent_noop(struct ev_loop *_loop, void *watcher, int revents) { } diff --git a/python/gevent/libev/corecext.ppyx b/python/gevent/libev/corecext.ppyx new file mode 100644 index 0000000..a474d7e --- /dev/null +++ b/python/gevent/libev/corecext.ppyx @@ -0,0 +1,1134 @@ +# Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details. +# This directive, supported in Cython 0.24+, causes sources files to be +# much smaller and thus cythonpp.py to be slightly faster. But it does make +# debugging more difficult. +# cython: emit_code_comments=False +cimport cython +cimport libev +# Note this is not the standard cython 'cpython' (which has a backwards compat alias of 'python') +# it's our custom def. If it's not on the include path, we get warned. +from python cimport * + +# Work around lack of absolute_import in Cython +# Note for PY3: not doing so will leave reference to locals() on import +# (reproducible under Python 3.3, not under Python 3.4; see test__refcount_core.py) +sys = __import__('sys', level=0) +os = __import__('os', level=0) +traceback = __import__('traceback', level=0) +signalmodule = __import__('signal', level=0) + + +__all__ = ['get_version', + 'get_header_version', + 'supported_backends', + 'recommended_backends', + 'embeddable_backends', + 'time', + 'loop'] + +cdef tuple integer_types + +if sys.version_info[0] >= 3: + integer_types = int, +else: + integer_types = (int, long) + + +cdef extern from "callbacks.h": + void gevent_callback_io(libev.ev_loop, void*, int) + void gevent_callback_timer(libev.ev_loop, void*, int) + void gevent_callback_signal(libev.ev_loop, void*, int) + void gevent_callback_idle(libev.ev_loop, void*, int) + void gevent_callback_prepare(libev.ev_loop, void*, int) + void gevent_callback_check(libev.ev_loop, void*, int) + void gevent_callback_fork(libev.ev_loop, void*, int) + void gevent_callback_async(libev.ev_loop, void*, int) + void gevent_callback_child(libev.ev_loop, void*, int) + void gevent_callback_stat(libev.ev_loop, void*, int) + void gevent_run_callbacks(libev.ev_loop, void*, int) + void gevent_periodic_signal_check(libev.ev_loop, void*, int) + void gevent_call(loop, callback) + void gevent_noop(libev.ev_loop, void*, int) + +cdef extern from *: + int errno + +cdef extern from "stathelper.c": + object _pystat_fromstructstat(void*) + + +UNDEF = libev.EV_UNDEF +NONE = libev.EV_NONE +READ = libev.EV_READ +WRITE = libev.EV_WRITE +TIMER = libev.EV_TIMER +PERIODIC = libev.EV_PERIODIC +SIGNAL = libev.EV_SIGNAL +CHILD = libev.EV_CHILD +STAT = libev.EV_STAT +IDLE = libev.EV_IDLE +PREPARE = libev.EV_PREPARE +CHECK = libev.EV_CHECK +EMBED = libev.EV_EMBED +FORK = libev.EV_FORK +CLEANUP = libev.EV_CLEANUP +ASYNC = libev.EV_ASYNC +CUSTOM = libev.EV_CUSTOM +ERROR = libev.EV_ERROR + +READWRITE = libev.EV_READ | libev.EV_WRITE + +MINPRI = libev.EV_MINPRI +MAXPRI = libev.EV_MAXPRI + +BACKEND_PORT = libev.EVBACKEND_PORT +BACKEND_KQUEUE = libev.EVBACKEND_KQUEUE +BACKEND_EPOLL = libev.EVBACKEND_EPOLL +BACKEND_POLL = libev.EVBACKEND_POLL +BACKEND_SELECT = libev.EVBACKEND_SELECT +FORKCHECK = libev.EVFLAG_FORKCHECK +NOINOTIFY = libev.EVFLAG_NOINOTIFY +SIGNALFD = libev.EVFLAG_SIGNALFD +NOSIGMASK = libev.EVFLAG_NOSIGMASK + + +@cython.internal +cdef class _EVENTSType: + + def __repr__(self): + return 'gevent.core.EVENTS' + + +cdef public object GEVENT_CORE_EVENTS = _EVENTSType() +EVENTS = GEVENT_CORE_EVENTS + + +def get_version(): + return 'libev-%d.%02d' % (libev.ev_version_major(), libev.ev_version_minor()) + + +def get_header_version(): + return 'libev-%d.%02d' % (libev.EV_VERSION_MAJOR, libev.EV_VERSION_MINOR) + + +# This list backends in the order they are actually tried by libev +_flags = [(libev.EVBACKEND_PORT, 'port'), + (libev.EVBACKEND_KQUEUE, 'kqueue'), + (libev.EVBACKEND_EPOLL, 'epoll'), + (libev.EVBACKEND_POLL, 'poll'), + (libev.EVBACKEND_SELECT, 'select'), + (libev.EVFLAG_NOENV, 'noenv'), + (libev.EVFLAG_FORKCHECK, 'forkcheck'), + (libev.EVFLAG_NOINOTIFY, 'noinotify'), + (libev.EVFLAG_SIGNALFD, 'signalfd'), + (libev.EVFLAG_NOSIGMASK, 'nosigmask')] + + +_flags_str2int = dict((string, flag) for (flag, string) in _flags) + + +_events = [(libev.EV_READ, 'READ'), + (libev.EV_WRITE, 'WRITE'), + (libev.EV__IOFDSET, '_IOFDSET'), + (libev.EV_PERIODIC, 'PERIODIC'), + (libev.EV_SIGNAL, 'SIGNAL'), + (libev.EV_CHILD, 'CHILD'), + (libev.EV_STAT, 'STAT'), + (libev.EV_IDLE, 'IDLE'), + (libev.EV_PREPARE, 'PREPARE'), + (libev.EV_CHECK, 'CHECK'), + (libev.EV_EMBED, 'EMBED'), + (libev.EV_FORK, 'FORK'), + (libev.EV_CLEANUP, 'CLEANUP'), + (libev.EV_ASYNC, 'ASYNC'), + (libev.EV_CUSTOM, 'CUSTOM'), + (libev.EV_ERROR, 'ERROR')] + + +cpdef _flags_to_list(unsigned int flags): + cdef list result = [] + for code, value in _flags: + if flags & code: + result.append(value) + flags &= ~code + if not flags: + break + if flags: + result.append(flags) + return result + + +if sys.version_info[0] >= 3: + basestring = (bytes, str) +else: + basestring = __builtins__.basestring + + +cpdef unsigned int _flags_to_int(object flags) except? -1: + # Note, that order does not matter, libev has its own predefined order + if not flags: + return 0 + if isinstance(flags, integer_types): + return flags + cdef unsigned int result = 0 + try: + if isinstance(flags, basestring): + flags = flags.split(',') + for value in flags: + value = value.strip().lower() + if value: + result |= _flags_str2int[value] + except KeyError as ex: + raise ValueError('Invalid backend or flag: %s\nPossible values: %s' % (ex, ', '.join(sorted(_flags_str2int.keys())))) + return result + + +cdef str _str_hex(object flag): + if isinstance(flag, integer_types): + return hex(flag) + return str(flag) + + +cpdef _check_flags(unsigned int flags): + cdef list as_list + flags &= libev.EVBACKEND_MASK + if not flags: + return + if not (flags & libev.EVBACKEND_ALL): + raise ValueError('Invalid value for backend: 0x%x' % flags) + if not (flags & libev.ev_supported_backends()): + as_list = [_str_hex(x) for x in _flags_to_list(flags)] + raise ValueError('Unsupported backend: %s' % '|'.join(as_list)) + + +cpdef _events_to_str(int events): + cdef list result = [] + cdef int c_flag + for (flag, string) in _events: + c_flag = flag + if events & c_flag: + result.append(string) + events = events & (~c_flag) + if not events: + break + if events: + result.append(hex(events)) + return '|'.join(result) + + +def supported_backends(): + return _flags_to_list(libev.ev_supported_backends()) + + +def recommended_backends(): + return _flags_to_list(libev.ev_recommended_backends()) + + +def embeddable_backends(): + return _flags_to_list(libev.ev_embeddable_backends()) + + +def time(): + return libev.ev_time() + + +#define LOOP_PROPERTY(NAME) property NAME: \ + \ + def __get__(self): \ + CHECK_LOOP3(self) \ + return self._ptr.NAME + + +cdef bint _default_loop_destroyed = False + + +#define CHECK_LOOP2(LOOP) \ + if not LOOP._ptr: \ + raise ValueError('operation on destroyed loop') + + +#define CHECK_LOOP3(LOOP) \ + if not LOOP._ptr: \ + raise ValueError('operation on destroyed loop') + + + +cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]: + cdef libev.ev_loop* _ptr + cdef public object error_handler + cdef libev.ev_prepare _prepare + cdef public list _callbacks + cdef libev.ev_timer _timer0 +#ifdef _WIN32 + cdef libev.ev_timer _periodic_signal_checker +#endif + + def __init__(self, object flags=None, object default=None, size_t ptr=0): + cdef unsigned int c_flags + cdef object old_handler = None + libev.ev_prepare_init(&self._prepare, <void*>gevent_run_callbacks) +#ifdef _WIN32 + libev.ev_timer_init(&self._periodic_signal_checker, <void*>gevent_periodic_signal_check, 0.3, 0.3) +#endif + libev.ev_timer_init(&self._timer0, <void*>gevent_noop, 0.0, 0.0) + if ptr: + self._ptr = <libev.ev_loop*>ptr + else: + c_flags = _flags_to_int(flags) + _check_flags(c_flags) + c_flags |= libev.EVFLAG_NOENV + c_flags |= libev.EVFLAG_FORKCHECK + if default is None: + default = True + if _default_loop_destroyed: + default = False + if default: + self._ptr = libev.gevent_ev_default_loop(c_flags) + if not self._ptr: + raise SystemError("ev_default_loop(%s) failed" % (c_flags, )) +#ifdef _WIN32 + libev.ev_timer_start(self._ptr, &self._periodic_signal_checker) + libev.ev_unref(self._ptr) +#endif + else: + self._ptr = libev.ev_loop_new(c_flags) + if not self._ptr: + raise SystemError("ev_loop_new(%s) failed" % (c_flags, )) + if default or __SYSERR_CALLBACK is None: + set_syserr_cb(self._handle_syserr) + libev.ev_prepare_start(self._ptr, &self._prepare) + libev.ev_unref(self._ptr) + self._callbacks = [] + + cdef _run_callbacks(self): + cdef callback cb + cdef object callbacks + cdef int count = 1000 + libev.ev_timer_stop(self._ptr, &self._timer0) + while self._callbacks and count > 0: + callbacks = self._callbacks + self._callbacks = [] + for cb in callbacks: + libev.ev_unref(self._ptr) + gevent_call(self, cb) + count -= 1 + if self._callbacks: + libev.ev_timer_start(self._ptr, &self._timer0) + + def _stop_watchers(self): + if libev.ev_is_active(&self._prepare): + libev.ev_ref(self._ptr) + libev.ev_prepare_stop(self._ptr, &self._prepare) +#ifdef _WIN32 + if libev.ev_is_active(&self._periodic_signal_checker): + libev.ev_ref(self._ptr) + libev.ev_timer_stop(self._ptr, &self._periodic_signal_checker) +#endif + + def destroy(self): + global _default_loop_destroyed + if self._ptr: + self._stop_watchers() + if __SYSERR_CALLBACK == self._handle_syserr: + set_syserr_cb(None) + if libev.ev_is_default_loop(self._ptr): + _default_loop_destroyed = True + libev.ev_loop_destroy(self._ptr) + self._ptr = NULL + + def __dealloc__(self): + if self._ptr: + self._stop_watchers() + if not libev.ev_is_default_loop(self._ptr): + libev.ev_loop_destroy(self._ptr) + self._ptr = NULL + + property ptr: + + def __get__(self): + return <size_t>self._ptr + + property WatcherType: + + def __get__(self): + return watcher + + property MAXPRI: + + def __get__(self): + return libev.EV_MAXPRI + + property MINPRI: + + def __get__(self): + return libev.EV_MINPRI + + def _handle_syserr(self, message, errno): + if sys.version_info[0] >= 3: + message = message.decode() + self.handle_error(None, SystemError, SystemError(message + ': ' + os.strerror(errno)), None) + + cpdef handle_error(self, context, type, value, tb): + cdef object handle_error + cdef object error_handler = self.error_handler + if error_handler is not None: + # we do want to do getattr every time so that setting Hub.handle_error property just works + handle_error = getattr(error_handler, 'handle_error', error_handler) + handle_error(context, type, value, tb) + else: + self._default_handle_error(context, type, value, tb) + + cpdef _default_handle_error(self, context, type, value, tb): + # note: Hub sets its own error handler so this is not used by gevent + # this is here to make core.loop usable without the rest of gevent + traceback.print_exception(type, value, tb) + if self._ptr: + libev.ev_break(self._ptr, libev.EVBREAK_ONE) + + def run(self, nowait=False, once=False): + CHECK_LOOP2(self) + cdef unsigned int flags = 0 + if nowait: + flags |= libev.EVRUN_NOWAIT + if once: + flags |= libev.EVRUN_ONCE + with nogil: + libev.ev_run(self._ptr, flags) + + def reinit(self): + if self._ptr: + libev.ev_loop_fork(self._ptr) + + def ref(self): + CHECK_LOOP2(self) + libev.ev_ref(self._ptr) + + def unref(self): + CHECK_LOOP2(self) + libev.ev_unref(self._ptr) + + def break_(self, int how=libev.EVBREAK_ONE): + CHECK_LOOP2(self) + libev.ev_break(self._ptr, how) + + def verify(self): + CHECK_LOOP2(self) + libev.ev_verify(self._ptr) + + def now(self): + CHECK_LOOP2(self) + return libev.ev_now(self._ptr) + + def update(self): + CHECK_LOOP2(self) + libev.ev_now_update(self._ptr) + + def __repr__(self): + return '<%s at 0x%x %s>' % (self.__class__.__name__, id(self), self._format()) + + property default: + + def __get__(self): + CHECK_LOOP3(self) + return True if libev.ev_is_default_loop(self._ptr) else False + + property iteration: + + def __get__(self): + CHECK_LOOP3(self) + return libev.ev_iteration(self._ptr) + + property depth: + + def __get__(self): + CHECK_LOOP3(self) + return libev.ev_depth(self._ptr) + + property backend_int: + + def __get__(self): + CHECK_LOOP3(self) + return libev.ev_backend(self._ptr) + + property backend: + + def __get__(self): + CHECK_LOOP3(self) + cdef unsigned int backend = libev.ev_backend(self._ptr) + for key, value in _flags: + if key == backend: + return value + return backend + + property pendingcnt: + + def __get__(self): + CHECK_LOOP3(self) + return libev.ev_pending_count(self._ptr) + +#ifdef _WIN32 + def io(self, libev.vfd_socket_t fd, int events, ref=True, priority=None): + return io(self, fd, events, ref, priority) +#else + def io(self, int fd, int events, ref=True, priority=None): + return io(self, fd, events, ref, priority) +#endif + + def timer(self, double after, double repeat=0.0, ref=True, priority=None): + return timer(self, after, repeat, ref, priority) + + def signal(self, int signum, ref=True, priority=None): + return signal(self, signum, ref, priority) + + def idle(self, ref=True, priority=None): + return idle(self, ref, priority) + + def prepare(self, ref=True, priority=None): + return prepare(self, ref, priority) + + def check(self, ref=True, priority=None): + return check(self, ref, priority) + + def fork(self, ref=True, priority=None): + return fork(self, ref, priority) + + def async(self, ref=True, priority=None): + return async(self, ref, priority) + +#ifdef _WIN32 +#else + + def child(self, int pid, bint trace=0, ref=True): + return child(self, pid, trace, ref) + + def install_sigchld(self): + libev.gevent_install_sigchld_handler() + + def reset_sigchld(self): + libev.gevent_reset_sigchld_handler() + +#endif + + def stat(self, str path, float interval=0.0, ref=True, priority=None): + return stat(self, path, interval, ref, priority) + + def run_callback(self, func, *args): + CHECK_LOOP2(self) + cdef callback cb = callback(func, args) + self._callbacks.append(cb) + libev.ev_ref(self._ptr) + return cb + + def _format(self): + if not self._ptr: + return 'destroyed' + cdef object msg = self.backend + if self.default: + msg += ' default' + msg += ' pending=%s' % self.pendingcnt +#ifdef LIBEV_EMBED + msg += self._format_details() +#endif + return msg + +#ifdef LIBEV_EMBED + + def _format_details(self): + cdef str msg = '' + cdef object fileno = self.fileno() + cdef object sigfd = None + cdef object activecnt = None + try: + sigfd = self.sigfd + except AttributeError: + sigfd = None + try: + activecnt = self.activecnt + except AttributeError: + pass + if activecnt is not None: + msg += ' ref=' + repr(activecnt) + if fileno is not None: + msg += ' fileno=' + repr(fileno) + if sigfd is not None and sigfd != -1: + msg += ' sigfd=' + repr(sigfd) + return msg + + def fileno(self): + cdef int fd + if self._ptr: + fd = self._ptr.backend_fd + if fd >= 0: + return fd + + LOOP_PROPERTY(activecnt) + + LOOP_PROPERTY(sig_pending) + +#if EV_USE_SIGNALFD + LOOP_PROPERTY(sigfd) +#endif + + property origflags: + + def __get__(self): + CHECK_LOOP3(self) + return _flags_to_list(self._ptr.origflags) + + property origflags_int: + + def __get__(self): + CHECK_LOOP3(self) + return self._ptr.origflags + +#endif + + +cdef public class callback [object PyGeventCallbackObject, type PyGeventCallback_Type]: + cdef public object callback + cdef public tuple args + + def __init__(self, callback, args): + self.callback = callback + self.args = args + + def stop(self): + self.callback = None + self.args = None + + # Note, that __nonzero__ and pending are different + # nonzero is used in contexts where we need to know whether to schedule another callback, + # so it's true if it's pending or currently running + # 'pending' has the same meaning as libev watchers: it is cleared before entering callback + + def __nonzero__(self): + # it's nonzero if it's pending or currently executing + return self.args is not None + + property pending: + + def __get__(self): + return self.callback is not None + + def __repr__(self): + if Py_ReprEnter(<PyObjectPtr>self) != 0: + return "<...>" + try: + format = self._format() + result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format) + if self.pending: + result += " pending" + if self.callback is not None: + result += " callback=%r" % (self.callback, ) + if self.args is not None: + result += " args=%r" % (self.args, ) + if self.callback is None and self.args is None: + result += " stopped" + return result + ">" + finally: + Py_ReprLeave(<PyObjectPtr>self) + + def _format(self): + return '' + + +#define PYTHON_INCREF if not self._flags & 1: \ + Py_INCREF(<PyObjectPtr>self) \ + self._flags |= 1 + +#define LIBEV_UNREF if self._flags & 6 == 4: \ + libev.ev_unref(self.loop._ptr) \ + self._flags |= 2 + +# about readonly _flags attribute: +# bit #1 set if object owns Python reference to itself (Py_INCREF was called and we must call Py_DECREF later) +# bit #2 set if ev_unref() was called and we must call ev_ref() later +# bit #3 set if user wants to call ev_unref() before start() + +#define WATCHER_BASE(TYPE) \ + cdef public loop loop \ + cdef object _callback \ + cdef public tuple args \ + cdef readonly int _flags \ + cdef libev.ev_##TYPE _watcher \ + \ + property ref: \ + \ + def __get__(self): \ + return False if self._flags & 4 else True \ + \ + def __set__(self, object value): \ + CHECK_LOOP3(self.loop) \ + if value: \ + if not self._flags & 4: \ + return # ref is already True \ + if self._flags & 2: # ev_unref was called, undo \ + libev.ev_ref(self.loop._ptr) \ + self._flags &= ~6 # do not want unref, no outstanding unref \ + else: \ + if self._flags & 4: \ + return # ref is already False \ + self._flags |= 4 \ + if not self._flags & 2 and libev.ev_is_active(&self._watcher): \ + libev.ev_unref(self.loop._ptr) \ + self._flags |= 2 \ + \ + property callback: \ + \ + def __get__(self): \ + return self._callback \ + \ + def __set__(self, object callback): \ + if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None: \ + raise TypeError("Expected callable, not %r" % (callback, )) \ + self._callback = callback \ + \ + def stop(self): \ + CHECK_LOOP2(self.loop) \ + if self._flags & 2: \ + libev.ev_ref(self.loop._ptr) \ + self._flags &= ~2 \ + libev.ev_##TYPE##_stop(self.loop._ptr, &self._watcher) \ + self._callback = None \ + self.args = None \ + if self._flags & 1: \ + Py_DECREF(<PyObjectPtr>self) \ + self._flags &= ~1 \ + \ + property priority: \ + \ + def __get__(self): \ + return libev.ev_priority(&self._watcher) \ + \ + def __set__(self, int priority): \ + if libev.ev_is_active(&self._watcher): \ + raise AttributeError("Cannot set priority of an active watcher") \ + libev.ev_set_priority(&self._watcher, priority) \ + \ + def feed(self, int revents, object callback, *args): \ + CHECK_LOOP2(self.loop) \ + self.callback = callback \ + self.args = args \ + LIBEV_UNREF \ + libev.ev_feed_event(self.loop._ptr, &self._watcher, revents) \ + PYTHON_INCREF + +#define ACTIVE property active: \ + \ + def __get__(self): \ + return True if libev.ev_is_active(&self._watcher) else False + +#define START(TYPE) def start(self, object callback, *args): \ + CHECK_LOOP2(self.loop) \ + if callback is None: \ + raise TypeError('callback must be callable, not None') \ + self.callback = callback \ + self.args = args \ + LIBEV_UNREF \ + libev.ev_##TYPE##_start(self.loop._ptr, &self._watcher) \ + PYTHON_INCREF + + +#define PENDING \ + property pending: \ + \ + def __get__(self): \ + return True if libev.ev_is_pending(&self._watcher) else False + + + +#define WATCHER(TYPE) WATCHER_BASE(TYPE) \ + \ + START(TYPE) \ + \ + ACTIVE \ + \ + PENDING + + +#define COMMA , + + +#define INIT(TYPE, ARGS_INITIALIZERS, ARGS) \ + def __init__(self, loop loop ARGS_INITIALIZERS, ref=True, priority=None): \ + libev.ev_##TYPE##_init(&self._watcher, <void *>gevent_callback_##TYPE ARGS) \ + self.loop = loop \ + if ref: \ + self._flags = 0 \ + else: \ + self._flags = 4 \ + if priority is not None: \ + libev.ev_set_priority(&self._watcher, priority) + + +cdef public class watcher [object PyGeventWatcherObject, type PyGeventWatcher_Type]: + """Abstract base class for all the watchers""" + + def __repr__(self): + if Py_ReprEnter(<PyObjectPtr>self) != 0: + return "<...>" + try: + format = self._format() + result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format) + if self.active: + result += " active" + if self.pending: + result += " pending" + if self.callback is not None: + result += " callback=%r" % (self.callback, ) + if self.args is not None: + result += " args=%r" % (self.args, ) + return result + ">" + finally: + Py_ReprLeave(<PyObjectPtr>self) + + def _format(self): + return '' + + +cdef public class io(watcher) [object PyGeventIOObject, type PyGeventIO_Type]: + + WATCHER_BASE(io) + + def start(self, object callback, *args, pass_events=False): + CHECK_LOOP2(self.loop) + if callback is None: + raise TypeError('callback must be callable, not None') + self.callback = callback + if pass_events: + self.args = (GEVENT_CORE_EVENTS, ) + args + else: + self.args = args + LIBEV_UNREF + libev.ev_io_start(self.loop._ptr, &self._watcher) + PYTHON_INCREF + + ACTIVE + + PENDING + +#ifdef _WIN32 + + def __init__(self, loop loop, libev.vfd_socket_t fd, int events, ref=True, priority=None): + if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE): + raise ValueError('illegal event mask: %r' % events) + cdef int vfd = libev.vfd_open(fd) + libev.vfd_free(self._watcher.fd) + libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, vfd, events) + self.loop = loop + if ref: + self._flags = 0 + else: + self._flags = 4 + if priority is not None: + libev.ev_set_priority(&self._watcher, priority) + +#else + + def __init__(self, loop loop, int fd, int events, ref=True, priority=None): + if fd < 0: + raise ValueError('fd must be non-negative: %r' % fd) + if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE): + raise ValueError('illegal event mask: %r' % events) + libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, fd, events) + self.loop = loop + if ref: + self._flags = 0 + else: + self._flags = 4 + if priority is not None: + libev.ev_set_priority(&self._watcher, priority) + +#endif + + property fd: + + def __get__(self): + return libev.vfd_get(self._watcher.fd) + + def __set__(self, long fd): + if libev.ev_is_active(&self._watcher): + raise AttributeError("'io' watcher attribute 'fd' is read-only while watcher is active") + cdef int vfd = libev.vfd_open(fd) + libev.vfd_free(self._watcher.fd) + libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, vfd, self._watcher.events) + + property events: + + def __get__(self): + return self._watcher.events + + def __set__(self, int events): + if libev.ev_is_active(&self._watcher): + raise AttributeError("'io' watcher attribute 'events' is read-only while watcher is active") + libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, self._watcher.fd, events) + + property events_str: + + def __get__(self): + return _events_to_str(self._watcher.events) + + def _format(self): + return ' fd=%s events=%s' % (self.fd, self.events_str) + +#ifdef _WIN32 + + def __cinit__(self): + self._watcher.fd = -1; + + def __dealloc__(self): + libev.vfd_free(self._watcher.fd) + +#endif + + +cdef public class timer(watcher) [object PyGeventTimerObject, type PyGeventTimer_Type]: + + WATCHER_BASE(timer) + + def start(self, object callback, *args, update=True): + CHECK_LOOP2(self.loop) + if callback is None: + raise TypeError('callback must be callable, not None') + self.callback = callback + self.args = args + LIBEV_UNREF + if update: + libev.ev_now_update(self.loop._ptr) + libev.ev_timer_start(self.loop._ptr, &self._watcher) + PYTHON_INCREF + + ACTIVE + + PENDING + + def __init__(self, loop loop, double after=0.0, double repeat=0.0, ref=True, priority=None): + if repeat < 0.0: + raise ValueError("repeat must be positive or zero: %r" % repeat) + libev.ev_timer_init(&self._watcher, <void *>gevent_callback_timer, after, repeat) + self.loop = loop + if ref: + self._flags = 0 + else: + self._flags = 4 + if priority is not None: + libev.ev_set_priority(&self._watcher, priority) + + property at: + + def __get__(self): + return self._watcher.at + + # QQQ: add 'after' and 'repeat' properties? + + def again(self, object callback, *args, update=True): + CHECK_LOOP2(self.loop) + self.callback = callback + self.args = args + LIBEV_UNREF + if update: + libev.ev_now_update(self.loop._ptr) + libev.ev_timer_again(self.loop._ptr, &self._watcher) + PYTHON_INCREF + + +cdef public class signal(watcher) [object PyGeventSignalObject, type PyGeventSignal_Type]: + + WATCHER(signal) + + def __init__(self, loop loop, int signalnum, ref=True, priority=None): + if signalnum < 1 or signalnum >= signalmodule.NSIG: + raise ValueError('illegal signal number: %r' % signalnum) + # still possible to crash on one of libev's asserts: + # 1) "libev: ev_signal_start called with illegal signal number" + # EV_NSIG might be different from signal.NSIG on some platforms + # 2) "libev: a signal must not be attached to two different loops" + # we probably could check that in LIBEV_EMBED mode, but not in general + libev.ev_signal_init(&self._watcher, <void *>gevent_callback_signal, signalnum) + self.loop = loop + if ref: + self._flags = 0 + else: + self._flags = 4 + if priority is not None: + libev.ev_set_priority(&self._watcher, priority) + + +cdef public class idle(watcher) [object PyGeventIdleObject, type PyGeventIdle_Type]: + + WATCHER(idle) + + INIT(idle,,) + + +cdef public class prepare(watcher) [object PyGeventPrepareObject, type PyGeventPrepare_Type]: + + WATCHER(prepare) + + INIT(prepare,,) + + +cdef public class check(watcher) [object PyGeventCheckObject, type PyGeventCheck_Type]: + + WATCHER(check) + + INIT(check,,) + + +cdef public class fork(watcher) [object PyGeventForkObject, type PyGeventFork_Type]: + + WATCHER(fork) + + INIT(fork,,) + + +cdef public class async(watcher) [object PyGeventAsyncObject, type PyGeventAsync_Type]: + + WATCHER_BASE(async) + + START(async) + + ACTIVE + + property pending: + + def __get__(self): + return True if libev.ev_async_pending(&self._watcher) else False + + INIT(async,,) + + def send(self): + CHECK_LOOP2(self.loop) + libev.ev_async_send(self.loop._ptr, &self._watcher) + +#ifdef _WIN32 +#else + +cdef public class child(watcher) [object PyGeventChildObject, type PyGeventChild_Type]: + + WATCHER(child) + + def __init__(self, loop loop, int pid, bint trace=0, ref=True): + if not loop.default: + raise TypeError('child watchers are only available on the default loop') + libev.gevent_install_sigchld_handler() + libev.ev_child_init(&self._watcher, <void *>gevent_callback_child, pid, trace) + self.loop = loop + if ref: + self._flags = 0 + else: + self._flags = 4 + + def _format(self): + return ' pid=%r rstatus=%r' % (self.pid, self.rstatus) + + property pid: + + def __get__(self): + return self._watcher.pid + + property rpid: + + def __get__(self): + return self._watcher.rpid + + def __set__(self, int value): + self._watcher.rpid = value + + property rstatus: + + def __get__(self): + return self._watcher.rstatus + + def __set__(self, int value): + self._watcher.rstatus = value + +#endif + + +cdef public class stat(watcher) [object PyGeventStatObject, type PyGeventStat_Type]: + + WATCHER(stat) + cdef readonly str path + cdef readonly bytes _paths + + def __init__(self, loop loop, str path, float interval=0.0, ref=True, priority=None): + self.path = path + cdef bytes paths + if isinstance(path, unicode): + # the famous Python3 filesystem encoding debacle hits us here. Can we do better? + # We must keep a reference to the encoded string so that its bytes don't get freed + # and overwritten, leading to strange errors from libev ("no such file or directory") + paths = (<unicode>path).encode(sys.getfilesystemencoding()) + self._paths = paths + else: + paths = <bytes>path + self._paths = paths + libev.ev_stat_init(&self._watcher, <void *>gevent_callback_stat, <char*>paths, interval) + self.loop = loop + if ref: + self._flags = 0 + else: + self._flags = 4 + if priority is not None: + libev.ev_set_priority(&self._watcher, priority) + + property attr: + + def __get__(self): + if not self._watcher.attr.st_nlink: + return + return _pystat_fromstructstat(&self._watcher.attr) + + property prev: + + def __get__(self): + if not self._watcher.prev.st_nlink: + return + return _pystat_fromstructstat(&self._watcher.prev) + + property interval: + + def __get__(self): + return self._watcher.interval + + +__SYSERR_CALLBACK = None + + +cdef void _syserr_cb(char* msg) with gil: + try: + __SYSERR_CALLBACK(msg, errno) + except: + set_syserr_cb(None) + print_exc = getattr(traceback, 'print_exc', None) + if print_exc is not None: + print_exc() + + +cpdef set_syserr_cb(callback): + global __SYSERR_CALLBACK + if callback is None: + libev.ev_set_syserr_cb(NULL) + __SYSERR_CALLBACK = None + elif callable(callback): + libev.ev_set_syserr_cb(<void *>_syserr_cb) + __SYSERR_CALLBACK = callback + else: + raise TypeError('Expected callable or None, got %r' % (callback, )) + + +#ifdef LIBEV_EMBED +LIBEV_EMBED = True +EV_USE_FLOOR = libev.EV_USE_FLOOR +EV_USE_CLOCK_SYSCALL = libev.EV_USE_CLOCK_SYSCALL +EV_USE_REALTIME = libev.EV_USE_REALTIME +EV_USE_MONOTONIC = libev.EV_USE_MONOTONIC +EV_USE_NANOSLEEP = libev.EV_USE_NANOSLEEP +EV_USE_INOTIFY = libev.EV_USE_INOTIFY +EV_USE_SIGNALFD = libev.EV_USE_SIGNALFD +EV_USE_EVENTFD = libev.EV_USE_EVENTFD +EV_USE_4HEAP = libev.EV_USE_4HEAP +#else +LIBEV_EMBED = False +#endif diff --git a/python/gevent/libev/corecext.pyx b/python/gevent/libev/corecext.pyx new file mode 100644 index 0000000..a7fb888 --- /dev/null +++ b/python/gevent/libev/corecext.pyx @@ -0,0 +1,2110 @@ +# Generated by cythonpp.py on 2017-06-05 11:30:19 +# Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details. +# This directive, supported in Cython 0.24+, causes sources files to be +# much smaller and thus cythonpp.py to be slightly faster. But it does make +# debugging more difficult. +# cython: emit_code_comments=False +cimport cython +cimport libev +# Note this is not the standard cython 'cpython' (which has a backwards compat alias of 'python') +# it's our custom def. If it's not on the include path, we get warned. +from python cimport * + +# Work around lack of absolute_import in Cython +# Note for PY3: not doing so will leave reference to locals() on import +# (reproducible under Python 3.3, not under Python 3.4; see test__refcount_core.py) +sys = __import__('sys', level=0) +os = __import__('os', level=0) +traceback = __import__('traceback', level=0) +signalmodule = __import__('signal', level=0) + + +__all__ = ['get_version', + 'get_header_version', + 'supported_backends', + 'recommended_backends', + 'embeddable_backends', + 'time', + 'loop'] + +cdef tuple integer_types + +if sys.version_info[0] >= 3: + integer_types = int, +else: + integer_types = (int, long) + + +cdef extern from "callbacks.h": + void gevent_callback_io(libev.ev_loop, void*, int) + void gevent_callback_timer(libev.ev_loop, void*, int) + void gevent_callback_signal(libev.ev_loop, void*, int) + void gevent_callback_idle(libev.ev_loop, void*, int) + void gevent_callback_prepare(libev.ev_loop, void*, int) + void gevent_callback_check(libev.ev_loop, void*, int) + void gevent_callback_fork(libev.ev_loop, void*, int) + void gevent_callback_async(libev.ev_loop, void*, int) + void gevent_callback_child(libev.ev_loop, void*, int) + void gevent_callback_stat(libev.ev_loop, void*, int) + void gevent_run_callbacks(libev.ev_loop, void*, int) + void gevent_periodic_signal_check(libev.ev_loop, void*, int) + void gevent_call(loop, callback) + void gevent_noop(libev.ev_loop, void*, int) + +cdef extern from *: + int errno + +cdef extern from "stathelper.c": + object _pystat_fromstructstat(void*) + + +UNDEF = libev.EV_UNDEF +NONE = libev.EV_NONE +READ = libev.EV_READ +WRITE = libev.EV_WRITE +TIMER = libev.EV_TIMER +PERIODIC = libev.EV_PERIODIC +SIGNAL = libev.EV_SIGNAL +CHILD = libev.EV_CHILD +STAT = libev.EV_STAT +IDLE = libev.EV_IDLE +PREPARE = libev.EV_PREPARE +CHECK = libev.EV_CHECK +EMBED = libev.EV_EMBED +FORK = libev.EV_FORK +CLEANUP = libev.EV_CLEANUP +ASYNC = libev.EV_ASYNC +CUSTOM = libev.EV_CUSTOM +ERROR = libev.EV_ERROR + +READWRITE = libev.EV_READ | libev.EV_WRITE + +MINPRI = libev.EV_MINPRI +MAXPRI = libev.EV_MAXPRI + +BACKEND_PORT = libev.EVBACKEND_PORT +BACKEND_KQUEUE = libev.EVBACKEND_KQUEUE +BACKEND_EPOLL = libev.EVBACKEND_EPOLL +BACKEND_POLL = libev.EVBACKEND_POLL +BACKEND_SELECT = libev.EVBACKEND_SELECT +FORKCHECK = libev.EVFLAG_FORKCHECK +NOINOTIFY = libev.EVFLAG_NOINOTIFY +SIGNALFD = libev.EVFLAG_SIGNALFD +NOSIGMASK = libev.EVFLAG_NOSIGMASK + + +@cython.internal +cdef class _EVENTSType: + + def __repr__(self): + return 'gevent.core.EVENTS' + + +cdef public object GEVENT_CORE_EVENTS = _EVENTSType() +EVENTS = GEVENT_CORE_EVENTS + + +def get_version(): + return 'libev-%d.%02d' % (libev.ev_version_major(), libev.ev_version_minor()) + + +def get_header_version(): + return 'libev-%d.%02d' % (libev.EV_VERSION_MAJOR, libev.EV_VERSION_MINOR) + + +# This list backends in the order they are actually tried by libev +_flags = [(libev.EVBACKEND_PORT, 'port'), + (libev.EVBACKEND_KQUEUE, 'kqueue'), + (libev.EVBACKEND_EPOLL, 'epoll'), + (libev.EVBACKEND_POLL, 'poll'), + (libev.EVBACKEND_SELECT, 'select'), + (libev.EVFLAG_NOENV, 'noenv'), + (libev.EVFLAG_FORKCHECK, 'forkcheck'), + (libev.EVFLAG_NOINOTIFY, 'noinotify'), + (libev.EVFLAG_SIGNALFD, 'signalfd'), + (libev.EVFLAG_NOSIGMASK, 'nosigmask')] + + +_flags_str2int = dict((string, flag) for (flag, string) in _flags) + + +_events = [(libev.EV_READ, 'READ'), + (libev.EV_WRITE, 'WRITE'), + (libev.EV__IOFDSET, '_IOFDSET'), + (libev.EV_PERIODIC, 'PERIODIC'), + (libev.EV_SIGNAL, 'SIGNAL'), + (libev.EV_CHILD, 'CHILD'), + (libev.EV_STAT, 'STAT'), + (libev.EV_IDLE, 'IDLE'), + (libev.EV_PREPARE, 'PREPARE'), + (libev.EV_CHECK, 'CHECK'), + (libev.EV_EMBED, 'EMBED'), + (libev.EV_FORK, 'FORK'), + (libev.EV_CLEANUP, 'CLEANUP'), + (libev.EV_ASYNC, 'ASYNC'), + (libev.EV_CUSTOM, 'CUSTOM'), + (libev.EV_ERROR, 'ERROR')] + + +cpdef _flags_to_list(unsigned int flags): + cdef list result = [] + for code, value in _flags: + if flags & code: + result.append(value) + flags &= ~code + if not flags: + break + if flags: + result.append(flags) + return result + + +if sys.version_info[0] >= 3: + basestring = (bytes, str) +else: + basestring = __builtins__.basestring + + +cpdef unsigned int _flags_to_int(object flags) except? -1: + # Note, that order does not matter, libev has its own predefined order + if not flags: + return 0 + if isinstance(flags, integer_types): + return flags + cdef unsigned int result = 0 + try: + if isinstance(flags, basestring): + flags = flags.split(',') + for value in flags: + value = value.strip().lower() + if value: + result |= _flags_str2int[value] + except KeyError as ex: + raise ValueError('Invalid backend or flag: %s\nPossible values: %s' % (ex, ', '.join(sorted(_flags_str2int.keys())))) + return result + + +cdef str _str_hex(object flag): + if isinstance(flag, integer_types): + return hex(flag) + return str(flag) + + +cpdef _check_flags(unsigned int flags): + cdef list as_list + flags &= libev.EVBACKEND_MASK + if not flags: + return + if not (flags & libev.EVBACKEND_ALL): + raise ValueError('Invalid value for backend: 0x%x' % flags) + if not (flags & libev.ev_supported_backends()): + as_list = [_str_hex(x) for x in _flags_to_list(flags)] + raise ValueError('Unsupported backend: %s' % '|'.join(as_list)) + + +cpdef _events_to_str(int events): + cdef list result = [] + cdef int c_flag + for (flag, string) in _events: + c_flag = flag + if events & c_flag: + result.append(string) + events = events & (~c_flag) + if not events: + break + if events: + result.append(hex(events)) + return '|'.join(result) + + +def supported_backends(): + return _flags_to_list(libev.ev_supported_backends()) + + +def recommended_backends(): + return _flags_to_list(libev.ev_recommended_backends()) + + +def embeddable_backends(): + return _flags_to_list(libev.ev_embeddable_backends()) + + +def time(): + return libev.ev_time() + + + + +cdef bint _default_loop_destroyed = False + + + + + + + +cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]: + cdef libev.ev_loop* _ptr + cdef public object error_handler + cdef libev.ev_prepare _prepare + cdef public list _callbacks + cdef libev.ev_timer _timer0 +#ifdef _WIN32 + cdef libev.ev_timer _periodic_signal_checker +#endif + + def __init__(self, object flags=None, object default=None, size_t ptr=0): + cdef unsigned int c_flags + cdef object old_handler = None + libev.ev_prepare_init(&self._prepare, <void*>gevent_run_callbacks) +#ifdef _WIN32 + libev.ev_timer_init(&self._periodic_signal_checker, <void*>gevent_periodic_signal_check, 0.3, 0.3) +#endif + libev.ev_timer_init(&self._timer0, <void*>gevent_noop, 0.0, 0.0) + if ptr: + self._ptr = <libev.ev_loop*>ptr + else: + c_flags = _flags_to_int(flags) + _check_flags(c_flags) + c_flags |= libev.EVFLAG_NOENV + c_flags |= libev.EVFLAG_FORKCHECK + if default is None: + default = True + if _default_loop_destroyed: + default = False + if default: + self._ptr = libev.gevent_ev_default_loop(c_flags) + if not self._ptr: + raise SystemError("ev_default_loop(%s) failed" % (c_flags, )) +#ifdef _WIN32 + libev.ev_timer_start(self._ptr, &self._periodic_signal_checker) + libev.ev_unref(self._ptr) +#endif + else: + self._ptr = libev.ev_loop_new(c_flags) + if not self._ptr: + raise SystemError("ev_loop_new(%s) failed" % (c_flags, )) + if default or __SYSERR_CALLBACK is None: + set_syserr_cb(self._handle_syserr) + libev.ev_prepare_start(self._ptr, &self._prepare) + libev.ev_unref(self._ptr) + self._callbacks = [] + + cdef _run_callbacks(self): + cdef callback cb + cdef object callbacks + cdef int count = 1000 + libev.ev_timer_stop(self._ptr, &self._timer0) + while self._callbacks and count > 0: + callbacks = self._callbacks + self._callbacks = [] + for cb in callbacks: + libev.ev_unref(self._ptr) + gevent_call(self, cb) + count -= 1 + if self._callbacks: + libev.ev_timer_start(self._ptr, &self._timer0) + + def _stop_watchers(self): + if libev.ev_is_active(&self._prepare): + libev.ev_ref(self._ptr) + libev.ev_prepare_stop(self._ptr, &self._prepare) +#ifdef _WIN32 + if libev.ev_is_active(&self._periodic_signal_checker): + libev.ev_ref(self._ptr) + libev.ev_timer_stop(self._ptr, &self._periodic_signal_checker) +#endif + + def destroy(self): + global _default_loop_destroyed + if self._ptr: + self._stop_watchers() + if __SYSERR_CALLBACK == self._handle_syserr: + set_syserr_cb(None) + if libev.ev_is_default_loop(self._ptr): + _default_loop_destroyed = True + libev.ev_loop_destroy(self._ptr) + self._ptr = NULL + + def __dealloc__(self): + if self._ptr: + self._stop_watchers() + if not libev.ev_is_default_loop(self._ptr): + libev.ev_loop_destroy(self._ptr) + self._ptr = NULL + + property ptr: + + def __get__(self): + return <size_t>self._ptr + + property WatcherType: + + def __get__(self): + return watcher + + property MAXPRI: + + def __get__(self): + return libev.EV_MAXPRI + + property MINPRI: + + def __get__(self): + return libev.EV_MINPRI + + def _handle_syserr(self, message, errno): + if sys.version_info[0] >= 3: + message = message.decode() + self.handle_error(None, SystemError, SystemError(message + ': ' + os.strerror(errno)), None) + + cpdef handle_error(self, context, type, value, tb): + cdef object handle_error + cdef object error_handler = self.error_handler + if error_handler is not None: + # we do want to do getattr every time so that setting Hub.handle_error property just works + handle_error = getattr(error_handler, 'handle_error', error_handler) + handle_error(context, type, value, tb) + else: + self._default_handle_error(context, type, value, tb) + + cpdef _default_handle_error(self, context, type, value, tb): + # note: Hub sets its own error handler so this is not used by gevent + # this is here to make core.loop usable without the rest of gevent + traceback.print_exception(type, value, tb) + if self._ptr: + libev.ev_break(self._ptr, libev.EVBREAK_ONE) + + def run(self, nowait=False, once=False): + + if not self._ptr: + raise ValueError('operation on destroyed loop') + cdef unsigned int flags = 0 + if nowait: + flags |= libev.EVRUN_NOWAIT + if once: + flags |= libev.EVRUN_ONCE + with nogil: + libev.ev_run(self._ptr, flags) + + def reinit(self): + if self._ptr: + libev.ev_loop_fork(self._ptr) + + def ref(self): + + if not self._ptr: + raise ValueError('operation on destroyed loop') + libev.ev_ref(self._ptr) + + def unref(self): + + if not self._ptr: + raise ValueError('operation on destroyed loop') + libev.ev_unref(self._ptr) + + def break_(self, int how=libev.EVBREAK_ONE): + + if not self._ptr: + raise ValueError('operation on destroyed loop') + libev.ev_break(self._ptr, how) + + def verify(self): + + if not self._ptr: + raise ValueError('operation on destroyed loop') + libev.ev_verify(self._ptr) + + def now(self): + + if not self._ptr: + raise ValueError('operation on destroyed loop') + return libev.ev_now(self._ptr) + + def update(self): + + if not self._ptr: + raise ValueError('operation on destroyed loop') + libev.ev_now_update(self._ptr) + + def __repr__(self): + return '<%s at 0x%x %s>' % (self.__class__.__name__, id(self), self._format()) + + property default: + + def __get__(self): + + if not self._ptr: + raise ValueError('operation on destroyed loop') + return True if libev.ev_is_default_loop(self._ptr) else False + + property iteration: + + def __get__(self): + + if not self._ptr: + raise ValueError('operation on destroyed loop') + return libev.ev_iteration(self._ptr) + + property depth: + + def __get__(self): + + if not self._ptr: + raise ValueError('operation on destroyed loop') + return libev.ev_depth(self._ptr) + + property backend_int: + + def __get__(self): + + if not self._ptr: + raise ValueError('operation on destroyed loop') + return libev.ev_backend(self._ptr) + + property backend: + + def __get__(self): + + if not self._ptr: + raise ValueError('operation on destroyed loop') + cdef unsigned int backend = libev.ev_backend(self._ptr) + for key, value in _flags: + if key == backend: + return value + return backend + + property pendingcnt: + + def __get__(self): + + if not self._ptr: + raise ValueError('operation on destroyed loop') + return libev.ev_pending_count(self._ptr) + +#ifdef _WIN32 + def io(self, libev.vfd_socket_t fd, int events, ref=True, priority=None): + return io(self, fd, events, ref, priority) +#else + def io(self, int fd, int events, ref=True, priority=None): + return io(self, fd, events, ref, priority) +#endif + + def timer(self, double after, double repeat=0.0, ref=True, priority=None): + return timer(self, after, repeat, ref, priority) + + def signal(self, int signum, ref=True, priority=None): + return signal(self, signum, ref, priority) + + def idle(self, ref=True, priority=None): + return idle(self, ref, priority) + + def prepare(self, ref=True, priority=None): + return prepare(self, ref, priority) + + def check(self, ref=True, priority=None): + return check(self, ref, priority) + + def fork(self, ref=True, priority=None): + return fork(self, ref, priority) + + def async(self, ref=True, priority=None): + return async(self, ref, priority) + +#ifdef _WIN32 +#else + + def child(self, int pid, bint trace=0, ref=True): + return child(self, pid, trace, ref) + + def install_sigchld(self): + libev.gevent_install_sigchld_handler() + + def reset_sigchld(self): + libev.gevent_reset_sigchld_handler() + +#endif + + def stat(self, str path, float interval=0.0, ref=True, priority=None): + return stat(self, path, interval, ref, priority) + + def run_callback(self, func, *args): + + if not self._ptr: + raise ValueError('operation on destroyed loop') + cdef callback cb = callback(func, args) + self._callbacks.append(cb) + libev.ev_ref(self._ptr) + return cb + + def _format(self): + if not self._ptr: + return 'destroyed' + cdef object msg = self.backend + if self.default: + msg += ' default' + msg += ' pending=%s' % self.pendingcnt +#ifdef LIBEV_EMBED + msg += self._format_details() +#endif + return msg + +#ifdef LIBEV_EMBED + + def _format_details(self): + cdef str msg = '' + cdef object fileno = self.fileno() + cdef object sigfd = None + cdef object activecnt = None + try: + sigfd = self.sigfd + except AttributeError: + sigfd = None + try: + activecnt = self.activecnt + except AttributeError: + pass + if activecnt is not None: + msg += ' ref=' + repr(activecnt) + if fileno is not None: + msg += ' fileno=' + repr(fileno) + if sigfd is not None and sigfd != -1: + msg += ' sigfd=' + repr(sigfd) + return msg + + def fileno(self): + cdef int fd + if self._ptr: + fd = self._ptr.backend_fd + if fd >= 0: + return fd + + property activecnt: + + def __get__(self): + + if not self._ptr: + raise ValueError('operation on destroyed loop') + return self._ptr.activecnt + + property sig_pending: + + def __get__(self): + + if not self._ptr: + raise ValueError('operation on destroyed loop') + return self._ptr.sig_pending + +#if EV_USE_SIGNALFD + property sigfd: + + def __get__(self): + + if not self._ptr: + raise ValueError('operation on destroyed loop') + return self._ptr.sigfd +#endif + + property origflags: + + def __get__(self): + + if not self._ptr: + raise ValueError('operation on destroyed loop') + return _flags_to_list(self._ptr.origflags) + + property origflags_int: + + def __get__(self): + + if not self._ptr: + raise ValueError('operation on destroyed loop') + return self._ptr.origflags + +#endif + + +cdef public class callback [object PyGeventCallbackObject, type PyGeventCallback_Type]: + cdef public object callback + cdef public tuple args + + def __init__(self, callback, args): + self.callback = callback + self.args = args + + def stop(self): + self.callback = None + self.args = None + + # Note, that __nonzero__ and pending are different + # nonzero is used in contexts where we need to know whether to schedule another callback, + # so it's true if it's pending or currently running + # 'pending' has the same meaning as libev watchers: it is cleared before entering callback + + def __nonzero__(self): + # it's nonzero if it's pending or currently executing + return self.args is not None + + property pending: + + def __get__(self): + return self.callback is not None + + def __repr__(self): + if Py_ReprEnter(<PyObjectPtr>self) != 0: + return "<...>" + try: + format = self._format() + result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format) + if self.pending: + result += " pending" + if self.callback is not None: + result += " callback=%r" % (self.callback, ) + if self.args is not None: + result += " args=%r" % (self.args, ) + if self.callback is None and self.args is None: + result += " stopped" + return result + ">" + finally: + Py_ReprLeave(<PyObjectPtr>self) + + def _format(self): + return '' + + + + +# about readonly _flags attribute: +# bit #1 set if object owns Python reference to itself (Py_INCREF was called and we must call Py_DECREF later) +# bit #2 set if ev_unref() was called and we must call ev_ref() later +# bit #3 set if user wants to call ev_unref() before start() + + + + + + + + + + + + + + +cdef public class watcher [object PyGeventWatcherObject, type PyGeventWatcher_Type]: + """Abstract base class for all the watchers""" + + def __repr__(self): + if Py_ReprEnter(<PyObjectPtr>self) != 0: + return "<...>" + try: + format = self._format() + result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format) + if self.active: + result += " active" + if self.pending: + result += " pending" + if self.callback is not None: + result += " callback=%r" % (self.callback, ) + if self.args is not None: + result += " args=%r" % (self.args, ) + return result + ">" + finally: + Py_ReprLeave(<PyObjectPtr>self) + + def _format(self): + return '' + + +cdef public class io(watcher) [object PyGeventIOObject, type PyGeventIO_Type]: + + + cdef public loop loop + cdef object _callback + cdef public tuple args + cdef readonly int _flags + cdef libev.ev_io _watcher + + property ref: + + def __get__(self): + return False if self._flags & 4 else True + + def __set__(self, object value): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if value: + if not self._flags & 4: + return # ref is already True + if self._flags & 2: # ev_unref was called, undo + libev.ev_ref(self.loop._ptr) + self._flags &= ~6 # do not want unref, no outstanding unref + else: + if self._flags & 4: + return # ref is already False + self._flags |= 4 + if not self._flags & 2 and libev.ev_is_active(&self._watcher): + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + + property callback: + + def __get__(self): + return self._callback + + def __set__(self, object callback): + if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None: + raise TypeError("Expected callable, not %r" % (callback, )) + self._callback = callback + + def stop(self): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if self._flags & 2: + libev.ev_ref(self.loop._ptr) + self._flags &= ~2 + libev.ev_io_stop(self.loop._ptr, &self._watcher) + self._callback = None + self.args = None + if self._flags & 1: + Py_DECREF(<PyObjectPtr>self) + self._flags &= ~1 + + property priority: + + def __get__(self): + return libev.ev_priority(&self._watcher) + + def __set__(self, int priority): + if libev.ev_is_active(&self._watcher): + raise AttributeError("Cannot set priority of an active watcher") + libev.ev_set_priority(&self._watcher, priority) + + def feed(self, int revents, object callback, *args): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + self.callback = callback + self.args = args + if self._flags & 6 == 4: + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + libev.ev_feed_event(self.loop._ptr, &self._watcher, revents) + if not self._flags & 1: + Py_INCREF(<PyObjectPtr>self) + self._flags |= 1 + + def start(self, object callback, *args, pass_events=False): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if callback is None: + raise TypeError('callback must be callable, not None') + self.callback = callback + if pass_events: + self.args = (GEVENT_CORE_EVENTS, ) + args + else: + self.args = args + if self._flags & 6 == 4: + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + libev.ev_io_start(self.loop._ptr, &self._watcher) + if not self._flags & 1: + Py_INCREF(<PyObjectPtr>self) + self._flags |= 1 + + property active: + + def __get__(self): + return True if libev.ev_is_active(&self._watcher) else False + + + property pending: + + def __get__(self): + return True if libev.ev_is_pending(&self._watcher) else False + +#ifdef _WIN32 + + def __init__(self, loop loop, libev.vfd_socket_t fd, int events, ref=True, priority=None): + if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE): + raise ValueError('illegal event mask: %r' % events) + cdef int vfd = libev.vfd_open(fd) + libev.vfd_free(self._watcher.fd) + libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, vfd, events) + self.loop = loop + if ref: + self._flags = 0 + else: + self._flags = 4 + if priority is not None: + libev.ev_set_priority(&self._watcher, priority) + +#else + + def __init__(self, loop loop, int fd, int events, ref=True, priority=None): + if fd < 0: + raise ValueError('fd must be non-negative: %r' % fd) + if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE): + raise ValueError('illegal event mask: %r' % events) + libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, fd, events) + self.loop = loop + if ref: + self._flags = 0 + else: + self._flags = 4 + if priority is not None: + libev.ev_set_priority(&self._watcher, priority) + +#endif + + property fd: + + def __get__(self): + return libev.vfd_get(self._watcher.fd) + + def __set__(self, long fd): + if libev.ev_is_active(&self._watcher): + raise AttributeError("'io' watcher attribute 'fd' is read-only while watcher is active") + cdef int vfd = libev.vfd_open(fd) + libev.vfd_free(self._watcher.fd) + libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, vfd, self._watcher.events) + + property events: + + def __get__(self): + return self._watcher.events + + def __set__(self, int events): + if libev.ev_is_active(&self._watcher): + raise AttributeError("'io' watcher attribute 'events' is read-only while watcher is active") + libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, self._watcher.fd, events) + + property events_str: + + def __get__(self): + return _events_to_str(self._watcher.events) + + def _format(self): + return ' fd=%s events=%s' % (self.fd, self.events_str) + +#ifdef _WIN32 + + def __cinit__(self): + self._watcher.fd = -1; + + def __dealloc__(self): + libev.vfd_free(self._watcher.fd) + +#endif + + +cdef public class timer(watcher) [object PyGeventTimerObject, type PyGeventTimer_Type]: + + + cdef public loop loop + cdef object _callback + cdef public tuple args + cdef readonly int _flags + cdef libev.ev_timer _watcher + + property ref: + + def __get__(self): + return False if self._flags & 4 else True + + def __set__(self, object value): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if value: + if not self._flags & 4: + return # ref is already True + if self._flags & 2: # ev_unref was called, undo + libev.ev_ref(self.loop._ptr) + self._flags &= ~6 # do not want unref, no outstanding unref + else: + if self._flags & 4: + return # ref is already False + self._flags |= 4 + if not self._flags & 2 and libev.ev_is_active(&self._watcher): + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + + property callback: + + def __get__(self): + return self._callback + + def __set__(self, object callback): + if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None: + raise TypeError("Expected callable, not %r" % (callback, )) + self._callback = callback + + def stop(self): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if self._flags & 2: + libev.ev_ref(self.loop._ptr) + self._flags &= ~2 + libev.ev_timer_stop(self.loop._ptr, &self._watcher) + self._callback = None + self.args = None + if self._flags & 1: + Py_DECREF(<PyObjectPtr>self) + self._flags &= ~1 + + property priority: + + def __get__(self): + return libev.ev_priority(&self._watcher) + + def __set__(self, int priority): + if libev.ev_is_active(&self._watcher): + raise AttributeError("Cannot set priority of an active watcher") + libev.ev_set_priority(&self._watcher, priority) + + def feed(self, int revents, object callback, *args): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + self.callback = callback + self.args = args + if self._flags & 6 == 4: + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + libev.ev_feed_event(self.loop._ptr, &self._watcher, revents) + if not self._flags & 1: + Py_INCREF(<PyObjectPtr>self) + self._flags |= 1 + + def start(self, object callback, *args, update=True): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if callback is None: + raise TypeError('callback must be callable, not None') + self.callback = callback + self.args = args + if self._flags & 6 == 4: + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + if update: + libev.ev_now_update(self.loop._ptr) + libev.ev_timer_start(self.loop._ptr, &self._watcher) + if not self._flags & 1: + Py_INCREF(<PyObjectPtr>self) + self._flags |= 1 + + property active: + + def __get__(self): + return True if libev.ev_is_active(&self._watcher) else False + + + property pending: + + def __get__(self): + return True if libev.ev_is_pending(&self._watcher) else False + + def __init__(self, loop loop, double after=0.0, double repeat=0.0, ref=True, priority=None): + if repeat < 0.0: + raise ValueError("repeat must be positive or zero: %r" % repeat) + libev.ev_timer_init(&self._watcher, <void *>gevent_callback_timer, after, repeat) + self.loop = loop + if ref: + self._flags = 0 + else: + self._flags = 4 + if priority is not None: + libev.ev_set_priority(&self._watcher, priority) + + property at: + + def __get__(self): + return self._watcher.at + + # QQQ: add 'after' and 'repeat' properties? + + def again(self, object callback, *args, update=True): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + self.callback = callback + self.args = args + if self._flags & 6 == 4: + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + if update: + libev.ev_now_update(self.loop._ptr) + libev.ev_timer_again(self.loop._ptr, &self._watcher) + if not self._flags & 1: + Py_INCREF(<PyObjectPtr>self) + self._flags |= 1 + + +cdef public class signal(watcher) [object PyGeventSignalObject, type PyGeventSignal_Type]: + + + cdef public loop loop + cdef object _callback + cdef public tuple args + cdef readonly int _flags + cdef libev.ev_signal _watcher + + property ref: + + def __get__(self): + return False if self._flags & 4 else True + + def __set__(self, object value): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if value: + if not self._flags & 4: + return # ref is already True + if self._flags & 2: # ev_unref was called, undo + libev.ev_ref(self.loop._ptr) + self._flags &= ~6 # do not want unref, no outstanding unref + else: + if self._flags & 4: + return # ref is already False + self._flags |= 4 + if not self._flags & 2 and libev.ev_is_active(&self._watcher): + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + + property callback: + + def __get__(self): + return self._callback + + def __set__(self, object callback): + if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None: + raise TypeError("Expected callable, not %r" % (callback, )) + self._callback = callback + + def stop(self): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if self._flags & 2: + libev.ev_ref(self.loop._ptr) + self._flags &= ~2 + libev.ev_signal_stop(self.loop._ptr, &self._watcher) + self._callback = None + self.args = None + if self._flags & 1: + Py_DECREF(<PyObjectPtr>self) + self._flags &= ~1 + + property priority: + + def __get__(self): + return libev.ev_priority(&self._watcher) + + def __set__(self, int priority): + if libev.ev_is_active(&self._watcher): + raise AttributeError("Cannot set priority of an active watcher") + libev.ev_set_priority(&self._watcher, priority) + + def feed(self, int revents, object callback, *args): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + self.callback = callback + self.args = args + if self._flags & 6 == 4: + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + libev.ev_feed_event(self.loop._ptr, &self._watcher, revents) + if not self._flags & 1: + Py_INCREF(<PyObjectPtr>self) + self._flags |= 1 + + def start(self, object callback, *args): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if callback is None: + raise TypeError('callback must be callable, not None') + self.callback = callback + self.args = args + if self._flags & 6 == 4: + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + libev.ev_signal_start(self.loop._ptr, &self._watcher) + if not self._flags & 1: + Py_INCREF(<PyObjectPtr>self) + self._flags |= 1 + + property active: + + def __get__(self): + return True if libev.ev_is_active(&self._watcher) else False + + + property pending: + + def __get__(self): + return True if libev.ev_is_pending(&self._watcher) else False + + def __init__(self, loop loop, int signalnum, ref=True, priority=None): + if signalnum < 1 or signalnum >= signalmodule.NSIG: + raise ValueError('illegal signal number: %r' % signalnum) + # still possible to crash on one of libev's asserts: + # 1) "libev: ev_signal_start called with illegal signal number" + # EV_NSIG might be different from signal.NSIG on some platforms + # 2) "libev: a signal must not be attached to two different loops" + # we probably could check that in LIBEV_EMBED mode, but not in general + libev.ev_signal_init(&self._watcher, <void *>gevent_callback_signal, signalnum) + self.loop = loop + if ref: + self._flags = 0 + else: + self._flags = 4 + if priority is not None: + libev.ev_set_priority(&self._watcher, priority) + + +cdef public class idle(watcher) [object PyGeventIdleObject, type PyGeventIdle_Type]: + + + cdef public loop loop + cdef object _callback + cdef public tuple args + cdef readonly int _flags + cdef libev.ev_idle _watcher + + property ref: + + def __get__(self): + return False if self._flags & 4 else True + + def __set__(self, object value): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if value: + if not self._flags & 4: + return # ref is already True + if self._flags & 2: # ev_unref was called, undo + libev.ev_ref(self.loop._ptr) + self._flags &= ~6 # do not want unref, no outstanding unref + else: + if self._flags & 4: + return # ref is already False + self._flags |= 4 + if not self._flags & 2 and libev.ev_is_active(&self._watcher): + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + + property callback: + + def __get__(self): + return self._callback + + def __set__(self, object callback): + if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None: + raise TypeError("Expected callable, not %r" % (callback, )) + self._callback = callback + + def stop(self): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if self._flags & 2: + libev.ev_ref(self.loop._ptr) + self._flags &= ~2 + libev.ev_idle_stop(self.loop._ptr, &self._watcher) + self._callback = None + self.args = None + if self._flags & 1: + Py_DECREF(<PyObjectPtr>self) + self._flags &= ~1 + + property priority: + + def __get__(self): + return libev.ev_priority(&self._watcher) + + def __set__(self, int priority): + if libev.ev_is_active(&self._watcher): + raise AttributeError("Cannot set priority of an active watcher") + libev.ev_set_priority(&self._watcher, priority) + + def feed(self, int revents, object callback, *args): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + self.callback = callback + self.args = args + if self._flags & 6 == 4: + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + libev.ev_feed_event(self.loop._ptr, &self._watcher, revents) + if not self._flags & 1: + Py_INCREF(<PyObjectPtr>self) + self._flags |= 1 + + def start(self, object callback, *args): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if callback is None: + raise TypeError('callback must be callable, not None') + self.callback = callback + self.args = args + if self._flags & 6 == 4: + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + libev.ev_idle_start(self.loop._ptr, &self._watcher) + if not self._flags & 1: + Py_INCREF(<PyObjectPtr>self) + self._flags |= 1 + + property active: + + def __get__(self): + return True if libev.ev_is_active(&self._watcher) else False + + + property pending: + + def __get__(self): + return True if libev.ev_is_pending(&self._watcher) else False + + + def __init__(self, loop loop , ref=True, priority=None): + libev.ev_idle_init(&self._watcher, <void *>gevent_callback_idle ) + self.loop = loop + if ref: + self._flags = 0 + else: + self._flags = 4 + if priority is not None: + libev.ev_set_priority(&self._watcher, priority) + + +cdef public class prepare(watcher) [object PyGeventPrepareObject, type PyGeventPrepare_Type]: + + + cdef public loop loop + cdef object _callback + cdef public tuple args + cdef readonly int _flags + cdef libev.ev_prepare _watcher + + property ref: + + def __get__(self): + return False if self._flags & 4 else True + + def __set__(self, object value): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if value: + if not self._flags & 4: + return # ref is already True + if self._flags & 2: # ev_unref was called, undo + libev.ev_ref(self.loop._ptr) + self._flags &= ~6 # do not want unref, no outstanding unref + else: + if self._flags & 4: + return # ref is already False + self._flags |= 4 + if not self._flags & 2 and libev.ev_is_active(&self._watcher): + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + + property callback: + + def __get__(self): + return self._callback + + def __set__(self, object callback): + if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None: + raise TypeError("Expected callable, not %r" % (callback, )) + self._callback = callback + + def stop(self): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if self._flags & 2: + libev.ev_ref(self.loop._ptr) + self._flags &= ~2 + libev.ev_prepare_stop(self.loop._ptr, &self._watcher) + self._callback = None + self.args = None + if self._flags & 1: + Py_DECREF(<PyObjectPtr>self) + self._flags &= ~1 + + property priority: + + def __get__(self): + return libev.ev_priority(&self._watcher) + + def __set__(self, int priority): + if libev.ev_is_active(&self._watcher): + raise AttributeError("Cannot set priority of an active watcher") + libev.ev_set_priority(&self._watcher, priority) + + def feed(self, int revents, object callback, *args): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + self.callback = callback + self.args = args + if self._flags & 6 == 4: + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + libev.ev_feed_event(self.loop._ptr, &self._watcher, revents) + if not self._flags & 1: + Py_INCREF(<PyObjectPtr>self) + self._flags |= 1 + + def start(self, object callback, *args): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if callback is None: + raise TypeError('callback must be callable, not None') + self.callback = callback + self.args = args + if self._flags & 6 == 4: + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + libev.ev_prepare_start(self.loop._ptr, &self._watcher) + if not self._flags & 1: + Py_INCREF(<PyObjectPtr>self) + self._flags |= 1 + + property active: + + def __get__(self): + return True if libev.ev_is_active(&self._watcher) else False + + + property pending: + + def __get__(self): + return True if libev.ev_is_pending(&self._watcher) else False + + + def __init__(self, loop loop , ref=True, priority=None): + libev.ev_prepare_init(&self._watcher, <void *>gevent_callback_prepare ) + self.loop = loop + if ref: + self._flags = 0 + else: + self._flags = 4 + if priority is not None: + libev.ev_set_priority(&self._watcher, priority) + + +cdef public class check(watcher) [object PyGeventCheckObject, type PyGeventCheck_Type]: + + + cdef public loop loop + cdef object _callback + cdef public tuple args + cdef readonly int _flags + cdef libev.ev_check _watcher + + property ref: + + def __get__(self): + return False if self._flags & 4 else True + + def __set__(self, object value): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if value: + if not self._flags & 4: + return # ref is already True + if self._flags & 2: # ev_unref was called, undo + libev.ev_ref(self.loop._ptr) + self._flags &= ~6 # do not want unref, no outstanding unref + else: + if self._flags & 4: + return # ref is already False + self._flags |= 4 + if not self._flags & 2 and libev.ev_is_active(&self._watcher): + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + + property callback: + + def __get__(self): + return self._callback + + def __set__(self, object callback): + if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None: + raise TypeError("Expected callable, not %r" % (callback, )) + self._callback = callback + + def stop(self): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if self._flags & 2: + libev.ev_ref(self.loop._ptr) + self._flags &= ~2 + libev.ev_check_stop(self.loop._ptr, &self._watcher) + self._callback = None + self.args = None + if self._flags & 1: + Py_DECREF(<PyObjectPtr>self) + self._flags &= ~1 + + property priority: + + def __get__(self): + return libev.ev_priority(&self._watcher) + + def __set__(self, int priority): + if libev.ev_is_active(&self._watcher): + raise AttributeError("Cannot set priority of an active watcher") + libev.ev_set_priority(&self._watcher, priority) + + def feed(self, int revents, object callback, *args): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + self.callback = callback + self.args = args + if self._flags & 6 == 4: + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + libev.ev_feed_event(self.loop._ptr, &self._watcher, revents) + if not self._flags & 1: + Py_INCREF(<PyObjectPtr>self) + self._flags |= 1 + + def start(self, object callback, *args): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if callback is None: + raise TypeError('callback must be callable, not None') + self.callback = callback + self.args = args + if self._flags & 6 == 4: + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + libev.ev_check_start(self.loop._ptr, &self._watcher) + if not self._flags & 1: + Py_INCREF(<PyObjectPtr>self) + self._flags |= 1 + + property active: + + def __get__(self): + return True if libev.ev_is_active(&self._watcher) else False + + + property pending: + + def __get__(self): + return True if libev.ev_is_pending(&self._watcher) else False + + + def __init__(self, loop loop , ref=True, priority=None): + libev.ev_check_init(&self._watcher, <void *>gevent_callback_check ) + self.loop = loop + if ref: + self._flags = 0 + else: + self._flags = 4 + if priority is not None: + libev.ev_set_priority(&self._watcher, priority) + + +cdef public class fork(watcher) [object PyGeventForkObject, type PyGeventFork_Type]: + + + cdef public loop loop + cdef object _callback + cdef public tuple args + cdef readonly int _flags + cdef libev.ev_fork _watcher + + property ref: + + def __get__(self): + return False if self._flags & 4 else True + + def __set__(self, object value): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if value: + if not self._flags & 4: + return # ref is already True + if self._flags & 2: # ev_unref was called, undo + libev.ev_ref(self.loop._ptr) + self._flags &= ~6 # do not want unref, no outstanding unref + else: + if self._flags & 4: + return # ref is already False + self._flags |= 4 + if not self._flags & 2 and libev.ev_is_active(&self._watcher): + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + + property callback: + + def __get__(self): + return self._callback + + def __set__(self, object callback): + if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None: + raise TypeError("Expected callable, not %r" % (callback, )) + self._callback = callback + + def stop(self): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if self._flags & 2: + libev.ev_ref(self.loop._ptr) + self._flags &= ~2 + libev.ev_fork_stop(self.loop._ptr, &self._watcher) + self._callback = None + self.args = None + if self._flags & 1: + Py_DECREF(<PyObjectPtr>self) + self._flags &= ~1 + + property priority: + + def __get__(self): + return libev.ev_priority(&self._watcher) + + def __set__(self, int priority): + if libev.ev_is_active(&self._watcher): + raise AttributeError("Cannot set priority of an active watcher") + libev.ev_set_priority(&self._watcher, priority) + + def feed(self, int revents, object callback, *args): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + self.callback = callback + self.args = args + if self._flags & 6 == 4: + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + libev.ev_feed_event(self.loop._ptr, &self._watcher, revents) + if not self._flags & 1: + Py_INCREF(<PyObjectPtr>self) + self._flags |= 1 + + def start(self, object callback, *args): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if callback is None: + raise TypeError('callback must be callable, not None') + self.callback = callback + self.args = args + if self._flags & 6 == 4: + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + libev.ev_fork_start(self.loop._ptr, &self._watcher) + if not self._flags & 1: + Py_INCREF(<PyObjectPtr>self) + self._flags |= 1 + + property active: + + def __get__(self): + return True if libev.ev_is_active(&self._watcher) else False + + + property pending: + + def __get__(self): + return True if libev.ev_is_pending(&self._watcher) else False + + + def __init__(self, loop loop , ref=True, priority=None): + libev.ev_fork_init(&self._watcher, <void *>gevent_callback_fork ) + self.loop = loop + if ref: + self._flags = 0 + else: + self._flags = 4 + if priority is not None: + libev.ev_set_priority(&self._watcher, priority) + + +cdef public class async(watcher) [object PyGeventAsyncObject, type PyGeventAsync_Type]: + + + cdef public loop loop + cdef object _callback + cdef public tuple args + cdef readonly int _flags + cdef libev.ev_async _watcher + + property ref: + + def __get__(self): + return False if self._flags & 4 else True + + def __set__(self, object value): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if value: + if not self._flags & 4: + return # ref is already True + if self._flags & 2: # ev_unref was called, undo + libev.ev_ref(self.loop._ptr) + self._flags &= ~6 # do not want unref, no outstanding unref + else: + if self._flags & 4: + return # ref is already False + self._flags |= 4 + if not self._flags & 2 and libev.ev_is_active(&self._watcher): + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + + property callback: + + def __get__(self): + return self._callback + + def __set__(self, object callback): + if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None: + raise TypeError("Expected callable, not %r" % (callback, )) + self._callback = callback + + def stop(self): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if self._flags & 2: + libev.ev_ref(self.loop._ptr) + self._flags &= ~2 + libev.ev_async_stop(self.loop._ptr, &self._watcher) + self._callback = None + self.args = None + if self._flags & 1: + Py_DECREF(<PyObjectPtr>self) + self._flags &= ~1 + + property priority: + + def __get__(self): + return libev.ev_priority(&self._watcher) + + def __set__(self, int priority): + if libev.ev_is_active(&self._watcher): + raise AttributeError("Cannot set priority of an active watcher") + libev.ev_set_priority(&self._watcher, priority) + + def feed(self, int revents, object callback, *args): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + self.callback = callback + self.args = args + if self._flags & 6 == 4: + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + libev.ev_feed_event(self.loop._ptr, &self._watcher, revents) + if not self._flags & 1: + Py_INCREF(<PyObjectPtr>self) + self._flags |= 1 + + def start(self, object callback, *args): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if callback is None: + raise TypeError('callback must be callable, not None') + self.callback = callback + self.args = args + if self._flags & 6 == 4: + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + libev.ev_async_start(self.loop._ptr, &self._watcher) + if not self._flags & 1: + Py_INCREF(<PyObjectPtr>self) + self._flags |= 1 + + property active: + + def __get__(self): + return True if libev.ev_is_active(&self._watcher) else False + + property pending: + + def __get__(self): + return True if libev.ev_async_pending(&self._watcher) else False + + + def __init__(self, loop loop , ref=True, priority=None): + libev.ev_async_init(&self._watcher, <void *>gevent_callback_async ) + self.loop = loop + if ref: + self._flags = 0 + else: + self._flags = 4 + if priority is not None: + libev.ev_set_priority(&self._watcher, priority) + + def send(self): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + libev.ev_async_send(self.loop._ptr, &self._watcher) + +#ifdef _WIN32 +#else + +cdef public class child(watcher) [object PyGeventChildObject, type PyGeventChild_Type]: + + + cdef public loop loop + cdef object _callback + cdef public tuple args + cdef readonly int _flags + cdef libev.ev_child _watcher + + property ref: + + def __get__(self): + return False if self._flags & 4 else True + + def __set__(self, object value): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if value: + if not self._flags & 4: + return # ref is already True + if self._flags & 2: # ev_unref was called, undo + libev.ev_ref(self.loop._ptr) + self._flags &= ~6 # do not want unref, no outstanding unref + else: + if self._flags & 4: + return # ref is already False + self._flags |= 4 + if not self._flags & 2 and libev.ev_is_active(&self._watcher): + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + + property callback: + + def __get__(self): + return self._callback + + def __set__(self, object callback): + if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None: + raise TypeError("Expected callable, not %r" % (callback, )) + self._callback = callback + + def stop(self): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if self._flags & 2: + libev.ev_ref(self.loop._ptr) + self._flags &= ~2 + libev.ev_child_stop(self.loop._ptr, &self._watcher) + self._callback = None + self.args = None + if self._flags & 1: + Py_DECREF(<PyObjectPtr>self) + self._flags &= ~1 + + property priority: + + def __get__(self): + return libev.ev_priority(&self._watcher) + + def __set__(self, int priority): + if libev.ev_is_active(&self._watcher): + raise AttributeError("Cannot set priority of an active watcher") + libev.ev_set_priority(&self._watcher, priority) + + def feed(self, int revents, object callback, *args): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + self.callback = callback + self.args = args + if self._flags & 6 == 4: + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + libev.ev_feed_event(self.loop._ptr, &self._watcher, revents) + if not self._flags & 1: + Py_INCREF(<PyObjectPtr>self) + self._flags |= 1 + + def start(self, object callback, *args): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if callback is None: + raise TypeError('callback must be callable, not None') + self.callback = callback + self.args = args + if self._flags & 6 == 4: + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + libev.ev_child_start(self.loop._ptr, &self._watcher) + if not self._flags & 1: + Py_INCREF(<PyObjectPtr>self) + self._flags |= 1 + + property active: + + def __get__(self): + return True if libev.ev_is_active(&self._watcher) else False + + + property pending: + + def __get__(self): + return True if libev.ev_is_pending(&self._watcher) else False + + def __init__(self, loop loop, int pid, bint trace=0, ref=True): + if not loop.default: + raise TypeError('child watchers are only available on the default loop') + libev.gevent_install_sigchld_handler() + libev.ev_child_init(&self._watcher, <void *>gevent_callback_child, pid, trace) + self.loop = loop + if ref: + self._flags = 0 + else: + self._flags = 4 + + def _format(self): + return ' pid=%r rstatus=%r' % (self.pid, self.rstatus) + + property pid: + + def __get__(self): + return self._watcher.pid + + property rpid: + + def __get__(self): + return self._watcher.rpid + + def __set__(self, int value): + self._watcher.rpid = value + + property rstatus: + + def __get__(self): + return self._watcher.rstatus + + def __set__(self, int value): + self._watcher.rstatus = value + +#endif + + +cdef public class stat(watcher) [object PyGeventStatObject, type PyGeventStat_Type]: + + + cdef public loop loop + cdef object _callback + cdef public tuple args + cdef readonly int _flags + cdef libev.ev_stat _watcher + + property ref: + + def __get__(self): + return False if self._flags & 4 else True + + def __set__(self, object value): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if value: + if not self._flags & 4: + return # ref is already True + if self._flags & 2: # ev_unref was called, undo + libev.ev_ref(self.loop._ptr) + self._flags &= ~6 # do not want unref, no outstanding unref + else: + if self._flags & 4: + return # ref is already False + self._flags |= 4 + if not self._flags & 2 and libev.ev_is_active(&self._watcher): + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + + property callback: + + def __get__(self): + return self._callback + + def __set__(self, object callback): + if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None: + raise TypeError("Expected callable, not %r" % (callback, )) + self._callback = callback + + def stop(self): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if self._flags & 2: + libev.ev_ref(self.loop._ptr) + self._flags &= ~2 + libev.ev_stat_stop(self.loop._ptr, &self._watcher) + self._callback = None + self.args = None + if self._flags & 1: + Py_DECREF(<PyObjectPtr>self) + self._flags &= ~1 + + property priority: + + def __get__(self): + return libev.ev_priority(&self._watcher) + + def __set__(self, int priority): + if libev.ev_is_active(&self._watcher): + raise AttributeError("Cannot set priority of an active watcher") + libev.ev_set_priority(&self._watcher, priority) + + def feed(self, int revents, object callback, *args): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + self.callback = callback + self.args = args + if self._flags & 6 == 4: + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + libev.ev_feed_event(self.loop._ptr, &self._watcher, revents) + if not self._flags & 1: + Py_INCREF(<PyObjectPtr>self) + self._flags |= 1 + + def start(self, object callback, *args): + + if not self.loop._ptr: + raise ValueError('operation on destroyed loop') + if callback is None: + raise TypeError('callback must be callable, not None') + self.callback = callback + self.args = args + if self._flags & 6 == 4: + libev.ev_unref(self.loop._ptr) + self._flags |= 2 + libev.ev_stat_start(self.loop._ptr, &self._watcher) + if not self._flags & 1: + Py_INCREF(<PyObjectPtr>self) + self._flags |= 1 + + property active: + + def __get__(self): + return True if libev.ev_is_active(&self._watcher) else False + + + property pending: + + def __get__(self): + return True if libev.ev_is_pending(&self._watcher) else False + cdef readonly str path + cdef readonly bytes _paths + + def __init__(self, loop loop, str path, float interval=0.0, ref=True, priority=None): + self.path = path + cdef bytes paths + if isinstance(path, unicode): + # the famous Python3 filesystem encoding debacle hits us here. Can we do better? + # We must keep a reference to the encoded string so that its bytes don't get freed + # and overwritten, leading to strange errors from libev ("no such file or directory") + paths = (<unicode>path).encode(sys.getfilesystemencoding()) + self._paths = paths + else: + paths = <bytes>path + self._paths = paths + libev.ev_stat_init(&self._watcher, <void *>gevent_callback_stat, <char*>paths, interval) + self.loop = loop + if ref: + self._flags = 0 + else: + self._flags = 4 + if priority is not None: + libev.ev_set_priority(&self._watcher, priority) + + property attr: + + def __get__(self): + if not self._watcher.attr.st_nlink: + return + return _pystat_fromstructstat(&self._watcher.attr) + + property prev: + + def __get__(self): + if not self._watcher.prev.st_nlink: + return + return _pystat_fromstructstat(&self._watcher.prev) + + property interval: + + def __get__(self): + return self._watcher.interval + + +__SYSERR_CALLBACK = None + + +cdef void _syserr_cb(char* msg) with gil: + try: + __SYSERR_CALLBACK(msg, errno) + except: + set_syserr_cb(None) + print_exc = getattr(traceback, 'print_exc', None) + if print_exc is not None: + print_exc() + + +cpdef set_syserr_cb(callback): + global __SYSERR_CALLBACK + if callback is None: + libev.ev_set_syserr_cb(NULL) + __SYSERR_CALLBACK = None + elif callable(callback): + libev.ev_set_syserr_cb(<void *>_syserr_cb) + __SYSERR_CALLBACK = callback + else: + raise TypeError('Expected callable or None, got %r' % (callback, )) + + +#ifdef LIBEV_EMBED +LIBEV_EMBED = True +EV_USE_FLOOR = libev.EV_USE_FLOOR +EV_USE_CLOCK_SYSCALL = libev.EV_USE_CLOCK_SYSCALL +EV_USE_REALTIME = libev.EV_USE_REALTIME +EV_USE_MONOTONIC = libev.EV_USE_MONOTONIC +EV_USE_NANOSLEEP = libev.EV_USE_NANOSLEEP +EV_USE_INOTIFY = libev.EV_USE_INOTIFY +EV_USE_SIGNALFD = libev.EV_USE_SIGNALFD +EV_USE_EVENTFD = libev.EV_USE_EVENTFD +EV_USE_4HEAP = libev.EV_USE_4HEAP +#else +LIBEV_EMBED = False +#endif diff --git a/python/gevent/libev/corecffi.py b/python/gevent/libev/corecffi.py new file mode 100644 index 0000000..7283fb4 --- /dev/null +++ b/python/gevent/libev/corecffi.py @@ -0,0 +1,1132 @@ +# pylint:disable=too-many-lines, protected-access, redefined-outer-name, not-callable, +# pylint:disable=no-member +from __future__ import absolute_import, print_function +import sys +import os +import traceback +import signal as signalmodule + +# pylint:disable=undefined-all-variable +__all__ = [ + 'get_version', + 'get_header_version', + 'supported_backends', + 'recommended_backends', + 'embeddable_backends', + 'time', + 'loop', +] + +import gevent.libev._corecffi as _corecffi # pylint:disable=no-name-in-module + +ffi = _corecffi.ffi # pylint:disable=no-member +libev = _corecffi.lib # pylint:disable=no-member + +if hasattr(libev, 'vfd_open'): + # Must be on windows + assert sys.platform.startswith("win"), "vfd functions only needed on windows" + vfd_open = libev.vfd_open + vfd_free = libev.vfd_free + vfd_get = libev.vfd_get +else: + vfd_open = vfd_free = vfd_get = lambda fd: fd + +##### +## NOTE on Windows: +# The C implementation does several things specially for Windows; +# a possibly incomplete list is: +# +# - the loop runs a periodic signal checker; +# - the io watcher constructor is different and it has a destructor; +# - the child watcher is not defined +# +# The CFFI implementation does none of these things, and so +# is possibly NOT FUNCTIONALLY CORRECT on Win32 +##### + +##### +## Note on CFFI objects, callbacks and the lifecycle of watcher objects +# +# Each subclass of `watcher` allocates a C structure of the +# appropriate type e.g., struct gevent_ev_io and holds this pointer in +# its `_gwatcher` attribute. When that watcher instance is garbage +# collected, then the C structure is also freed. The C structure is +# passed to libev from the watcher's start() method and then to the +# appropriate C callback function, e.g., _gevent_ev_io_callback, which +# passes it back to python's _python_callback where we need the +# watcher instance. Therefore, as long as that callback is active (the +# watcher is started), the watcher instance must not be allowed to get +# GC'd---any access at the C level or even the FFI level to the freed +# memory could crash the process. +# +# However, the typical idiom calls for writing something like this: +# loop.io(fd, python_cb).start() +# thus forgetting the newly created watcher subclass and allowing it to be immediately +# GC'd. To combat this, when the watcher is started, it places itself into the loop's +# `_keepaliveset`, and it only removes itself when the watcher's `stop()` method is called. +# Often, this is the *only* reference keeping the watcher object, and hence its C structure, +# alive. +# +# This is slightly complicated by the fact that the python-level +# callback, called from the C callback, could choose to manually stop +# the watcher. When we return to the C level callback, we now have an +# invalid pointer, and attempting to pass it back to Python (e.g., to +# handle an error) could crash. Hence, _python_callback, +# _gevent_io_callback, and _python_handle_error cooperate to make sure +# that the watcher instance stays in the loops `_keepaliveset` while +# the C code could be running---and if it gets removed, to not call back +# to Python again. +# See also https://github.com/gevent/gevent/issues/676 +#### + + +@ffi.callback("int(void* handle, int revents)") +def _python_callback(handle, revents): + """ + Returns an integer having one of three values: + + - -1 + An exception occurred during the callback and you must call + :func:`_python_handle_error` to deal with it. The Python watcher + object will have the exception tuple saved in ``_exc_info``. + - 0 + Everything went according to plan. You should check to see if the libev + watcher is still active, and call :func:`_python_stop` if so. This will + clean up the memory. + - 1 + Everything went according to plan, but the watcher has already + been stopped. Its memory may no longer be valid. + """ + try: + # Even dereferencing the handle needs to be inside the try/except; + # if we don't return normally (e.g., a signal) then we wind up going + # to the 'onerror' handler, which + # is not what we want; that can permanently wedge the loop depending + # on which callback was executing + the_watcher = ffi.from_handle(handle) + args = the_watcher.args + if args is None: + # Legacy behaviour from corecext: convert None into () + # See test__core_watcher.py + args = _NOARGS + if args and args[0] == GEVENT_CORE_EVENTS: + args = (revents, ) + args[1:] + the_watcher.callback(*args) + except: # pylint:disable=bare-except + the_watcher._exc_info = sys.exc_info() + # Depending on when the exception happened, the watcher + # may or may not have been stopped. We need to make sure its + # memory stays valid so we can stop it at the ev level if needed. + the_watcher.loop._keepaliveset.add(the_watcher) + return -1 + else: + if the_watcher in the_watcher.loop._keepaliveset: + # It didn't stop itself + return 0 + return 1 # It stopped itself +libev.python_callback = _python_callback + + +@ffi.callback("void(void* handle, int revents)") +def _python_handle_error(handle, revents): + try: + watcher = ffi.from_handle(handle) + exc_info = watcher._exc_info + del watcher._exc_info + watcher.loop.handle_error(watcher, *exc_info) + finally: + # XXX Since we're here on an error condition, and we + # made sure that the watcher object was put in loop._keepaliveset, + # what about not stopping the watcher? Looks like a possible + # memory leak? + if revents & (libev.EV_READ | libev.EV_WRITE): + try: + watcher.stop() + except: # pylint:disable=bare-except + watcher.loop.handle_error(watcher, *sys.exc_info()) + return # pylint:disable=lost-exception +libev.python_handle_error = _python_handle_error + + +@ffi.callback("void(void* handle)") +def _python_stop(handle): + watcher = ffi.from_handle(handle) + watcher.stop() +libev.python_stop = _python_stop + + +UNDEF = libev.EV_UNDEF +NONE = libev.EV_NONE +READ = libev.EV_READ +WRITE = libev.EV_WRITE +TIMER = libev.EV_TIMER +PERIODIC = libev.EV_PERIODIC +SIGNAL = libev.EV_SIGNAL +CHILD = libev.EV_CHILD +STAT = libev.EV_STAT +IDLE = libev.EV_IDLE +PREPARE = libev.EV_PREPARE +CHECK = libev.EV_CHECK +EMBED = libev.EV_EMBED +FORK = libev.EV_FORK +CLEANUP = libev.EV_CLEANUP +ASYNC = libev.EV_ASYNC +CUSTOM = libev.EV_CUSTOM +ERROR = libev.EV_ERROR + +READWRITE = libev.EV_READ | libev.EV_WRITE + +MINPRI = libev.EV_MINPRI +MAXPRI = libev.EV_MAXPRI + +BACKEND_PORT = libev.EVBACKEND_PORT +BACKEND_KQUEUE = libev.EVBACKEND_KQUEUE +BACKEND_EPOLL = libev.EVBACKEND_EPOLL +BACKEND_POLL = libev.EVBACKEND_POLL +BACKEND_SELECT = libev.EVBACKEND_SELECT +FORKCHECK = libev.EVFLAG_FORKCHECK +NOINOTIFY = libev.EVFLAG_NOINOTIFY +SIGNALFD = libev.EVFLAG_SIGNALFD +NOSIGMASK = libev.EVFLAG_NOSIGMASK + + +class _EVENTSType(object): + def __repr__(self): + return 'gevent.core.EVENTS' + +EVENTS = GEVENT_CORE_EVENTS = _EVENTSType() + + +def get_version(): + return 'libev-%d.%02d' % (libev.ev_version_major(), libev.ev_version_minor()) + + +def get_header_version(): + return 'libev-%d.%02d' % (libev.EV_VERSION_MAJOR, libev.EV_VERSION_MINOR) + +_flags = [(libev.EVBACKEND_PORT, 'port'), + (libev.EVBACKEND_KQUEUE, 'kqueue'), + (libev.EVBACKEND_EPOLL, 'epoll'), + (libev.EVBACKEND_POLL, 'poll'), + (libev.EVBACKEND_SELECT, 'select'), + (libev.EVFLAG_NOENV, 'noenv'), + (libev.EVFLAG_FORKCHECK, 'forkcheck'), + (libev.EVFLAG_SIGNALFD, 'signalfd'), + (libev.EVFLAG_NOSIGMASK, 'nosigmask')] + +_flags_str2int = dict((string, flag) for (flag, string) in _flags) + +_events = [(libev.EV_READ, 'READ'), + (libev.EV_WRITE, 'WRITE'), + (libev.EV__IOFDSET, '_IOFDSET'), + (libev.EV_PERIODIC, 'PERIODIC'), + (libev.EV_SIGNAL, 'SIGNAL'), + (libev.EV_CHILD, 'CHILD'), + (libev.EV_STAT, 'STAT'), + (libev.EV_IDLE, 'IDLE'), + (libev.EV_PREPARE, 'PREPARE'), + (libev.EV_CHECK, 'CHECK'), + (libev.EV_EMBED, 'EMBED'), + (libev.EV_FORK, 'FORK'), + (libev.EV_CLEANUP, 'CLEANUP'), + (libev.EV_ASYNC, 'ASYNC'), + (libev.EV_CUSTOM, 'CUSTOM'), + (libev.EV_ERROR, 'ERROR')] + + +def _flags_to_list(flags): + result = [] + for code, value in _flags: + if flags & code: + result.append(value) + flags &= ~code + if not flags: + break + if flags: + result.append(flags) + return result + +if sys.version_info[0] >= 3: + basestring = (bytes, str) + integer_types = (int,) +else: + import __builtin__ # pylint:disable=import-error + basestring = __builtin__.basestring, + integer_types = (int, __builtin__.long) + + +def _flags_to_int(flags): + # Note, that order does not matter, libev has its own predefined order + if not flags: + return 0 + if isinstance(flags, integer_types): + return flags + result = 0 + try: + if isinstance(flags, basestring): + flags = flags.split(',') + for value in flags: + value = value.strip().lower() + if value: + result |= _flags_str2int[value] + except KeyError as ex: + raise ValueError('Invalid backend or flag: %s\nPossible values: %s' % (ex, ', '.join(sorted(_flags_str2int.keys())))) + return result + + +def _str_hex(flag): + if isinstance(flag, integer_types): + return hex(flag) + return str(flag) + + +def _check_flags(flags): + as_list = [] + flags &= libev.EVBACKEND_MASK + if not flags: + return + if not flags & libev.EVBACKEND_ALL: + raise ValueError('Invalid value for backend: 0x%x' % flags) + if not flags & libev.ev_supported_backends(): + as_list = [_str_hex(x) for x in _flags_to_list(flags)] + raise ValueError('Unsupported backend: %s' % '|'.join(as_list)) + + +def _events_to_str(events): + result = [] + for (flag, string) in _events: + c_flag = flag + if events & c_flag: + result.append(string) + events = events & (~c_flag) + if not events: + break + if events: + result.append(hex(events)) + return '|'.join(result) + + +def supported_backends(): + return _flags_to_list(libev.ev_supported_backends()) + + +def recommended_backends(): + return _flags_to_list(libev.ev_recommended_backends()) + + +def embeddable_backends(): + return _flags_to_list(libev.ev_embeddable_backends()) + + +def time(): + return libev.ev_time() + +_default_loop_destroyed = False + + +def _loop_callback(*args, **kwargs): + return ffi.callback(*args, **kwargs) + + +class loop(object): + # pylint:disable=too-many-public-methods + + error_handler = None + + def __init__(self, flags=None, default=None): + self._in_callback = False + self._callbacks = [] + + # self._check is a watcher that runs in each iteration of the + # mainloop, just after the blocking call + self._check = ffi.new("struct ev_check *") + self._check_callback_ffi = _loop_callback("void(*)(struct ev_loop *, void*, int)", + self._check_callback, + onerror=self._check_callback_handle_error) + libev.ev_check_init(self._check, self._check_callback_ffi) + + # self._prepare is a watcher that runs in each iteration of the mainloop, + # just before the blocking call + self._prepare = ffi.new("struct ev_prepare *") + self._prepare_callback_ffi = _loop_callback("void(*)(struct ev_loop *, void*, int)", + self._run_callbacks, + onerror=self._check_callback_handle_error) + libev.ev_prepare_init(self._prepare, self._prepare_callback_ffi) + + # A timer we start and stop on demand. If we have callbacks, + # too many to run in one iteration of _run_callbacks, we turn this + # on so as to have the next iteration of the run loop return to us + # as quickly as possible. + # TODO: There may be a more efficient way to do this using ev_timer_again; + # see the "ev_timer" section of the ev manpage (http://linux.die.net/man/3/ev) + self._timer0 = ffi.new("struct ev_timer *") + libev.ev_timer_init(self._timer0, libev.gevent_noop, 0.0, 0.0) + + # TODO: We may be able to do something nicer and use the existing python_callback + # combined with onerror and the class check/timer/prepare to simplify things + # and unify our handling + + c_flags = _flags_to_int(flags) + _check_flags(c_flags) + c_flags |= libev.EVFLAG_NOENV + c_flags |= libev.EVFLAG_FORKCHECK + if default is None: + default = True + if _default_loop_destroyed: + default = False + if default: + self._ptr = libev.gevent_ev_default_loop(c_flags) + if not self._ptr: + raise SystemError("ev_default_loop(%s) failed" % (c_flags, )) + + else: + self._ptr = libev.ev_loop_new(c_flags) + if not self._ptr: + raise SystemError("ev_loop_new(%s) failed" % (c_flags, )) + if default or globals()["__SYSERR_CALLBACK"] is None: + set_syserr_cb(self._handle_syserr) + + libev.ev_prepare_start(self._ptr, self._prepare) + self.unref() + libev.ev_check_start(self._ptr, self._check) + self.unref() + + self._keepaliveset = set() + + def _check_callback_handle_error(self, t, v, tb): + # None as the context argument causes the exception to be raised + # in the main greenlet. + self.handle_error(None, t, v, tb) + + def _check_callback(self, *args): + # If we have the onerror callback, this is a no-op; all the real + # work to rethrow the exception is done by the onerror callback + pass + + def _run_callbacks(self, _evloop, _, _revents): + count = 1000 + libev.ev_timer_stop(self._ptr, self._timer0) + while self._callbacks and count > 0: + callbacks = self._callbacks + self._callbacks = [] + for cb in callbacks: + self.unref() + callback = cb.callback + args = cb.args + if callback is None or args is None: + # it's been stopped + continue + + cb.callback = None + + try: + callback(*args) + except: # pylint:disable=bare-except + # If we allow an exception to escape this method (while we are running the ev callback), + # then CFFI will print the error and libev will continue executing. + # There are two problems with this. The first is that the code after + # the loop won't run. The second is that any remaining callbacks scheduled + # for this loop iteration will be silently dropped; they won't run, but they'll + # also not be *stopped* (which is not a huge deal unless you're looking for + # consistency or checking the boolean/pending status; the loop doesn't keep + # a reference to them like it does to watchers...*UNLESS* the callback itself had + # a reference to a watcher; then I don't know what would happen, it depends on + # the state of the watcher---a leak or crash is not totally inconceivable). + # The Cython implementation in core.ppyx uses gevent_call from callbacks.c + # to run the callback, which uses gevent_handle_error to handle any errors the + # Python callback raises...it unconditionally simply prints any error raised + # by loop.handle_error and clears it, so callback handling continues. + # We take a similar approach (but are extra careful about printing) + try: + self.handle_error(cb, *sys.exc_info()) + except: # pylint:disable=bare-except + try: + print("Exception while handling another error", file=sys.stderr) + traceback.print_exc() + except: # pylint:disable=bare-except + pass # Nothing we can do here + finally: + # NOTE: this must be reset here, because cb.args is used as a flag in + # the callback class so that bool(cb) of a callback that has been run + # becomes False + cb.args = None + count -= 1 + if self._callbacks: + libev.ev_timer_start(self._ptr, self._timer0) + + def _stop_aux_watchers(self): + if libev.ev_is_active(self._prepare): + self.ref() + libev.ev_prepare_stop(self._ptr, self._prepare) + if libev.ev_is_active(self._check): + self.ref() + libev.ev_check_stop(self._ptr, self._check) + + def destroy(self): + global _default_loop_destroyed + if self._ptr: + self._stop_aux_watchers() + if globals()["__SYSERR_CALLBACK"] == self._handle_syserr: + set_syserr_cb(None) + if libev.ev_is_default_loop(self._ptr): + _default_loop_destroyed = True + libev.ev_loop_destroy(self._ptr) + self._ptr = ffi.NULL + + @property + def ptr(self): + return self._ptr + + @property + def WatcherType(self): + return watcher + + @property + def MAXPRI(self): + return libev.EV_MAXPRI + + @property + def MINPRI(self): + return libev.EV_MINPRI + + def _handle_syserr(self, message, errno): + try: + errno = os.strerror(errno) + except: # pylint:disable=bare-except + traceback.print_exc() + try: + message = '%s: %s' % (message, errno) + except: # pylint:disable=bare-except + traceback.print_exc() + self.handle_error(None, SystemError, SystemError(message), None) + + def handle_error(self, context, type, value, tb): + handle_error = None + error_handler = self.error_handler + if error_handler is not None: + # we do want to do getattr every time so that setting Hub.handle_error property just works + handle_error = getattr(error_handler, 'handle_error', error_handler) + handle_error(context, type, value, tb) + else: + self._default_handle_error(context, type, value, tb) + + def _default_handle_error(self, context, type, value, tb): # pylint:disable=unused-argument + # note: Hub sets its own error handler so this is not used by gevent + # this is here to make core.loop usable without the rest of gevent + traceback.print_exception(type, value, tb) + libev.ev_break(self._ptr, libev.EVBREAK_ONE) + + def run(self, nowait=False, once=False): + flags = 0 + if nowait: + flags |= libev.EVRUN_NOWAIT + if once: + flags |= libev.EVRUN_ONCE + + libev.ev_run(self._ptr, flags) + + def reinit(self): + libev.ev_loop_fork(self._ptr) + + def ref(self): + libev.ev_ref(self._ptr) + + def unref(self): + libev.ev_unref(self._ptr) + + def break_(self, how=libev.EVBREAK_ONE): + libev.ev_break(self._ptr, how) + + def verify(self): + libev.ev_verify(self._ptr) + + def now(self): + return libev.ev_now(self._ptr) + + def update(self): + libev.ev_now_update(self._ptr) + + def __repr__(self): + return '<%s at 0x%x %s>' % (self.__class__.__name__, id(self), self._format()) + + @property + def default(self): + return True if libev.ev_is_default_loop(self._ptr) else False + + @property + def iteration(self): + return libev.ev_iteration(self._ptr) + + @property + def depth(self): + return libev.ev_depth(self._ptr) + + @property + def backend_int(self): + return libev.ev_backend(self._ptr) + + @property + def backend(self): + backend = libev.ev_backend(self._ptr) + for key, value in _flags: + if key == backend: + return value + return backend + + @property + def pendingcnt(self): + return libev.ev_pending_count(self._ptr) + + def io(self, fd, events, ref=True, priority=None): + return io(self, fd, events, ref, priority) + + def timer(self, after, repeat=0.0, ref=True, priority=None): + return timer(self, after, repeat, ref, priority) + + def signal(self, signum, ref=True, priority=None): + return signal(self, signum, ref, priority) + + def idle(self, ref=True, priority=None): + return idle(self, ref, priority) + + def prepare(self, ref=True, priority=None): + return prepare(self, ref, priority) + + def check(self, ref=True, priority=None): + return check(self, ref, priority) + + def fork(self, ref=True, priority=None): + return fork(self, ref, priority) + + def async(self, ref=True, priority=None): + return async(self, ref, priority) + + if sys.platform != "win32": + + def child(self, pid, trace=0, ref=True): + return child(self, pid, trace, ref) + + def install_sigchld(self): + libev.gevent_install_sigchld_handler() + + def reset_sigchld(self): + libev.gevent_reset_sigchld_handler() + + def stat(self, path, interval=0.0, ref=True, priority=None): + return stat(self, path, interval, ref, priority) + + def callback(self, priority=None): + return callback(self, priority) + + def run_callback(self, func, *args): + cb = callback(func, args) + self._callbacks.append(cb) + self.ref() + + return cb + + def _format(self): + if not self._ptr: + return 'destroyed' + msg = self.backend + if self.default: + msg += ' default' + msg += ' pending=%s' % self.pendingcnt + msg += self._format_details() + return msg + + def _format_details(self): + msg = '' + fileno = self.fileno() + try: + activecnt = self.activecnt + except AttributeError: + activecnt = None + if activecnt is not None: + msg += ' ref=' + repr(activecnt) + if fileno is not None: + msg += ' fileno=' + repr(fileno) + #if sigfd is not None and sigfd != -1: + # msg += ' sigfd=' + repr(sigfd) + return msg + + def fileno(self): + if self._ptr: + fd = self._ptr.backend_fd + if fd >= 0: + return fd + + @property + def activecnt(self): + if not self._ptr: + raise ValueError('operation on destroyed loop') + return self._ptr.activecnt + +# For times when *args is captured but often not passed (empty), +# we can avoid keeping the new tuple that was created for *args +# around by using a constant. +_NOARGS = () + + +class callback(object): + + __slots__ = ('callback', 'args') + + def __init__(self, callback, args): + self.callback = callback + self.args = args or _NOARGS + + def stop(self): + self.callback = None + self.args = None + + # Note that __nonzero__ and pending are different + # bool() is used in contexts where we need to know whether to schedule another callback, + # so it's true if it's pending or currently running + # 'pending' has the same meaning as libev watchers: it is cleared before actually + # running the callback + + def __nonzero__(self): + # it's nonzero if it's pending or currently executing + # NOTE: This depends on loop._run_callbacks setting the args property + # to None. + return self.args is not None + __bool__ = __nonzero__ + + @property + def pending(self): + return self.callback is not None + + def _format(self): + return '' + + def __repr__(self): + result = "<%s at 0x%x" % (self.__class__.__name__, id(self)) + if self.pending: + result += " pending" + if self.callback is not None: + result += " callback=%r" % (self.callback, ) + if self.args is not None: + result += " args=%r" % (self.args, ) + if self.callback is None and self.args is None: + result += " stopped" + return result + ">" + + +class watcher(object): + + def __init__(self, _loop, ref=True, priority=None, args=_NOARGS): + self.loop = _loop + if ref: + self._flags = 0 + else: + self._flags = 4 + self._args = None + self._callback = None + self._handle = ffi.new_handle(self) + + self._watcher = ffi.new(self._watcher_struct_pointer_type) + self._watcher.data = self._handle + if priority is not None: + libev.ev_set_priority(self._watcher, priority) + self._watcher_init(self._watcher, + self._watcher_callback, + *args) + + # A string identifying the type of libev object we watch, e.g., 'ev_io' + # This should be a class attribute. + _watcher_type = None + # A class attribute that is the callback on the libev object that init's the C struct, + # e.g., libev.ev_io_init. If None, will be set by _init_subclasses. + _watcher_init = None + # A class attribute that is the callback on the libev object that starts the C watcher, + # e.g., libev.ev_io_start. If None, will be set by _init_subclasses. + _watcher_start = None + # A class attribute that is the callback on the libev object that stops the C watcher, + # e.g., libev.ev_io_stop. If None, will be set by _init_subclasses. + _watcher_stop = None + # A cffi ctype object identifying the struct pointer we create. + # This is a class attribute set based on the _watcher_type + _watcher_struct_pointer_type = None + # The attribute of the libev object identifying the custom + # callback function for this type of watcher. This is a class + # attribute set based on the _watcher_type in _init_subclasses. + _watcher_callback = None + + @classmethod + def _init_subclasses(cls): + for subclass in cls.__subclasses__(): # pylint:disable=no-member + watcher_type = subclass._watcher_type + subclass._watcher_struct_pointer_type = ffi.typeof('struct ' + watcher_type + '*') + subclass._watcher_callback = ffi.addressof(libev, + '_gevent_generic_callback') + for name in 'start', 'stop', 'init': + ev_name = watcher_type + '_' + name + watcher_name = '_watcher' + '_' + name + if getattr(subclass, watcher_name) is None: + setattr(subclass, watcher_name, + getattr(libev, ev_name)) + + # this is not needed, since we keep alive the watcher while it's started + #def __del__(self): + # self._watcher_stop(self.loop._ptr, self._watcher) + + def __repr__(self): + formats = self._format() + result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), formats) + if self.pending: + result += " pending" + if self.callback is not None: + result += " callback=%r" % (self.callback, ) + if self.args is not None: + result += " args=%r" % (self.args, ) + if self.callback is None and self.args is None: + result += " stopped" + result += " handle=%s" % (self._watcher.data) + return result + ">" + + def _format(self): + return '' + + def _libev_unref(self): + if self._flags & 6 == 4: + self.loop.unref() + self._flags |= 2 + + def _get_ref(self): + return False if self._flags & 4 else True + + def _set_ref(self, value): + if value: + if not self._flags & 4: + return # ref is already True + if self._flags & 2: # ev_unref was called, undo + self.loop.ref() + self._flags &= ~6 # do not want unref, no outstanding unref + else: + if self._flags & 4: + return # ref is already False + self._flags |= 4 + if not self._flags & 2 and libev.ev_is_active(self._watcher): + self.loop.unref() + self._flags |= 2 + + ref = property(_get_ref, _set_ref) + + def _get_callback(self): + return self._callback + + def _set_callback(self, cb): + if not callable(cb) and cb is not None: + raise TypeError("Expected callable, not %r" % (cb, )) + self._callback = cb + callback = property(_get_callback, _set_callback) + + def _get_args(self): + return self._args + + def _set_args(self, args): + if not isinstance(args, tuple) and args is not None: + raise TypeError("args must be a tuple or None") + self._args = args + + args = property(_get_args, _set_args) + + def start(self, callback, *args): + if callback is None: + raise TypeError('callback must be callable, not None') + self.callback = callback + self.args = args or _NOARGS + self._libev_unref() + self.loop._keepaliveset.add(self) + self._watcher_start(self.loop._ptr, self._watcher) + + def stop(self): + if self._flags & 2: + self.loop.ref() + self._flags &= ~2 + self._watcher_stop(self.loop._ptr, self._watcher) + self.loop._keepaliveset.discard(self) + self._callback = None + self.args = None + + def _get_priority(self): + return libev.ev_priority(self._watcher) + + def _set_priority(self, priority): + if libev.ev_is_active(self._watcher): + raise AttributeError("Cannot set priority of an active watcher") + libev.ev_set_priority(self._watcher, priority) + + priority = property(_get_priority, _set_priority) + + def feed(self, revents, callback, *args): + self.callback = callback + self.args = args or _NOARGS + if self._flags & 6 == 4: + self.loop.unref() + self._flags |= 2 + libev.ev_feed_event(self.loop._ptr, self._watcher, revents) + if not self._flags & 1: + # Py_INCREF(<PyObjectPtr>self) + self._flags |= 1 + + @property + def active(self): + return True if libev.ev_is_active(self._watcher) else False + + @property + def pending(self): + return True if libev.ev_is_pending(self._watcher) else False + + +class io(watcher): + _watcher_type = 'ev_io' + + def __init__(self, loop, fd, events, ref=True, priority=None): + # XXX: Win32: Need to vfd_open the fd and free the old one? + # XXX: Win32: Need a destructor to free the old fd? + if fd < 0: + raise ValueError('fd must be non-negative: %r' % fd) + if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE): + raise ValueError('illegal event mask: %r' % events) + watcher.__init__(self, loop, ref=ref, priority=priority, args=(fd, events)) + + def start(self, callback, *args, **kwargs): + # pylint:disable=arguments-differ + args = args or _NOARGS + if kwargs.get('pass_events'): + args = (GEVENT_CORE_EVENTS, ) + args + watcher.start(self, callback, *args) + + def _get_fd(self): + return vfd_get(self._watcher.fd) + + def _set_fd(self, fd): + if libev.ev_is_active(self._watcher): + raise AttributeError("'io' watcher attribute 'fd' is read-only while watcher is active") + vfd = vfd_open(fd) + vfd_free(self._watcher.fd) + self._watcher_init(self._watcher, self._watcher_callback, vfd, self._watcher.events) + + fd = property(_get_fd, _set_fd) + + def _get_events(self): + return self._watcher.events + + def _set_events(self, events): + if libev.ev_is_active(self._watcher): + raise AttributeError("'io' watcher attribute 'events' is read-only while watcher is active") + self._watcher_init(self._watcher, self._watcher_callback, self._watcher.fd, events) + + events = property(_get_events, _set_events) + + @property + def events_str(self): + return _events_to_str(self._watcher.events) + + def _format(self): + return ' fd=%s events=%s' % (self.fd, self.events_str) + + +class timer(watcher): + _watcher_type = 'ev_timer' + + def __init__(self, loop, after=0.0, repeat=0.0, ref=True, priority=None): + if repeat < 0.0: + raise ValueError("repeat must be positive or zero: %r" % repeat) + watcher.__init__(self, loop, ref=ref, priority=priority, args=(after, repeat)) + + def start(self, callback, *args, **kw): + # pylint:disable=arguments-differ + update = kw.get("update", True) + if update: + # Quoth the libev doc: "This is a costly operation and is + # usually done automatically within ev_run(). This + # function is rarely useful, but when some event callback + # runs for a very long time without entering the event + # loop, updating libev's idea of the current time is a + # good idea." + # So do we really need to default to true? + libev.ev_now_update(self.loop._ptr) + watcher.start(self, callback, *args) + + @property + def at(self): + return self._watcher.at + + def again(self, callback, *args, **kw): + # Exactly the same as start(), just with a different initializer + # function + self._watcher_start = libev.ev_timer_again + try: + self.start(callback, *args, **kw) + finally: + del self._watcher_start + + +class signal(watcher): + _watcher_type = 'ev_signal' + + def __init__(self, loop, signalnum, ref=True, priority=None): + if signalnum < 1 or signalnum >= signalmodule.NSIG: + raise ValueError('illegal signal number: %r' % signalnum) + # still possible to crash on one of libev's asserts: + # 1) "libev: ev_signal_start called with illegal signal number" + # EV_NSIG might be different from signal.NSIG on some platforms + # 2) "libev: a signal must not be attached to two different loops" + # we probably could check that in LIBEV_EMBED mode, but not in general + watcher.__init__(self, loop, ref=ref, priority=priority, args=(signalnum, )) + + +class idle(watcher): + _watcher_type = 'ev_idle' + + +class prepare(watcher): + _watcher_type = 'ev_prepare' + + +class check(watcher): + _watcher_type = 'ev_check' + + +class fork(watcher): + _watcher_type = 'ev_fork' + + +class async(watcher): + _watcher_type = 'ev_async' + + def send(self): + libev.ev_async_send(self.loop._ptr, self._watcher) + + @property + def pending(self): + return True if libev.ev_async_pending(self._watcher) else False + + +class child(watcher): + _watcher_type = 'ev_child' + + def __init__(self, loop, pid, trace=0, ref=True): + if not loop.default: + raise TypeError('child watchers are only available on the default loop') + loop.install_sigchld() + watcher.__init__(self, loop, ref=ref, args=(pid, trace)) + + def _format(self): + return ' pid=%r rstatus=%r' % (self.pid, self.rstatus) + + @property + def pid(self): + return self._watcher.pid + + @property + def rpid(self, ): + return self._watcher.rpid + + @rpid.setter + def rpid(self, value): + self._watcher.rpid = value + + @property + def rstatus(self): + return self._watcher.rstatus + + @rstatus.setter + def rstatus(self, value): + self._watcher.rstatus = value + + +class stat(watcher): + _watcher_type = 'ev_stat' + + @staticmethod + def _encode_path(path): + if isinstance(path, bytes): + return path + + # encode for the filesystem. Not all systems (e.g., Unix) + # will have an encoding specified + encoding = sys.getfilesystemencoding() or 'utf-8' + try: + path = path.encode(encoding, 'surrogateescape') + except LookupError: + # Can't encode it, and the error handler doesn't + # exist. Probably on Python 2 with an astral character. + # Not sure how to handle this. + raise UnicodeEncodeError("Can't encode path to filesystem encoding") + return path + + def __init__(self, _loop, path, interval=0.0, ref=True, priority=None): + # Store the encoded path in the same attribute that corecext does + self._paths = self._encode_path(path) + + # Keep the original path to avoid re-encoding, especially on Python 3 + self._path = path + + # Although CFFI would automatically convert a bytes object into a char* when + # calling ev_stat_init(..., char*, ...), on PyPy the char* pointer is not + # guaranteed to live past the function call. On CPython, only with a constant/interned + # bytes object is the pointer guaranteed to last path the function call. (And since + # Python 3 is pretty much guaranteed to produce a newly-encoded bytes object above, thats + # rarely the case). Therefore, we must keep a reference to the produced cdata object + # so that the struct ev_stat_watcher's `path` pointer doesn't become invalid/deallocated + self._cpath = ffi.new('char[]', self._paths) + + watcher.__init__(self, _loop, ref=ref, priority=priority, + args=(self._cpath, + interval)) + + @property + def path(self): + return self._path + + @property + def attr(self): + if not self._watcher.attr.st_nlink: + return + return self._watcher.attr + + @property + def prev(self): + if not self._watcher.prev.st_nlink: + return + return self._watcher.prev + + @property + def interval(self): + return self._watcher.interval + +# All watcher subclasses must be declared above. Now we do some +# initialization; this is not only a minor optimization, it protects +# against later runtime typos and attribute errors +watcher._init_subclasses() + + +def _syserr_cb(msg): + try: + msg = ffi.string(msg) + __SYSERR_CALLBACK(msg, ffi.errno) + except: + set_syserr_cb(None) + raise # let cffi print the traceback + +_syserr_cb._cb = ffi.callback("void(*)(char *msg)", _syserr_cb) + + +def set_syserr_cb(callback): + global __SYSERR_CALLBACK + if callback is None: + libev.ev_set_syserr_cb(ffi.NULL) + __SYSERR_CALLBACK = None + elif callable(callback): + libev.ev_set_syserr_cb(_syserr_cb._cb) + __SYSERR_CALLBACK = callback + else: + raise TypeError('Expected callable or None, got %r' % (callback, )) + +__SYSERR_CALLBACK = None + +LIBEV_EMBED = True diff --git a/python/gevent/libev/gevent.corecext.c b/python/gevent/libev/gevent.corecext.c new file mode 100644 index 0000000..d118d59 --- /dev/null +++ b/python/gevent/libev/gevent.corecext.c @@ -0,0 +1,33465 @@ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +/* Generated by cythonpp.py on 2017-06-05 11:30:19 */ +/* Generated by Cython 0.25.2 */ +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) + #error Cython requires Python 2.6+ or Python 3.2+. +#else +#define CYTHON_ABI "0_25_2" +#include <stddef.h> +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include <math.h> +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent__libev__corecext +#define __PYX_HAVE_API__gevent__libev__corecext +#include "libev_vfd.h" +#include "libev.h" +#include "frameobject.h" +#include "callbacks.h" +#include "stathelper.c" +#ifdef _OPENMP +#include <omp.h> +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +#if defined (__cplusplus) && __cplusplus >= 201103L + #include <cstdlib> + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) && defined (_M_X64) + #define __Pyx_sst_abs(value) _abs64(value) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "gevent.libev.corecext.pyx", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType; +struct PyGeventLoopObject; +struct PyGeventCallbackObject; +struct PyGeventWatcherObject; +struct PyGeventIOObject; +struct PyGeventTimerObject; +struct PyGeventSignalObject; +struct PyGeventIdleObject; +struct PyGeventPrepareObject; +struct PyGeventCheckObject; +struct PyGeventForkObject; +struct PyGeventAsyncObject; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +struct PyGeventChildObject; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +struct PyGeventStatObject; +struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr; + +struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType { + PyObject_HEAD +}; + + +struct PyGeventLoopObject { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *__pyx_vtab; + struct ev_loop *_ptr; + PyObject *error_handler; + struct ev_prepare _prepare; + PyObject *_callbacks; + struct ev_timer _timer0; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + struct ev_timer _periodic_signal_checker; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventLoop_Type; + +struct PyGeventCallbackObject { + PyObject_HEAD + PyObject *callback; + PyObject *args; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventCallback_Type; + +struct PyGeventWatcherObject { + PyObject_HEAD +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventWatcher_Type; + +struct PyGeventIOObject { + struct PyGeventWatcherObject __pyx_base; + struct PyGeventLoopObject *loop; + PyObject *_callback; + PyObject *args; + int _flags; + struct ev_io _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventIO_Type; + +struct PyGeventTimerObject { + struct PyGeventWatcherObject __pyx_base; + struct PyGeventLoopObject *loop; + PyObject *_callback; + PyObject *args; + int _flags; + struct ev_timer _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventTimer_Type; + +struct PyGeventSignalObject { + struct PyGeventWatcherObject __pyx_base; + struct PyGeventLoopObject *loop; + PyObject *_callback; + PyObject *args; + int _flags; + struct ev_signal _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventSignal_Type; + +struct PyGeventIdleObject { + struct PyGeventWatcherObject __pyx_base; + struct PyGeventLoopObject *loop; + PyObject *_callback; + PyObject *args; + int _flags; + struct ev_idle _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventIdle_Type; + +struct PyGeventPrepareObject { + struct PyGeventWatcherObject __pyx_base; + struct PyGeventLoopObject *loop; + PyObject *_callback; + PyObject *args; + int _flags; + struct ev_prepare _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventPrepare_Type; + +struct PyGeventCheckObject { + struct PyGeventWatcherObject __pyx_base; + struct PyGeventLoopObject *loop; + PyObject *_callback; + PyObject *args; + int _flags; + struct ev_check _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventCheck_Type; + +struct PyGeventForkObject { + struct PyGeventWatcherObject __pyx_base; + struct PyGeventLoopObject *loop; + PyObject *_callback; + PyObject *args; + int _flags; + struct ev_fork _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventFork_Type; + +struct PyGeventAsyncObject { + struct PyGeventWatcherObject __pyx_base; + struct PyGeventLoopObject *loop; + PyObject *_callback; + PyObject *args; + int _flags; + struct ev_async _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventAsync_Type; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + +struct PyGeventChildObject { + struct PyGeventWatcherObject __pyx_base; + struct PyGeventLoopObject *loop; + PyObject *_callback; + PyObject *args; + int _flags; + struct ev_child _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventChild_Type; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + +struct PyGeventStatObject { + struct PyGeventWatcherObject __pyx_base; + struct PyGeventLoopObject *loop; + PyObject *_callback; + PyObject *args; + int _flags; + struct ev_stat _watcher; + PyObject *path; + PyObject *_paths; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventStat_Type; + +struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr { + PyObject_HEAD + PyObject *__pyx_v_flag; + PyObject *__pyx_v_string; +}; + + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventLoop_Type; + + +struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop { + PyObject *(*_run_callbacks)(struct PyGeventLoopObject *); + PyObject *(*handle_error)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_default_handle_error)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *__pyx_vtabptr_6gevent_5libev_8corecext_loop; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* GetModuleGlobalName.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* StringJoin.proto */ +#if PY_MAJOR_VERSION < 3 +#define __Pyx_PyString_Join __Pyx_PyBytes_Join +#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) +#else +#define __Pyx_PyString_Join PyUnicode_Join +#define __Pyx_PyBaseString_Join PyUnicode_Join +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION < 3 + #define __Pyx_PyBytes_Join _PyString_Join + #else + #define __Pyx_PyBytes_Join _PyBytes_Join + #endif +#else +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* ListCompAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* ArgTypeTest.proto */ +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +/* KeywordStringCheck.proto */ +static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +/* CallableCheck.proto */ +#if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyCallable_Check(obj) ((obj)->ob_type->tp_call != NULL) +#else +#define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj) +#endif + +/* CallNextTpTraverse.proto */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); + +/* CallNextTpClear.proto */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); + +/* IncludeStringH.proto */ +#include <string.h> + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_vfd_socket_t(vfd_socket_t value); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +/* CIntFromPy.proto */ +static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + +/* CIntFromPy.proto */ +static CYTHON_INLINE vfd_socket_t __Pyx_PyInt_As_vfd_socket_t(PyObject *); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* PyObjectCallMethod1.proto */ +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); + +/* CoroutineBase.proto */ +typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyObject *); +typedef struct { + PyObject_HEAD + __pyx_coroutine_body_t body; + PyObject *closure; + PyObject *exc_type; + PyObject *exc_value; + PyObject *exc_traceback; + PyObject *gi_weakreflist; + PyObject *classobj; + PyObject *yieldfrom; + PyObject *gi_name; + PyObject *gi_qualname; + PyObject *gi_modulename; + int resume_label; + char is_running; +} __pyx_CoroutineObject; +static __pyx_CoroutineObject *__Pyx__Coroutine_New( + PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name); +static int __Pyx_Coroutine_clear(PyObject *self); +#if 1 || PY_VERSION_HEX < 0x030300B0 +static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue); +#else +#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue) +#endif + +/* PatchModuleWithCoroutine.proto */ +static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); + +/* PatchGeneratorABC.proto */ +static int __Pyx_patch_abc(void); + +/* Generator.proto */ +#define __Pyx_Generator_USED +static PyTypeObject *__pyx_GeneratorType = 0; +#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) +#define __Pyx_Generator_New(body, closure, name, qualname, module_name)\ + __Pyx__Coroutine_New(__pyx_GeneratorType, body, closure, name, qualname, module_name) +static PyObject *__Pyx_Generator_Next(PyObject *self); +static int __pyx_Generator_init(void); + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__run_callbacks(struct PyGeventLoopObject *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__default_handle_error(struct PyGeventLoopObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'libev' */ + +/* Module declarations from 'python' */ + +/* Module declarations from 'gevent.libev.corecext' */ +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext__EVENTSType = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_loop = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_callback = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_watcher = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_io = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_timer = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_signal = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_idle = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_prepare = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_check = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_fork = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_async = 0; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_child = 0; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_stat = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext___pyx_scope_struct__genexpr = 0; +static PyObject *__pyx_v_6gevent_5libev_8corecext_integer_types = 0; +__PYX_EXTERN_C DL_EXPORT(PyObject) *GEVENT_CORE_EVENTS; +static int __pyx_v_6gevent_5libev_8corecext__default_loop_destroyed; +static PyObject *__pyx_f_6gevent_5libev_8corecext__flags_to_list(unsigned int, int __pyx_skip_dispatch); /*proto*/ +static unsigned int __pyx_f_6gevent_5libev_8corecext__flags_to_int(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext__str_hex(PyObject *); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext__check_flags(unsigned int, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext__events_to_str(int, int __pyx_skip_dispatch); /*proto*/ +static void __pyx_f_6gevent_5libev_8corecext__syserr_cb(char *); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext_set_syserr_cb(PyObject *, int __pyx_skip_dispatch); /*proto*/ +#define __Pyx_MODULE_NAME "gevent.libev.corecext" +int __pyx_module_is_main_gevent__libev__corecext = 0; + +/* Implementation of 'gevent.libev.corecext' */ +static PyObject *__pyx_builtin___import__; +static PyObject *__pyx_builtin_KeyError; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_hex; +static PyObject *__pyx_builtin_SystemError; +static PyObject *__pyx_builtin_id; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_builtin_AttributeError; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_builtin_TypeError; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_builtin_AttributeError; +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_[] = ","; +static const char __pyx_k__3[] = ", "; +static const char __pyx_k__4[] = "|"; +static const char __pyx_k__5[] = ": "; +static const char __pyx_k_fd[] = "fd"; +static const char __pyx_k_id[] = "id"; +static const char __pyx_k_os[] = "os"; +static const char __pyx_k_tb[] = "tb"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) +static const char __pyx_k__21[] = "<...>"; +static const char __pyx_k__22[] = ">"; +static const char __pyx_k__23[] = ""; +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k__21[] = ""; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static const char __pyx_k__27[] = "<...>"; +static const char __pyx_k__28[] = ">"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k__26[] = "<...>"; +static const char __pyx_k__27[] = ">"; +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_hex[] = "hex"; +static const char __pyx_k_how[] = "how"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_pid[] = "pid"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_ptr[] = "ptr"; +static const char __pyx_k_ref[] = "ref"; +static const char __pyx_k_sys[] = "sys"; +static const char __pyx_k_FORK[] = "FORK"; +static const char __pyx_k_IDLE[] = "IDLE"; +static const char __pyx_k_NONE[] = "NONE"; +static const char __pyx_k_NSIG[] = "NSIG"; +static const char __pyx_k_READ[] = "READ"; +static const char __pyx_k_STAT[] = "STAT"; +static const char __pyx_k_args[] = "args"; +static const char __pyx_k_func[] = "func"; +static const char __pyx_k_join[] = "join"; +static const char __pyx_k_keys[] = "keys"; +static const char __pyx_k_loop[] = "loop"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_once[] = "once"; +static const char __pyx_k_path[] = "path"; +static const char __pyx_k_poll[] = "poll"; +static const char __pyx_k_port[] = "port"; +static const char __pyx_k_send[] = "send"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_time[] = "time"; +static const char __pyx_k_type[] = "type"; +static const char __pyx_k_ASYNC[] = "ASYNC"; +static const char __pyx_k_CHECK[] = "CHECK"; +static const char __pyx_k_CHILD[] = "CHILD"; +static const char __pyx_k_EMBED[] = "EMBED"; +static const char __pyx_k_ERROR[] = "ERROR"; +static const char __pyx_k_TIMER[] = "TIMER"; +static const char __pyx_k_UNDEF[] = "UNDEF"; +static const char __pyx_k_WRITE[] = "WRITE"; +static const char __pyx_k_after[] = "after"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_close[] = "close"; +static const char __pyx_k_epoll[] = "epoll"; +static const char __pyx_k_errno[] = "errno"; +static const char __pyx_k_flags[] = "_flags"; +static const char __pyx_k_level[] = "level"; +static const char __pyx_k_lower[] = "lower"; +static const char __pyx_k_noenv[] = "noenv"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_ref_2[] = " ref="; +static const char __pyx_k_sigfd[] = "sigfd"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_split[] = "split"; +static const char __pyx_k_strip[] = "strip"; +static const char __pyx_k_throw[] = "throw"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_trace[] = "trace"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_value[] = "value"; +static const char __pyx_k_CUSTOM[] = "CUSTOM"; +static const char __pyx_k_EVENTS[] = "EVENTS"; +static const char __pyx_k_MAXPRI[] = "MAXPRI"; +static const char __pyx_k_MINPRI[] = "MINPRI"; +static const char __pyx_k_SIGNAL[] = "SIGNAL"; +static const char __pyx_k_active[] = "active"; +static const char __pyx_k_args_r[] = " args=%r"; +static const char __pyx_k_decode[] = "decode"; +static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_events[] = "_events"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_fileno[] = "fileno"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_format[] = "_format"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_kqueue[] = "kqueue"; +static const char __pyx_k_nowait[] = "nowait"; +static const char __pyx_k_repeat[] = "repeat"; +static const char __pyx_k_select[] = "select"; +static const char __pyx_k_signal[] = "signal"; +static const char __pyx_k_signum[] = "signum"; +static const char __pyx_k_update[] = "update"; +static const char __pyx_k_CLEANUP[] = "CLEANUP"; +static const char __pyx_k_IOFDSET[] = "_IOFDSET"; +static const char __pyx_k_PREPARE[] = "PREPARE"; +static const char __pyx_k_backend[] = "backend"; +static const char __pyx_k_context[] = "context"; +static const char __pyx_k_default[] = "default"; +static const char __pyx_k_flags_2[] = "flags"; +static const char __pyx_k_genexpr[] = "genexpr"; +static const char __pyx_k_message[] = "message"; +static const char __pyx_k_pending[] = "pending"; +static const char __pyx_k_revents[] = "revents"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_rstatus[] = "rstatus"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_sigfd_2[] = " sigfd="; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_stopped[] = " stopped"; +static const char __pyx_k_KeyError[] = "KeyError"; +static const char __pyx_k_PERIODIC[] = "PERIODIC"; +static const char __pyx_k_SIGNALFD[] = "SIGNALFD"; +static const char __pyx_k_active_2[] = " active"; +static const char __pyx_k_builtins[] = "__builtins__"; +static const char __pyx_k_callback[] = "callback"; +static const char __pyx_k_events_2[] = "events"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_fileno_2[] = " fileno="; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_interval[] = "interval"; +static const char __pyx_k_priority[] = "priority"; +static const char __pyx_k_signalfd[] = "signalfd"; +static const char __pyx_k_strerror[] = "strerror"; +static const char __pyx_k_FORKCHECK[] = "FORKCHECK"; +static const char __pyx_k_NOINOTIFY[] = "NOINOTIFY"; +static const char __pyx_k_NOSIGMASK[] = "NOSIGMASK"; +static const char __pyx_k_READWRITE[] = "READWRITE"; +static const char __pyx_k_TypeError[] = "TypeError"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_activecnt[] = "activecnt"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_default_2[] = " default"; +static const char __pyx_k_destroyed[] = "destroyed"; +static const char __pyx_k_forkcheck[] = "forkcheck"; +static const char __pyx_k_noinotify[] = "noinotify"; +static const char __pyx_k_nosigmask[] = "nosigmask"; +static const char __pyx_k_pending_2[] = " pending"; +static const char __pyx_k_pending_s[] = " pending=%s"; +static const char __pyx_k_print_exc[] = "print_exc"; +static const char __pyx_k_signalnum[] = "signalnum"; +static const char __pyx_k_traceback[] = "traceback"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_basestring[] = "basestring"; +static const char __pyx_k_callback_r[] = " callback=%r"; +static const char __pyx_k_events_str[] = "events_str"; +static const char __pyx_k_pendingcnt[] = "pendingcnt"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_LIBEV_EMBED[] = "LIBEV_EMBED"; +static const char __pyx_k_SystemError[] = "SystemError"; +static const char __pyx_k_get_version[] = "get_version"; +static const char __pyx_k_libev_d_02d[] = "libev-%d.%02d"; +static const char __pyx_k_pass_events[] = "pass_events"; +static const char __pyx_k_s_at_0x_x_s[] = "<%s at 0x%x %s>"; +static const char __pyx_k_BACKEND_POLL[] = "BACKEND_POLL"; +static const char __pyx_k_BACKEND_PORT[] = "BACKEND_PORT"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_EV_USE_4HEAP[] = "EV_USE_4HEAP"; +static const char __pyx_k_EV_USE_FLOOR[] = "EV_USE_FLOOR"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_handle_error[] = "handle_error"; +static const char __pyx_k_signalmodule[] = "signalmodule"; +static const char __pyx_k_version_info[] = "version_info"; +static const char __pyx_k_BACKEND_EPOLL[] = "BACKEND_EPOLL"; +static const char __pyx_k_fd_s_events_s[] = " fd=%s events=%s"; +static const char __pyx_k_flags_str2int[] = "_flags_str2int"; +static const char __pyx_k_handle_syserr[] = "_handle_syserr"; +static const char __pyx_k_s_at_0x_x_s_2[] = "<%s at 0x%x%s"; +static const char __pyx_k_stop_watchers[] = "_stop_watchers"; +static const char __pyx_k_AttributeError[] = "AttributeError"; +static const char __pyx_k_BACKEND_KQUEUE[] = "BACKEND_KQUEUE"; +static const char __pyx_k_BACKEND_SELECT[] = "BACKEND_SELECT"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_EV_USE_EVENTFD[] = "EV_USE_EVENTFD"; +static const char __pyx_k_EV_USE_INOTIFY[] = "EV_USE_INOTIFY"; +static const char __pyx_k_format_details[] = "_format_details"; +static const char __pyx_k_EV_USE_REALTIME[] = "EV_USE_REALTIME"; +static const char __pyx_k_EV_USE_SIGNALFD[] = "EV_USE_SIGNALFD"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_SYSERR_CALLBACK[] = "__SYSERR_CALLBACK"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_pid_r_rstatus_r[] = " pid=%r rstatus=%r"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_print_exception[] = "print_exception"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_EV_USE_MONOTONIC[] = "EV_USE_MONOTONIC"; +static const char __pyx_k_EV_USE_NANOSLEEP[] = "EV_USE_NANOSLEEP"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_get_header_version[] = "get_header_version"; +static const char __pyx_k_gevent_core_EVENTS[] = "gevent.core.EVENTS"; +static const char __pyx_k_supported_backends[] = "supported_backends"; +static const char __pyx_k_embeddable_backends[] = "embeddable_backends"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_EV_USE_CLOCK_SYSCALL[] = "EV_USE_CLOCK_SYSCALL"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_default_handle_error[] = "_default_handle_error"; +static const char __pyx_k_ev_loop_new_s_failed[] = "ev_loop_new(%s) failed"; +static const char __pyx_k_illegal_event_mask_r[] = "illegal event mask: %r"; +static const char __pyx_k_recommended_backends[] = "recommended_backends"; +static const char __pyx_k_Unsupported_backend_s[] = "Unsupported backend: %s"; +static const char __pyx_k_getfilesystemencoding[] = "getfilesystemencoding"; +static const char __pyx_k_gevent_libev_corecext[] = "gevent.libev.corecext"; +static const char __pyx_k_Expected_callable_not_r[] = "Expected callable, not %r"; +static const char __pyx_k_illegal_signal_number_r[] = "illegal signal number: %r"; +static const char __pyx_k_ev_default_loop_s_failed[] = "ev_default_loop(%s) failed"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_fd_must_be_non_negative_r[] = "fd must be non-negative: %r"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_operation_on_destroyed_loop[] = "operation on destroyed loop"; +static const char __pyx_k_Invalid_value_for_backend_0x_x[] = "Invalid value for backend: 0x%x"; +static const char __pyx_k_io_watcher_attribute_events_is[] = "'io' watcher attribute 'events' is read-only while watcher is active"; +static const char __pyx_k_Expected_callable_or_None_got_r[] = "Expected callable or None, got %r"; +static const char __pyx_k_io_watcher_attribute_fd_is_read[] = "'io' watcher attribute 'fd' is read-only while watcher is active"; +static const char __pyx_k_repeat_must_be_positive_or_zero[] = "repeat must be positive or zero: %r"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_C_Users_appveyor_AppData_Local_T[] = "C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\tmpqvkqo2j9\\gevent.libev.corecext.pyx"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static const char __pyx_k_C_Users_appveyor_AppData_Local_T[] = "C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\tmp2ctkbz0o\\gevent.libev.corecext.pyx"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_C_Users_appveyor_AppData_Local_T[] = "C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\tmp2ae88oah\\gevent.libev.corecext.pyx"; +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) +static const char __pyx_k_C_Users_appveyor_AppData_Local_T[] = "C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\tmpoursn1jm\\gevent.libev.corecext.pyx"; +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static const char __pyx_k_C_Users_appveyor_AppData_Local_T[] = "C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\tmp60jryori\\gevent.libev.corecext.pyx"; +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_C_Users_appveyor_AppData_Local_T[] = "C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\tmpetzymc07\\gevent.libev.corecext.pyx"; +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_Cannot_set_priority_of_an_active[] = "Cannot set priority of an active watcher"; +static const char __pyx_k_Invalid_backend_or_flag_s_Possib[] = "Invalid backend or flag: %s\nPossible values: %s"; +static const char __pyx_k_callback_must_be_callable_not_No[] = "callback must be callable, not None"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static const char __pyx_k_child_watchers_are_only_availabl[] = "child watchers are only available on the default loop"; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_kp_s_; +static PyObject *__pyx_n_s_ASYNC; +static PyObject *__pyx_n_s_AttributeError; +static PyObject *__pyx_n_s_BACKEND_EPOLL; +static PyObject *__pyx_n_s_BACKEND_KQUEUE; +static PyObject *__pyx_n_s_BACKEND_POLL; +static PyObject *__pyx_n_s_BACKEND_PORT; +static PyObject *__pyx_n_s_BACKEND_SELECT; +static PyObject *__pyx_n_s_CHECK; +static PyObject *__pyx_n_s_CHILD; +static PyObject *__pyx_n_s_CLEANUP; +static PyObject *__pyx_n_s_CUSTOM; +static PyObject *__pyx_kp_s_C_Users_appveyor_AppData_Local_T; +static PyObject *__pyx_kp_s_Cannot_set_priority_of_an_active; +static PyObject *__pyx_n_s_EMBED; +static PyObject *__pyx_n_s_ERROR; +static PyObject *__pyx_n_s_EVENTS; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_n_s_EV_USE_4HEAP; +static PyObject *__pyx_n_s_EV_USE_CLOCK_SYSCALL; +static PyObject *__pyx_n_s_EV_USE_EVENTFD; +static PyObject *__pyx_n_s_EV_USE_FLOOR; +static PyObject *__pyx_n_s_EV_USE_INOTIFY; +static PyObject *__pyx_n_s_EV_USE_MONOTONIC; +static PyObject *__pyx_n_s_EV_USE_NANOSLEEP; +static PyObject *__pyx_n_s_EV_USE_REALTIME; +static PyObject *__pyx_n_s_EV_USE_SIGNALFD; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_kp_s_Expected_callable_not_r; +static PyObject *__pyx_kp_s_Expected_callable_or_None_got_r; +static PyObject *__pyx_n_s_FORK; +static PyObject *__pyx_n_s_FORKCHECK; +static PyObject *__pyx_n_s_IDLE; +static PyObject *__pyx_n_s_IOFDSET; +static PyObject *__pyx_kp_s_Invalid_backend_or_flag_s_Possib; +static PyObject *__pyx_kp_s_Invalid_value_for_backend_0x_x; +static PyObject *__pyx_n_s_KeyError; +static PyObject *__pyx_n_s_LIBEV_EMBED; +static PyObject *__pyx_n_s_MAXPRI; +static PyObject *__pyx_n_s_MINPRI; +static PyObject *__pyx_n_s_NOINOTIFY; +static PyObject *__pyx_n_s_NONE; +static PyObject *__pyx_n_s_NOSIGMASK; +static PyObject *__pyx_n_s_NSIG; +static PyObject *__pyx_n_s_PERIODIC; +static PyObject *__pyx_n_s_PREPARE; +static PyObject *__pyx_n_s_READ; +static PyObject *__pyx_n_s_READWRITE; +static PyObject *__pyx_n_s_SIGNAL; +static PyObject *__pyx_n_s_SIGNALFD; +static PyObject *__pyx_n_s_STAT; +static PyObject *__pyx_n_s_SYSERR_CALLBACK; +static PyObject *__pyx_n_s_SystemError; +static PyObject *__pyx_n_s_TIMER; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_UNDEF; +static PyObject *__pyx_kp_s_Unsupported_backend_s; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_WRITE; +static PyObject *__pyx_kp_s__21; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_kp_s__22; +static PyObject *__pyx_kp_s__23; +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_kp_s__26; +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_kp_s__27; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_kp_s__28; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_kp_s__3; +static PyObject *__pyx_kp_s__4; +static PyObject *__pyx_kp_s__5; +static PyObject *__pyx_n_s_active; +static PyObject *__pyx_kp_s_active_2; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_n_s_activecnt; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_n_s_after; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_kp_s_args_r; +static PyObject *__pyx_n_s_backend; +static PyObject *__pyx_n_s_basestring; +static PyObject *__pyx_n_s_builtins; +static PyObject *__pyx_n_s_callback; +static PyObject *__pyx_kp_s_callback_must_be_callable_not_No; +static PyObject *__pyx_kp_s_callback_r; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_kp_s_child_watchers_are_only_availabl; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_close; +static PyObject *__pyx_n_s_context; +static PyObject *__pyx_n_s_decode; +static PyObject *__pyx_n_s_default; +static PyObject *__pyx_kp_s_default_2; +static PyObject *__pyx_n_s_default_handle_error; +static PyObject *__pyx_n_s_destroyed; +static PyObject *__pyx_n_s_embeddable_backends; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_epoll; +static PyObject *__pyx_n_s_errno; +static PyObject *__pyx_kp_s_ev_default_loop_s_failed; +static PyObject *__pyx_kp_s_ev_loop_new_s_failed; +static PyObject *__pyx_n_s_events; +static PyObject *__pyx_n_s_events_2; +static PyObject *__pyx_n_s_events_str; +static PyObject *__pyx_n_s_fd; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_kp_s_fd_must_be_non_negative_r; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_kp_s_fd_s_events_s; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_n_s_fileno; +static PyObject *__pyx_kp_s_fileno_2; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_n_s_flags; +static PyObject *__pyx_n_s_flags_2; +static PyObject *__pyx_n_s_flags_str2int; +static PyObject *__pyx_n_s_forkcheck; +static PyObject *__pyx_n_s_format; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_n_s_format_details; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_n_s_func; +static PyObject *__pyx_n_s_genexpr; +static PyObject *__pyx_n_s_get_header_version; +static PyObject *__pyx_n_s_get_version; +static PyObject *__pyx_n_s_getfilesystemencoding; +static PyObject *__pyx_kp_s_gevent_core_EVENTS; +static PyObject *__pyx_n_s_gevent_libev_corecext; +static PyObject *__pyx_n_s_handle_error; +static PyObject *__pyx_n_s_handle_syserr; +static PyObject *__pyx_n_s_hex; +static PyObject *__pyx_n_s_how; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_kp_s_illegal_event_mask_r; +static PyObject *__pyx_kp_s_illegal_signal_number_r; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_interval; +static PyObject *__pyx_kp_s_io_watcher_attribute_events_is; +static PyObject *__pyx_kp_s_io_watcher_attribute_fd_is_read; +static PyObject *__pyx_n_s_join; +static PyObject *__pyx_n_s_keys; +static PyObject *__pyx_n_s_kqueue; +static PyObject *__pyx_n_s_level; +static PyObject *__pyx_kp_s_libev_d_02d; +static PyObject *__pyx_n_s_loop; +static PyObject *__pyx_n_s_lower; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_message; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_noenv; +static PyObject *__pyx_n_s_noinotify; +static PyObject *__pyx_n_s_nosigmask; +static PyObject *__pyx_n_s_nowait; +static PyObject *__pyx_n_s_once; +static PyObject *__pyx_kp_s_operation_on_destroyed_loop; +static PyObject *__pyx_n_s_os; +static PyObject *__pyx_n_s_pass_events; +static PyObject *__pyx_n_s_path; +static PyObject *__pyx_n_s_pending; +static PyObject *__pyx_kp_s_pending_2; +static PyObject *__pyx_kp_s_pending_s; +static PyObject *__pyx_n_s_pendingcnt; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_n_s_pid; +static PyObject *__pyx_kp_s_pid_r_rstatus_r; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_n_s_poll; +static PyObject *__pyx_n_s_port; +static PyObject *__pyx_n_s_print_exc; +static PyObject *__pyx_n_s_print_exception; +static PyObject *__pyx_n_s_priority; +static PyObject *__pyx_n_s_ptr; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_recommended_backends; +static PyObject *__pyx_n_s_ref; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_kp_s_ref_2; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_n_s_repeat; +static PyObject *__pyx_kp_s_repeat_must_be_positive_or_zero; +static PyObject *__pyx_n_s_revents; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_n_s_rstatus; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_kp_s_s_at_0x_x_s; +static PyObject *__pyx_kp_s_s_at_0x_x_s_2; +static PyObject *__pyx_n_s_select; +static PyObject *__pyx_n_s_send; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_n_s_sigfd; +static PyObject *__pyx_kp_s_sigfd_2; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_n_s_signal; +static PyObject *__pyx_n_s_signalfd; +static PyObject *__pyx_n_s_signalmodule; +static PyObject *__pyx_n_s_signalnum; +static PyObject *__pyx_n_s_signum; +static PyObject *__pyx_n_s_split; +static PyObject *__pyx_n_s_stop_watchers; +static PyObject *__pyx_kp_s_stopped; +static PyObject *__pyx_n_s_strerror; +static PyObject *__pyx_n_s_strip; +static PyObject *__pyx_n_s_supported_backends; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_tb; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_throw; +static PyObject *__pyx_n_s_time; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_n_s_trace; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_n_s_traceback; +static PyObject *__pyx_n_s_type; +static PyObject *__pyx_n_s_update; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_version_info; +static PyObject *__pyx_pf_6gevent_5libev_8corecext_22genexpr(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_11_EVENTSType___repr__(CYTHON_UNUSED struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_get_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2get_header_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4_flags_to_list(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6_flags_to_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flags); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8_check_flags(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_10_events_to_str(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_events); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_12supported_backends(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_14recommended_backends(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_16embeddable_backends(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_18time(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4loop___init__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_flags, PyObject *__pyx_v_default, size_t __pyx_v_ptr); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_2_stop_watchers(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_4destroy(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static void __pyx_pf_6gevent_5libev_8corecext_4loop_6__dealloc__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_3ptr___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11WatcherType___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_6MAXPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_6MINPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_8_handle_syserr(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_errno); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_12_default_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_14run(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_nowait, PyObject *__pyx_v_once); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_16reinit(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_18ref(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_20unref(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_22break_(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_how); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_24verify(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_26now(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_28update(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_30__repr__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_7default___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9iteration___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_5depth___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11backend_int___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_7backend___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10pendingcnt___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_32io(struct PyGeventLoopObject *__pyx_v_self, vfd_socket_t __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_32io(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_32io(struct PyGeventLoopObject *__pyx_v_self, vfd_socket_t __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_34timer(struct PyGeventLoopObject *__pyx_v_self, double __pyx_v_after, double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_36signal(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_signum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_38idle(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_40prepare(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_42check(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_44fork(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_46async(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_48stat(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_path, float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_50run_callback(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_52_format(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_54_format_details(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_56fileno(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_48child(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_pid, int __pyx_v_trace, PyObject *__pyx_v_ref); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_50install_sigchld(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_52reset_sigchld(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_54stat(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_path, float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_56run_callback(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_58_format(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_60_format_details(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_62fileno(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_48stat(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_path, float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_50run_callback(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_52_format(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_54_format_details(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_56fileno(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_60_format_details(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_62fileno(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9activecnt___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11sig_pending___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_5sigfd___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9origflags___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_13origflags_int___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_4__del__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_4__del__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_8callback___init__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_2stop(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_8callback_4__nonzero__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_7pending___get__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_6__repr__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_8_format(CYTHON_UNUSED struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_8callback___get__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_4__del__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_4args___get__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_8callback_4args_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_8callback_4args_4__del__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher___repr__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_2_format(CYTHON_UNUSED struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_3ref___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_2io_3ref_2__set__(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_8callback___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_2io_8callback_2__set__(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_stop(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_8priority___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_2io_8priority_2__set__(struct PyGeventIOObject *__pyx_v_self, int __pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_2feed(struct PyGeventIOObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_4start(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_pass_events, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_6active___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_7pending___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static int __pyx_pf_6gevent_5libev_8corecext_2io_6__init__(struct PyGeventIOObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, vfd_socket_t __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static int __pyx_pf_6gevent_5libev_8corecext_2io_6__init__(struct PyGeventIOObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) +static int __pyx_pf_6gevent_5libev_8corecext_2io_6__init__(struct PyGeventIOObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, vfd_socket_t __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_2fd___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_2io_2fd_2__set__(struct PyGeventIOObject *__pyx_v_self, long __pyx_v_fd); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_6events___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_2io_6events_2__set__(struct PyGeventIOObject *__pyx_v_self, int __pyx_v_events); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_10events_str___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_8_format(struct PyGeventIOObject *__pyx_v_self); /* proto */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static int __pyx_pf_6gevent_5libev_8corecext_2io_10__cinit__(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static void __pyx_pf_6gevent_5libev_8corecext_2io_12__dealloc__(struct PyGeventIOObject *__pyx_v_self); /* proto */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_4loop___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_2io_4loop_2__set__(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_2io_4loop_4__del__(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_4args___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_2io_4args_2__set__(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_2io_4args_4__del__(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_6_flags___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_3ref___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5timer_3ref_2__set__(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_8callback___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5timer_8callback_2__set__(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_stop(struct PyGeventTimerObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_8priority___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5timer_8priority_2__set__(struct PyGeventTimerObject *__pyx_v_self, int __pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_2feed(struct PyGeventTimerObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_4start(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_6active___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_7pending___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5timer_6__init__(struct PyGeventTimerObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, double __pyx_v_after, double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_2at___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_8again(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_4loop___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5timer_4loop_2__set__(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5timer_4loop_4__del__(struct PyGeventTimerObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_4args___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5timer_4args_2__set__(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5timer_4args_4__del__(struct PyGeventTimerObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_6_flags___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6signal_3ref___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_6signal_3ref_2__set__(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6signal_8callback___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_6signal_8callback_2__set__(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6signal_stop(struct PyGeventSignalObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6signal_8priority___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_6signal_8priority_2__set__(struct PyGeventSignalObject *__pyx_v_self, int __pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6signal_2feed(struct PyGeventSignalObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6signal_4start(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6signal_6active___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6signal_7pending___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_6signal_6__init__(struct PyGeventSignalObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_signalnum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6signal_4loop___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_6signal_4loop_2__set__(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_6signal_4loop_4__del__(struct PyGeventSignalObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6signal_4args___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_6signal_4args_2__set__(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_6signal_4args_4__del__(struct PyGeventSignalObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6signal_6_flags___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4idle_3ref___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4idle_3ref_2__set__(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4idle_8callback___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4idle_8callback_2__set__(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4idle_stop(struct PyGeventIdleObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4idle_8priority___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4idle_8priority_2__set__(struct PyGeventIdleObject *__pyx_v_self, int __pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4idle_2feed(struct PyGeventIdleObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4idle_4start(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4idle_6active___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4idle_7pending___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4idle_6__init__(struct PyGeventIdleObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4idle_4loop___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4idle_4loop_2__set__(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4idle_4loop_4__del__(struct PyGeventIdleObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4idle_4args___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4idle_4args_2__set__(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4idle_4args_4__del__(struct PyGeventIdleObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4idle_6_flags___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7prepare_3ref___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7prepare_3ref_2__set__(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7prepare_8callback___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7prepare_8callback_2__set__(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7prepare_stop(struct PyGeventPrepareObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7prepare_8priority___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7prepare_8priority_2__set__(struct PyGeventPrepareObject *__pyx_v_self, int __pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7prepare_2feed(struct PyGeventPrepareObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7prepare_4start(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7prepare_6active___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7prepare_7pending___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7prepare_6__init__(struct PyGeventPrepareObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7prepare_4loop___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7prepare_4loop_2__set__(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7prepare_4loop_4__del__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7prepare_4args___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7prepare_4args_2__set__(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7prepare_4args_4__del__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7prepare_6_flags___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5check_3ref___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5check_3ref_2__set__(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5check_8callback___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5check_8callback_2__set__(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5check_stop(struct PyGeventCheckObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5check_8priority___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5check_8priority_2__set__(struct PyGeventCheckObject *__pyx_v_self, int __pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5check_2feed(struct PyGeventCheckObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5check_4start(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5check_6active___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5check_7pending___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5check_6__init__(struct PyGeventCheckObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5check_4loop___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5check_4loop_2__set__(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5check_4loop_4__del__(struct PyGeventCheckObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5check_4args___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5check_4args_2__set__(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5check_4args_4__del__(struct PyGeventCheckObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5check_6_flags___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4fork_3ref___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4fork_3ref_2__set__(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4fork_8callback___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4fork_8callback_2__set__(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4fork_stop(struct PyGeventForkObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4fork_8priority___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4fork_8priority_2__set__(struct PyGeventForkObject *__pyx_v_self, int __pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4fork_2feed(struct PyGeventForkObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4fork_4start(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4fork_6active___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4fork_7pending___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4fork_6__init__(struct PyGeventForkObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4fork_4loop___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4fork_4loop_2__set__(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4fork_4loop_4__del__(struct PyGeventForkObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4fork_4args___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4fork_4args_2__set__(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4fork_4args_4__del__(struct PyGeventForkObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4fork_6_flags___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_3ref___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5async_3ref_2__set__(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_8callback___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5async_8callback_2__set__(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_stop(struct PyGeventAsyncObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_8priority___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5async_8priority_2__set__(struct PyGeventAsyncObject *__pyx_v_self, int __pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_2feed(struct PyGeventAsyncObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_4start(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_6active___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_7pending___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5async_6__init__(struct PyGeventAsyncObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_8send(struct PyGeventAsyncObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_4loop___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5async_4loop_2__set__(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5async_4loop_4__del__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_4args___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5async_4args_2__set__(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5async_4args_4__del__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_6_flags___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_3ref___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5child_3ref_2__set__(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_8callback___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5child_8callback_2__set__(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_stop(struct PyGeventChildObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_8priority___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5child_8priority_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_2feed(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4start(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_6active___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_7pending___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5child_6__init__(struct PyGeventChildObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_pid, int __pyx_v_trace, PyObject *__pyx_v_ref); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_8_format(struct PyGeventChildObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_3pid___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4rpid___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5child_4rpid_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_7rstatus___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5child_7rstatus_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4loop___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5child_4loop_2__set__(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5child_4loop_4__del__(struct PyGeventChildObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4args___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5child_4args_2__set__(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5child_4args_4__del__(struct PyGeventChildObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_6_flags___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_3ref___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4stat_3ref_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_8callback___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4stat_8callback_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_stop(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_8priority___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4stat_8priority_2__set__(struct PyGeventStatObject *__pyx_v_self, int __pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_2feed(struct PyGeventStatObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4start(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_6active___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_7pending___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4stat_6__init__(struct PyGeventStatObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_path, float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4attr___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4prev___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_8interval___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4loop___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4stat_4loop_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4stat_4loop_4__del__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4args___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4stat_4args_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4stat_4args_4__del__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_6_flags___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4path___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_6_paths___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_20set_syserr_cb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext__EVENTSType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_loop(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_callback(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_watcher(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_io(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_timer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_signal(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_idle(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_prepare(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_check(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_fork(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_async(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_child(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_stat(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_3; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_int_neg_1; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static int __pyx_k__9; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__25; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_tuple__26; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_tuple__27; +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_tuple__28; +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__44; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__46; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__48; +static PyObject *__pyx_tuple__49; +static PyObject *__pyx_tuple__50; +static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__52; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__54; +static PyObject *__pyx_tuple__55; +static PyObject *__pyx_tuple__56; +static PyObject *__pyx_tuple__57; +static PyObject *__pyx_tuple__58; +static PyObject *__pyx_tuple__59; +static PyObject *__pyx_tuple__60; +static PyObject *__pyx_tuple__61; +static PyObject *__pyx_tuple__62; +static PyObject *__pyx_tuple__63; +static PyObject *__pyx_tuple__64; +static PyObject *__pyx_tuple__65; +static PyObject *__pyx_tuple__66; +static PyObject *__pyx_tuple__67; +static PyObject *__pyx_tuple__68; +static PyObject *__pyx_tuple__69; +static PyObject *__pyx_tuple__70; +static PyObject *__pyx_tuple__71; +static PyObject *__pyx_tuple__72; +static PyObject *__pyx_tuple__73; +static PyObject *__pyx_tuple__74; +static PyObject *__pyx_tuple__75; +static PyObject *__pyx_tuple__76; +static PyObject *__pyx_tuple__77; +static PyObject *__pyx_tuple__78; +static PyObject *__pyx_tuple__79; +static PyObject *__pyx_tuple__80; +static PyObject *__pyx_tuple__81; +static PyObject *__pyx_tuple__82; +static PyObject *__pyx_tuple__83; +static PyObject *__pyx_tuple__84; +static PyObject *__pyx_tuple__85; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_tuple__86; +static PyObject *__pyx_tuple__87; +static PyObject *__pyx_tuple__88; +static PyObject *__pyx_tuple__89; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_tuple__90; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_tuple__91; +static PyObject *__pyx_tuple__92; +static PyObject *__pyx_tuple__93; +static PyObject *__pyx_tuple__94; +static PyObject *__pyx_tuple__95; +static PyObject *__pyx_tuple__96; +static PyObject *__pyx_tuple__97; +static PyObject *__pyx_codeobj__98; +static PyObject *__pyx_codeobj__99; +static PyObject *__pyx_codeobj__100; +static PyObject *__pyx_codeobj__101; +static PyObject *__pyx_codeobj__102; +static PyObject *__pyx_codeobj__103; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_codeobj__90; +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_codeobj__91; +static PyObject *__pyx_codeobj__92; +static PyObject *__pyx_codeobj__93; +static PyObject *__pyx_codeobj__94; +static PyObject *__pyx_codeobj__95; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_tuple__90; +static PyObject *__pyx_tuple__91; +static PyObject *__pyx_tuple__92; +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_codeobj__93; +static PyObject *__pyx_codeobj__94; +static PyObject *__pyx_codeobj__95; +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_codeobj__96; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_tuple__93; +static PyObject *__pyx_tuple__94; +static PyObject *__pyx_tuple__95; +static PyObject *__pyx_tuple__96; +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_codeobj__97; +static PyObject *__pyx_codeobj__98; +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_codeobj__86; +static PyObject *__pyx_codeobj__87; +static PyObject *__pyx_codeobj__88; +static PyObject *__pyx_codeobj__89; +static PyObject *__pyx_codeobj__90; +static PyObject *__pyx_codeobj__91; +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_codeobj__99; +static PyObject *__pyx_codeobj__100; +static PyObject *__pyx_codeobj__101; +static PyObject *__pyx_codeobj__102; +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_gb_6gevent_5libev_8corecext_24generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ + + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_22genexpr(CYTHON_UNUSED PyObject *__pyx_self) { + struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)__pyx_tp_new_6gevent_5libev_8corecext___pyx_scope_struct__genexpr(__pyx_ptype_6gevent_5libev_8corecext___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 128, __pyx_L1_error) + } else { + __Pyx_GOTREF(__pyx_cur_scope); + } + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6gevent_5libev_8corecext_24generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_gevent_libev_corecext); if (unlikely(!gen)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.libev.corecext.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_6gevent_5libev_8corecext_24generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("None", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_r = PyDict_New(); if (unlikely(!__pyx_r)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 128, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 128, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 128, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 128, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L7_unpacking_done; + __pyx_L6_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_L7_unpacking_done:; + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_flag); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_flag, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_string); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_string, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + if (unlikely(PyDict_SetItem(__pyx_r, (PyObject*)__pyx_cur_scope->__pyx_v_string, (PyObject*)__pyx_cur_scope->__pyx_v_flag))) __PYX_ERR(0, 128, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +PyObject *GEVENT_CORE_EVENTS = 0; + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_EVENTSType_1__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_EVENTSType_1__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_11_EVENTSType___repr__(((struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_11_EVENTSType___repr__(CYTHON_UNUSED struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s_gevent_core_EVENTS); + __pyx_r = __pyx_kp_s_gevent_core_EVENTS; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_1get_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_1get_version = {"get_version", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_1get_version, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_5libev_8corecext_1get_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_version (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_get_version(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_get_version(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("get_version", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(ev_version_major()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(ev_version_minor()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_libev_d_02d, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.get_version", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_3get_header_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_3get_header_version = {"get_header_version", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_3get_header_version, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_5libev_8corecext_3get_header_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_header_version (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2get_header_version(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2get_header_version(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("get_header_version", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(EV_VERSION_MAJOR); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(EV_VERSION_MINOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_libev_d_02d, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.get_header_version", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5_flags_to_list(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext__flags_to_list(unsigned int __pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_result = 0; + PyObject *__pyx_v_code = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_t_9; + int __pyx_t_10; + unsigned int __pyx_t_11; + __Pyx_RefNannySetupContext("_flags_to_list", 0); + + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 151, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 151, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 151, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 151, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_L6_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_code, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6); + __pyx_t_6 = 0; + + __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyNumber_And(__pyx_t_1, __pyx_v_code); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_9) { + + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_value); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 153, __pyx_L1_error) + + } + + __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyNumber_Invert(__pyx_v_code); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyNumber_InPlaceAnd(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = __Pyx_PyInt_As_unsigned_int(__pyx_t_5); if (unlikely((__pyx_t_11 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_flags = __pyx_t_11; + + __pyx_t_9 = ((!(__pyx_v_flags != 0)) != 0); + if (__pyx_t_9) { + + goto __pyx_L4_break; + + } + + } + __pyx_L4_break:; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_9 = (__pyx_v_flags != 0); + if (__pyx_t_9) { + + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_2); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + } + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.libev.corecext._flags_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_code); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5_flags_to_list(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5_flags_to_list(PyObject *__pyx_self, PyObject *__pyx_arg_flags) { + unsigned int __pyx_v_flags; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_flags_to_list (wrapper)", 0); + assert(__pyx_arg_flags); { + __pyx_v_flags = __Pyx_PyInt_As_unsigned_int(__pyx_arg_flags); if (unlikely((__pyx_v_flags == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext._flags_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4_flags_to_list(__pyx_self, ((unsigned int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4_flags_to_list(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_flags_to_list", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(__pyx_v_flags, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext._flags_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7_flags_to_int(PyObject *__pyx_self, PyObject *__pyx_v_flags); /*proto*/ +static unsigned int __pyx_f_6gevent_5libev_8corecext__flags_to_int(PyObject *__pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch) { + unsigned int __pyx_v_result; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_v_ex = NULL; + unsigned int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + unsigned int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + PyObject *(*__pyx_t_10)(PyObject *); + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_t_14; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + int __pyx_t_17; + __Pyx_RefNannySetupContext("_flags_to_int", 0); + __Pyx_INCREF(__pyx_v_flags); + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flags); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_2 = ((!__pyx_t_1) != 0); + if (__pyx_t_2) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_t_3 = __pyx_v_6gevent_5libev_8corecext_integer_types; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = PyObject_IsInstance(__pyx_v_flags, __pyx_t_3); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + __pyx_t_4 = __Pyx_PyInt_As_unsigned_int(__pyx_v_flags); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_r = __pyx_t_4; + goto __pyx_L0; + + } + + __pyx_v_result = 0; + + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + /*try:*/ { + + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_IsInstance(__pyx_v_flags, __pyx_t_3); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 176, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_flags, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 177, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_flags, __pyx_t_8); + __pyx_t_8 = 0; + + } + + if (likely(PyList_CheckExact(__pyx_v_flags)) || PyTuple_CheckExact(__pyx_v_flags)) { + __pyx_t_8 = __pyx_v_flags; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0; + __pyx_t_10 = NULL; + } else { + __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_flags); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 178, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 178, __pyx_L5_error) + } + for (;;) { + if (likely(!__pyx_t_10)) { + if (likely(PyList_CheckExact(__pyx_t_8))) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 178, __pyx_L5_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 178, __pyx_L5_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_10(__pyx_t_8); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 178, __pyx_L5_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); + __pyx_t_3 = 0; + + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_strip); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 179, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_13)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + } + } + if (__pyx_t_13) { + __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 179, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } else { + __pyx_t_11 = __Pyx_PyObject_CallNoArg(__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 179, __pyx_L5_error) + } + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_lower); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 179, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + } + } + if (__pyx_t_11) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } else { + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L5_error) + } + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_3); + __pyx_t_3 = 0; + + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 180, __pyx_L5_error) + if (__pyx_t_2) { + + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_flags_str2int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 181, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_v_value); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 181, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyNumber_InPlaceOr(__pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 181, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_4 = __Pyx_PyInt_As_unsigned_int(__pyx_t_12); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_result = __pyx_t_4; + + } + + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + } + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L12_try_end; + __pyx_L5_error:; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); + if (__pyx_t_14) { + __Pyx_AddTraceback("gevent.libev.corecext._flags_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_12, &__pyx_t_11) < 0) __PYX_ERR(0, 182, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_t_12); + __pyx_v_ex = __pyx_t_12; + + __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_flags_str2int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 183, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_keys); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 183, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_16); + if (likely(__pyx_t_15)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_16, function); + } + } + if (__pyx_t_15) { + __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_15); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 183, __pyx_L7_except_error) + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } else { + __pyx_t_13 = __Pyx_PyObject_CallNoArg(__pyx_t_16); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 183, __pyx_L7_except_error) + } + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = PySequence_List(__pyx_t_13); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 183, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_3 = ((PyObject*)__pyx_t_16); + __pyx_t_16 = 0; + __pyx_t_17 = PyList_Sort(__pyx_t_3); if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(0, 183, __pyx_L7_except_error) + __pyx_t_16 = __Pyx_PyString_Join(__pyx_kp_s__3, __pyx_t_3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 183, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_ex); + __Pyx_GIVEREF(__pyx_v_ex); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ex); + __Pyx_GIVEREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_16); + __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_backend_or_flag_s_Possib, __pyx_t_3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 183, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_16); + __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 183, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_16, 0, 0, 0); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __PYX_ERR(0, 183, __pyx_L7_except_error) + } + goto __pyx_L7_except_error; + __pyx_L7_except_error:; + + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L1_error; + __pyx_L12_try_end:; + } + + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("gevent.libev.corecext._flags_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_ex); + __Pyx_XDECREF(__pyx_v_flags); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7_flags_to_int(PyObject *__pyx_self, PyObject *__pyx_v_flags); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7_flags_to_int(PyObject *__pyx_self, PyObject *__pyx_v_flags) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_flags_to_int (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6_flags_to_int(__pyx_self, ((PyObject *)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6_flags_to_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flags) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + unsigned int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("_flags_to_int", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_int(__pyx_v_flags, 0); if (unlikely(__pyx_t_1 == -1 && PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext._flags_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_f_6gevent_5libev_8corecext__str_hex(PyObject *__pyx_v_flag) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_str_hex", 0); + + __pyx_t_1 = __pyx_v_6gevent_5libev_8corecext_integer_types; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyObject_IsInstance(__pyx_v_flag, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_flag); + __Pyx_GIVEREF(__pyx_v_flag); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_flag); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_hex, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L0; + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_flag); + __Pyx_GIVEREF(__pyx_v_flag); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_flag); + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext._str_hex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_9_check_flags(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext__check_flags(unsigned int __pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_as_list = 0; + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + __Pyx_RefNannySetupContext("_check_flags", 0); + + __pyx_v_flags = (__pyx_v_flags & EVBACKEND_MASK); + + __pyx_t_1 = ((!(__pyx_v_flags != 0)) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + } + + __pyx_t_1 = ((!((__pyx_v_flags & EVBACKEND_ALL) != 0)) != 0); + if (__pyx_t_1) { + + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_value_for_backend_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 199, __pyx_L1_error) + + } + + __pyx_t_1 = ((!((__pyx_v_flags & ev_supported_backends()) != 0)) != 0); + if (__pyx_t_1) { + + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(__pyx_v_flags, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 201, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 201, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 201, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__str_hex(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_as_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__4, __pyx_v_as_list); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Unsupported_backend_s, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 202, __pyx_L1_error) + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext._check_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_as_list); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_9_check_flags(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_9_check_flags(PyObject *__pyx_self, PyObject *__pyx_arg_flags) { + unsigned int __pyx_v_flags; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_check_flags (wrapper)", 0); + assert(__pyx_arg_flags); { + __pyx_v_flags = __Pyx_PyInt_As_unsigned_int(__pyx_arg_flags); if (unlikely((__pyx_v_flags == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext._check_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8_check_flags(__pyx_self, ((unsigned int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8_check_flags(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_check_flags", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_flags(__pyx_v_flags, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext._check_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_events_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_events); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext__events_to_str(int __pyx_v_events, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_result = 0; + int __pyx_v_c_flag; + PyObject *__pyx_v_flag = NULL; + PyObject *__pyx_v_string = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + __Pyx_RefNannySetupContext("_events_to_str", 0); + + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_events); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 208, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 208, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 208, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 208, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_L6_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_flag, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_string, __pyx_t_6); + __pyx_t_6 = 0; + + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_flag); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_v_c_flag = __pyx_t_9; + + __pyx_t_10 = ((__pyx_v_events & __pyx_v_c_flag) != 0); + if (__pyx_t_10) { + + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_string); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 211, __pyx_L1_error) + + __pyx_v_events = (__pyx_v_events & (~__pyx_v_c_flag)); + + } + + __pyx_t_10 = ((!(__pyx_v_events != 0)) != 0); + if (__pyx_t_10) { + + goto __pyx_L4_break; + + } + + } + __pyx_L4_break:; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_10 = (__pyx_v_events != 0); + if (__pyx_t_10) { + + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_hex, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_2); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 216, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__4, __pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.libev.corecext._events_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_flag); + __Pyx_XDECREF(__pyx_v_string); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_events_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_events); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_events_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_events) { + int __pyx_v_events; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_events_to_str (wrapper)", 0); + assert(__pyx_arg_events); { + __pyx_v_events = __Pyx_PyInt_As_int(__pyx_arg_events); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 205, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext._events_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_10_events_to_str(__pyx_self, ((int)__pyx_v_events)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_10_events_to_str(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_events) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_events_to_str", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__events_to_str(__pyx_v_events, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext._events_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_13supported_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_13supported_backends = {"supported_backends", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_13supported_backends, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_5libev_8corecext_13supported_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("supported_backends (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12supported_backends(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_12supported_backends(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("supported_backends", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(ev_supported_backends(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.supported_backends", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_15recommended_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_15recommended_backends = {"recommended_backends", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_15recommended_backends, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_5libev_8corecext_15recommended_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("recommended_backends (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_14recommended_backends(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_14recommended_backends(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("recommended_backends", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(ev_recommended_backends(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.recommended_backends", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_17embeddable_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_17embeddable_backends = {"embeddable_backends", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_17embeddable_backends, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_5libev_8corecext_17embeddable_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("embeddable_backends (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_16embeddable_backends(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_16embeddable_backends(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("embeddable_backends", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(ev_embeddable_backends(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.embeddable_backends", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_19time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_19time = {"time", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_19time, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_5libev_8corecext_19time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("time (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_18time(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_18time(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("time", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(ev_time()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.time", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_flags = 0; + PyObject *__pyx_v_default = 0; + size_t __pyx_v_ptr; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flags_2,&__pyx_n_s_default,&__pyx_n_s_ptr,0}; + PyObject* values[3] = {0,0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags_2); + if (value) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ptr); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 256, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_flags = values[0]; + __pyx_v_default = values[1]; + if (values[2]) { + __pyx_v_ptr = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_ptr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 256, __pyx_L3_error) + } else { + __pyx_v_ptr = ((size_t)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 256, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop___init__(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_flags, __pyx_v_default, __pyx_v_ptr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4loop___init__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_flags, PyObject *__pyx_v_default, size_t __pyx_v_ptr) { + unsigned int __pyx_v_c_flags; + CYTHON_UNUSED PyObject *__pyx_v_old_handler = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + unsigned int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + __Pyx_RefNannySetupContext("__init__", 0); + __Pyx_INCREF(__pyx_v_default); + + __Pyx_INCREF(Py_None); + __pyx_v_old_handler = Py_None; + + ev_prepare_init((&__pyx_v_self->_prepare), ((void *)gevent_run_callbacks)); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + ev_timer_init((&__pyx_v_self->_periodic_signal_checker), ((void *)gevent_periodic_signal_check), 0.3, 0.3); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + ev_timer_init((&__pyx_v_self->_timer0), ((void *)gevent_noop), 0.0, 0.0); + + __pyx_t_1 = (__pyx_v_ptr != 0); + if (__pyx_t_1) { + + __pyx_v_self->_ptr = ((struct ev_loop *)__pyx_v_ptr); + + goto __pyx_L3; + } + + /*else*/ { + __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__flags_to_int(__pyx_v_flags, 0); if (unlikely(__pyx_t_2 == -1 && PyErr_Occurred())) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_v_c_flags = __pyx_t_2; + + __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext__check_flags(__pyx_v_c_flags, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + __pyx_v_c_flags = (__pyx_v_c_flags | EVFLAG_NOENV); + + __pyx_v_c_flags = (__pyx_v_c_flags | EVFLAG_FORKCHECK); + + __pyx_t_1 = (__pyx_v_default == Py_None); + __pyx_t_4 = (__pyx_t_1 != 0); + if (__pyx_t_4) { + + __Pyx_INCREF(Py_True); + __Pyx_DECREF_SET(__pyx_v_default, Py_True); + + __pyx_t_4 = (__pyx_v_6gevent_5libev_8corecext__default_loop_destroyed != 0); + if (__pyx_t_4) { + + __Pyx_INCREF(Py_False); + __Pyx_DECREF_SET(__pyx_v_default, Py_False); + + } + + } + + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_default); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 275, __pyx_L1_error) + if (__pyx_t_4) { + + __pyx_v_self->_ptr = gevent_ev_default_loop(__pyx_v_c_flags); + + __pyx_t_4 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_4) { + + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_c_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_ev_default_loop_s_failed, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_SystemError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 278, __pyx_L1_error) + + } +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + + ev_timer_start(__pyx_v_self->_ptr, (&__pyx_v_self->_periodic_signal_checker)); + + ev_unref(__pyx_v_self->_ptr); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + + goto __pyx_L6; + } + + /*else*/ { + __pyx_v_self->_ptr = ev_loop_new(__pyx_v_c_flags); + + __pyx_t_4 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_4) { + + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_c_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_ev_loop_new_s_failed, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_SystemError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 286, __pyx_L1_error) + + } + } + __pyx_L6:; + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_default); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 287, __pyx_L1_error) + if (!__pyx_t_1) { + } else { + __pyx_t_4 = __pyx_t_1; + goto __pyx_L10_bool_binop_done; + } + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_SYSERR_CALLBACK); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = (__pyx_t_3 == Py_None); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = (__pyx_t_1 != 0); + __pyx_t_4 = __pyx_t_6; + __pyx_L10_bool_binop_done:; + if (__pyx_t_4) { + + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_syserr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(__pyx_t_3, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + } + + ev_prepare_start(__pyx_v_self->_ptr, (&__pyx_v_self->_prepare)); + + ev_unref(__pyx_v_self->_ptr); + } + __pyx_L3:; + + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->_callbacks); + __Pyx_DECREF(__pyx_v_self->_callbacks); + __pyx_v_self->_callbacks = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.loop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_old_handler); + __Pyx_XDECREF(__pyx_v_default); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__run_callbacks(struct PyGeventLoopObject *__pyx_v_self) { + struct PyGeventCallbackObject *__pyx_v_cb = 0; + PyObject *__pyx_v_callbacks = 0; + int __pyx_v_count; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("_run_callbacks", 0); + + __pyx_v_count = 0x3E8; + + ev_timer_stop(__pyx_v_self->_ptr, (&__pyx_v_self->_timer0)); + + while (1) { + __pyx_t_2 = (__pyx_v_self->_callbacks != Py_None) && (PyList_GET_SIZE(__pyx_v_self->_callbacks) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_count > 0) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L5_bool_binop_done:; + if (!__pyx_t_1) break; + + __pyx_t_3 = __pyx_v_self->_callbacks; + __Pyx_INCREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_callbacks, __pyx_t_3); + __pyx_t_3 = 0; + + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_callbacks); + __Pyx_DECREF(__pyx_v_self->_callbacks); + __pyx_v_self->_callbacks = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + if (likely(PyList_CheckExact(__pyx_v_callbacks)) || PyTuple_CheckExact(__pyx_v_callbacks)) { + __pyx_t_3 = __pyx_v_callbacks; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_callbacks); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 301, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 301, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 301, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_6gevent_5libev_8corecext_callback))))) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_cb, ((struct PyGeventCallbackObject *)__pyx_t_6)); + __pyx_t_6 = 0; + + ev_unref(__pyx_v_self->_ptr); + + gevent_call(__pyx_v_self, __pyx_v_cb); + + __pyx_v_count = (__pyx_v_count - 1); + + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + + __pyx_t_1 = (__pyx_v_self->_callbacks != Py_None) && (PyList_GET_SIZE(__pyx_v_self->_callbacks) != 0); + if (__pyx_t_1) { + + ev_timer_start(__pyx_v_self->_ptr, (&__pyx_v_self->_timer0)); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.libev.corecext.loop._run_callbacks", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_cb); + __Pyx_XDECREF(__pyx_v_callbacks); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_3_stop_watchers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_3_stop_watchers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_stop_watchers (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_2_stop_watchers(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_2_stop_watchers(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("_stop_watchers", 0); + + __pyx_t_1 = (ev_is_active((&__pyx_v_self->_prepare)) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->_ptr); + + ev_prepare_stop(__pyx_v_self->_ptr, (&__pyx_v_self->_prepare)); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + + } + + __pyx_t_1 = (ev_is_active((&__pyx_v_self->_periodic_signal_checker)) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->_ptr); + + ev_timer_stop(__pyx_v_self->_ptr, (&__pyx_v_self->_periodic_signal_checker)); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("destroy (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_4destroy(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_4destroy(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("destroy", 0); + + __pyx_t_1 = (__pyx_v_self->_ptr != 0); + if (__pyx_t_1) { + + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_stop_watchers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + if (__pyx_t_4) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_SYSERR_CALLBACK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_syserr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_1) { + + __pyx_t_4 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(Py_None, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + } + + __pyx_t_1 = (ev_is_default_loop(__pyx_v_self->_ptr) != 0); + if (__pyx_t_1) { + + __pyx_v_6gevent_5libev_8corecext__default_loop_destroyed = 1; + + } + + ev_loop_destroy(__pyx_v_self->_ptr); + + __pyx_v_self->_ptr = NULL; + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext.loop.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static void __pyx_pw_6gevent_5libev_8corecext_4loop_7__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6gevent_5libev_8corecext_4loop_7__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6gevent_5libev_8corecext_4loop_6__dealloc__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6gevent_5libev_8corecext_4loop_6__dealloc__(struct PyGeventLoopObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + __pyx_t_1 = (__pyx_v_self->_ptr != 0); + if (__pyx_t_1) { + + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_stop_watchers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + if (__pyx_t_4) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_1 = ((!(ev_is_default_loop(__pyx_v_self->_ptr) != 0)) != 0); + if (__pyx_t_1) { + + ev_loop_destroy(__pyx_v_self->_ptr); + + } + + __pyx_v_self->_ptr = NULL; + + } + + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent.libev.corecext.loop.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __pyx_L0:; + __Pyx_RefNannyFinishContext(); +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_3ptr_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_3ptr_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_3ptr___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_3ptr___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop.ptr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11WatcherType_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11WatcherType_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_11WatcherType___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11WatcherType___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher)); + __pyx_r = ((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher); + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MAXPRI_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MAXPRI_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_6MAXPRI___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_6MAXPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(EV_MAXPRI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop.MAXPRI.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MINPRI_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MINPRI_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_6MINPRI___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_6MINPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(EV_MINPRI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop.MINPRI.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9_handle_syserr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9_handle_syserr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_message = 0; + PyObject *__pyx_v_errno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_handle_syserr (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_message,&__pyx_n_s_errno,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_errno)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_handle_syserr", 1, 2, 2, 1); __PYX_ERR(0, 356, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_handle_syserr") < 0)) __PYX_ERR(0, 356, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_message = values[0]; + __pyx_v_errno = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_handle_syserr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 356, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop._handle_syserr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_8_handle_syserr(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_message, __pyx_v_errno); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_8_handle_syserr(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_errno) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("_handle_syserr", 0); + __Pyx_INCREF(__pyx_v_message); + + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 357, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_message, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + if (__pyx_t_4) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_2); + __pyx_t_2 = 0; + + } + + __pyx_t_2 = PyNumber_Add(__pyx_v_message, __pyx_kp_s__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_4) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_errno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_errno}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_errno}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + __Pyx_INCREF(__pyx_v_errno); + __Pyx_GIVEREF(__pyx_v_errno); + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_errno); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_SystemError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_vtab)->handle_error(__pyx_v_self, Py_None, __pyx_builtin_SystemError, __pyx_t_5, Py_None, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.libev.corecext.loop._handle_syserr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_message); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch) { + PyObject *__pyx_v_handle_error = 0; + PyObject *__pyx_v_error_handler = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + __Pyx_RefNannySetupContext("handle_error", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_context); + __Pyx_GIVEREF(__pyx_v_context); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_context); + __Pyx_INCREF(__pyx_v_type); + __Pyx_GIVEREF(__pyx_v_type); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_type); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_value); + __Pyx_INCREF(__pyx_v_tb); + __Pyx_GIVEREF(__pyx_v_tb); + PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_tb); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + __pyx_t_1 = __pyx_v_self->error_handler; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_error_handler = __pyx_t_1; + __pyx_t_1 = 0; + + __pyx_t_7 = (__pyx_v_error_handler != Py_None); + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_error_handler, __pyx_n_s_handle_error, __pyx_v_error_handler); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_handle_error = __pyx_t_1; + __pyx_t_1 = 0; + + __Pyx_INCREF(__pyx_v_handle_error); + __pyx_t_2 = __pyx_v_handle_error; __pyx_t_3 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 367, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_context); + __Pyx_GIVEREF(__pyx_v_context); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_context); + __Pyx_INCREF(__pyx_v_type); + __Pyx_GIVEREF(__pyx_v_type); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_type); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_value); + __Pyx_INCREF(__pyx_v_tb); + __Pyx_GIVEREF(__pyx_v_tb); + PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_tb); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + goto __pyx_L3; + } + + /*else*/ { + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_vtab)->_default_handle_error(__pyx_v_self, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L3:; + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.libev.corecext.loop.handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_handle_error); + __Pyx_XDECREF(__pyx_v_error_handler); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_context = 0; + PyObject *__pyx_v_type = 0; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_tb = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("handle_error (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_type,&__pyx_n_s_value,&__pyx_n_s_tb,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, 1); __PYX_ERR(0, 361, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, 2); __PYX_ERR(0, 361, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, 3); __PYX_ERR(0, 361, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_error") < 0)) __PYX_ERR(0, 361, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_context = values[0]; + __pyx_v_type = values[1]; + __pyx_v_value = values[2]; + __pyx_v_tb = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 361, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10handle_error(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("handle_error", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext_4loop_handle_error(__pyx_v_self, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop.handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__default_handle_error(struct PyGeventLoopObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __Pyx_RefNannySetupContext("_default_handle_error", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_default_handle_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_context); + __Pyx_GIVEREF(__pyx_v_context); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_context); + __Pyx_INCREF(__pyx_v_type); + __Pyx_GIVEREF(__pyx_v_type); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_type); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_value); + __Pyx_INCREF(__pyx_v_tb); + __Pyx_GIVEREF(__pyx_v_tb); + PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_tb); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_traceback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_print_exception); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_2) { + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL; + } + __Pyx_INCREF(__pyx_v_type); + __Pyx_GIVEREF(__pyx_v_type); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_type); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_value); + __Pyx_INCREF(__pyx_v_tb); + __Pyx_GIVEREF(__pyx_v_tb); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_tb); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + __pyx_t_7 = (__pyx_v_self->_ptr != 0); + if (__pyx_t_7) { + + ev_break(__pyx_v_self->_ptr, EVBREAK_ONE); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.libev.corecext.loop._default_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_context = 0; + PyObject *__pyx_v_type = 0; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_tb = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_default_handle_error (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_type,&__pyx_n_s_value,&__pyx_n_s_tb,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, 1); __PYX_ERR(0, 371, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, 2); __PYX_ERR(0, 371, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, 3); __PYX_ERR(0, 371, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_default_handle_error") < 0)) __PYX_ERR(0, 371, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_context = values[0]; + __pyx_v_type = values[1]; + __pyx_v_value = values[2]; + __pyx_v_tb = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 371, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop._default_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_12_default_handle_error(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_12_default_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_default_handle_error", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext_4loop__default_handle_error(__pyx_v_self, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop._default_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_15run(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_15run(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_nowait = 0; + PyObject *__pyx_v_once = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("run (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nowait,&__pyx_n_s_once,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_False); + values[1] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nowait); + if (value) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_once); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run") < 0)) __PYX_ERR(0, 378, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_nowait = values[0]; + __pyx_v_once = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("run", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 378, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.run", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_14run(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_nowait, __pyx_v_once); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_14run(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_nowait, PyObject *__pyx_v_once) { + unsigned int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("run", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_1) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 381, __pyx_L1_error) + + } + + __pyx_v_flags = 0; + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_nowait); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 383, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_v_flags = (__pyx_v_flags | EVRUN_NOWAIT); + + } + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_once); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 385, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_v_flags = (__pyx_v_flags | EVRUN_ONCE); + + } + + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + #endif + /*try:*/ { + + ev_run(__pyx_v_self->_ptr, __pyx_v_flags); + } + + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + Py_BLOCK_THREADS + #endif + goto __pyx_L8; + } + __pyx_L8:; + } + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.run", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_17reinit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_17reinit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reinit (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_16reinit(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_16reinit(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("reinit", 0); + + __pyx_t_1 = (__pyx_v_self->_ptr != 0); + if (__pyx_t_1) { + + ev_loop_fork(__pyx_v_self->_ptr); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_19ref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_19ref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ref (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_18ref(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_18ref(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("ref", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_1) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 397, __pyx_L1_error) + + } + + ev_ref(__pyx_v_self->_ptr); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.ref", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_21unref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_21unref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unref (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_20unref(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_20unref(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("unref", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_1) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 403, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 403, __pyx_L1_error) + + } + + ev_unref(__pyx_v_self->_ptr); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.unref", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_23break_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_23break_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_how; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("break_ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_how,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_how); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "break_") < 0)) __PYX_ERR(0, 406, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + if (values[0]) { + __pyx_v_how = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_how == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 406, __pyx_L3_error) + } else { + __pyx_v_how = __pyx_k__9; + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("break_", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 406, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.break_", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_22break_(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_how); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_22break_(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_how) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("break_", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_1) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 409, __pyx_L1_error) + + } + + ev_break(__pyx_v_self->_ptr, __pyx_v_how); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.break_", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_25verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_25verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("verify (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_24verify(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_24verify(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("verify", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_1) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 415, __pyx_L1_error) + + } + + ev_verify(__pyx_v_self->_ptr); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.verify", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_27now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_27now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("now (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_26now(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_26now(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("now", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_1) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 421, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 421, __pyx_L1_error) + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(ev_now(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.now", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_29update(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_29update(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("update (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_28update(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_28update(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("update", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_1) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 427, __pyx_L1_error) + + } + + ev_now_update(__pyx_v_self->_ptr); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.update", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_31__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_31__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_30__repr__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_30__repr__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + if (__pyx_t_5) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.loop.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7default_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7default_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_7default___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_7default___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_1) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 438, __pyx_L1_error) + + } + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_default_loop(__pyx_v_self->_ptr) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_2 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_2 = Py_False; + } + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.default.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9iteration_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9iteration_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_9iteration___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9iteration___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_1) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 446, __pyx_L1_error) + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_iteration(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.iteration.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5depth_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5depth_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_5depth___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_5depth___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_1) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 454, __pyx_L1_error) + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_depth(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.depth.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11backend_int_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11backend_int_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_11backend_int___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11backend_int___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_1) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 462, __pyx_L1_error) + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_backend(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.backend_int.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7backend_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7backend_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_7backend___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_7backend___get__(struct PyGeventLoopObject *__pyx_v_self) { + unsigned int __pyx_v_backend; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *(*__pyx_t_9)(PyObject *); + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_1) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 470, __pyx_L1_error) + + } + + __pyx_v_backend = ev_backend(__pyx_v_self->_ptr); + + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } else { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 472, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 472, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L7_unpacking_done; + __pyx_L6_unpacking_failed:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_L7_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_6); + __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_7); + __pyx_t_7 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_backend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_key, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 473, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 473, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_value); + __pyx_r = __pyx_v_value; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L0; + + } + + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_backend); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("gevent.libev.corecext.loop.backend.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10pendingcnt_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10pendingcnt_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10pendingcnt___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10pendingcnt___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_1) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 482, __pyx_L1_error) + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_pending_count(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.pendingcnt.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_33io(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_33io(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + vfd_socket_t __pyx_v_fd; +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + int __pyx_v_fd; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + vfd_socket_t __pyx_v_fd; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + int __pyx_v_events; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("io (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fd,&__pyx_n_s_events_2,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[4] = {0,0,0,0}; + values[2] = ((PyObject *)Py_True); + values[3] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fd)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_events_2)) != 0)) kw_args--; + else { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __Pyx_RaiseArgtupleInvalid("io", 0, 2, 4, 1); __PYX_ERR(0, 486, __pyx_L3_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_RaiseArgtupleInvalid("io", 0, 2, 4, 1); __PYX_ERR(0, 489, __pyx_L3_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __Pyx_RaiseArgtupleInvalid("io", 0, 2, 4, 1); __PYX_ERR(0, 486, __pyx_L3_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "io") < 0)) __PYX_ERR(0, 486, __pyx_L3_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "io") < 0)) __PYX_ERR(0, 489, __pyx_L3_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "io") < 0)) __PYX_ERR(0, 486, __pyx_L3_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_v_fd = __Pyx_PyInt_As_vfd_socket_t(values[0]); if (unlikely((__pyx_v_fd == ((vfd_socket_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + __pyx_v_events = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_v_fd = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_fd == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 489, __pyx_L3_error) + __pyx_v_events = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 489, __pyx_L3_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_v_fd = __Pyx_PyInt_As_vfd_socket_t(values[0]); if (unlikely((__pyx_v_fd == ((vfd_socket_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + __pyx_v_events = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_v_ref = values[2]; + __pyx_v_priority = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __Pyx_RaiseArgtupleInvalid("io", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 486, __pyx_L3_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_RaiseArgtupleInvalid("io", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 489, __pyx_L3_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __Pyx_RaiseArgtupleInvalid("io", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 486, __pyx_L3_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.io", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_32io(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_fd, __pyx_v_events, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_32io(struct PyGeventLoopObject *__pyx_v_self, vfd_socket_t __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_32io(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_32io(struct PyGeventLoopObject *__pyx_v_self, vfd_socket_t __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("io", 0); + + __Pyx_XDECREF(__pyx_r); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_1 = __Pyx_PyInt_From_vfd_socket_t(__pyx_v_fd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 487, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_fd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 490, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_1 = __Pyx_PyInt_From_vfd_socket_t(__pyx_v_fd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 487, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_1); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 487, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 490, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 487, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_priority); + __pyx_t_1 = 0; + __pyx_t_2 = 0; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_io), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_io), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_io), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.loop.io", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_35timer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_35timer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + double __pyx_v_after; + double __pyx_v_repeat; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_after,&__pyx_n_s_repeat,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[4] = {0,0,0,0}; + values[2] = ((PyObject *)Py_True); + values[3] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_after)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repeat); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer") < 0)) __PYX_ERR(0, 493, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_after = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_after == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 493, __pyx_L3_error) + if (values[1]) { + __pyx_v_repeat = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_repeat == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 493, __pyx_L3_error) + } else { + __pyx_v_repeat = ((double)0.0); + } + __pyx_v_ref = values[2]; + __pyx_v_priority = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 493, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.timer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_34timer(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_after, __pyx_v_repeat, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_34timer(struct PyGeventLoopObject *__pyx_v_self, double __pyx_v_after, double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("timer", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_after); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_repeat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_priority); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_timer), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.loop.timer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_37signal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_37signal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_signum; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("signal (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signum,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signum)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "signal") < 0)) __PYX_ERR(0, 496, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_signum = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_signum == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 496, __pyx_L3_error) + __pyx_v_ref = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("signal", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 496, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.signal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_36signal(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_signum, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_36signal(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_signum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("signal", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_signum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_priority); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_signal), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.signal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_39idle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_39idle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("idle (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "idle") < 0)) __PYX_ERR(0, 499, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_ref = values[0]; + __pyx_v_priority = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("idle", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 499, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.idle", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_38idle(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_38idle(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("idle", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_idle), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.idle", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_41prepare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_41prepare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("prepare (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prepare") < 0)) __PYX_ERR(0, 502, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_ref = values[0]; + __pyx_v_priority = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("prepare", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 502, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_40prepare(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_40prepare(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("prepare", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_prepare), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_43check(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_43check(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("check (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "check") < 0)) __PYX_ERR(0, 505, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_ref = values[0]; + __pyx_v_priority = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("check", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 505, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.check", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_42check(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_42check(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("check", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 506, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_check), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 506, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.check", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_45fork(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_45fork(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fork (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fork") < 0)) __PYX_ERR(0, 508, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_ref = values[0]; + __pyx_v_priority = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("fork", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 508, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.fork", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_44fork(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_44fork(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("fork", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_fork), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.fork", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_47async(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_47async(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async") < 0)) __PYX_ERR(0, 511, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_ref = values[0]; + __pyx_v_priority = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 511, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.async", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_46async(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_46async(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("async", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_async), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.async", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_49stat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_49stat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_49child(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_49child(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_pid; + int __pyx_v_trace; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("child (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pid,&__pyx_n_s_trace,&__pyx_n_s_ref,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pid)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_trace); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "child") < 0)) __PYX_ERR(0, 517, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_pid = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_pid == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 517, __pyx_L3_error) + if (values[1]) { + __pyx_v_trace = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_trace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 517, __pyx_L3_error) + } else { + __pyx_v_trace = ((int)0); + } + __pyx_v_ref = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("child", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 517, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.child", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_48child(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_pid, __pyx_v_trace, __pyx_v_ref); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_48child(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_pid, int __pyx_v_trace, PyObject *__pyx_v_ref) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("child", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_trace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_ref); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_child), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.loop.child", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_51install_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_51install_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("install_sigchld (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_50install_sigchld(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_50install_sigchld(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("install_sigchld", 0); + + gevent_install_sigchld_handler(); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_53reset_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_53reset_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reset_sigchld (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_52reset_sigchld(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_52reset_sigchld(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reset_sigchld", 0); + + gevent_reset_sigchld_handler(); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_55stat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_55stat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_49stat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_49stat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + PyObject *__pyx_v_path = 0; + float __pyx_v_interval; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stat (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_interval,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[4] = {0,0,0,0}; + values[2] = ((PyObject *)Py_True); + values[3] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_interval); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stat") < 0)) __PYX_ERR(0, 528, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_path = ((PyObject*)values[0]); + if (values[1]) { + __pyx_v_interval = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_interval == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 528, __pyx_L3_error) + } else { + __pyx_v_interval = ((float)0.0); + } + __pyx_v_ref = values[2]; + __pyx_v_priority = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stat", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 528, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.stat", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), (&PyString_Type), 1, "path", 1))) __PYX_ERR(0, 528, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_48stat(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_path, __pyx_v_interval, __pyx_v_ref, __pyx_v_priority); +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_54stat(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_path, __pyx_v_interval, __pyx_v_ref, __pyx_v_priority); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_48stat(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_path, __pyx_v_interval, __pyx_v_ref, __pyx_v_priority); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_48stat(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_path, float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_54stat(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_path, float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_48stat(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_path, float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stat", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_interval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 529, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_path); + __Pyx_GIVEREF(__pyx_v_path); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_path); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_priority); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_stat), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.stat", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_51run_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_51run_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_57run_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_57run_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_51run_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_51run_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("run_callback (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "run_callback") < 0)) __PYX_ERR(0, 531, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_func = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("run_callback", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 531, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.loop.run_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_50run_callback(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_func, __pyx_v_args); +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_56run_callback(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_func, __pyx_v_args); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_50run_callback(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_func, __pyx_v_args); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_50run_callback(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args) { +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_56run_callback(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_50run_callback(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + struct PyGeventCallbackObject *__pyx_v_cb = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + __Pyx_RefNannySetupContext("run_callback", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_1) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 534, __pyx_L1_error) + + } + + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_func); + __Pyx_GIVEREF(__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_func); + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_callback), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_cb = ((struct PyGeventCallbackObject *)__pyx_t_3); + __pyx_t_3 = 0; + + if (unlikely(__pyx_v_self->_callbacks == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); + __PYX_ERR(0, 536, __pyx_L1_error) + } + __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_self->_callbacks, ((PyObject *)__pyx_v_cb)); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 536, __pyx_L1_error) + + ev_ref(__pyx_v_self->_ptr); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_cb)); + __pyx_r = ((PyObject *)__pyx_v_cb); + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.loop.run_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_cb); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_53_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_53_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_59_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_59_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_53_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_53_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format (wrapper)", 0); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_52_format(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_52_format(struct PyGeventLoopObject *__pyx_v_self) { +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_58_format(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_58_format(struct PyGeventLoopObject *__pyx_v_self) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_52_format(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_52_format(struct PyGeventLoopObject *__pyx_v_self) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + PyObject *__pyx_v_msg = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + PyObject *__pyx_t_4 = NULL; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_RefNannySetupContext("_format", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_destroyed); + __pyx_r = __pyx_n_s_destroyed; + goto __pyx_L0; + + } + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_backend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_msg = __pyx_t_2; + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 544, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_kp_s_default_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_2); + __pyx_t_2 = 0; + + } + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pendingcnt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_pending_s, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_2); + __pyx_t_2 = 0; + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format_details); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 548, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + if (__pyx_t_4) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 548, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 548, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 548, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_3); + __pyx_t_3 = 0; + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_msg); + __pyx_r = __pyx_v_msg; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_XDECREF(__pyx_t_4); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_AddTraceback("gevent.libev.corecext.loop._format", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_msg); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_55_format_details(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_55_format_details(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_61_format_details(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_61_format_details(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_55_format_details(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_55_format_details(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format_details (wrapper)", 0); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_54_format_details(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_54_format_details(struct PyGeventLoopObject *__pyx_v_self) { +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_60_format_details(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_60_format_details(struct PyGeventLoopObject *__pyx_v_self) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_54_format_details(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_54_format_details(struct PyGeventLoopObject *__pyx_v_self) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + PyObject *__pyx_v_msg = 0; + PyObject *__pyx_v_fileno = 0; + PyObject *__pyx_v_sigfd = 0; + PyObject *__pyx_v_activecnt = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + __Pyx_RefNannySetupContext("_format_details", 0); + + __Pyx_INCREF(__pyx_kp_s__21); + __pyx_v_msg = __pyx_kp_s__21; + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fileno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_fileno = __pyx_t_1; + __pyx_t_1 = 0; + + __Pyx_INCREF(Py_None); + __pyx_v_sigfd = Py_None; + + __Pyx_INCREF(Py_None); + __pyx_v_activecnt = Py_None; + + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sigfd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_sigfd, __pyx_t_1); + __pyx_t_1 = 0; + + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_7) { + __Pyx_AddTraceback("gevent.libev.corecext.loop._format_details", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 561, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); + + __Pyx_INCREF(Py_None); + __Pyx_DECREF_SET(__pyx_v_sigfd, Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L10_try_end:; + } + + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_activecnt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 564, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_activecnt, __pyx_t_3); + __pyx_t_3 = 0; + + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L20_try_end; + __pyx_L13_error:; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_7) { + __Pyx_ErrRestore(0,0,0); + goto __pyx_L14_exception_handled; + } + goto __pyx_L15_except_error; + __pyx_L15_except_error:; + + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L14_exception_handled:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4); + __pyx_L20_try_end:; + } + + __pyx_t_8 = (__pyx_v_activecnt != Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + __pyx_t_3 = PyObject_Repr(__pyx_v_activecnt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_ref_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + } + + __pyx_t_9 = (__pyx_v_fileno != Py_None); + __pyx_t_8 = (__pyx_t_9 != 0); + if (__pyx_t_8) { + + __pyx_t_3 = PyObject_Repr(__pyx_v_fileno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_fileno_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + } + + __pyx_t_9 = (__pyx_v_sigfd != Py_None); + __pyx_t_10 = (__pyx_t_9 != 0); + if (__pyx_t_10) { + } else { + __pyx_t_8 = __pyx_t_10; + goto __pyx_L24_bool_binop_done; + } + __pyx_t_3 = PyObject_RichCompare(__pyx_v_sigfd, __pyx_int_neg_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 571, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = __pyx_t_10; + __pyx_L24_bool_binop_done:; + if (__pyx_t_8) { + + __pyx_t_3 = PyObject_Repr(__pyx_v_sigfd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_sigfd_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + } + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_msg); + __pyx_r = __pyx_v_msg; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.loop._format_details", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_msg); + __Pyx_XDECREF(__pyx_v_fileno); + __Pyx_XDECREF(__pyx_v_sigfd); + __Pyx_XDECREF(__pyx_v_activecnt); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_57fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_57fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_63fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_63fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_57fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_57fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fileno (wrapper)", 0); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_56fileno(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_56fileno(struct PyGeventLoopObject *__pyx_v_self) { +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_62fileno(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_62fileno(struct PyGeventLoopObject *__pyx_v_self) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_56fileno(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_56fileno(struct PyGeventLoopObject *__pyx_v_self) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + int __pyx_v_fd; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("fileno", 0); + + __pyx_t_1 = (__pyx_v_self->_ptr != 0); + if (__pyx_t_1) { + + __pyx_t_2 = __pyx_v_self->_ptr->backend_fd; + __pyx_v_fd = __pyx_t_2; + + __pyx_t_1 = ((__pyx_v_fd >= 0) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_fd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + } + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.loop.fileno", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9activecnt_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9activecnt_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_9activecnt___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9activecnt___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_1) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 587, __pyx_L1_error) + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_ptr->activecnt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.activecnt.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11sig_pending_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11sig_pending_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_11sig_pending___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11sig_pending___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_1) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 595, __pyx_L1_error) + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_ptr->sig_pending); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.sig_pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5sigfd_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5sigfd_1__get__(PyObject *__pyx_v_self) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9origflags_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9origflags_1__get__(PyObject *__pyx_v_self) { +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_5sigfd___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_5sigfd___get__(struct PyGeventLoopObject *__pyx_v_self) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_9origflags___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9origflags___get__(struct PyGeventLoopObject *__pyx_v_self) { +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 604, __pyx_L1_error) + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_ptr->sigfd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 605, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.sigfd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9origflags_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9origflags_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_9origflags___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9origflags___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_1) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 613, __pyx_L1_error) + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(__pyx_v_self->_ptr->origflags, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 614, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.origflags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13origflags_int_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13origflags_int_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13origflags_int___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_13origflags_int___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 621, __pyx_L1_error) + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_ptr->origflags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.origflags_int.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->error_handler); + __pyx_r = __pyx_v_self->error_handler; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_2__set__(((struct PyGeventLoopObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->error_handler); + __Pyx_DECREF(__pyx_v_self->error_handler); + __pyx_v_self->error_handler = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_4__del__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_4__del__(struct PyGeventLoopObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->error_handler); + __Pyx_DECREF(__pyx_v_self->error_handler); + __pyx_v_self->error_handler = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_callbacks); + __pyx_r = __pyx_v_self->_callbacks; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_2__set__(((struct PyGeventLoopObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_callbacks); + __Pyx_DECREF(__pyx_v_self->_callbacks); + __pyx_v_self->_callbacks = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop._callbacks.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_4__del__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_4__del__(struct PyGeventLoopObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_callbacks); + __Pyx_DECREF(__pyx_v_self->_callbacks); + __pyx_v_self->_callbacks = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_args,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 631, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 631, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_callback = values[0]; + __pyx_v_args = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 631, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.callback.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback___init__(((struct PyGeventCallbackObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_8callback___init__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + __Pyx_GOTREF(__pyx_v_self->callback); + __Pyx_DECREF(__pyx_v_self->callback); + __pyx_v_self->callback = __pyx_v_callback; + + if (!(likely(PyTuple_CheckExact(__pyx_v_args))||((__pyx_v_args) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_args)->tp_name), 0))) __PYX_ERR(0, 633, __pyx_L1_error) + __pyx_t_1 = __pyx_v_args; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.callback.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stop (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_2stop(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_2stop(struct PyGeventCallbackObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stop", 0); + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->callback); + __Pyx_DECREF(__pyx_v_self->callback); + __pyx_v_self->callback = Py_None; + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_5__nonzero__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_5__nonzero__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4__nonzero__(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_8callback_4__nonzero__(struct PyGeventCallbackObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__nonzero__", 0); + + __pyx_t_1 = (__pyx_v_self->args != ((PyObject*)Py_None)); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7pending_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_7pending___get__(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_7pending___get__(struct PyGeventCallbackObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = (__pyx_v_self->callback != Py_None); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 651, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.callback.pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_6__repr__(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_6__repr__(struct PyGeventCallbackObject *__pyx_v_self) { + PyObject *__pyx_v_format = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + char const *__pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + __pyx_t_1 = ((Py_ReprEnter(((PyObject*)__pyx_v_self)) != 0) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __Pyx_INCREF(__pyx_kp_s__27); + __pyx_r = __pyx_kp_s__27; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __Pyx_INCREF(__pyx_kp_s__21); + __pyx_r = __pyx_kp_s__21; +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_INCREF(__pyx_kp_s__26); + __pyx_r = __pyx_kp_s__26; +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + goto __pyx_L0; + + } + + /*try:*/ { + + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 657, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + if (__pyx_t_4) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L5_error) + } + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_format = __pyx_t_2; + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 658, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_INCREF(__pyx_v_format); + __Pyx_GIVEREF(__pyx_v_format); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_format); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x_s_2, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 658, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pending); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 659, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 659, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_1) { + + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_pending_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 660, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + } + + __pyx_t_1 = (__pyx_v_self->callback != Py_None); + __pyx_t_5 = (__pyx_t_1 != 0); + if (__pyx_t_5) { + + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 662, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_self->callback); + __Pyx_GIVEREF(__pyx_v_self->callback); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->callback); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_callback_r, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 662, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + } + + __pyx_t_5 = (__pyx_v_self->args != ((PyObject*)Py_None)); + __pyx_t_1 = (__pyx_t_5 != 0); + if (__pyx_t_1) { + + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_self->args); + __Pyx_GIVEREF(__pyx_v_self->args); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->args); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_args_r, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 664, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + } + + __pyx_t_5 = (__pyx_v_self->callback == Py_None); + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + } else { + __pyx_t_1 = __pyx_t_6; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_6 = (__pyx_v_self->args == ((PyObject*)Py_None)); + __pyx_t_5 = (__pyx_t_6 != 0); + __pyx_t_1 = __pyx_t_5; + __pyx_L11_bool_binop_done:; + if (__pyx_t_1) { + + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_stopped); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + } + + __Pyx_XDECREF(__pyx_r); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_4 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__28); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 667, __pyx_L5_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_4 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__22); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 667, __pyx_L5_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_4 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__27); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 667, __pyx_L5_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L4_return; + } + + /*finally:*/ { + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __pyx_L5_error:; + __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __pyx_t_7 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename; + { + Py_ReprLeave(((PyObject*)__pyx_v_self)); + } + __Pyx_PyThreadState_assign + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + } + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9; + goto __pyx_L1_error; + } + __pyx_L4_return: { + __pyx_t_15 = __pyx_r; + __pyx_r = 0; + Py_ReprLeave(((PyObject*)__pyx_v_self)); + __pyx_r = __pyx_t_15; + __pyx_t_15 = 0; + goto __pyx_L0; + } + } + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext.callback.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_format); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8_format(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_8_format(CYTHON_UNUSED struct PyGeventCallbackObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format", 0); + + __Pyx_XDECREF(__pyx_r); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __Pyx_INCREF(__pyx_kp_s__23); + __pyx_r = __pyx_kp_s__23; +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_INCREF(__pyx_kp_s__21); + __pyx_r = __pyx_kp_s__21; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_8callback_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8callback___get__(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_8callback___get__(struct PyGeventCallbackObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->callback); + __pyx_r = __pyx_v_self->callback; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_2__set__(((struct PyGeventCallbackObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->callback); + __Pyx_DECREF(__pyx_v_self->callback); + __pyx_v_self->callback = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_4__del__(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_4__del__(struct PyGeventCallbackObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->callback); + __Pyx_DECREF(__pyx_v_self->callback); + __pyx_v_self->callback = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_4args_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_4args_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4args___get__(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_4args___get__(struct PyGeventCallbackObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->args); + __pyx_r = __pyx_v_self->args; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4args_2__set__(((struct PyGeventCallbackObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_8callback_4args_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 629, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.callback.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4args_4__del__(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_8callback_4args_4__del__(struct PyGeventCallbackObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_1__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_1__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher___repr__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher___repr__(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_v_format = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + char const *__pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + __pyx_t_1 = ((Py_ReprEnter(((PyObject*)__pyx_v_self)) != 0) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __Pyx_INCREF(__pyx_kp_s__27); + __pyx_r = __pyx_kp_s__27; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __Pyx_INCREF(__pyx_kp_s__21); + __pyx_r = __pyx_kp_s__21; +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_INCREF(__pyx_kp_s__26); + __pyx_r = __pyx_kp_s__26; +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + goto __pyx_L0; + + } + + /*try:*/ { + + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + if (__pyx_t_4) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L5_error) + } + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_format = __pyx_t_2; + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_INCREF(__pyx_v_format); + __Pyx_GIVEREF(__pyx_v_format); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_format); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x_s_2, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_active); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 704, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_1) { + + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_active_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 705, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + } + + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pending); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 706, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 706, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_1) { + + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_pending_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 707, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + } + + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 708, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = (__pyx_t_4 != Py_None); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = (__pyx_t_1 != 0); + if (__pyx_t_5) { + + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 709, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 709, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_callback_r, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 709, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 709, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + } + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = (__pyx_t_2 != Py_None); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = (__pyx_t_5 != 0); + if (__pyx_t_1) { + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 711, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_args_r, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 711, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + } + + __Pyx_XDECREF(__pyx_r); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_4 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__28); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 712, __pyx_L5_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_4 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__22); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 712, __pyx_L5_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_4 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__27); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 712, __pyx_L5_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L4_return; + } + + /*finally:*/ { + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __pyx_L5_error:; + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __pyx_t_6 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename; + { + Py_ReprLeave(((PyObject*)__pyx_v_self)); + } + __Pyx_PyThreadState_assign + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8; + goto __pyx_L1_error; + } + __pyx_L4_return: { + __pyx_t_14 = __pyx_r; + __pyx_r = 0; + Py_ReprLeave(((PyObject*)__pyx_v_self)); + __pyx_r = __pyx_t_14; + __pyx_t_14 = 0; + goto __pyx_L0; + } + } + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_format); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_3_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_3_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_2_format(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_2_format(CYTHON_UNUSED struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format", 0); + + __Pyx_XDECREF(__pyx_r); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __Pyx_INCREF(__pyx_kp_s__23); + __pyx_r = __pyx_kp_s__23; +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_INCREF(__pyx_kp_s__21); + __pyx_r = __pyx_kp_s__21; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_3ref_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_3ref___get__(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_3ref___get__(struct PyGeventIOObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if (((__pyx_v_self->_flags & 4) != 0)) { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } else { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_2io_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_2io_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_3ref_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_2io_3ref_2__set__(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 737, __pyx_L1_error) + + } + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 738, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_t_1 = ((!((__pyx_v_self->_flags & 4) != 0)) != 0); + if (__pyx_t_1) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->loop->_ptr); + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6)); + + goto __pyx_L4; + } + + /*else*/ { + __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0); + if (__pyx_t_1) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 4); + + __pyx_t_3 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L9_bool_binop_done:; + if (__pyx_t_1) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + } + __pyx_L4:; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.io.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_8callback_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_8callback___get__(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_8callback___get__(struct PyGeventIOObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_callback); + __pyx_r = __pyx_v_self->_callback; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_2io_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_2io_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_8callback_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_2io_8callback_2__set__(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_2 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_callback != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 759, __pyx_L1_error) + + } + + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = __pyx_v_callback; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.io.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stop (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_stop(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_stop(struct PyGeventIOObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stop", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 765, __pyx_L1_error) + + } + + __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2)); + + } + + ev_io_stop(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher)); + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = Py_None; + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0); + if (__pyx_t_1) { + + Py_DECREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1)); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.io.stop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_8priority_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_8priority___get__(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_8priority___get__(struct PyGeventIOObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 779, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.io.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_2io_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_2io_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) { + int __pyx_v_priority; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_priority); { + __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 781, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.io.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_8priority_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((int)__pyx_v_priority)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_2io_8priority_2__set__(struct PyGeventIOObject *__pyx_v_self, int __pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 783, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 783, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 783, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 783, __pyx_L1_error) + + } + + ev_set_priority((&__pyx_v_self->_watcher), __pyx_v_priority); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.io.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_revents; + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("feed (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 2) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); __PYX_ERR(0, 786, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) __PYX_ERR(0, 786, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 786, __pyx_L3_error) + __pyx_v_callback = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 786, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.io.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_2feed(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_2feed(struct PyGeventIOObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("feed", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 789, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 789, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 789, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 789, __pyx_L1_error) + + } + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 790, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0); + if (__pyx_t_1) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + + ev_feed_event(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher), __pyx_v_revents); + + __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); + if (__pyx_t_1) { + + Py_INCREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.io.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_pass_events = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_pass_events,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (kw_args == 1) { + const Py_ssize_t index = 1; + PyObject* value = PyDict_GetItem(__pyx_kwds, *__pyx_pyargnames[index]); + if (value) { values[index] = value; kw_args--; } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 800, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + __pyx_v_pass_events = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 800, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.io.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_4start(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_pass_events, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_4start(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_pass_events, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("start", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 803, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 803, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 803, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 803, __pyx_L1_error) + + } + + __pyx_t_1 = (__pyx_v_callback == Py_None); + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 805, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 805, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 805, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 805, __pyx_L1_error) + + } + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 806, __pyx_L1_error) + + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_pass_events); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 807, __pyx_L1_error) + if (__pyx_t_3) { + + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 808, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(GEVENT_CORE_EVENTS); + __Pyx_GIVEREF(GEVENT_CORE_EVENTS); + PyTuple_SET_ITEM(__pyx_t_2, 0, GEVENT_CORE_EVENTS); + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 808, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + goto __pyx_L5; + } + + /*else*/ { + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + } + __pyx_L5:; + + __pyx_t_3 = (((__pyx_v_self->_flags & 6) == 4) != 0); + if (__pyx_t_3) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + + ev_io_start(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher)); + + __pyx_t_3 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); + if (__pyx_t_3) { + + Py_INCREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext.io.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_6active_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_6active_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_6active___get__(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_6active___get__(struct PyGeventIOObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_active((&__pyx_v_self->_watcher)) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_7pending_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_7pending___get__(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_7pending___get__(struct PyGeventIOObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_pending((&__pyx_v_self->_watcher)) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_2io_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_2io_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + vfd_socket_t __pyx_v_fd; +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + int __pyx_v_fd; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + vfd_socket_t __pyx_v_fd; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + int __pyx_v_events; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_fd,&__pyx_n_s_events_2,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)Py_True); + values[4] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fd)) != 0)) kw_args--; + else { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 832, __pyx_L3_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 848, __pyx_L3_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 832, __pyx_L3_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_events_2)) != 0)) kw_args--; + else { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 832, __pyx_L3_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 848, __pyx_L3_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 832, __pyx_L3_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 832, __pyx_L3_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 848, __pyx_L3_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 832, __pyx_L3_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_v_fd = __Pyx_PyInt_As_vfd_socket_t(values[1]); if (unlikely((__pyx_v_fd == ((vfd_socket_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L3_error) + __pyx_v_events = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L3_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_v_fd = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_fd == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 848, __pyx_L3_error) + __pyx_v_events = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 848, __pyx_L3_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_v_fd = __Pyx_PyInt_As_vfd_socket_t(values[1]); if (unlikely((__pyx_v_fd == ((vfd_socket_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L3_error) + __pyx_v_events = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L3_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_v_ref = values[3]; + __pyx_v_priority = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 832, __pyx_L3_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 848, __pyx_L3_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 832, __pyx_L3_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.io.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 832, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 848, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 832, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_6__init__(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_fd, __pyx_v_events, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) +static int __pyx_pf_6gevent_5libev_8corecext_2io_6__init__(struct PyGeventIOObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static int __pyx_pf_6gevent_5libev_8corecext_2io_6__init__(struct PyGeventIOObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, vfd_socket_t __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + int __pyx_v_vfd; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static int __pyx_pf_6gevent_5libev_8corecext_2io_6__init__(struct PyGeventIOObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("__init__", 0); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_1 = ((__pyx_v_events & (~((EV__IOFDSET | EV_READ) | EV_WRITE))) != 0); +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_1 = ((__pyx_v_fd < 0) != 0); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_1 = ((__pyx_v_events & (~((EV__IOFDSET | EV_READ) | EV_WRITE))) != 0); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_illegal_event_mask_r, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 834, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_fd_must_be_non_negative_r, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 850, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_illegal_event_mask_r, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 834, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __pyx_t_3 = 0; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 834, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 850, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 834, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __PYX_ERR(0, 834, __pyx_L1_error) + + } + + __pyx_t_4 = vfd_open(__pyx_v_fd); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 835, __pyx_L1_error) + __pyx_v_vfd = __pyx_t_4; + + vfd_free(__pyx_v_self->_watcher.fd); + + ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_vfd, __pyx_v_events); +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __PYX_ERR(0, 850, __pyx_L1_error) + + } + + __pyx_t_1 = ((__pyx_v_events & (~((EV__IOFDSET | EV_READ) | EV_WRITE))) != 0); + if (__pyx_t_1) { + + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 852, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_illegal_event_mask_r, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 852, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 852, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 852, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 852, __pyx_L1_error) + + } + + ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_fd, __pyx_v_events); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __PYX_ERR(0, 834, __pyx_L1_error) + + } + + __pyx_t_4 = vfd_open(__pyx_v_fd); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 835, __pyx_L1_error) + __pyx_v_vfd = __pyx_t_4; + + vfd_free(__pyx_v_self->_watcher.fd); + + ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_vfd, __pyx_v_events); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + + __Pyx_INCREF(((PyObject *)__pyx_v_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = __pyx_v_loop; + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 839, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 855, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 839, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + if (__pyx_t_1) { + + __pyx_v_self->_flags = 0; + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + goto __pyx_L4; +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + goto __pyx_L5; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + goto __pyx_L4; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + } + + /*else*/ { + __pyx_v_self->_flags = 4; + } +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_L4:; +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_L5:; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_L4:; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + + __pyx_t_1 = (__pyx_v_priority != Py_None); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_5 = (__pyx_t_1 != 0); + if (__pyx_t_5) { + + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 844, __pyx_L1_error) + ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_4); +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_4 = (__pyx_t_1 != 0); + if (__pyx_t_4) { + + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 860, __pyx_L1_error) + ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_5); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_5 = (__pyx_t_1 != 0); + if (__pyx_t_5) { + + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 844, __pyx_L1_error) + ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_4); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + + } + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.io.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_2fd_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_2fd_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_2fd___get__(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_2fd___get__(struct PyGeventIOObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_long(vfd_get(__pyx_v_self->_watcher.fd)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 867, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.io.fd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_2io_2fd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_fd); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_2io_2fd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_fd) { + long __pyx_v_fd; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_fd); { + __pyx_v_fd = __Pyx_PyInt_As_long(__pyx_arg_fd); if (unlikely((__pyx_v_fd == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 869, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.io.fd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_2fd_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((long)__pyx_v_fd)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_2io_2fd_2__set__(struct PyGeventIOObject *__pyx_v_self, long __pyx_v_fd) { + int __pyx_v_vfd; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 871, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 871, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 871, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 871, __pyx_L1_error) + + } + + __pyx_t_3 = vfd_open(__pyx_v_fd); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 872, __pyx_L1_error) + __pyx_v_vfd = __pyx_t_3; + + vfd_free(__pyx_v_self->_watcher.fd); + + ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_vfd, __pyx_v_self->_watcher.events); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.io.fd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_6events_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_6events_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_6events___get__(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_6events___get__(struct PyGeventIOObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.events); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.io.events.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_2io_6events_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_events); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_2io_6events_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_events) { + int __pyx_v_events; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_events); { + __pyx_v_events = __Pyx_PyInt_As_int(__pyx_arg_events); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.io.events.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_6events_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((int)__pyx_v_events)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_2io_6events_2__set__(struct PyGeventIOObject *__pyx_v_self, int __pyx_v_events) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 883, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 883, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 883, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 883, __pyx_L1_error) + + } + + ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_self->_watcher.fd, __pyx_v_events); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.io.events.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_10events_str_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_10events_str_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_10events_str___get__(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_10events_str___get__(struct PyGeventIOObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__events_to_str(__pyx_v_self->_watcher.events, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.io.events_str.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_8_format(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_8_format(struct PyGeventIOObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_format", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_events_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_fd_s_events_s, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.io._format", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_2io_11__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_2io_11__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_10__cinit__(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_2io_10__cinit__(struct PyGeventIOObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + __pyx_v_self->_watcher.fd = -1; + + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static void __pyx_pw_6gevent_5libev_8corecext_2io_13__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6gevent_5libev_8corecext_2io_13__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6gevent_5libev_8corecext_2io_12__dealloc__(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6gevent_5libev_8corecext_2io_12__dealloc__(struct PyGeventIOObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + vfd_free(__pyx_v_self->_watcher.fd); + + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_4loop_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_4loop___get__(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_4loop___get__(struct PyGeventIOObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->loop)); + __pyx_r = ((PyObject *)__pyx_v_self->loop); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_2io_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_2io_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_4loop_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_2io_4loop_2__set__(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_5libev_8corecext_loop))))) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.io.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_2io_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_2io_4loop_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_4loop_4__del__(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_2io_4loop_4__del__(struct PyGeventIOObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_4args_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_4args_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_4args___get__(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_4args___get__(struct PyGeventIOObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->args); + __pyx_r = __pyx_v_self->args; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_2io_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_2io_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_4args_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_2io_4args_2__set__(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 725, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.io.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_2io_4args_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_2io_4args_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_4args_4__del__(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_2io_4args_4__del__(struct PyGeventIOObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_6_flags_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_6_flags___get__(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_6_flags___get__(struct PyGeventIOObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.io._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_3ref_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_3ref___get__(((struct PyGeventTimerObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_3ref___get__(struct PyGeventTimerObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if (((__pyx_v_self->_flags & 4) != 0)) { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } else { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_3ref_2__set__(((struct PyGeventTimerObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5timer_3ref_2__set__(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 922, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 922, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 922, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 922, __pyx_L1_error) + + } + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 923, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_t_1 = ((!((__pyx_v_self->_flags & 4) != 0)) != 0); + if (__pyx_t_1) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->loop->_ptr); + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6)); + + goto __pyx_L4; + } + + /*else*/ { + __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0); + if (__pyx_t_1) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 4); + + __pyx_t_3 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L9_bool_binop_done:; + if (__pyx_t_1) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + } + __pyx_L4:; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.timer.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_8callback_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_8callback___get__(((struct PyGeventTimerObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_8callback___get__(struct PyGeventTimerObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_callback); + __pyx_r = __pyx_v_self->_callback; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_8callback_2__set__(((struct PyGeventTimerObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5timer_8callback_2__set__(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_2 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_callback != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 944, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 944, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 944, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 944, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 944, __pyx_L1_error) + + } + + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = __pyx_v_callback; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.timer.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stop (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_stop(((struct PyGeventTimerObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_stop(struct PyGeventTimerObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stop", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 950, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 950, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 950, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 950, __pyx_L1_error) + + } + + __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2)); + + } + + ev_timer_stop(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher)); + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = Py_None; + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0); + if (__pyx_t_1) { + + Py_DECREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1)); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.timer.stop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_8priority_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_8priority___get__(((struct PyGeventTimerObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_8priority___get__(struct PyGeventTimerObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 964, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.timer.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) { + int __pyx_v_priority; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_priority); { + __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 966, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.timer.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_8priority_2__set__(((struct PyGeventTimerObject *)__pyx_v_self), ((int)__pyx_v_priority)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5timer_8priority_2__set__(struct PyGeventTimerObject *__pyx_v_self, int __pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 968, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 968, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 968, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 968, __pyx_L1_error) + + } + + ev_set_priority((&__pyx_v_self->_watcher), __pyx_v_priority); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.timer.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_revents; + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("feed (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 2) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); __PYX_ERR(0, 971, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) __PYX_ERR(0, 971, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 971, __pyx_L3_error) + __pyx_v_callback = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 971, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.timer.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_2feed(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_2feed(struct PyGeventTimerObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("feed", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 974, __pyx_L1_error) + + } + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 975, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0); + if (__pyx_t_1) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + + ev_feed_event(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher), __pyx_v_revents); + + __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); + if (__pyx_t_1) { + + Py_INCREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.timer.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_update = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_update,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (kw_args == 1) { + const Py_ssize_t index = 1; + PyObject* value = PyDict_GetItem(__pyx_kwds, *__pyx_pyargnames[index]); + if (value) { values[index] = value; kw_args--; } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 985, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + __pyx_v_update = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 985, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.timer.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_4start(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_update, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_4start(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("start", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 988, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 988, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 988, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 988, __pyx_L1_error) + + } + + __pyx_t_1 = (__pyx_v_callback == Py_None); + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 990, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 990, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 990, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 990, __pyx_L1_error) + + } + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 991, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_t_3 = (((__pyx_v_self->_flags & 6) == 4) != 0); + if (__pyx_t_3) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_update); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 996, __pyx_L1_error) + if (__pyx_t_3) { + + ev_now_update(__pyx_v_self->loop->_ptr); + + } + + ev_timer_start(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher)); + + __pyx_t_3 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); + if (__pyx_t_3) { + + Py_INCREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.timer.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_6active_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_6active_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_6active___get__(((struct PyGeventTimerObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_6active___get__(struct PyGeventTimerObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_active((&__pyx_v_self->_watcher)) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_7pending_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_7pending___get__(((struct PyGeventTimerObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_7pending___get__(struct PyGeventTimerObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_pending((&__pyx_v_self->_watcher)) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; + double __pyx_v_after; + double __pyx_v_repeat; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_after,&__pyx_n_s_repeat,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)Py_True); + values[4] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_after); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repeat); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1014, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + if (values[1]) { + __pyx_v_after = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_after == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1014, __pyx_L3_error) + } else { + __pyx_v_after = ((double)0.0); + } + if (values[2]) { + __pyx_v_repeat = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_repeat == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1014, __pyx_L3_error) + } else { + __pyx_v_repeat = ((double)0.0); + } + __pyx_v_ref = values[3]; + __pyx_v_priority = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1014, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.timer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1014, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_6__init__(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_after, __pyx_v_repeat, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5timer_6__init__(struct PyGeventTimerObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, double __pyx_v_after, double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("__init__", 0); + + __pyx_t_1 = ((__pyx_v_repeat < 0.0) != 0); + if (__pyx_t_1) { + + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_repeat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1016, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_repeat_must_be_positive_or_zero, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1016, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1016, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1016, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 1016, __pyx_L1_error) + + } + + ev_timer_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_timer), __pyx_v_after, __pyx_v_repeat); + + __Pyx_INCREF(((PyObject *)__pyx_v_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = __pyx_v_loop; + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1019, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_v_self->_flags = 0; + + goto __pyx_L4; + } + + /*else*/ { + __pyx_v_self->_flags = 4; + } + __pyx_L4:; + + __pyx_t_1 = (__pyx_v_priority != Py_None); + __pyx_t_4 = (__pyx_t_1 != 0); + if (__pyx_t_4) { + + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1024, __pyx_L1_error) + ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_5); + + } + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.timer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_2at_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_2at_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_2at___get__(((struct PyGeventTimerObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_2at___get__(struct PyGeventTimerObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_watcher.at); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.timer.at.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_9again(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_9again(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_update = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("again (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_update,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (kw_args == 1) { + const Py_ssize_t index = 1; + PyObject* value = PyDict_GetItem(__pyx_kwds, *__pyx_pyargnames[index]); + if (value) { values[index] = value; kw_args--; } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "again") < 0)) __PYX_ERR(0, 1033, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + __pyx_v_update = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("again", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1033, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.timer.again", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_8again(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_update, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_8again(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("again", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1036, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1036, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1036, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1036, __pyx_L1_error) + + } + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 1037, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0); + if (__pyx_t_1) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_update); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1042, __pyx_L1_error) + if (__pyx_t_1) { + + ev_now_update(__pyx_v_self->loop->_ptr); + + } + + ev_timer_again(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher)); + + __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); + if (__pyx_t_1) { + + Py_INCREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.timer.again", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_4loop_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_4loop___get__(((struct PyGeventTimerObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_4loop___get__(struct PyGeventTimerObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->loop)); + __pyx_r = ((PyObject *)__pyx_v_self->loop); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_4loop_2__set__(((struct PyGeventTimerObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5timer_4loop_2__set__(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_5libev_8corecext_loop))))) __PYX_ERR(0, 908, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.timer.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_4loop_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_4loop_4__del__(((struct PyGeventTimerObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5timer_4loop_4__del__(struct PyGeventTimerObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_4args_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_4args_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_4args___get__(((struct PyGeventTimerObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_4args___get__(struct PyGeventTimerObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->args); + __pyx_r = __pyx_v_self->args; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_4args_2__set__(((struct PyGeventTimerObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5timer_4args_2__set__(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 910, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.timer.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_4args_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_4args_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_4args_4__del__(((struct PyGeventTimerObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5timer_4args_4__del__(struct PyGeventTimerObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_6_flags_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_6_flags___get__(((struct PyGeventTimerObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_6_flags___get__(struct PyGeventTimerObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.timer._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6signal_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6signal_3ref_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_3ref___get__(((struct PyGeventSignalObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6signal_3ref___get__(struct PyGeventSignalObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if (((__pyx_v_self->_flags & 4) != 0)) { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } else { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_3ref_2__set__(((struct PyGeventSignalObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_6signal_3ref_2__set__(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1067, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1067, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1067, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1067, __pyx_L1_error) + + } + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1068, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_t_1 = ((!((__pyx_v_self->_flags & 4) != 0)) != 0); + if (__pyx_t_1) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->loop->_ptr); + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6)); + + goto __pyx_L4; + } + + /*else*/ { + __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0); + if (__pyx_t_1) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 4); + + __pyx_t_3 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L9_bool_binop_done:; + if (__pyx_t_1) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + } + __pyx_L4:; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.signal.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6signal_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6signal_8callback_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_8callback___get__(((struct PyGeventSignalObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6signal_8callback___get__(struct PyGeventSignalObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_callback); + __pyx_r = __pyx_v_self->_callback; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_8callback_2__set__(((struct PyGeventSignalObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_6signal_8callback_2__set__(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_2 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_callback != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1089, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1089, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1089, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1089, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 1089, __pyx_L1_error) + + } + + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = __pyx_v_callback; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.signal.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6signal_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6signal_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stop (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_stop(((struct PyGeventSignalObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6signal_stop(struct PyGeventSignalObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stop", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1095, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1095, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1095, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1095, __pyx_L1_error) + + } + + __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2)); + + } + + ev_signal_stop(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher)); + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = Py_None; + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0); + if (__pyx_t_1) { + + Py_DECREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1)); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.signal.stop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6signal_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6signal_8priority_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_8priority___get__(((struct PyGeventSignalObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6signal_8priority___get__(struct PyGeventSignalObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.signal.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) { + int __pyx_v_priority; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_priority); { + __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1111, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.signal.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_8priority_2__set__(((struct PyGeventSignalObject *)__pyx_v_self), ((int)__pyx_v_priority)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_6signal_8priority_2__set__(struct PyGeventSignalObject *__pyx_v_self, int __pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1113, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1113, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1113, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1113, __pyx_L1_error) + + } + + ev_set_priority((&__pyx_v_self->_watcher), __pyx_v_priority); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.signal.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6signal_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6signal_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_revents; + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("feed (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 2) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); __PYX_ERR(0, 1116, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) __PYX_ERR(0, 1116, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1116, __pyx_L3_error) + __pyx_v_callback = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1116, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.signal.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_2feed(((struct PyGeventSignalObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6signal_2feed(struct PyGeventSignalObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("feed", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1119, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1119, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1119, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1119, __pyx_L1_error) + + } + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 1120, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0); + if (__pyx_t_1) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + + ev_feed_event(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher), __pyx_v_revents); + + __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); + if (__pyx_t_1) { + + Py_INCREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.signal.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6signal_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6signal_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 1130, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1130, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.signal.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_4start(((struct PyGeventSignalObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6signal_4start(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("start", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1133, __pyx_L1_error) + + } + + __pyx_t_1 = (__pyx_v_callback == Py_None); + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1135, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1135, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1135, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1135, __pyx_L1_error) + + } + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 1136, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_t_3 = (((__pyx_v_self->_flags & 6) == 4) != 0); + if (__pyx_t_3) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + + ev_signal_start(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher)); + + __pyx_t_3 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); + if (__pyx_t_3) { + + Py_INCREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.signal.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6signal_6active_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6signal_6active_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_6active___get__(((struct PyGeventSignalObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6signal_6active___get__(struct PyGeventSignalObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_active((&__pyx_v_self->_watcher)) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6signal_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6signal_7pending_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_7pending___get__(((struct PyGeventSignalObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6signal_7pending___get__(struct PyGeventSignalObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_pending((&__pyx_v_self->_watcher)) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; + int __pyx_v_signalnum; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_signalnum,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[4] = {0,0,0,0}; + values[2] = ((PyObject *)Py_True); + values[3] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signalnum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 1157, __pyx_L3_error) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1157, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_signalnum = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_signalnum == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1157, __pyx_L3_error) + __pyx_v_ref = values[2]; + __pyx_v_priority = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1157, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.signal.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1157, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_6__init__(((struct PyGeventSignalObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_signalnum, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_6signal_6__init__(struct PyGeventSignalObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_signalnum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + __Pyx_RefNannySetupContext("__init__", 0); + + __pyx_t_2 = ((__pyx_v_signalnum < 1) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_signalnum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_signalmodule); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_NSIG); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1158, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1158, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_signalnum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_illegal_signal_number_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 1159, __pyx_L1_error) + + } + + ev_signal_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_signal), __pyx_v_signalnum); + + __Pyx_INCREF(((PyObject *)__pyx_v_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = __pyx_v_loop; + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1167, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_v_self->_flags = 0; + + goto __pyx_L6; + } + + /*else*/ { + __pyx_v_self->_flags = 4; + } + __pyx_L6:; + + __pyx_t_1 = (__pyx_v_priority != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1172, __pyx_L1_error) + ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_6); + + } + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.signal.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6signal_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6signal_4loop_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_4loop___get__(((struct PyGeventSignalObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6signal_4loop___get__(struct PyGeventSignalObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->loop)); + __pyx_r = ((PyObject *)__pyx_v_self->loop); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_4loop_2__set__(((struct PyGeventSignalObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_6signal_4loop_2__set__(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_5libev_8corecext_loop))))) __PYX_ERR(0, 1053, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.signal.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_4loop_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_4loop_4__del__(((struct PyGeventSignalObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_6signal_4loop_4__del__(struct PyGeventSignalObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6signal_4args_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6signal_4args_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_4args___get__(((struct PyGeventSignalObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6signal_4args___get__(struct PyGeventSignalObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->args); + __pyx_r = __pyx_v_self->args; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_4args_2__set__(((struct PyGeventSignalObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_6signal_4args_2__set__(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 1055, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.signal.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_4args_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_4args_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_4args_4__del__(((struct PyGeventSignalObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_6signal_4args_4__del__(struct PyGeventSignalObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6signal_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6signal_6_flags_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_6_flags___get__(((struct PyGeventSignalObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6signal_6_flags___get__(struct PyGeventSignalObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1056, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.signal._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4idle_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4idle_3ref_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle_3ref___get__(((struct PyGeventIdleObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4idle_3ref___get__(struct PyGeventIdleObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if (((__pyx_v_self->_flags & 4) != 0)) { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } else { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4idle_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4idle_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle_3ref_2__set__(((struct PyGeventIdleObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4idle_3ref_2__set__(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1192, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1192, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1192, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1192, __pyx_L1_error) + + } + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1193, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_t_1 = ((!((__pyx_v_self->_flags & 4) != 0)) != 0); + if (__pyx_t_1) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->loop->_ptr); + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6)); + + goto __pyx_L4; + } + + /*else*/ { + __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0); + if (__pyx_t_1) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 4); + + __pyx_t_3 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L9_bool_binop_done:; + if (__pyx_t_1) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + } + __pyx_L4:; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.idle.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4idle_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4idle_8callback_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle_8callback___get__(((struct PyGeventIdleObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4idle_8callback___get__(struct PyGeventIdleObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_callback); + __pyx_r = __pyx_v_self->_callback; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4idle_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4idle_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle_8callback_2__set__(((struct PyGeventIdleObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4idle_8callback_2__set__(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_2 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_callback != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 1214, __pyx_L1_error) + + } + + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = __pyx_v_callback; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.idle.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4idle_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4idle_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stop (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle_stop(((struct PyGeventIdleObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4idle_stop(struct PyGeventIdleObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stop", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1220, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1220, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1220, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1220, __pyx_L1_error) + + } + + __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2)); + + } + + ev_idle_stop(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher)); + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = Py_None; + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0); + if (__pyx_t_1) { + + Py_DECREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1)); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.idle.stop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4idle_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4idle_8priority_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle_8priority___get__(((struct PyGeventIdleObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4idle_8priority___get__(struct PyGeventIdleObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.idle.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4idle_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4idle_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) { + int __pyx_v_priority; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_priority); { + __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1236, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.idle.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle_8priority_2__set__(((struct PyGeventIdleObject *)__pyx_v_self), ((int)__pyx_v_priority)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4idle_8priority_2__set__(struct PyGeventIdleObject *__pyx_v_self, int __pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1238, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1238, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1238, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1238, __pyx_L1_error) + + } + + ev_set_priority((&__pyx_v_self->_watcher), __pyx_v_priority); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.idle.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4idle_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4idle_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_revents; + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("feed (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 2) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); __PYX_ERR(0, 1241, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) __PYX_ERR(0, 1241, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1241, __pyx_L3_error) + __pyx_v_callback = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1241, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.idle.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle_2feed(((struct PyGeventIdleObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4idle_2feed(struct PyGeventIdleObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("feed", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1244, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1244, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1244, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1244, __pyx_L1_error) + + } + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 1245, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0); + if (__pyx_t_1) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + + ev_feed_event(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher), __pyx_v_revents); + + __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); + if (__pyx_t_1) { + + Py_INCREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.idle.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4idle_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4idle_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 1255, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1255, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.idle.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle_4start(((struct PyGeventIdleObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4idle_4start(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("start", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1258, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1258, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1258, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1258, __pyx_L1_error) + + } + + __pyx_t_1 = (__pyx_v_callback == Py_None); + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1260, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1260, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1260, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1260, __pyx_L1_error) + + } + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 1261, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_t_3 = (((__pyx_v_self->_flags & 6) == 4) != 0); + if (__pyx_t_3) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + + ev_idle_start(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher)); + + __pyx_t_3 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); + if (__pyx_t_3) { + + Py_INCREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.idle.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4idle_6active_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4idle_6active_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle_6active___get__(((struct PyGeventIdleObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4idle_6active___get__(struct PyGeventIdleObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_active((&__pyx_v_self->_watcher)) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4idle_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4idle_7pending_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle_7pending___get__(((struct PyGeventIdleObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4idle_7pending___get__(struct PyGeventIdleObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_pending((&__pyx_v_self->_watcher)) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4idle_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4idle_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1283, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_ref = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1283, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.idle.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1283, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle_6__init__(((struct PyGeventIdleObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4idle_6__init__(struct PyGeventIdleObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__init__", 0); + + ev_idle_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_idle)); + + __Pyx_INCREF(((PyObject *)__pyx_v_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = __pyx_v_loop; + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1286, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_v_self->_flags = 0; + + goto __pyx_L3; + } + + /*else*/ { + __pyx_v_self->_flags = 4; + } + __pyx_L3:; + + __pyx_t_1 = (__pyx_v_priority != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1291, __pyx_L1_error) + ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_3); + + } + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.libev.corecext.idle.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4idle_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4idle_4loop_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle_4loop___get__(((struct PyGeventIdleObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4idle_4loop___get__(struct PyGeventIdleObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->loop)); + __pyx_r = ((PyObject *)__pyx_v_self->loop); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4idle_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4idle_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle_4loop_2__set__(((struct PyGeventIdleObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4idle_4loop_2__set__(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_5libev_8corecext_loop))))) __PYX_ERR(0, 1178, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.idle.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4idle_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4idle_4loop_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle_4loop_4__del__(((struct PyGeventIdleObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4idle_4loop_4__del__(struct PyGeventIdleObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4idle_4args_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4idle_4args_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle_4args___get__(((struct PyGeventIdleObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4idle_4args___get__(struct PyGeventIdleObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->args); + __pyx_r = __pyx_v_self->args; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4idle_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4idle_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle_4args_2__set__(((struct PyGeventIdleObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4idle_4args_2__set__(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 1180, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.idle.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4idle_4args_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4idle_4args_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle_4args_4__del__(((struct PyGeventIdleObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4idle_4args_4__del__(struct PyGeventIdleObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4idle_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4idle_6_flags_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle_6_flags___get__(((struct PyGeventIdleObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4idle_6_flags___get__(struct PyGeventIdleObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.idle._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7prepare_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7prepare_3ref_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare_3ref___get__(((struct PyGeventPrepareObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7prepare_3ref___get__(struct PyGeventPrepareObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if (((__pyx_v_self->_flags & 4) != 0)) { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } else { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7prepare_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7prepare_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare_3ref_2__set__(((struct PyGeventPrepareObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7prepare_3ref_2__set__(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1311, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1311, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1311, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1311, __pyx_L1_error) + + } + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1312, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_t_1 = ((!((__pyx_v_self->_flags & 4) != 0)) != 0); + if (__pyx_t_1) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->loop->_ptr); + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6)); + + goto __pyx_L4; + } + + /*else*/ { + __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0); + if (__pyx_t_1) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 4); + + __pyx_t_3 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L9_bool_binop_done:; + if (__pyx_t_1) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + } + __pyx_L4:; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.prepare.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7prepare_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7prepare_8callback_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare_8callback___get__(((struct PyGeventPrepareObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7prepare_8callback___get__(struct PyGeventPrepareObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_callback); + __pyx_r = __pyx_v_self->_callback; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7prepare_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7prepare_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare_8callback_2__set__(((struct PyGeventPrepareObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7prepare_8callback_2__set__(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_2 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_callback != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 1333, __pyx_L1_error) + + } + + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = __pyx_v_callback; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.prepare.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7prepare_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7prepare_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stop (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare_stop(((struct PyGeventPrepareObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7prepare_stop(struct PyGeventPrepareObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stop", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1339, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1339, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1339, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1339, __pyx_L1_error) + + } + + __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2)); + + } + + ev_prepare_stop(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher)); + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = Py_None; + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0); + if (__pyx_t_1) { + + Py_DECREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1)); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.prepare.stop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7prepare_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7prepare_8priority_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare_8priority___get__(((struct PyGeventPrepareObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7prepare_8priority___get__(struct PyGeventPrepareObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.prepare.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7prepare_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7prepare_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) { + int __pyx_v_priority; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_priority); { + __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1355, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.prepare.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare_8priority_2__set__(((struct PyGeventPrepareObject *)__pyx_v_self), ((int)__pyx_v_priority)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7prepare_8priority_2__set__(struct PyGeventPrepareObject *__pyx_v_self, int __pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1357, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1357, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1357, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1357, __pyx_L1_error) + + } + + ev_set_priority((&__pyx_v_self->_watcher), __pyx_v_priority); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.prepare.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7prepare_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7prepare_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_revents; + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("feed (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 2) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); __PYX_ERR(0, 1360, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) __PYX_ERR(0, 1360, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1360, __pyx_L3_error) + __pyx_v_callback = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1360, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.prepare.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare_2feed(((struct PyGeventPrepareObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7prepare_2feed(struct PyGeventPrepareObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("feed", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1363, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1363, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1363, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1363, __pyx_L1_error) + + } + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 1364, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0); + if (__pyx_t_1) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + + ev_feed_event(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher), __pyx_v_revents); + + __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); + if (__pyx_t_1) { + + Py_INCREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.prepare.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7prepare_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7prepare_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 1374, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1374, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.prepare.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare_4start(((struct PyGeventPrepareObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7prepare_4start(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("start", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1377, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1377, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1377, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1377, __pyx_L1_error) + + } + + __pyx_t_1 = (__pyx_v_callback == Py_None); + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1379, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1379, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1379, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1379, __pyx_L1_error) + + } + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 1380, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_t_3 = (((__pyx_v_self->_flags & 6) == 4) != 0); + if (__pyx_t_3) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + + ev_prepare_start(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher)); + + __pyx_t_3 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); + if (__pyx_t_3) { + + Py_INCREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.prepare.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7prepare_6active_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7prepare_6active_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare_6active___get__(((struct PyGeventPrepareObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7prepare_6active___get__(struct PyGeventPrepareObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_active((&__pyx_v_self->_watcher)) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7prepare_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7prepare_7pending_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare_7pending___get__(((struct PyGeventPrepareObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7prepare_7pending___get__(struct PyGeventPrepareObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_pending((&__pyx_v_self->_watcher)) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7prepare_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7prepare_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1402, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_ref = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1402, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.prepare.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1402, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare_6__init__(((struct PyGeventPrepareObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7prepare_6__init__(struct PyGeventPrepareObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__init__", 0); + + ev_prepare_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_prepare)); + + __Pyx_INCREF(((PyObject *)__pyx_v_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = __pyx_v_loop; + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1405, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_v_self->_flags = 0; + + goto __pyx_L3; + } + + /*else*/ { + __pyx_v_self->_flags = 4; + } + __pyx_L3:; + + __pyx_t_1 = (__pyx_v_priority != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1410, __pyx_L1_error) + ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_3); + + } + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.libev.corecext.prepare.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7prepare_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7prepare_4loop_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare_4loop___get__(((struct PyGeventPrepareObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7prepare_4loop___get__(struct PyGeventPrepareObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->loop)); + __pyx_r = ((PyObject *)__pyx_v_self->loop); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7prepare_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7prepare_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare_4loop_2__set__(((struct PyGeventPrepareObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7prepare_4loop_2__set__(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_5libev_8corecext_loop))))) __PYX_ERR(0, 1297, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.prepare.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7prepare_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7prepare_4loop_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare_4loop_4__del__(((struct PyGeventPrepareObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7prepare_4loop_4__del__(struct PyGeventPrepareObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7prepare_4args_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7prepare_4args_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare_4args___get__(((struct PyGeventPrepareObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7prepare_4args___get__(struct PyGeventPrepareObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->args); + __pyx_r = __pyx_v_self->args; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7prepare_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7prepare_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare_4args_2__set__(((struct PyGeventPrepareObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7prepare_4args_2__set__(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 1299, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.prepare.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7prepare_4args_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7prepare_4args_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare_4args_4__del__(((struct PyGeventPrepareObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7prepare_4args_4__del__(struct PyGeventPrepareObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7prepare_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7prepare_6_flags_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare_6_flags___get__(((struct PyGeventPrepareObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7prepare_6_flags___get__(struct PyGeventPrepareObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.prepare._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5check_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5check_3ref_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check_3ref___get__(((struct PyGeventCheckObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5check_3ref___get__(struct PyGeventCheckObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if (((__pyx_v_self->_flags & 4) != 0)) { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } else { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5check_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5check_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check_3ref_2__set__(((struct PyGeventCheckObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5check_3ref_2__set__(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1430, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1430, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1430, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1430, __pyx_L1_error) + + } + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1431, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_t_1 = ((!((__pyx_v_self->_flags & 4) != 0)) != 0); + if (__pyx_t_1) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->loop->_ptr); + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6)); + + goto __pyx_L4; + } + + /*else*/ { + __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0); + if (__pyx_t_1) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 4); + + __pyx_t_3 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L9_bool_binop_done:; + if (__pyx_t_1) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + } + __pyx_L4:; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.check.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5check_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5check_8callback_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check_8callback___get__(((struct PyGeventCheckObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5check_8callback___get__(struct PyGeventCheckObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_callback); + __pyx_r = __pyx_v_self->_callback; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5check_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5check_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check_8callback_2__set__(((struct PyGeventCheckObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5check_8callback_2__set__(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_2 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_callback != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 1452, __pyx_L1_error) + + } + + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = __pyx_v_callback; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.check.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5check_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5check_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stop (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check_stop(((struct PyGeventCheckObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5check_stop(struct PyGeventCheckObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stop", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1458, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1458, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1458, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1458, __pyx_L1_error) + + } + + __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2)); + + } + + ev_check_stop(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher)); + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = Py_None; + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0); + if (__pyx_t_1) { + + Py_DECREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1)); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.check.stop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5check_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5check_8priority_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check_8priority___get__(((struct PyGeventCheckObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5check_8priority___get__(struct PyGeventCheckObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.check.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5check_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5check_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) { + int __pyx_v_priority; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_priority); { + __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1474, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.check.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check_8priority_2__set__(((struct PyGeventCheckObject *)__pyx_v_self), ((int)__pyx_v_priority)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5check_8priority_2__set__(struct PyGeventCheckObject *__pyx_v_self, int __pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1476, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1476, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1476, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1476, __pyx_L1_error) + + } + + ev_set_priority((&__pyx_v_self->_watcher), __pyx_v_priority); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.check.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5check_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5check_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_revents; + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("feed (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 2) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); __PYX_ERR(0, 1479, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) __PYX_ERR(0, 1479, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1479, __pyx_L3_error) + __pyx_v_callback = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1479, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.check.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check_2feed(((struct PyGeventCheckObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5check_2feed(struct PyGeventCheckObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("feed", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1482, __pyx_L1_error) + + } + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 1483, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0); + if (__pyx_t_1) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + + ev_feed_event(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher), __pyx_v_revents); + + __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); + if (__pyx_t_1) { + + Py_INCREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.check.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5check_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5check_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 1493, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1493, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.check.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check_4start(((struct PyGeventCheckObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5check_4start(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("start", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1496, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1496, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1496, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1496, __pyx_L1_error) + + } + + __pyx_t_1 = (__pyx_v_callback == Py_None); + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1498, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1498, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1498, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1498, __pyx_L1_error) + + } + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 1499, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_t_3 = (((__pyx_v_self->_flags & 6) == 4) != 0); + if (__pyx_t_3) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + + ev_check_start(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher)); + + __pyx_t_3 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); + if (__pyx_t_3) { + + Py_INCREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.check.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5check_6active_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5check_6active_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check_6active___get__(((struct PyGeventCheckObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5check_6active___get__(struct PyGeventCheckObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_active((&__pyx_v_self->_watcher)) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5check_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5check_7pending_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check_7pending___get__(((struct PyGeventCheckObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5check_7pending___get__(struct PyGeventCheckObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_pending((&__pyx_v_self->_watcher)) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5check_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5check_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1521, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_ref = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1521, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.check.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1521, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check_6__init__(((struct PyGeventCheckObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5check_6__init__(struct PyGeventCheckObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__init__", 0); + + ev_check_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_check)); + + __Pyx_INCREF(((PyObject *)__pyx_v_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = __pyx_v_loop; + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1524, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_v_self->_flags = 0; + + goto __pyx_L3; + } + + /*else*/ { + __pyx_v_self->_flags = 4; + } + __pyx_L3:; + + __pyx_t_1 = (__pyx_v_priority != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1529, __pyx_L1_error) + ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_3); + + } + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.libev.corecext.check.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5check_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5check_4loop_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check_4loop___get__(((struct PyGeventCheckObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5check_4loop___get__(struct PyGeventCheckObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->loop)); + __pyx_r = ((PyObject *)__pyx_v_self->loop); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5check_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5check_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check_4loop_2__set__(((struct PyGeventCheckObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5check_4loop_2__set__(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_5libev_8corecext_loop))))) __PYX_ERR(0, 1416, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.check.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5check_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5check_4loop_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check_4loop_4__del__(((struct PyGeventCheckObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5check_4loop_4__del__(struct PyGeventCheckObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5check_4args_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5check_4args_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check_4args___get__(((struct PyGeventCheckObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5check_4args___get__(struct PyGeventCheckObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->args); + __pyx_r = __pyx_v_self->args; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5check_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5check_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check_4args_2__set__(((struct PyGeventCheckObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5check_4args_2__set__(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 1418, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.check.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5check_4args_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5check_4args_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check_4args_4__del__(((struct PyGeventCheckObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5check_4args_4__del__(struct PyGeventCheckObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5check_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5check_6_flags_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check_6_flags___get__(((struct PyGeventCheckObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5check_6_flags___get__(struct PyGeventCheckObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.check._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4fork_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4fork_3ref_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork_3ref___get__(((struct PyGeventForkObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4fork_3ref___get__(struct PyGeventForkObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if (((__pyx_v_self->_flags & 4) != 0)) { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } else { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4fork_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4fork_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork_3ref_2__set__(((struct PyGeventForkObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4fork_3ref_2__set__(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1549, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1549, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1549, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1549, __pyx_L1_error) + + } + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1550, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_t_1 = ((!((__pyx_v_self->_flags & 4) != 0)) != 0); + if (__pyx_t_1) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->loop->_ptr); + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6)); + + goto __pyx_L4; + } + + /*else*/ { + __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0); + if (__pyx_t_1) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 4); + + __pyx_t_3 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L9_bool_binop_done:; + if (__pyx_t_1) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + } + __pyx_L4:; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.fork.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4fork_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4fork_8callback_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork_8callback___get__(((struct PyGeventForkObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4fork_8callback___get__(struct PyGeventForkObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_callback); + __pyx_r = __pyx_v_self->_callback; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4fork_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4fork_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork_8callback_2__set__(((struct PyGeventForkObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4fork_8callback_2__set__(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_2 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_callback != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 1571, __pyx_L1_error) + + } + + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = __pyx_v_callback; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.fork.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4fork_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4fork_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stop (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork_stop(((struct PyGeventForkObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4fork_stop(struct PyGeventForkObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stop", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1577, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1577, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1577, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1577, __pyx_L1_error) + + } + + __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2)); + + } + + ev_fork_stop(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher)); + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = Py_None; + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0); + if (__pyx_t_1) { + + Py_DECREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1)); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.fork.stop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4fork_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4fork_8priority_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork_8priority___get__(((struct PyGeventForkObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4fork_8priority___get__(struct PyGeventForkObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.fork.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4fork_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4fork_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) { + int __pyx_v_priority; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_priority); { + __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1593, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.fork.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork_8priority_2__set__(((struct PyGeventForkObject *)__pyx_v_self), ((int)__pyx_v_priority)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4fork_8priority_2__set__(struct PyGeventForkObject *__pyx_v_self, int __pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1595, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1595, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1595, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1595, __pyx_L1_error) + + } + + ev_set_priority((&__pyx_v_self->_watcher), __pyx_v_priority); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.fork.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4fork_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4fork_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_revents; + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("feed (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 2) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); __PYX_ERR(0, 1598, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) __PYX_ERR(0, 1598, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1598, __pyx_L3_error) + __pyx_v_callback = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1598, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.fork.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork_2feed(((struct PyGeventForkObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4fork_2feed(struct PyGeventForkObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("feed", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1601, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1601, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1601, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1601, __pyx_L1_error) + + } + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 1602, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0); + if (__pyx_t_1) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + + ev_feed_event(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher), __pyx_v_revents); + + __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); + if (__pyx_t_1) { + + Py_INCREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.fork.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4fork_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4fork_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 1612, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1612, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.fork.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork_4start(((struct PyGeventForkObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4fork_4start(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("start", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1615, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1615, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1615, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1615, __pyx_L1_error) + + } + + __pyx_t_1 = (__pyx_v_callback == Py_None); + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1617, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1617, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1617, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1617, __pyx_L1_error) + + } + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 1618, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_t_3 = (((__pyx_v_self->_flags & 6) == 4) != 0); + if (__pyx_t_3) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + + ev_fork_start(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher)); + + __pyx_t_3 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); + if (__pyx_t_3) { + + Py_INCREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.fork.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4fork_6active_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4fork_6active_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork_6active___get__(((struct PyGeventForkObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4fork_6active___get__(struct PyGeventForkObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_active((&__pyx_v_self->_watcher)) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4fork_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4fork_7pending_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork_7pending___get__(((struct PyGeventForkObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4fork_7pending___get__(struct PyGeventForkObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_pending((&__pyx_v_self->_watcher)) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4fork_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4fork_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1640, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_ref = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1640, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.fork.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1640, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork_6__init__(((struct PyGeventForkObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4fork_6__init__(struct PyGeventForkObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__init__", 0); + + ev_fork_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_fork)); + + __Pyx_INCREF(((PyObject *)__pyx_v_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = __pyx_v_loop; + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1643, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_v_self->_flags = 0; + + goto __pyx_L3; + } + + /*else*/ { + __pyx_v_self->_flags = 4; + } + __pyx_L3:; + + __pyx_t_1 = (__pyx_v_priority != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1648, __pyx_L1_error) + ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_3); + + } + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.libev.corecext.fork.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4fork_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4fork_4loop_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork_4loop___get__(((struct PyGeventForkObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4fork_4loop___get__(struct PyGeventForkObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->loop)); + __pyx_r = ((PyObject *)__pyx_v_self->loop); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4fork_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4fork_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork_4loop_2__set__(((struct PyGeventForkObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4fork_4loop_2__set__(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_5libev_8corecext_loop))))) __PYX_ERR(0, 1535, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.fork.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4fork_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4fork_4loop_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork_4loop_4__del__(((struct PyGeventForkObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4fork_4loop_4__del__(struct PyGeventForkObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4fork_4args_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4fork_4args_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork_4args___get__(((struct PyGeventForkObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4fork_4args___get__(struct PyGeventForkObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->args); + __pyx_r = __pyx_v_self->args; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4fork_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4fork_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork_4args_2__set__(((struct PyGeventForkObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4fork_4args_2__set__(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 1537, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.fork.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4fork_4args_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4fork_4args_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork_4args_4__del__(((struct PyGeventForkObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4fork_4args_4__del__(struct PyGeventForkObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4fork_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4fork_6_flags_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork_6_flags___get__(((struct PyGeventForkObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4fork_6_flags___get__(struct PyGeventForkObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1538, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.fork._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_3ref_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5async_3ref___get__(((struct PyGeventAsyncObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_3ref___get__(struct PyGeventAsyncObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if (((__pyx_v_self->_flags & 4) != 0)) { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } else { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5async_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5async_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5async_3ref_2__set__(((struct PyGeventAsyncObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5async_3ref_2__set__(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1668, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1668, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1668, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1668, __pyx_L1_error) + + } + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1669, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_t_1 = ((!((__pyx_v_self->_flags & 4) != 0)) != 0); + if (__pyx_t_1) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->loop->_ptr); + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6)); + + goto __pyx_L4; + } + + /*else*/ { + __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0); + if (__pyx_t_1) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 4); + + __pyx_t_3 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L9_bool_binop_done:; + if (__pyx_t_1) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + } + __pyx_L4:; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.async.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_8callback_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5async_8callback___get__(((struct PyGeventAsyncObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_8callback___get__(struct PyGeventAsyncObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_callback); + __pyx_r = __pyx_v_self->_callback; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5async_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5async_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5async_8callback_2__set__(((struct PyGeventAsyncObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5async_8callback_2__set__(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_2 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_callback != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 1690, __pyx_L1_error) + + } + + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = __pyx_v_callback; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.async.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stop (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5async_stop(((struct PyGeventAsyncObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_stop(struct PyGeventAsyncObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stop", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1696, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1696, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1696, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1696, __pyx_L1_error) + + } + + __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2)); + + } + + ev_async_stop(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher)); + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = Py_None; + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0); + if (__pyx_t_1) { + + Py_DECREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1)); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.async.stop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_8priority_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5async_8priority___get__(((struct PyGeventAsyncObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_8priority___get__(struct PyGeventAsyncObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1710, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.async.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5async_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5async_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) { + int __pyx_v_priority; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_priority); { + __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1712, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.async.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5async_8priority_2__set__(((struct PyGeventAsyncObject *)__pyx_v_self), ((int)__pyx_v_priority)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5async_8priority_2__set__(struct PyGeventAsyncObject *__pyx_v_self, int __pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1714, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1714, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1714, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1714, __pyx_L1_error) + + } + + ev_set_priority((&__pyx_v_self->_watcher), __pyx_v_priority); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.async.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_revents; + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("feed (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 2) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); __PYX_ERR(0, 1717, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) __PYX_ERR(0, 1717, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1717, __pyx_L3_error) + __pyx_v_callback = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1717, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.async.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5async_2feed(((struct PyGeventAsyncObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_2feed(struct PyGeventAsyncObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("feed", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1720, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1720, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1720, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1720, __pyx_L1_error) + + } + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 1721, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0); + if (__pyx_t_1) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + + ev_feed_event(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher), __pyx_v_revents); + + __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); + if (__pyx_t_1) { + + Py_INCREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.async.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 1731, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1731, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.async.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5async_4start(((struct PyGeventAsyncObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_4start(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("start", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1734, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1734, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1734, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1734, __pyx_L1_error) + + } + + __pyx_t_1 = (__pyx_v_callback == Py_None); + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1736, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1736, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1736, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1736, __pyx_L1_error) + + } + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 1737, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_t_3 = (((__pyx_v_self->_flags & 6) == 4) != 0); + if (__pyx_t_3) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + + ev_async_start(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher)); + + __pyx_t_3 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); + if (__pyx_t_3) { + + Py_INCREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.async.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_6active_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_6active_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5async_6active___get__(((struct PyGeventAsyncObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_6active___get__(struct PyGeventAsyncObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_active((&__pyx_v_self->_watcher)) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_7pending_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5async_7pending___get__(((struct PyGeventAsyncObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_7pending___get__(struct PyGeventAsyncObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_async_pending((&__pyx_v_self->_watcher)) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5async_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5async_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1758, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_ref = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1758, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.async.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1758, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5async_6__init__(((struct PyGeventAsyncObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5async_6__init__(struct PyGeventAsyncObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__init__", 0); + + ev_async_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_async)); + + __Pyx_INCREF(((PyObject *)__pyx_v_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = __pyx_v_loop; + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1761, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_v_self->_flags = 0; + + goto __pyx_L3; + } + + /*else*/ { + __pyx_v_self->_flags = 4; + } + __pyx_L3:; + + __pyx_t_1 = (__pyx_v_priority != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1766, __pyx_L1_error) + ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_3); + + } + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.libev.corecext.async.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_9send(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_9send(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("send (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5async_8send(((struct PyGeventAsyncObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_8send(struct PyGeventAsyncObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("send", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1771, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1771, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1771, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1771, __pyx_L1_error) + + } + + ev_async_send(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher)); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.async.send", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_4loop_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5async_4loop___get__(((struct PyGeventAsyncObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_4loop___get__(struct PyGeventAsyncObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->loop)); + __pyx_r = ((PyObject *)__pyx_v_self->loop); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5async_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5async_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5async_4loop_2__set__(((struct PyGeventAsyncObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5async_4loop_2__set__(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_5libev_8corecext_loop))))) __PYX_ERR(0, 1654, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.async.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5async_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5async_4loop_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5async_4loop_4__del__(((struct PyGeventAsyncObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5async_4loop_4__del__(struct PyGeventAsyncObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_4args_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_4args_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5async_4args___get__(((struct PyGeventAsyncObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_4args___get__(struct PyGeventAsyncObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->args); + __pyx_r = __pyx_v_self->args; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5async_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5async_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5async_4args_2__set__(((struct PyGeventAsyncObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5async_4args_2__set__(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 1656, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.async.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5async_4args_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5async_4args_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5async_4args_4__del__(((struct PyGeventAsyncObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5async_4args_4__del__(struct PyGeventAsyncObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5async_6_flags_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5async_6_flags___get__(((struct PyGeventAsyncObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5async_6_flags___get__(struct PyGeventAsyncObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.async._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_3ref_1__get__(PyObject *__pyx_v_self) { +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_3ref_1__get__(PyObject *__pyx_v_self) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_3ref_1__get__(PyObject *__pyx_v_self) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_3ref___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_3ref___get__(struct PyGeventStatObject *__pyx_v_self) { +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_3ref___get__(((struct PyGeventChildObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_3ref___get__(struct PyGeventChildObject *__pyx_v_self) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_3ref___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_3ref___get__(struct PyGeventStatObject *__pyx_v_self) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if (((__pyx_v_self->_flags & 4) != 0)) { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } else { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static int __pyx_pw_6gevent_5libev_8corecext_4stat_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static int __pyx_pw_6gevent_5libev_8corecext_5child_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5child_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) +static int __pyx_pw_6gevent_5libev_8corecext_4stat_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_3ref_2__set__(((struct PyGeventStatObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4stat_3ref_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_value) { +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_3ref_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5child_3ref_2__set__(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_value) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_3ref_2__set__(((struct PyGeventStatObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4stat_3ref_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_value) { +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1794, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1794, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1939, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1794, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1794, __pyx_L1_error) + + } + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1795, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_t_1 = ((!((__pyx_v_self->_flags & 4) != 0)) != 0); + if (__pyx_t_1) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->loop->_ptr); + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6)); + + goto __pyx_L4; + } + + /*else*/ { + __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0); + if (__pyx_t_1) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 4); + + __pyx_t_3 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L9_bool_binop_done:; + if (__pyx_t_1) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + } + __pyx_L4:; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.child.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_8callback_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_8callback___get__(((struct PyGeventChildObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_8callback___get__(struct PyGeventChildObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_callback); + __pyx_r = __pyx_v_self->_callback; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5child_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5child_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_8callback_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5child_8callback_2__set__(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_2 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_callback != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1816, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1816, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1816, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1816, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 1816, __pyx_L1_error) + + } + + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = __pyx_v_callback; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.child.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stop (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_stop(((struct PyGeventChildObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_stop(struct PyGeventChildObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stop", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1822, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1822, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1822, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1822, __pyx_L1_error) + + } + + __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2)); + + } + + ev_child_stop(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher)); + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = Py_None; + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0); + if (__pyx_t_1) { + + Py_DECREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1)); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.child.stop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_8priority_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_8priority___get__(((struct PyGeventChildObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_8priority___get__(struct PyGeventChildObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.child.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5child_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5child_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) { + int __pyx_v_priority; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_priority); { + __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1838, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.child.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_8priority_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((int)__pyx_v_priority)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5child_8priority_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1840, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1840, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1840, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1840, __pyx_L1_error) + + } + + ev_set_priority((&__pyx_v_self->_watcher), __pyx_v_priority); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.child.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_revents; + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("feed (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 2) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); __PYX_ERR(0, 1843, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) __PYX_ERR(0, 1843, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1843, __pyx_L3_error) + __pyx_v_callback = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1843, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.child.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_2feed(((struct PyGeventChildObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_2feed(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("feed", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1846, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1846, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1846, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1846, __pyx_L1_error) + + } + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 1847, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0); + if (__pyx_t_1) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + + ev_feed_event(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher), __pyx_v_revents); + + __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); + if (__pyx_t_1) { + + Py_INCREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.child.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 1857, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1857, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.child.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4start(((struct PyGeventChildObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4start(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("start", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1860, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1860, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1860, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1860, __pyx_L1_error) + + } + + __pyx_t_1 = (__pyx_v_callback == Py_None); + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1862, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1862, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1862, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1862, __pyx_L1_error) + + } + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 1863, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_t_3 = (((__pyx_v_self->_flags & 6) == 4) != 0); + if (__pyx_t_3) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + + ev_child_start(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher)); + + __pyx_t_3 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); + if (__pyx_t_3) { + + Py_INCREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.child.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_6active_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_6active_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_6active___get__(((struct PyGeventChildObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_6active___get__(struct PyGeventChildObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_active((&__pyx_v_self->_watcher)) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_7pending_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_7pending___get__(((struct PyGeventChildObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_7pending___get__(struct PyGeventChildObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_pending((&__pyx_v_self->_watcher)) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5child_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5child_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; + int __pyx_v_pid; + int __pyx_v_trace; + PyObject *__pyx_v_ref = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_pid,&__pyx_n_s_trace,&__pyx_n_s_ref,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pid)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 1884, __pyx_L3_error) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_trace); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1884, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_pid = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_pid == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1884, __pyx_L3_error) + if (values[2]) { + __pyx_v_trace = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_trace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1884, __pyx_L3_error) + } else { + __pyx_v_trace = ((int)0); + } + __pyx_v_ref = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1884, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.child.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1884, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_6__init__(((struct PyGeventChildObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_pid, __pyx_v_trace, __pyx_v_ref); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5child_6__init__(struct PyGeventChildObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_pid, int __pyx_v_trace, PyObject *__pyx_v_ref) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__init__", 0); + + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_loop), __pyx_n_s_default); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1885, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1885, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = ((!__pyx_t_2) != 0); + if (__pyx_t_3) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1886, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1886, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1886, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 1886, __pyx_L1_error) + + } + + gevent_install_sigchld_handler(); + + ev_child_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_child), __pyx_v_pid, __pyx_v_trace); + + __Pyx_INCREF(((PyObject *)__pyx_v_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = __pyx_v_loop; + + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1890, __pyx_L1_error) + if (__pyx_t_3) { + + __pyx_v_self->_flags = 0; + + goto __pyx_L4; + } + + /*else*/ { + __pyx_v_self->_flags = 4; + } + __pyx_L4:; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.child.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_8_format(((struct PyGeventChildObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_8_format(struct PyGeventChildObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_format", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rstatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_pid_r_rstatus_r, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.child._format", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_3pid_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_3pid_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_3pid___get__(((struct PyGeventChildObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_3pid___get__(struct PyGeventChildObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1901, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.child.pid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_4rpid_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_4rpid_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4rpid___get__(((struct PyGeventChildObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4rpid___get__(struct PyGeventChildObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.rpid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1906, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.child.rpid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5child_4rpid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5child_4rpid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) { + int __pyx_v_value; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_value); { + __pyx_v_value = __Pyx_PyInt_As_int(__pyx_arg_value); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1908, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.child.rpid.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4rpid_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((int)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5child_4rpid_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_v_self->_watcher.rpid = __pyx_v_value; + + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_7rstatus___get__(((struct PyGeventChildObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_7rstatus___get__(struct PyGeventChildObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.rstatus); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.child.rstatus.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) { + int __pyx_v_value; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_value); { + __pyx_v_value = __Pyx_PyInt_As_int(__pyx_arg_value); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1916, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.child.rstatus.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_7rstatus_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((int)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5child_7rstatus_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_v_self->_watcher.rstatus = __pyx_v_value; + + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_4loop_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4loop___get__(((struct PyGeventChildObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4loop___get__(struct PyGeventChildObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->loop)); + __pyx_r = ((PyObject *)__pyx_v_self->loop); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5child_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5child_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4loop_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5child_4loop_2__set__(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_5libev_8corecext_loop))))) __PYX_ERR(0, 1780, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.child.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5child_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5child_4loop_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4loop_4__del__(((struct PyGeventChildObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5child_4loop_4__del__(struct PyGeventChildObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_4args_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_4args_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4args___get__(((struct PyGeventChildObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4args___get__(struct PyGeventChildObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->args); + __pyx_r = __pyx_v_self->args; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5child_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5child_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4args_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5child_4args_2__set__(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 1782, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.child.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5child_4args_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5child_4args_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4args_4__del__(((struct PyGeventChildObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5child_4args_4__del__(struct PyGeventChildObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_6_flags_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_6_flags___get__(((struct PyGeventChildObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_6_flags___get__(struct PyGeventChildObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.child._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_3ref_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_3ref___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_3ref___get__(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if (((__pyx_v_self->_flags & 4) != 0)) { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } else { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_3ref_2__set__(((struct PyGeventStatObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4stat_3ref_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1939, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1939, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1939, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1939, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1939, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1939, __pyx_L1_error) + + } + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1940, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_t_1 = ((!((__pyx_v_self->_flags & 4) != 0)) != 0); + if (__pyx_t_1) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->loop->_ptr); + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6)); + + goto __pyx_L4; + } + + /*else*/ { + __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0); + if (__pyx_t_1) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 4); + + __pyx_t_3 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L9_bool_binop_done:; + if (__pyx_t_1) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + } + __pyx_L4:; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.stat.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_8callback_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_8callback___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_8callback___get__(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_callback); + __pyx_r = __pyx_v_self->_callback; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_8callback_2__set__(((struct PyGeventStatObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4stat_8callback_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_2 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_callback != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1961, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1961, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1961, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1961, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 1961, __pyx_L1_error) + + } + + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = __pyx_v_callback; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.stat.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stop (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_stop(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_stop(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stop", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1967, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1967, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1967, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1967, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1967, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1967, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1967, __pyx_L1_error) + + } + + __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2)); + + } + + ev_stat_stop(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher)); + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = Py_None; + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0); + if (__pyx_t_1) { + + Py_DECREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1)); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.stat.stop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_8priority_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_8priority___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_8priority___get__(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.stat.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) { + int __pyx_v_priority; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_priority); { + __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1983, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.stat.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_8priority_2__set__(((struct PyGeventStatObject *)__pyx_v_self), ((int)__pyx_v_priority)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4stat_8priority_2__set__(struct PyGeventStatObject *__pyx_v_self, int __pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1985, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1985, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1985, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1985, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1985, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1985, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1985, __pyx_L1_error) + + } + + ev_set_priority((&__pyx_v_self->_watcher), __pyx_v_priority); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.stat.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_revents; + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("feed (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 2) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); __PYX_ERR(0, 1988, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) __PYX_ERR(0, 1988, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1988, __pyx_L3_error) + __pyx_v_callback = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1988, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.stat.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_2feed(((struct PyGeventStatObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_2feed(struct PyGeventStatObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("feed", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1991, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1991, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1991, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1991, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1991, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1991, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1991, __pyx_L1_error) + + } + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 1992, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0); + if (__pyx_t_1) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + + ev_feed_event(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher), __pyx_v_revents); + + __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); + if (__pyx_t_1) { + + Py_INCREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.stat.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 2002, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2002, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.stat.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4start(((struct PyGeventStatObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4start(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("start", 0); + + __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0); + if (__pyx_t_1) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2005, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2005, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2005, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2005, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2005, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2005, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 2005, __pyx_L1_error) + + } + + __pyx_t_1 = (__pyx_v_callback == Py_None); + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2007, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2007, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2007, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2007, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2007, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2007, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 2007, __pyx_L1_error) + + } + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 2008, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_t_3 = (((__pyx_v_self->_flags & 6) == 4) != 0); + if (__pyx_t_3) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + + ev_stat_start(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher)); + + __pyx_t_3 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); + if (__pyx_t_3) { + + Py_INCREF(((PyObject*)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.stat.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_6active_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_6active_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_6active___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_6active___get__(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_active((&__pyx_v_self->_watcher)) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_7pending_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_7pending___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_7pending___get__(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_pending((&__pyx_v_self->_watcher)) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; + PyObject *__pyx_v_path = 0; + float __pyx_v_interval; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_path,&__pyx_n_s_interval,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)Py_True); + values[4] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); __PYX_ERR(0, 2031, __pyx_L3_error) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_interval); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2031, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_path = ((PyObject*)values[1]); + if (values[2]) { + __pyx_v_interval = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_interval == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2031, __pyx_L3_error) + } else { + __pyx_v_interval = ((float)0.0); + } + __pyx_v_ref = values[3]; + __pyx_v_priority = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2031, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.stat.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 2031, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), (&PyString_Type), 1, "path", 1))) __PYX_ERR(0, 2031, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_6__init__(((struct PyGeventStatObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_path, __pyx_v_interval, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4stat_6__init__(struct PyGeventStatObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_path, float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_v_paths = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + char *__pyx_t_8; + int __pyx_t_9; + __Pyx_RefNannySetupContext("__init__", 0); + + __Pyx_INCREF(__pyx_v_path); + __Pyx_GIVEREF(__pyx_v_path); + __Pyx_GOTREF(__pyx_v_self->path); + __Pyx_DECREF(__pyx_v_self->path); + __pyx_v_self->path = __pyx_v_path; + + __pyx_t_1 = PyUnicode_Check(__pyx_v_path); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2038, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2038, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2038, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + if (__pyx_t_6) { + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2038, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2038, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + if (!__pyx_t_7) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2038, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2038, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2038, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2038, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL; + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2038, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 2038, __pyx_L1_error) + __pyx_v_paths = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + __Pyx_INCREF(__pyx_v_paths); + __Pyx_GIVEREF(__pyx_v_paths); + __Pyx_GOTREF(__pyx_v_self->_paths); + __Pyx_DECREF(__pyx_v_self->_paths); + __pyx_v_self->_paths = __pyx_v_paths; + + goto __pyx_L3; + } + + /*else*/ { + __pyx_t_3 = __pyx_v_path; + __Pyx_INCREF(__pyx_t_3); + __pyx_v_paths = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + __Pyx_INCREF(__pyx_v_paths); + __Pyx_GIVEREF(__pyx_v_paths); + __Pyx_GOTREF(__pyx_v_self->_paths); + __Pyx_DECREF(__pyx_v_self->_paths); + __pyx_v_self->_paths = __pyx_v_paths; + } + __pyx_L3:; + + __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_paths); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 2043, __pyx_L1_error) + ev_stat_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_stat), ((char *)__pyx_t_8), __pyx_v_interval); + + __Pyx_INCREF(((PyObject *)__pyx_v_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = __pyx_v_loop; + + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2045, __pyx_L1_error) + if (__pyx_t_2) { + + __pyx_v_self->_flags = 0; + + goto __pyx_L4; + } + + /*else*/ { + __pyx_v_self->_flags = 4; + } + __pyx_L4:; + + __pyx_t_2 = (__pyx_v_priority != Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2050, __pyx_L1_error) + ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_9); + + } + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.libev.corecext.stat.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_paths); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4attr_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4attr_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4attr___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4attr___get__(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_watcher.attr.st_nlink != 0)) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = _pystat_fromstructstat((&__pyx_v_self->_watcher.attr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.stat.attr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4prev_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4prev_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4prev___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4prev___get__(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_watcher.prev.st_nlink != 0)) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = _pystat_fromstructstat((&__pyx_v_self->_watcher.prev)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2064, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.stat.prev.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_8interval_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_8interval_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_8interval___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_8interval___get__(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_watcher.interval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2069, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.stat.interval.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4loop_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4loop___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4loop___get__(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->loop)); + __pyx_r = ((PyObject *)__pyx_v_self->loop); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4loop_2__set__(((struct PyGeventStatObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4stat_4loop_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_5libev_8corecext_loop))))) __PYX_ERR(0, 1925, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.stat.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_4loop_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4loop_4__del__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4stat_4loop_4__del__(struct PyGeventStatObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4args_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4args_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4args___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4args___get__(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->args); + __pyx_r = __pyx_v_self->args; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4args_2__set__(((struct PyGeventStatObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4stat_4args_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 1927, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.stat.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_4args_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_4args_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4args_4__del__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4stat_4args_4__del__(struct PyGeventStatObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_6_flags_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_6_flags___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_6_flags___get__(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1928, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.stat._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4path_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4path_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4path___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4path___get__(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->path); + __pyx_r = __pyx_v_self->path; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_6_paths_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_6_paths_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_6_paths___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_6_paths___get__(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_paths); + __pyx_r = __pyx_v_self->_paths; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static void __pyx_f_6gevent_5libev_8corecext__syserr_cb(char *__pyx_v_msg) { + PyObject *__pyx_v_print_exc = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_t_12; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_syserr_cb", 0); + + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_SYSERR_CALLBACK); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2077, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_msg); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2077, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2077, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_9 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2077, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2077, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + { + __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2077, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_10); + if (__pyx_t_8) { + __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; + } + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7); + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2077, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /*except:*/ { + __Pyx_AddTraceback("gevent.libev.corecext._syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_10) < 0) __PYX_ERR(0, 2078, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_10); + + __pyx_t_7 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(Py_None, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2079, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_traceback); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2080, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_GetAttr3(__pyx_t_7, __pyx_n_s_print_exc, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2080, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_print_exc = __pyx_t_6; + __pyx_t_6 = 0; + + __pyx_t_11 = (__pyx_v_print_exc != Py_None); + __pyx_t_12 = (__pyx_t_11 != 0); + if (__pyx_t_12) { + + __Pyx_INCREF(__pyx_v_print_exc); + __pyx_t_7 = __pyx_v_print_exc; __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + if (__pyx_t_8) { + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2082, __pyx_L5_except_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } else { + __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2082, __pyx_L5_except_error) + } + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L4_exception_handled; + } + __pyx_L5_except_error:; + + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_WriteUnraisable("gevent.libev.corecext._syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_print_exc); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_21set_syserr_cb(PyObject *__pyx_self, PyObject *__pyx_v_callback); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext_set_syserr_cb(PyObject *__pyx_v_callback, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("set_syserr_cb", 0); + + __pyx_t_1 = (__pyx_v_callback == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + ev_set_syserr_cb(NULL); + + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSERR_CALLBACK, Py_None) < 0) __PYX_ERR(0, 2089, __pyx_L1_error) + + goto __pyx_L3; + } + + __pyx_t_2 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2090, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + ev_set_syserr_cb(((void *)__pyx_f_6gevent_5libev_8corecext__syserr_cb)); + + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSERR_CALLBACK, __pyx_v_callback) < 0) __PYX_ERR(0, 2092, __pyx_L1_error) + + goto __pyx_L3; + } + + /*else*/ { + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2094, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_callback); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_or_None_got_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2094, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2094, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2094, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 2094, __pyx_L1_error) + } + __pyx_L3:; + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext.set_syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_21set_syserr_cb(PyObject *__pyx_self, PyObject *__pyx_v_callback); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_21set_syserr_cb(PyObject *__pyx_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_syserr_cb (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_20set_syserr_cb(__pyx_self, ((PyObject *)__pyx_v_callback)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_20set_syserr_cb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("set_syserr_cb", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(__pyx_v_callback, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2085, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.set_syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext__EVENTSType(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext__EVENTSType(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + (*Py_TYPE(o)->tp_free)(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext__EVENTSType[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_5libev_8corecext__EVENTSType = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext._EVENTSType", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext__EVENTSType, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_5libev_8corecext_11_EVENTSType_1__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext__EVENTSType, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext__EVENTSType, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop __pyx_vtable_6gevent_5libev_8corecext_loop; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_loop(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct PyGeventLoopObject *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct PyGeventLoopObject *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_5libev_8corecext_loop; + p->error_handler = Py_None; Py_INCREF(Py_None); + p->_callbacks = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_loop(PyObject *o) { + struct PyGeventLoopObject *p = (struct PyGeventLoopObject *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6gevent_5libev_8corecext_4loop_7__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->error_handler); + Py_CLEAR(p->_callbacks); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_5libev_8corecext_loop(PyObject *o, visitproc v, void *a) { + int e; + struct PyGeventLoopObject *p = (struct PyGeventLoopObject *)o; + if (p->error_handler) { + e = (*v)(p->error_handler, a); if (e) return e; + } + if (p->_callbacks) { + e = (*v)(p->_callbacks, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_5libev_8corecext_loop(PyObject *o) { + PyObject* tmp; + struct PyGeventLoopObject *p = (struct PyGeventLoopObject *)o; + tmp = ((PyObject*)p->error_handler); + p->error_handler = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_callbacks); + p->_callbacks = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_ptr(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_3ptr_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_WatcherType(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_11WatcherType_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_MAXPRI(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_6MAXPRI_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_MINPRI(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_6MINPRI_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_default(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_7default_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_iteration(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_9iteration_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_depth(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_5depth_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_backend_int(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_11backend_int_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_backend(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_7backend_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_pendingcnt(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_10pendingcnt_1__get__(o); +} + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_activecnt(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_9activecnt_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_sig_pending(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_11sig_pending_1__get__(o); +} + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_sigfd(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_5sigfd_1__get__(o); +} + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_origflags(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_9origflags_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_origflags_int(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_13origflags_int_1__get__(o); +} + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_error_handler(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_4loop_error_handler(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop__callbacks(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_4loop__callbacks(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_loop[] = { + {"_stop_watchers", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_3_stop_watchers, METH_NOARGS, 0}, + {"destroy", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_5destroy, METH_NOARGS, 0}, + {"_handle_syserr", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_9_handle_syserr, METH_VARARGS|METH_KEYWORDS, 0}, + {"handle_error", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error, METH_VARARGS|METH_KEYWORDS, 0}, + {"_default_handle_error", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error, METH_VARARGS|METH_KEYWORDS, 0}, + {"run", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_15run, METH_VARARGS|METH_KEYWORDS, 0}, + {"reinit", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_17reinit, METH_NOARGS, 0}, + {"ref", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_19ref, METH_NOARGS, 0}, + {"unref", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_21unref, METH_NOARGS, 0}, + {"break_", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_23break_, METH_VARARGS|METH_KEYWORDS, 0}, + {"verify", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_25verify, METH_NOARGS, 0}, + {"now", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_27now, METH_NOARGS, 0}, + {"update", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_29update, METH_NOARGS, 0}, + {"io", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_33io, METH_VARARGS|METH_KEYWORDS, 0}, + {"timer", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_35timer, METH_VARARGS|METH_KEYWORDS, 0}, + {"signal", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_37signal, METH_VARARGS|METH_KEYWORDS, 0}, + {"idle", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_39idle, METH_VARARGS|METH_KEYWORDS, 0}, + {"prepare", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_41prepare, METH_VARARGS|METH_KEYWORDS, 0}, + {"check", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_43check, METH_VARARGS|METH_KEYWORDS, 0}, + {"fork", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_45fork, METH_VARARGS|METH_KEYWORDS, 0}, + {"async", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_47async, METH_VARARGS|METH_KEYWORDS, 0}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + {"stat", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_49stat, METH_VARARGS|METH_KEYWORDS, 0}, + {"run_callback", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_51run_callback, METH_VARARGS|METH_KEYWORDS, 0}, + {"_format", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_53_format, METH_NOARGS, 0}, + {"_format_details", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_55_format_details, METH_NOARGS, 0}, + {"fileno", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_57fileno, METH_NOARGS, 0}, +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {"child", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_49child, METH_VARARGS|METH_KEYWORDS, 0}, + {"install_sigchld", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_51install_sigchld, METH_NOARGS, 0}, + {"reset_sigchld", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_53reset_sigchld, METH_NOARGS, 0}, + {"stat", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_55stat, METH_VARARGS|METH_KEYWORDS, 0}, + {"run_callback", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_57run_callback, METH_VARARGS|METH_KEYWORDS, 0}, + {"_format", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_59_format, METH_NOARGS, 0}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {"_format_details", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_61_format_details, METH_NOARGS, 0}, + {"fileno", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_63fileno, METH_NOARGS, 0}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + {"stat", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_49stat, METH_VARARGS|METH_KEYWORDS, 0}, + {"run_callback", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_51run_callback, METH_VARARGS|METH_KEYWORDS, 0}, + {"_format", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_53_format, METH_NOARGS, 0}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + {"_format_details", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_55_format_details, METH_NOARGS, 0}, + {"fileno", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_57fileno, METH_NOARGS, 0}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {"_format_details", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_61_format_details, METH_NOARGS, 0}, + {"fileno", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_63fileno, METH_NOARGS, 0}, +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_loop[] = { + {(char *)"ptr", __pyx_getprop_6gevent_5libev_8corecext_4loop_ptr, 0, (char *)0, 0}, + {(char *)"WatcherType", __pyx_getprop_6gevent_5libev_8corecext_4loop_WatcherType, 0, (char *)0, 0}, + {(char *)"MAXPRI", __pyx_getprop_6gevent_5libev_8corecext_4loop_MAXPRI, 0, (char *)0, 0}, + {(char *)"MINPRI", __pyx_getprop_6gevent_5libev_8corecext_4loop_MINPRI, 0, (char *)0, 0}, + {(char *)"default", __pyx_getprop_6gevent_5libev_8corecext_4loop_default, 0, (char *)0, 0}, + {(char *)"iteration", __pyx_getprop_6gevent_5libev_8corecext_4loop_iteration, 0, (char *)0, 0}, + {(char *)"depth", __pyx_getprop_6gevent_5libev_8corecext_4loop_depth, 0, (char *)0, 0}, + {(char *)"backend_int", __pyx_getprop_6gevent_5libev_8corecext_4loop_backend_int, 0, (char *)0, 0}, + {(char *)"backend", __pyx_getprop_6gevent_5libev_8corecext_4loop_backend, 0, (char *)0, 0}, + {(char *)"pendingcnt", __pyx_getprop_6gevent_5libev_8corecext_4loop_pendingcnt, 0, (char *)0, 0}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {(char *)"activecnt", __pyx_getprop_6gevent_5libev_8corecext_4loop_activecnt, 0, (char *)0, 0}, + {(char *)"sig_pending", __pyx_getprop_6gevent_5libev_8corecext_4loop_sig_pending, 0, (char *)0, 0}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + {(char *)"sigfd", __pyx_getprop_6gevent_5libev_8corecext_4loop_sigfd, 0, (char *)0, 0}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {(char *)"origflags", __pyx_getprop_6gevent_5libev_8corecext_4loop_origflags, 0, (char *)0, 0}, + {(char *)"origflags_int", __pyx_getprop_6gevent_5libev_8corecext_4loop_origflags_int, 0, (char *)0, 0}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {(char *)"error_handler", __pyx_getprop_6gevent_5libev_8corecext_4loop_error_handler, __pyx_setprop_6gevent_5libev_8corecext_4loop_error_handler, (char *)0, 0}, + {(char *)"_callbacks", __pyx_getprop_6gevent_5libev_8corecext_4loop__callbacks, __pyx_setprop_6gevent_5libev_8corecext_4loop__callbacks, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventLoop_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.loop", /*tp_name*/ + sizeof(struct PyGeventLoopObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_loop, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_5libev_8corecext_4loop_31__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_loop, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_loop, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_loop, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_loop, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_4loop_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_loop, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_callback(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct PyGeventCallbackObject *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct PyGeventCallbackObject *)o); + p->callback = Py_None; Py_INCREF(Py_None); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_callback(PyObject *o) { + struct PyGeventCallbackObject *p = (struct PyGeventCallbackObject *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->callback); + Py_CLEAR(p->args); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_5libev_8corecext_callback(PyObject *o, visitproc v, void *a) { + int e; + struct PyGeventCallbackObject *p = (struct PyGeventCallbackObject *)o; + if (p->callback) { + e = (*v)(p->callback, a); if (e) return e; + } + if (p->args) { + e = (*v)(p->args, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_5libev_8corecext_callback(PyObject *o) { + PyObject* tmp; + struct PyGeventCallbackObject *p = (struct PyGeventCallbackObject *)o; + tmp = ((PyObject*)p->callback); + p->callback = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->args); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_8callback_pending(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_8callback_7pending_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_8callback_callback(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_8callback_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_8callback_args(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_8callback_4args_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_8callback_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_8callback_4args_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_8callback_4args_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_callback[] = { + {"stop", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_8callback_3stop, METH_NOARGS, 0}, + {"_format", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_8callback_9_format, METH_NOARGS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_callback[] = { + {(char *)"pending", __pyx_getprop_6gevent_5libev_8corecext_8callback_pending, 0, (char *)0, 0}, + {(char *)"callback", __pyx_getprop_6gevent_5libev_8corecext_8callback_callback, __pyx_setprop_6gevent_5libev_8corecext_8callback_callback, (char *)0, 0}, + {(char *)"args", __pyx_getprop_6gevent_5libev_8corecext_8callback_args, __pyx_setprop_6gevent_5libev_8corecext_8callback_args, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_callback = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + __pyx_pw_6gevent_5libev_8corecext_8callback_5__nonzero__, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + 0, /*nb_index*/ + #if PY_VERSION_HEX >= 0x03050000 + 0, /*nb_matrix_multiply*/ + #endif + #if PY_VERSION_HEX >= 0x03050000 + 0, /*nb_inplace_matrix_multiply*/ + #endif +}; + +DL_EXPORT(PyTypeObject) PyGeventCallback_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.callback", /*tp_name*/ + sizeof(struct PyGeventCallbackObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_callback, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_5libev_8corecext_8callback_7__repr__, /*tp_repr*/ + &__pyx_tp_as_number_callback, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_callback, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_callback, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_callback, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_callback, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_8callback_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_callback, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_watcher(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + (*Py_TYPE(o)->tp_free)(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_watcher[] = { + {"_format", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_7watcher_3_format, METH_NOARGS, 0}, + {0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventWatcher_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.watcher", /*tp_name*/ + sizeof(struct PyGeventWatcherObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_5libev_8corecext_7watcher_1__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + "Abstract base class for all the watchers", /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_watcher, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_watcher, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_io(PyTypeObject *t, PyObject *a, PyObject *k) { + struct PyGeventIOObject *p; + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct PyGeventIOObject *)o); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + p->_callback = Py_None; Py_INCREF(Py_None); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + if (unlikely(__pyx_pw_6gevent_5libev_8corecext_2io_11__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + return o; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + bad: + Py_DECREF(o); o = 0; + return NULL; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_io(PyObject *o) { + struct PyGeventIOObject *p = (struct PyGeventIOObject *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6gevent_5libev_8corecext_2io_13__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + Py_CLEAR(p->loop); + Py_CLEAR(p->_callback); + Py_CLEAR(p->args); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher(o); +} + +static int __pyx_tp_traverse_6gevent_5libev_8corecext_io(PyObject *o, visitproc v, void *a) { + int e; + struct PyGeventIOObject *p = (struct PyGeventIOObject *)o; + e = ((likely(__pyx_ptype_6gevent_5libev_8corecext_watcher)) ? ((__pyx_ptype_6gevent_5libev_8corecext_watcher->tp_traverse) ? __pyx_ptype_6gevent_5libev_8corecext_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_5libev_8corecext_io)); if (e) return e; + if (p->loop) { + e = (*v)(((PyObject*)p->loop), a); if (e) return e; + } + if (p->_callback) { + e = (*v)(p->_callback, a); if (e) return e; + } + if (p->args) { + e = (*v)(p->args, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_5libev_8corecext_io(PyObject *o) { + PyObject* tmp; + struct PyGeventIOObject *p = (struct PyGeventIOObject *)o; + if (likely(__pyx_ptype_6gevent_5libev_8corecext_watcher)) { if (__pyx_ptype_6gevent_5libev_8corecext_watcher->tp_clear) __pyx_ptype_6gevent_5libev_8corecext_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_5libev_8corecext_io); + tmp = ((PyObject*)p->loop); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_callback); + p->_callback = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->args); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_2io_ref(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_2io_3ref_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_2io_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_2io_3ref_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_2io_callback(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_2io_8callback_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_2io_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_2io_8callback_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_2io_priority(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_2io_8priority_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_2io_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_2io_8priority_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_2io_active(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_2io_6active_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_2io_pending(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_2io_7pending_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_2io_fd(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_2io_2fd_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_2io_fd(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_2io_2fd_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_2io_events(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_2io_6events_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_2io_events(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_2io_6events_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_2io_events_str(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_2io_10events_str_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_2io_loop(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_2io_4loop_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_2io_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_2io_4loop_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_2io_4loop_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_2io_args(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_2io_4args_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_2io_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_2io_4args_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_2io_4args_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_2io__flags(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_2io_6_flags_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_io[] = { + {"stop", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_2io_1stop, METH_NOARGS, 0}, + {"feed", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_2io_3feed, METH_VARARGS|METH_KEYWORDS, 0}, + {"start", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_2io_5start, METH_VARARGS|METH_KEYWORDS, 0}, + {"_format", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_2io_9_format, METH_NOARGS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_io[] = { + {(char *)"ref", __pyx_getprop_6gevent_5libev_8corecext_2io_ref, __pyx_setprop_6gevent_5libev_8corecext_2io_ref, (char *)0, 0}, + {(char *)"callback", __pyx_getprop_6gevent_5libev_8corecext_2io_callback, __pyx_setprop_6gevent_5libev_8corecext_2io_callback, (char *)0, 0}, + {(char *)"priority", __pyx_getprop_6gevent_5libev_8corecext_2io_priority, __pyx_setprop_6gevent_5libev_8corecext_2io_priority, (char *)0, 0}, + {(char *)"active", __pyx_getprop_6gevent_5libev_8corecext_2io_active, 0, (char *)0, 0}, + {(char *)"pending", __pyx_getprop_6gevent_5libev_8corecext_2io_pending, 0, (char *)0, 0}, + {(char *)"fd", __pyx_getprop_6gevent_5libev_8corecext_2io_fd, __pyx_setprop_6gevent_5libev_8corecext_2io_fd, (char *)0, 0}, + {(char *)"events", __pyx_getprop_6gevent_5libev_8corecext_2io_events, __pyx_setprop_6gevent_5libev_8corecext_2io_events, (char *)0, 0}, + {(char *)"events_str", __pyx_getprop_6gevent_5libev_8corecext_2io_events_str, 0, (char *)0, 0}, + {(char *)"loop", __pyx_getprop_6gevent_5libev_8corecext_2io_loop, __pyx_setprop_6gevent_5libev_8corecext_2io_loop, (char *)0, 0}, + {(char *)"args", __pyx_getprop_6gevent_5libev_8corecext_2io_args, __pyx_setprop_6gevent_5libev_8corecext_2io_args, (char *)0, 0}, + {(char *)"_flags", __pyx_getprop_6gevent_5libev_8corecext_2io__flags, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventIO_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.io", /*tp_name*/ + sizeof(struct PyGeventIOObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_io, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_1__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_io, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_io, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_io, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_io, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_2io_7__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_io, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_timer(PyTypeObject *t, PyObject *a, PyObject *k) { + struct PyGeventTimerObject *p; + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct PyGeventTimerObject *)o); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + p->_callback = Py_None; Py_INCREF(Py_None); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_timer(PyObject *o) { + struct PyGeventTimerObject *p = (struct PyGeventTimerObject *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->loop); + Py_CLEAR(p->_callback); + Py_CLEAR(p->args); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher(o); +} + +static int __pyx_tp_traverse_6gevent_5libev_8corecext_timer(PyObject *o, visitproc v, void *a) { + int e; + struct PyGeventTimerObject *p = (struct PyGeventTimerObject *)o; + e = ((likely(__pyx_ptype_6gevent_5libev_8corecext_watcher)) ? ((__pyx_ptype_6gevent_5libev_8corecext_watcher->tp_traverse) ? __pyx_ptype_6gevent_5libev_8corecext_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_5libev_8corecext_timer)); if (e) return e; + if (p->loop) { + e = (*v)(((PyObject*)p->loop), a); if (e) return e; + } + if (p->_callback) { + e = (*v)(p->_callback, a); if (e) return e; + } + if (p->args) { + e = (*v)(p->args, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_5libev_8corecext_timer(PyObject *o) { + PyObject* tmp; + struct PyGeventTimerObject *p = (struct PyGeventTimerObject *)o; + if (likely(__pyx_ptype_6gevent_5libev_8corecext_watcher)) { if (__pyx_ptype_6gevent_5libev_8corecext_watcher->tp_clear) __pyx_ptype_6gevent_5libev_8corecext_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_5libev_8corecext_timer); + tmp = ((PyObject*)p->loop); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_callback); + p->_callback = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->args); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5timer_ref(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5timer_3ref_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5timer_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5timer_3ref_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5timer_callback(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5timer_8callback_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5timer_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5timer_8callback_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5timer_priority(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5timer_8priority_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5timer_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5timer_8priority_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5timer_active(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5timer_6active_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5timer_pending(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5timer_7pending_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5timer_at(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5timer_2at_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5timer_loop(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5timer_4loop_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5timer_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5timer_4loop_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_5timer_4loop_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5timer_args(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5timer_4args_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5timer_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5timer_4args_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_5timer_4args_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5timer__flags(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5timer_6_flags_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_timer[] = { + {"stop", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_5timer_1stop, METH_NOARGS, 0}, + {"feed", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_5timer_3feed, METH_VARARGS|METH_KEYWORDS, 0}, + {"start", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_5timer_5start, METH_VARARGS|METH_KEYWORDS, 0}, + {"again", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_5timer_9again, METH_VARARGS|METH_KEYWORDS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_timer[] = { + {(char *)"ref", __pyx_getprop_6gevent_5libev_8corecext_5timer_ref, __pyx_setprop_6gevent_5libev_8corecext_5timer_ref, (char *)0, 0}, + {(char *)"callback", __pyx_getprop_6gevent_5libev_8corecext_5timer_callback, __pyx_setprop_6gevent_5libev_8corecext_5timer_callback, (char *)0, 0}, + {(char *)"priority", __pyx_getprop_6gevent_5libev_8corecext_5timer_priority, __pyx_setprop_6gevent_5libev_8corecext_5timer_priority, (char *)0, 0}, + {(char *)"active", __pyx_getprop_6gevent_5libev_8corecext_5timer_active, 0, (char *)0, 0}, + {(char *)"pending", __pyx_getprop_6gevent_5libev_8corecext_5timer_pending, 0, (char *)0, 0}, + {(char *)"at", __pyx_getprop_6gevent_5libev_8corecext_5timer_at, 0, (char *)0, 0}, + {(char *)"loop", __pyx_getprop_6gevent_5libev_8corecext_5timer_loop, __pyx_setprop_6gevent_5libev_8corecext_5timer_loop, (char *)0, 0}, + {(char *)"args", __pyx_getprop_6gevent_5libev_8corecext_5timer_args, __pyx_setprop_6gevent_5libev_8corecext_5timer_args, (char *)0, 0}, + {(char *)"_flags", __pyx_getprop_6gevent_5libev_8corecext_5timer__flags, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventTimer_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.timer", /*tp_name*/ + sizeof(struct PyGeventTimerObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_timer, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_1__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_timer, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_timer, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_timer, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_timer, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_5timer_7__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_timer, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_signal(PyTypeObject *t, PyObject *a, PyObject *k) { + struct PyGeventSignalObject *p; + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct PyGeventSignalObject *)o); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + p->_callback = Py_None; Py_INCREF(Py_None); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_signal(PyObject *o) { + struct PyGeventSignalObject *p = (struct PyGeventSignalObject *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->loop); + Py_CLEAR(p->_callback); + Py_CLEAR(p->args); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher(o); +} + +static int __pyx_tp_traverse_6gevent_5libev_8corecext_signal(PyObject *o, visitproc v, void *a) { + int e; + struct PyGeventSignalObject *p = (struct PyGeventSignalObject *)o; + e = ((likely(__pyx_ptype_6gevent_5libev_8corecext_watcher)) ? ((__pyx_ptype_6gevent_5libev_8corecext_watcher->tp_traverse) ? __pyx_ptype_6gevent_5libev_8corecext_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_5libev_8corecext_signal)); if (e) return e; + if (p->loop) { + e = (*v)(((PyObject*)p->loop), a); if (e) return e; + } + if (p->_callback) { + e = (*v)(p->_callback, a); if (e) return e; + } + if (p->args) { + e = (*v)(p->args, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_5libev_8corecext_signal(PyObject *o) { + PyObject* tmp; + struct PyGeventSignalObject *p = (struct PyGeventSignalObject *)o; + if (likely(__pyx_ptype_6gevent_5libev_8corecext_watcher)) { if (__pyx_ptype_6gevent_5libev_8corecext_watcher->tp_clear) __pyx_ptype_6gevent_5libev_8corecext_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_5libev_8corecext_signal); + tmp = ((PyObject*)p->loop); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_callback); + p->_callback = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->args); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_6signal_ref(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_6signal_3ref_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_6signal_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_6signal_3ref_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_6signal_callback(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_6signal_8callback_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_6signal_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_6signal_8callback_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_6signal_priority(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_6signal_8priority_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_6signal_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_6signal_8priority_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_6signal_active(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_6signal_6active_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_6signal_pending(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_6signal_7pending_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_6signal_loop(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_6signal_4loop_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_6signal_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_6signal_4loop_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_6signal_4loop_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_6signal_args(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_6signal_4args_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_6signal_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_6signal_4args_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_6signal_4args_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_6signal__flags(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_6signal_6_flags_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_signal[] = { + {"stop", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_6signal_1stop, METH_NOARGS, 0}, + {"feed", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_6signal_3feed, METH_VARARGS|METH_KEYWORDS, 0}, + {"start", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_6signal_5start, METH_VARARGS|METH_KEYWORDS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_signal[] = { + {(char *)"ref", __pyx_getprop_6gevent_5libev_8corecext_6signal_ref, __pyx_setprop_6gevent_5libev_8corecext_6signal_ref, (char *)0, 0}, + {(char *)"callback", __pyx_getprop_6gevent_5libev_8corecext_6signal_callback, __pyx_setprop_6gevent_5libev_8corecext_6signal_callback, (char *)0, 0}, + {(char *)"priority", __pyx_getprop_6gevent_5libev_8corecext_6signal_priority, __pyx_setprop_6gevent_5libev_8corecext_6signal_priority, (char *)0, 0}, + {(char *)"active", __pyx_getprop_6gevent_5libev_8corecext_6signal_active, 0, (char *)0, 0}, + {(char *)"pending", __pyx_getprop_6gevent_5libev_8corecext_6signal_pending, 0, (char *)0, 0}, + {(char *)"loop", __pyx_getprop_6gevent_5libev_8corecext_6signal_loop, __pyx_setprop_6gevent_5libev_8corecext_6signal_loop, (char *)0, 0}, + {(char *)"args", __pyx_getprop_6gevent_5libev_8corecext_6signal_args, __pyx_setprop_6gevent_5libev_8corecext_6signal_args, (char *)0, 0}, + {(char *)"_flags", __pyx_getprop_6gevent_5libev_8corecext_6signal__flags, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventSignal_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.signal", /*tp_name*/ + sizeof(struct PyGeventSignalObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_signal, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_1__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_signal, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_signal, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_signal, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_signal, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_6signal_7__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_signal, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_idle(PyTypeObject *t, PyObject *a, PyObject *k) { + struct PyGeventIdleObject *p; + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct PyGeventIdleObject *)o); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + p->_callback = Py_None; Py_INCREF(Py_None); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_idle(PyObject *o) { + struct PyGeventIdleObject *p = (struct PyGeventIdleObject *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->loop); + Py_CLEAR(p->_callback); + Py_CLEAR(p->args); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher(o); +} + +static int __pyx_tp_traverse_6gevent_5libev_8corecext_idle(PyObject *o, visitproc v, void *a) { + int e; + struct PyGeventIdleObject *p = (struct PyGeventIdleObject *)o; + e = ((likely(__pyx_ptype_6gevent_5libev_8corecext_watcher)) ? ((__pyx_ptype_6gevent_5libev_8corecext_watcher->tp_traverse) ? __pyx_ptype_6gevent_5libev_8corecext_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_5libev_8corecext_idle)); if (e) return e; + if (p->loop) { + e = (*v)(((PyObject*)p->loop), a); if (e) return e; + } + if (p->_callback) { + e = (*v)(p->_callback, a); if (e) return e; + } + if (p->args) { + e = (*v)(p->args, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_5libev_8corecext_idle(PyObject *o) { + PyObject* tmp; + struct PyGeventIdleObject *p = (struct PyGeventIdleObject *)o; + if (likely(__pyx_ptype_6gevent_5libev_8corecext_watcher)) { if (__pyx_ptype_6gevent_5libev_8corecext_watcher->tp_clear) __pyx_ptype_6gevent_5libev_8corecext_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_5libev_8corecext_idle); + tmp = ((PyObject*)p->loop); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_callback); + p->_callback = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->args); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4idle_ref(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4idle_3ref_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_4idle_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_4idle_3ref_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4idle_callback(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4idle_8callback_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_4idle_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_4idle_8callback_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4idle_priority(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4idle_8priority_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_4idle_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_4idle_8priority_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4idle_active(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4idle_6active_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4idle_pending(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4idle_7pending_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4idle_loop(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4idle_4loop_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_4idle_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_4idle_4loop_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_4idle_4loop_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4idle_args(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4idle_4args_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_4idle_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_4idle_4args_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_4idle_4args_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4idle__flags(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4idle_6_flags_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_idle[] = { + {"stop", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4idle_1stop, METH_NOARGS, 0}, + {"feed", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4idle_3feed, METH_VARARGS|METH_KEYWORDS, 0}, + {"start", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4idle_5start, METH_VARARGS|METH_KEYWORDS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_idle[] = { + {(char *)"ref", __pyx_getprop_6gevent_5libev_8corecext_4idle_ref, __pyx_setprop_6gevent_5libev_8corecext_4idle_ref, (char *)0, 0}, + {(char *)"callback", __pyx_getprop_6gevent_5libev_8corecext_4idle_callback, __pyx_setprop_6gevent_5libev_8corecext_4idle_callback, (char *)0, 0}, + {(char *)"priority", __pyx_getprop_6gevent_5libev_8corecext_4idle_priority, __pyx_setprop_6gevent_5libev_8corecext_4idle_priority, (char *)0, 0}, + {(char *)"active", __pyx_getprop_6gevent_5libev_8corecext_4idle_active, 0, (char *)0, 0}, + {(char *)"pending", __pyx_getprop_6gevent_5libev_8corecext_4idle_pending, 0, (char *)0, 0}, + {(char *)"loop", __pyx_getprop_6gevent_5libev_8corecext_4idle_loop, __pyx_setprop_6gevent_5libev_8corecext_4idle_loop, (char *)0, 0}, + {(char *)"args", __pyx_getprop_6gevent_5libev_8corecext_4idle_args, __pyx_setprop_6gevent_5libev_8corecext_4idle_args, (char *)0, 0}, + {(char *)"_flags", __pyx_getprop_6gevent_5libev_8corecext_4idle__flags, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventIdle_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.idle", /*tp_name*/ + sizeof(struct PyGeventIdleObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_idle, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_1__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_idle, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_idle, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_idle, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_idle, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_4idle_7__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_idle, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_prepare(PyTypeObject *t, PyObject *a, PyObject *k) { + struct PyGeventPrepareObject *p; + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct PyGeventPrepareObject *)o); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + p->_callback = Py_None; Py_INCREF(Py_None); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_prepare(PyObject *o) { + struct PyGeventPrepareObject *p = (struct PyGeventPrepareObject *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->loop); + Py_CLEAR(p->_callback); + Py_CLEAR(p->args); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher(o); +} + +static int __pyx_tp_traverse_6gevent_5libev_8corecext_prepare(PyObject *o, visitproc v, void *a) { + int e; + struct PyGeventPrepareObject *p = (struct PyGeventPrepareObject *)o; + e = ((likely(__pyx_ptype_6gevent_5libev_8corecext_watcher)) ? ((__pyx_ptype_6gevent_5libev_8corecext_watcher->tp_traverse) ? __pyx_ptype_6gevent_5libev_8corecext_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_5libev_8corecext_prepare)); if (e) return e; + if (p->loop) { + e = (*v)(((PyObject*)p->loop), a); if (e) return e; + } + if (p->_callback) { + e = (*v)(p->_callback, a); if (e) return e; + } + if (p->args) { + e = (*v)(p->args, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_5libev_8corecext_prepare(PyObject *o) { + PyObject* tmp; + struct PyGeventPrepareObject *p = (struct PyGeventPrepareObject *)o; + if (likely(__pyx_ptype_6gevent_5libev_8corecext_watcher)) { if (__pyx_ptype_6gevent_5libev_8corecext_watcher->tp_clear) __pyx_ptype_6gevent_5libev_8corecext_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_5libev_8corecext_prepare); + tmp = ((PyObject*)p->loop); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_callback); + p->_callback = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->args); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7prepare_ref(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7prepare_3ref_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_7prepare_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_7prepare_3ref_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7prepare_callback(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7prepare_8callback_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_7prepare_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_7prepare_8callback_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7prepare_priority(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7prepare_8priority_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_7prepare_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_7prepare_8priority_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7prepare_active(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7prepare_6active_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7prepare_pending(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7prepare_7pending_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7prepare_loop(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7prepare_4loop_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_7prepare_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_7prepare_4loop_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_7prepare_4loop_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7prepare_args(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7prepare_4args_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_7prepare_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_7prepare_4args_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_7prepare_4args_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7prepare__flags(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7prepare_6_flags_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_prepare[] = { + {"stop", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_7prepare_1stop, METH_NOARGS, 0}, + {"feed", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_7prepare_3feed, METH_VARARGS|METH_KEYWORDS, 0}, + {"start", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_7prepare_5start, METH_VARARGS|METH_KEYWORDS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_prepare[] = { + {(char *)"ref", __pyx_getprop_6gevent_5libev_8corecext_7prepare_ref, __pyx_setprop_6gevent_5libev_8corecext_7prepare_ref, (char *)0, 0}, + {(char *)"callback", __pyx_getprop_6gevent_5libev_8corecext_7prepare_callback, __pyx_setprop_6gevent_5libev_8corecext_7prepare_callback, (char *)0, 0}, + {(char *)"priority", __pyx_getprop_6gevent_5libev_8corecext_7prepare_priority, __pyx_setprop_6gevent_5libev_8corecext_7prepare_priority, (char *)0, 0}, + {(char *)"active", __pyx_getprop_6gevent_5libev_8corecext_7prepare_active, 0, (char *)0, 0}, + {(char *)"pending", __pyx_getprop_6gevent_5libev_8corecext_7prepare_pending, 0, (char *)0, 0}, + {(char *)"loop", __pyx_getprop_6gevent_5libev_8corecext_7prepare_loop, __pyx_setprop_6gevent_5libev_8corecext_7prepare_loop, (char *)0, 0}, + {(char *)"args", __pyx_getprop_6gevent_5libev_8corecext_7prepare_args, __pyx_setprop_6gevent_5libev_8corecext_7prepare_args, (char *)0, 0}, + {(char *)"_flags", __pyx_getprop_6gevent_5libev_8corecext_7prepare__flags, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventPrepare_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.prepare", /*tp_name*/ + sizeof(struct PyGeventPrepareObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_prepare, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_1__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_prepare, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_prepare, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_prepare, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_prepare, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_7prepare_7__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_prepare, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_check(PyTypeObject *t, PyObject *a, PyObject *k) { + struct PyGeventCheckObject *p; + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct PyGeventCheckObject *)o); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + p->_callback = Py_None; Py_INCREF(Py_None); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_check(PyObject *o) { + struct PyGeventCheckObject *p = (struct PyGeventCheckObject *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->loop); + Py_CLEAR(p->_callback); + Py_CLEAR(p->args); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher(o); +} + +static int __pyx_tp_traverse_6gevent_5libev_8corecext_check(PyObject *o, visitproc v, void *a) { + int e; + struct PyGeventCheckObject *p = (struct PyGeventCheckObject *)o; + e = ((likely(__pyx_ptype_6gevent_5libev_8corecext_watcher)) ? ((__pyx_ptype_6gevent_5libev_8corecext_watcher->tp_traverse) ? __pyx_ptype_6gevent_5libev_8corecext_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_5libev_8corecext_check)); if (e) return e; + if (p->loop) { + e = (*v)(((PyObject*)p->loop), a); if (e) return e; + } + if (p->_callback) { + e = (*v)(p->_callback, a); if (e) return e; + } + if (p->args) { + e = (*v)(p->args, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_5libev_8corecext_check(PyObject *o) { + PyObject* tmp; + struct PyGeventCheckObject *p = (struct PyGeventCheckObject *)o; + if (likely(__pyx_ptype_6gevent_5libev_8corecext_watcher)) { if (__pyx_ptype_6gevent_5libev_8corecext_watcher->tp_clear) __pyx_ptype_6gevent_5libev_8corecext_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_5libev_8corecext_check); + tmp = ((PyObject*)p->loop); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_callback); + p->_callback = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->args); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5check_ref(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5check_3ref_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5check_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5check_3ref_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5check_callback(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5check_8callback_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5check_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5check_8callback_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5check_priority(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5check_8priority_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5check_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5check_8priority_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5check_active(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5check_6active_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5check_pending(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5check_7pending_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5check_loop(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5check_4loop_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5check_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5check_4loop_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_5check_4loop_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5check_args(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5check_4args_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5check_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5check_4args_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_5check_4args_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5check__flags(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5check_6_flags_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_check[] = { + {"stop", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_5check_1stop, METH_NOARGS, 0}, + {"feed", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_5check_3feed, METH_VARARGS|METH_KEYWORDS, 0}, + {"start", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_5check_5start, METH_VARARGS|METH_KEYWORDS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_check[] = { + {(char *)"ref", __pyx_getprop_6gevent_5libev_8corecext_5check_ref, __pyx_setprop_6gevent_5libev_8corecext_5check_ref, (char *)0, 0}, + {(char *)"callback", __pyx_getprop_6gevent_5libev_8corecext_5check_callback, __pyx_setprop_6gevent_5libev_8corecext_5check_callback, (char *)0, 0}, + {(char *)"priority", __pyx_getprop_6gevent_5libev_8corecext_5check_priority, __pyx_setprop_6gevent_5libev_8corecext_5check_priority, (char *)0, 0}, + {(char *)"active", __pyx_getprop_6gevent_5libev_8corecext_5check_active, 0, (char *)0, 0}, + {(char *)"pending", __pyx_getprop_6gevent_5libev_8corecext_5check_pending, 0, (char *)0, 0}, + {(char *)"loop", __pyx_getprop_6gevent_5libev_8corecext_5check_loop, __pyx_setprop_6gevent_5libev_8corecext_5check_loop, (char *)0, 0}, + {(char *)"args", __pyx_getprop_6gevent_5libev_8corecext_5check_args, __pyx_setprop_6gevent_5libev_8corecext_5check_args, (char *)0, 0}, + {(char *)"_flags", __pyx_getprop_6gevent_5libev_8corecext_5check__flags, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventCheck_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.check", /*tp_name*/ + sizeof(struct PyGeventCheckObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_check, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_1__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_check, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_check, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_check, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_check, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_5check_7__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_check, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_fork(PyTypeObject *t, PyObject *a, PyObject *k) { + struct PyGeventForkObject *p; + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct PyGeventForkObject *)o); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + p->_callback = Py_None; Py_INCREF(Py_None); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_fork(PyObject *o) { + struct PyGeventForkObject *p = (struct PyGeventForkObject *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->loop); + Py_CLEAR(p->_callback); + Py_CLEAR(p->args); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher(o); +} + +static int __pyx_tp_traverse_6gevent_5libev_8corecext_fork(PyObject *o, visitproc v, void *a) { + int e; + struct PyGeventForkObject *p = (struct PyGeventForkObject *)o; + e = ((likely(__pyx_ptype_6gevent_5libev_8corecext_watcher)) ? ((__pyx_ptype_6gevent_5libev_8corecext_watcher->tp_traverse) ? __pyx_ptype_6gevent_5libev_8corecext_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_5libev_8corecext_fork)); if (e) return e; + if (p->loop) { + e = (*v)(((PyObject*)p->loop), a); if (e) return e; + } + if (p->_callback) { + e = (*v)(p->_callback, a); if (e) return e; + } + if (p->args) { + e = (*v)(p->args, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_5libev_8corecext_fork(PyObject *o) { + PyObject* tmp; + struct PyGeventForkObject *p = (struct PyGeventForkObject *)o; + if (likely(__pyx_ptype_6gevent_5libev_8corecext_watcher)) { if (__pyx_ptype_6gevent_5libev_8corecext_watcher->tp_clear) __pyx_ptype_6gevent_5libev_8corecext_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_5libev_8corecext_fork); + tmp = ((PyObject*)p->loop); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_callback); + p->_callback = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->args); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4fork_ref(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4fork_3ref_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_4fork_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_4fork_3ref_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4fork_callback(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4fork_8callback_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_4fork_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_4fork_8callback_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4fork_priority(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4fork_8priority_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_4fork_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_4fork_8priority_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4fork_active(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4fork_6active_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4fork_pending(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4fork_7pending_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4fork_loop(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4fork_4loop_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_4fork_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_4fork_4loop_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_4fork_4loop_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4fork_args(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4fork_4args_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_4fork_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_4fork_4args_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_4fork_4args_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4fork__flags(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4fork_6_flags_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_fork[] = { + {"stop", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4fork_1stop, METH_NOARGS, 0}, + {"feed", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4fork_3feed, METH_VARARGS|METH_KEYWORDS, 0}, + {"start", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4fork_5start, METH_VARARGS|METH_KEYWORDS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_fork[] = { + {(char *)"ref", __pyx_getprop_6gevent_5libev_8corecext_4fork_ref, __pyx_setprop_6gevent_5libev_8corecext_4fork_ref, (char *)0, 0}, + {(char *)"callback", __pyx_getprop_6gevent_5libev_8corecext_4fork_callback, __pyx_setprop_6gevent_5libev_8corecext_4fork_callback, (char *)0, 0}, + {(char *)"priority", __pyx_getprop_6gevent_5libev_8corecext_4fork_priority, __pyx_setprop_6gevent_5libev_8corecext_4fork_priority, (char *)0, 0}, + {(char *)"active", __pyx_getprop_6gevent_5libev_8corecext_4fork_active, 0, (char *)0, 0}, + {(char *)"pending", __pyx_getprop_6gevent_5libev_8corecext_4fork_pending, 0, (char *)0, 0}, + {(char *)"loop", __pyx_getprop_6gevent_5libev_8corecext_4fork_loop, __pyx_setprop_6gevent_5libev_8corecext_4fork_loop, (char *)0, 0}, + {(char *)"args", __pyx_getprop_6gevent_5libev_8corecext_4fork_args, __pyx_setprop_6gevent_5libev_8corecext_4fork_args, (char *)0, 0}, + {(char *)"_flags", __pyx_getprop_6gevent_5libev_8corecext_4fork__flags, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventFork_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.fork", /*tp_name*/ + sizeof(struct PyGeventForkObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_fork, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_1__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_fork, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_fork, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_fork, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_fork, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_4fork_7__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_fork, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_async(PyTypeObject *t, PyObject *a, PyObject *k) { + struct PyGeventAsyncObject *p; + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct PyGeventAsyncObject *)o); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + p->_callback = Py_None; Py_INCREF(Py_None); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_async(PyObject *o) { + struct PyGeventAsyncObject *p = (struct PyGeventAsyncObject *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->loop); + Py_CLEAR(p->_callback); + Py_CLEAR(p->args); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher(o); +} + +static int __pyx_tp_traverse_6gevent_5libev_8corecext_async(PyObject *o, visitproc v, void *a) { + int e; + struct PyGeventAsyncObject *p = (struct PyGeventAsyncObject *)o; + e = ((likely(__pyx_ptype_6gevent_5libev_8corecext_watcher)) ? ((__pyx_ptype_6gevent_5libev_8corecext_watcher->tp_traverse) ? __pyx_ptype_6gevent_5libev_8corecext_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_5libev_8corecext_async)); if (e) return e; + if (p->loop) { + e = (*v)(((PyObject*)p->loop), a); if (e) return e; + } + if (p->_callback) { + e = (*v)(p->_callback, a); if (e) return e; + } + if (p->args) { + e = (*v)(p->args, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_5libev_8corecext_async(PyObject *o) { + PyObject* tmp; + struct PyGeventAsyncObject *p = (struct PyGeventAsyncObject *)o; + if (likely(__pyx_ptype_6gevent_5libev_8corecext_watcher)) { if (__pyx_ptype_6gevent_5libev_8corecext_watcher->tp_clear) __pyx_ptype_6gevent_5libev_8corecext_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_5libev_8corecext_async); + tmp = ((PyObject*)p->loop); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_callback); + p->_callback = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->args); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5async_ref(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5async_3ref_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5async_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5async_3ref_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5async_callback(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5async_8callback_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5async_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5async_8callback_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5async_priority(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5async_8priority_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5async_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5async_8priority_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5async_active(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5async_6active_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5async_pending(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5async_7pending_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5async_loop(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5async_4loop_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5async_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5async_4loop_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_5async_4loop_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5async_args(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5async_4args_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5async_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5async_4args_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_5async_4args_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5async__flags(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5async_6_flags_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_async[] = { + {"stop", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_5async_1stop, METH_NOARGS, 0}, + {"feed", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_5async_3feed, METH_VARARGS|METH_KEYWORDS, 0}, + {"start", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_5async_5start, METH_VARARGS|METH_KEYWORDS, 0}, + {"send", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_5async_9send, METH_NOARGS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_async[] = { + {(char *)"ref", __pyx_getprop_6gevent_5libev_8corecext_5async_ref, __pyx_setprop_6gevent_5libev_8corecext_5async_ref, (char *)0, 0}, + {(char *)"callback", __pyx_getprop_6gevent_5libev_8corecext_5async_callback, __pyx_setprop_6gevent_5libev_8corecext_5async_callback, (char *)0, 0}, + {(char *)"priority", __pyx_getprop_6gevent_5libev_8corecext_5async_priority, __pyx_setprop_6gevent_5libev_8corecext_5async_priority, (char *)0, 0}, + {(char *)"active", __pyx_getprop_6gevent_5libev_8corecext_5async_active, 0, (char *)0, 0}, + {(char *)"pending", __pyx_getprop_6gevent_5libev_8corecext_5async_pending, 0, (char *)0, 0}, + {(char *)"loop", __pyx_getprop_6gevent_5libev_8corecext_5async_loop, __pyx_setprop_6gevent_5libev_8corecext_5async_loop, (char *)0, 0}, + {(char *)"args", __pyx_getprop_6gevent_5libev_8corecext_5async_args, __pyx_setprop_6gevent_5libev_8corecext_5async_args, (char *)0, 0}, + {(char *)"_flags", __pyx_getprop_6gevent_5libev_8corecext_5async__flags, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventAsync_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.async", /*tp_name*/ + sizeof(struct PyGeventAsyncObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_async, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_1__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_async, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_async, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_async, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_async, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_5async_7__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_async, /*tp_new*/ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_child(PyTypeObject *t, PyObject *a, PyObject *k) { + struct PyGeventChildObject *p; + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct PyGeventChildObject *)o); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + p->_callback = Py_None; Py_INCREF(Py_None); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_child(PyObject *o) { + struct PyGeventChildObject *p = (struct PyGeventChildObject *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->loop); + Py_CLEAR(p->_callback); + Py_CLEAR(p->args); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher(o); +} + +static int __pyx_tp_traverse_6gevent_5libev_8corecext_child(PyObject *o, visitproc v, void *a) { + int e; + struct PyGeventChildObject *p = (struct PyGeventChildObject *)o; + e = ((likely(__pyx_ptype_6gevent_5libev_8corecext_watcher)) ? ((__pyx_ptype_6gevent_5libev_8corecext_watcher->tp_traverse) ? __pyx_ptype_6gevent_5libev_8corecext_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_5libev_8corecext_child)); if (e) return e; + if (p->loop) { + e = (*v)(((PyObject*)p->loop), a); if (e) return e; + } + if (p->_callback) { + e = (*v)(p->_callback, a); if (e) return e; + } + if (p->args) { + e = (*v)(p->args, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_5libev_8corecext_child(PyObject *o) { + PyObject* tmp; + struct PyGeventChildObject *p = (struct PyGeventChildObject *)o; + if (likely(__pyx_ptype_6gevent_5libev_8corecext_watcher)) { if (__pyx_ptype_6gevent_5libev_8corecext_watcher->tp_clear) __pyx_ptype_6gevent_5libev_8corecext_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_5libev_8corecext_child); + tmp = ((PyObject*)p->loop); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_callback); + p->_callback = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->args); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5child_ref(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5child_3ref_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5child_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5child_3ref_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5child_callback(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5child_8callback_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5child_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5child_8callback_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5child_priority(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5child_8priority_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5child_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5child_8priority_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5child_active(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5child_6active_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5child_pending(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5child_7pending_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5child_pid(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5child_3pid_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5child_rpid(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5child_4rpid_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5child_rpid(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5child_4rpid_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5child_rstatus(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5child_rstatus(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5child_loop(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5child_4loop_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5child_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5child_4loop_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_5child_4loop_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5child_args(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5child_4args_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5child_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5child_4args_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_5child_4args_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5child__flags(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5child_6_flags_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_child[] = { + {"stop", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_5child_1stop, METH_NOARGS, 0}, + {"feed", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_5child_3feed, METH_VARARGS|METH_KEYWORDS, 0}, + {"start", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_5child_5start, METH_VARARGS|METH_KEYWORDS, 0}, + {"_format", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_5child_9_format, METH_NOARGS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_child[] = { + {(char *)"ref", __pyx_getprop_6gevent_5libev_8corecext_5child_ref, __pyx_setprop_6gevent_5libev_8corecext_5child_ref, (char *)0, 0}, + {(char *)"callback", __pyx_getprop_6gevent_5libev_8corecext_5child_callback, __pyx_setprop_6gevent_5libev_8corecext_5child_callback, (char *)0, 0}, + {(char *)"priority", __pyx_getprop_6gevent_5libev_8corecext_5child_priority, __pyx_setprop_6gevent_5libev_8corecext_5child_priority, (char *)0, 0}, + {(char *)"active", __pyx_getprop_6gevent_5libev_8corecext_5child_active, 0, (char *)0, 0}, + {(char *)"pending", __pyx_getprop_6gevent_5libev_8corecext_5child_pending, 0, (char *)0, 0}, + {(char *)"pid", __pyx_getprop_6gevent_5libev_8corecext_5child_pid, 0, (char *)0, 0}, + {(char *)"rpid", __pyx_getprop_6gevent_5libev_8corecext_5child_rpid, __pyx_setprop_6gevent_5libev_8corecext_5child_rpid, (char *)0, 0}, + {(char *)"rstatus", __pyx_getprop_6gevent_5libev_8corecext_5child_rstatus, __pyx_setprop_6gevent_5libev_8corecext_5child_rstatus, (char *)0, 0}, + {(char *)"loop", __pyx_getprop_6gevent_5libev_8corecext_5child_loop, __pyx_setprop_6gevent_5libev_8corecext_5child_loop, (char *)0, 0}, + {(char *)"args", __pyx_getprop_6gevent_5libev_8corecext_5child_args, __pyx_setprop_6gevent_5libev_8corecext_5child_args, (char *)0, 0}, + {(char *)"_flags", __pyx_getprop_6gevent_5libev_8corecext_5child__flags, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventChild_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.child", /*tp_name*/ + sizeof(struct PyGeventChildObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_child, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_1__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_child, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_child, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_child, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_child, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_5child_7__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_child, /*tp_new*/ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_stat(PyTypeObject *t, PyObject *a, PyObject *k) { + struct PyGeventStatObject *p; + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct PyGeventStatObject *)o); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + p->_callback = Py_None; Py_INCREF(Py_None); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->path = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_paths = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_stat(PyObject *o) { + struct PyGeventStatObject *p = (struct PyGeventStatObject *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->loop); + Py_CLEAR(p->_callback); + Py_CLEAR(p->args); + Py_CLEAR(p->path); + Py_CLEAR(p->_paths); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher(o); +} + +static int __pyx_tp_traverse_6gevent_5libev_8corecext_stat(PyObject *o, visitproc v, void *a) { + int e; + struct PyGeventStatObject *p = (struct PyGeventStatObject *)o; + e = ((likely(__pyx_ptype_6gevent_5libev_8corecext_watcher)) ? ((__pyx_ptype_6gevent_5libev_8corecext_watcher->tp_traverse) ? __pyx_ptype_6gevent_5libev_8corecext_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_5libev_8corecext_stat)); if (e) return e; + if (p->loop) { + e = (*v)(((PyObject*)p->loop), a); if (e) return e; + } + if (p->_callback) { + e = (*v)(p->_callback, a); if (e) return e; + } + if (p->args) { + e = (*v)(p->args, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_5libev_8corecext_stat(PyObject *o) { + PyObject* tmp; + struct PyGeventStatObject *p = (struct PyGeventStatObject *)o; + if (likely(__pyx_ptype_6gevent_5libev_8corecext_watcher)) { if (__pyx_ptype_6gevent_5libev_8corecext_watcher->tp_clear) __pyx_ptype_6gevent_5libev_8corecext_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_5libev_8corecext_stat); + tmp = ((PyObject*)p->loop); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_callback); + p->_callback = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->args); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat_ref(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_3ref_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_4stat_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_3ref_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat_callback(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_8callback_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_4stat_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_8callback_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat_priority(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_8priority_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_4stat_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_8priority_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat_active(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_6active_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat_pending(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_7pending_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat_attr(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_4attr_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat_prev(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_4prev_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat_interval(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_8interval_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat_loop(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_4loop_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_4stat_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_4loop_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_4stat_4loop_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat_args(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_4args_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_4stat_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_4args_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_4stat_4args_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat__flags(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_6_flags_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat_path(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_4path_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat__paths(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_6_paths_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_stat[] = { + {"stop", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4stat_1stop, METH_NOARGS, 0}, + {"feed", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4stat_3feed, METH_VARARGS|METH_KEYWORDS, 0}, + {"start", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4stat_5start, METH_VARARGS|METH_KEYWORDS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_stat[] = { + {(char *)"ref", __pyx_getprop_6gevent_5libev_8corecext_4stat_ref, __pyx_setprop_6gevent_5libev_8corecext_4stat_ref, (char *)0, 0}, + {(char *)"callback", __pyx_getprop_6gevent_5libev_8corecext_4stat_callback, __pyx_setprop_6gevent_5libev_8corecext_4stat_callback, (char *)0, 0}, + {(char *)"priority", __pyx_getprop_6gevent_5libev_8corecext_4stat_priority, __pyx_setprop_6gevent_5libev_8corecext_4stat_priority, (char *)0, 0}, + {(char *)"active", __pyx_getprop_6gevent_5libev_8corecext_4stat_active, 0, (char *)0, 0}, + {(char *)"pending", __pyx_getprop_6gevent_5libev_8corecext_4stat_pending, 0, (char *)0, 0}, + {(char *)"attr", __pyx_getprop_6gevent_5libev_8corecext_4stat_attr, 0, (char *)0, 0}, + {(char *)"prev", __pyx_getprop_6gevent_5libev_8corecext_4stat_prev, 0, (char *)0, 0}, + {(char *)"interval", __pyx_getprop_6gevent_5libev_8corecext_4stat_interval, 0, (char *)0, 0}, + {(char *)"loop", __pyx_getprop_6gevent_5libev_8corecext_4stat_loop, __pyx_setprop_6gevent_5libev_8corecext_4stat_loop, (char *)0, 0}, + {(char *)"args", __pyx_getprop_6gevent_5libev_8corecext_4stat_args, __pyx_setprop_6gevent_5libev_8corecext_4stat_args, (char *)0, 0}, + {(char *)"_flags", __pyx_getprop_6gevent_5libev_8corecext_4stat__flags, 0, (char *)0, 0}, + {(char *)"path", __pyx_getprop_6gevent_5libev_8corecext_4stat_path, 0, (char *)0, 0}, + {(char *)"_paths", __pyx_getprop_6gevent_5libev_8corecext_4stat__paths, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventStat_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.stat", /*tp_name*/ + sizeof(struct PyGeventStatObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_stat, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_1__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_stat, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_stat, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_stat, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_stat, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_4stat_7__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_stat, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *__pyx_freelist_6gevent_5libev_8corecext___pyx_scope_struct__genexpr[8]; +static int __pyx_freecount_6gevent_5libev_8corecext___pyx_scope_struct__genexpr = 0; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6gevent_5libev_8corecext___pyx_scope_struct__genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr)))) { + o = (PyObject*)__pyx_freelist_6gevent_5libev_8corecext___pyx_scope_struct__genexpr[--__pyx_freecount_6gevent_5libev_8corecext___pyx_scope_struct__genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext___pyx_scope_struct__genexpr(PyObject *o) { + struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *p = (struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_flag); + Py_CLEAR(p->__pyx_v_string); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6gevent_5libev_8corecext___pyx_scope_struct__genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr)))) { + __pyx_freelist_6gevent_5libev_8corecext___pyx_scope_struct__genexpr[__pyx_freecount_6gevent_5libev_8corecext___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_6gevent_5libev_8corecext___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *p = (struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)o; + if (p->__pyx_v_flag) { + e = (*v)(p->__pyx_v_flag, a); if (e) return e; + } + if (p->__pyx_v_string) { + e = (*v)(p->__pyx_v_string, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_5libev_8corecext___pyx_scope_struct__genexpr(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *p = (struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)o; + tmp = ((PyObject*)p->__pyx_v_flag); + p->__pyx_v_flag = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_string); + p->__pyx_v_string = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.__pyx_scope_struct__genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext___pyx_scope_struct__genexpr, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext___pyx_scope_struct__genexpr, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext___pyx_scope_struct__genexpr, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext___pyx_scope_struct__genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {"_flags_to_list", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_5_flags_to_list, METH_O, 0}, + {"_flags_to_int", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_7_flags_to_int, METH_O, 0}, + {"_check_flags", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_9_check_flags, METH_O, 0}, + {"_events_to_str", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_11_events_to_str, METH_O, 0}, + {"set_syserr_cb", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_21set_syserr_cb, METH_O, 0}, + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + "corecext", + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, + {&__pyx_n_s_ASYNC, __pyx_k_ASYNC, sizeof(__pyx_k_ASYNC), 0, 0, 1, 1}, + {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, + {&__pyx_n_s_BACKEND_EPOLL, __pyx_k_BACKEND_EPOLL, sizeof(__pyx_k_BACKEND_EPOLL), 0, 0, 1, 1}, + {&__pyx_n_s_BACKEND_KQUEUE, __pyx_k_BACKEND_KQUEUE, sizeof(__pyx_k_BACKEND_KQUEUE), 0, 0, 1, 1}, + {&__pyx_n_s_BACKEND_POLL, __pyx_k_BACKEND_POLL, sizeof(__pyx_k_BACKEND_POLL), 0, 0, 1, 1}, + {&__pyx_n_s_BACKEND_PORT, __pyx_k_BACKEND_PORT, sizeof(__pyx_k_BACKEND_PORT), 0, 0, 1, 1}, + {&__pyx_n_s_BACKEND_SELECT, __pyx_k_BACKEND_SELECT, sizeof(__pyx_k_BACKEND_SELECT), 0, 0, 1, 1}, + {&__pyx_n_s_CHECK, __pyx_k_CHECK, sizeof(__pyx_k_CHECK), 0, 0, 1, 1}, + {&__pyx_n_s_CHILD, __pyx_k_CHILD, sizeof(__pyx_k_CHILD), 0, 0, 1, 1}, + {&__pyx_n_s_CLEANUP, __pyx_k_CLEANUP, sizeof(__pyx_k_CLEANUP), 0, 0, 1, 1}, + {&__pyx_n_s_CUSTOM, __pyx_k_CUSTOM, sizeof(__pyx_k_CUSTOM), 0, 0, 1, 1}, + {&__pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_k_C_Users_appveyor_AppData_Local_T, sizeof(__pyx_k_C_Users_appveyor_AppData_Local_T), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_set_priority_of_an_active, __pyx_k_Cannot_set_priority_of_an_active, sizeof(__pyx_k_Cannot_set_priority_of_an_active), 0, 0, 1, 0}, + {&__pyx_n_s_EMBED, __pyx_k_EMBED, sizeof(__pyx_k_EMBED), 0, 0, 1, 1}, + {&__pyx_n_s_ERROR, __pyx_k_ERROR, sizeof(__pyx_k_ERROR), 0, 0, 1, 1}, + {&__pyx_n_s_EVENTS, __pyx_k_EVENTS, sizeof(__pyx_k_EVENTS), 0, 0, 1, 1}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_n_s_EV_USE_4HEAP, __pyx_k_EV_USE_4HEAP, sizeof(__pyx_k_EV_USE_4HEAP), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_CLOCK_SYSCALL, __pyx_k_EV_USE_CLOCK_SYSCALL, sizeof(__pyx_k_EV_USE_CLOCK_SYSCALL), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_EVENTFD, __pyx_k_EV_USE_EVENTFD, sizeof(__pyx_k_EV_USE_EVENTFD), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_FLOOR, __pyx_k_EV_USE_FLOOR, sizeof(__pyx_k_EV_USE_FLOOR), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_INOTIFY, __pyx_k_EV_USE_INOTIFY, sizeof(__pyx_k_EV_USE_INOTIFY), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_MONOTONIC, __pyx_k_EV_USE_MONOTONIC, sizeof(__pyx_k_EV_USE_MONOTONIC), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_NANOSLEEP, __pyx_k_EV_USE_NANOSLEEP, sizeof(__pyx_k_EV_USE_NANOSLEEP), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_REALTIME, __pyx_k_EV_USE_REALTIME, sizeof(__pyx_k_EV_USE_REALTIME), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_SIGNALFD, __pyx_k_EV_USE_SIGNALFD, sizeof(__pyx_k_EV_USE_SIGNALFD), 0, 0, 1, 1}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_kp_s_Expected_callable_not_r, __pyx_k_Expected_callable_not_r, sizeof(__pyx_k_Expected_callable_not_r), 0, 0, 1, 0}, + {&__pyx_kp_s_Expected_callable_or_None_got_r, __pyx_k_Expected_callable_or_None_got_r, sizeof(__pyx_k_Expected_callable_or_None_got_r), 0, 0, 1, 0}, + {&__pyx_n_s_FORK, __pyx_k_FORK, sizeof(__pyx_k_FORK), 0, 0, 1, 1}, + {&__pyx_n_s_FORKCHECK, __pyx_k_FORKCHECK, sizeof(__pyx_k_FORKCHECK), 0, 0, 1, 1}, + {&__pyx_n_s_IDLE, __pyx_k_IDLE, sizeof(__pyx_k_IDLE), 0, 0, 1, 1}, + {&__pyx_n_s_IOFDSET, __pyx_k_IOFDSET, sizeof(__pyx_k_IOFDSET), 0, 0, 1, 1}, + {&__pyx_kp_s_Invalid_backend_or_flag_s_Possib, __pyx_k_Invalid_backend_or_flag_s_Possib, sizeof(__pyx_k_Invalid_backend_or_flag_s_Possib), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_value_for_backend_0x_x, __pyx_k_Invalid_value_for_backend_0x_x, sizeof(__pyx_k_Invalid_value_for_backend_0x_x), 0, 0, 1, 0}, + {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, + {&__pyx_n_s_LIBEV_EMBED, __pyx_k_LIBEV_EMBED, sizeof(__pyx_k_LIBEV_EMBED), 0, 0, 1, 1}, + {&__pyx_n_s_MAXPRI, __pyx_k_MAXPRI, sizeof(__pyx_k_MAXPRI), 0, 0, 1, 1}, + {&__pyx_n_s_MINPRI, __pyx_k_MINPRI, sizeof(__pyx_k_MINPRI), 0, 0, 1, 1}, + {&__pyx_n_s_NOINOTIFY, __pyx_k_NOINOTIFY, sizeof(__pyx_k_NOINOTIFY), 0, 0, 1, 1}, + {&__pyx_n_s_NONE, __pyx_k_NONE, sizeof(__pyx_k_NONE), 0, 0, 1, 1}, + {&__pyx_n_s_NOSIGMASK, __pyx_k_NOSIGMASK, sizeof(__pyx_k_NOSIGMASK), 0, 0, 1, 1}, + {&__pyx_n_s_NSIG, __pyx_k_NSIG, sizeof(__pyx_k_NSIG), 0, 0, 1, 1}, + {&__pyx_n_s_PERIODIC, __pyx_k_PERIODIC, sizeof(__pyx_k_PERIODIC), 0, 0, 1, 1}, + {&__pyx_n_s_PREPARE, __pyx_k_PREPARE, sizeof(__pyx_k_PREPARE), 0, 0, 1, 1}, + {&__pyx_n_s_READ, __pyx_k_READ, sizeof(__pyx_k_READ), 0, 0, 1, 1}, + {&__pyx_n_s_READWRITE, __pyx_k_READWRITE, sizeof(__pyx_k_READWRITE), 0, 0, 1, 1}, + {&__pyx_n_s_SIGNAL, __pyx_k_SIGNAL, sizeof(__pyx_k_SIGNAL), 0, 0, 1, 1}, + {&__pyx_n_s_SIGNALFD, __pyx_k_SIGNALFD, sizeof(__pyx_k_SIGNALFD), 0, 0, 1, 1}, + {&__pyx_n_s_STAT, __pyx_k_STAT, sizeof(__pyx_k_STAT), 0, 0, 1, 1}, + {&__pyx_n_s_SYSERR_CALLBACK, __pyx_k_SYSERR_CALLBACK, sizeof(__pyx_k_SYSERR_CALLBACK), 0, 0, 1, 1}, + {&__pyx_n_s_SystemError, __pyx_k_SystemError, sizeof(__pyx_k_SystemError), 0, 0, 1, 1}, + {&__pyx_n_s_TIMER, __pyx_k_TIMER, sizeof(__pyx_k_TIMER), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_UNDEF, __pyx_k_UNDEF, sizeof(__pyx_k_UNDEF), 0, 0, 1, 1}, + {&__pyx_kp_s_Unsupported_backend_s, __pyx_k_Unsupported_backend_s, sizeof(__pyx_k_Unsupported_backend_s), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_WRITE, __pyx_k_WRITE, sizeof(__pyx_k_WRITE), 0, 0, 1, 1}, + {&__pyx_kp_s__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 0, 1, 0}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + {&__pyx_kp_s__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 0, 1, 0}, + {&__pyx_kp_s__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 1, 0}, +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_kp_s__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 1, 0}, +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_kp_s__27, __pyx_k__27, sizeof(__pyx_k__27), 0, 0, 1, 0}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + {&__pyx_kp_s__28, __pyx_k__28, sizeof(__pyx_k__28), 0, 0, 1, 0}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0}, + {&__pyx_kp_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 0}, + {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0}, + {&__pyx_n_s_active, __pyx_k_active, sizeof(__pyx_k_active), 0, 0, 1, 1}, + {&__pyx_kp_s_active_2, __pyx_k_active_2, sizeof(__pyx_k_active_2), 0, 0, 1, 0}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_n_s_activecnt, __pyx_k_activecnt, sizeof(__pyx_k_activecnt), 0, 0, 1, 1}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_n_s_after, __pyx_k_after, sizeof(__pyx_k_after), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_kp_s_args_r, __pyx_k_args_r, sizeof(__pyx_k_args_r), 0, 0, 1, 0}, + {&__pyx_n_s_backend, __pyx_k_backend, sizeof(__pyx_k_backend), 0, 0, 1, 1}, + {&__pyx_n_s_basestring, __pyx_k_basestring, sizeof(__pyx_k_basestring), 0, 0, 1, 1}, + {&__pyx_n_s_builtins, __pyx_k_builtins, sizeof(__pyx_k_builtins), 0, 0, 1, 1}, + {&__pyx_n_s_callback, __pyx_k_callback, sizeof(__pyx_k_callback), 0, 0, 1, 1}, + {&__pyx_kp_s_callback_must_be_callable_not_No, __pyx_k_callback_must_be_callable_not_No, sizeof(__pyx_k_callback_must_be_callable_not_No), 0, 0, 1, 0}, + {&__pyx_kp_s_callback_r, __pyx_k_callback_r, sizeof(__pyx_k_callback_r), 0, 0, 1, 0}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_kp_s_child_watchers_are_only_availabl, __pyx_k_child_watchers_are_only_availabl, sizeof(__pyx_k_child_watchers_are_only_availabl), 0, 0, 1, 0}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_context, __pyx_k_context, sizeof(__pyx_k_context), 0, 0, 1, 1}, + {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, + {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, + {&__pyx_kp_s_default_2, __pyx_k_default_2, sizeof(__pyx_k_default_2), 0, 0, 1, 0}, + {&__pyx_n_s_default_handle_error, __pyx_k_default_handle_error, sizeof(__pyx_k_default_handle_error), 0, 0, 1, 1}, + {&__pyx_n_s_destroyed, __pyx_k_destroyed, sizeof(__pyx_k_destroyed), 0, 0, 1, 1}, + {&__pyx_n_s_embeddable_backends, __pyx_k_embeddable_backends, sizeof(__pyx_k_embeddable_backends), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_epoll, __pyx_k_epoll, sizeof(__pyx_k_epoll), 0, 0, 1, 1}, + {&__pyx_n_s_errno, __pyx_k_errno, sizeof(__pyx_k_errno), 0, 0, 1, 1}, + {&__pyx_kp_s_ev_default_loop_s_failed, __pyx_k_ev_default_loop_s_failed, sizeof(__pyx_k_ev_default_loop_s_failed), 0, 0, 1, 0}, + {&__pyx_kp_s_ev_loop_new_s_failed, __pyx_k_ev_loop_new_s_failed, sizeof(__pyx_k_ev_loop_new_s_failed), 0, 0, 1, 0}, + {&__pyx_n_s_events, __pyx_k_events, sizeof(__pyx_k_events), 0, 0, 1, 1}, + {&__pyx_n_s_events_2, __pyx_k_events_2, sizeof(__pyx_k_events_2), 0, 0, 1, 1}, + {&__pyx_n_s_events_str, __pyx_k_events_str, sizeof(__pyx_k_events_str), 0, 0, 1, 1}, + {&__pyx_n_s_fd, __pyx_k_fd, sizeof(__pyx_k_fd), 0, 0, 1, 1}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_kp_s_fd_must_be_non_negative_r, __pyx_k_fd_must_be_non_negative_r, sizeof(__pyx_k_fd_must_be_non_negative_r), 0, 0, 1, 0}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_kp_s_fd_s_events_s, __pyx_k_fd_s_events_s, sizeof(__pyx_k_fd_s_events_s), 0, 0, 1, 0}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_n_s_fileno, __pyx_k_fileno, sizeof(__pyx_k_fileno), 0, 0, 1, 1}, + {&__pyx_kp_s_fileno_2, __pyx_k_fileno_2, sizeof(__pyx_k_fileno_2), 0, 0, 1, 0}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_flags_2, __pyx_k_flags_2, sizeof(__pyx_k_flags_2), 0, 0, 1, 1}, + {&__pyx_n_s_flags_str2int, __pyx_k_flags_str2int, sizeof(__pyx_k_flags_str2int), 0, 0, 1, 1}, + {&__pyx_n_s_forkcheck, __pyx_k_forkcheck, sizeof(__pyx_k_forkcheck), 0, 0, 1, 1}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_n_s_format_details, __pyx_k_format_details, sizeof(__pyx_k_format_details), 0, 0, 1, 1}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, + {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, + {&__pyx_n_s_get_header_version, __pyx_k_get_header_version, sizeof(__pyx_k_get_header_version), 0, 0, 1, 1}, + {&__pyx_n_s_get_version, __pyx_k_get_version, sizeof(__pyx_k_get_version), 0, 0, 1, 1}, + {&__pyx_n_s_getfilesystemencoding, __pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 0, 1, 1}, + {&__pyx_kp_s_gevent_core_EVENTS, __pyx_k_gevent_core_EVENTS, sizeof(__pyx_k_gevent_core_EVENTS), 0, 0, 1, 0}, + {&__pyx_n_s_gevent_libev_corecext, __pyx_k_gevent_libev_corecext, sizeof(__pyx_k_gevent_libev_corecext), 0, 0, 1, 1}, + {&__pyx_n_s_handle_error, __pyx_k_handle_error, sizeof(__pyx_k_handle_error), 0, 0, 1, 1}, + {&__pyx_n_s_handle_syserr, __pyx_k_handle_syserr, sizeof(__pyx_k_handle_syserr), 0, 0, 1, 1}, + {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1}, + {&__pyx_n_s_how, __pyx_k_how, sizeof(__pyx_k_how), 0, 0, 1, 1}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_kp_s_illegal_event_mask_r, __pyx_k_illegal_event_mask_r, sizeof(__pyx_k_illegal_event_mask_r), 0, 0, 1, 0}, + {&__pyx_kp_s_illegal_signal_number_r, __pyx_k_illegal_signal_number_r, sizeof(__pyx_k_illegal_signal_number_r), 0, 0, 1, 0}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_interval, __pyx_k_interval, sizeof(__pyx_k_interval), 0, 0, 1, 1}, + {&__pyx_kp_s_io_watcher_attribute_events_is, __pyx_k_io_watcher_attribute_events_is, sizeof(__pyx_k_io_watcher_attribute_events_is), 0, 0, 1, 0}, + {&__pyx_kp_s_io_watcher_attribute_fd_is_read, __pyx_k_io_watcher_attribute_fd_is_read, sizeof(__pyx_k_io_watcher_attribute_fd_is_read), 0, 0, 1, 0}, + {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, + {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, + {&__pyx_n_s_kqueue, __pyx_k_kqueue, sizeof(__pyx_k_kqueue), 0, 0, 1, 1}, + {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1}, + {&__pyx_kp_s_libev_d_02d, __pyx_k_libev_d_02d, sizeof(__pyx_k_libev_d_02d), 0, 0, 1, 0}, + {&__pyx_n_s_loop, __pyx_k_loop, sizeof(__pyx_k_loop), 0, 0, 1, 1}, + {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_noenv, __pyx_k_noenv, sizeof(__pyx_k_noenv), 0, 0, 1, 1}, + {&__pyx_n_s_noinotify, __pyx_k_noinotify, sizeof(__pyx_k_noinotify), 0, 0, 1, 1}, + {&__pyx_n_s_nosigmask, __pyx_k_nosigmask, sizeof(__pyx_k_nosigmask), 0, 0, 1, 1}, + {&__pyx_n_s_nowait, __pyx_k_nowait, sizeof(__pyx_k_nowait), 0, 0, 1, 1}, + {&__pyx_n_s_once, __pyx_k_once, sizeof(__pyx_k_once), 0, 0, 1, 1}, + {&__pyx_kp_s_operation_on_destroyed_loop, __pyx_k_operation_on_destroyed_loop, sizeof(__pyx_k_operation_on_destroyed_loop), 0, 0, 1, 0}, + {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, + {&__pyx_n_s_pass_events, __pyx_k_pass_events, sizeof(__pyx_k_pass_events), 0, 0, 1, 1}, + {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, + {&__pyx_n_s_pending, __pyx_k_pending, sizeof(__pyx_k_pending), 0, 0, 1, 1}, + {&__pyx_kp_s_pending_2, __pyx_k_pending_2, sizeof(__pyx_k_pending_2), 0, 0, 1, 0}, + {&__pyx_kp_s_pending_s, __pyx_k_pending_s, sizeof(__pyx_k_pending_s), 0, 0, 1, 0}, + {&__pyx_n_s_pendingcnt, __pyx_k_pendingcnt, sizeof(__pyx_k_pendingcnt), 0, 0, 1, 1}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_n_s_pid, __pyx_k_pid, sizeof(__pyx_k_pid), 0, 0, 1, 1}, + {&__pyx_kp_s_pid_r_rstatus_r, __pyx_k_pid_r_rstatus_r, sizeof(__pyx_k_pid_r_rstatus_r), 0, 0, 1, 0}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_n_s_poll, __pyx_k_poll, sizeof(__pyx_k_poll), 0, 0, 1, 1}, + {&__pyx_n_s_port, __pyx_k_port, sizeof(__pyx_k_port), 0, 0, 1, 1}, + {&__pyx_n_s_print_exc, __pyx_k_print_exc, sizeof(__pyx_k_print_exc), 0, 0, 1, 1}, + {&__pyx_n_s_print_exception, __pyx_k_print_exception, sizeof(__pyx_k_print_exception), 0, 0, 1, 1}, + {&__pyx_n_s_priority, __pyx_k_priority, sizeof(__pyx_k_priority), 0, 0, 1, 1}, + {&__pyx_n_s_ptr, __pyx_k_ptr, sizeof(__pyx_k_ptr), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_recommended_backends, __pyx_k_recommended_backends, sizeof(__pyx_k_recommended_backends), 0, 0, 1, 1}, + {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_kp_s_ref_2, __pyx_k_ref_2, sizeof(__pyx_k_ref_2), 0, 0, 1, 0}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_n_s_repeat, __pyx_k_repeat, sizeof(__pyx_k_repeat), 0, 0, 1, 1}, + {&__pyx_kp_s_repeat_must_be_positive_or_zero, __pyx_k_repeat_must_be_positive_or_zero, sizeof(__pyx_k_repeat_must_be_positive_or_zero), 0, 0, 1, 0}, + {&__pyx_n_s_revents, __pyx_k_revents, sizeof(__pyx_k_revents), 0, 0, 1, 1}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_n_s_rstatus, __pyx_k_rstatus, sizeof(__pyx_k_rstatus), 0, 0, 1, 1}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_kp_s_s_at_0x_x_s, __pyx_k_s_at_0x_x_s, sizeof(__pyx_k_s_at_0x_x_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_at_0x_x_s_2, __pyx_k_s_at_0x_x_s_2, sizeof(__pyx_k_s_at_0x_x_s_2), 0, 0, 1, 0}, + {&__pyx_n_s_select, __pyx_k_select, sizeof(__pyx_k_select), 0, 0, 1, 1}, + {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_n_s_sigfd, __pyx_k_sigfd, sizeof(__pyx_k_sigfd), 0, 0, 1, 1}, + {&__pyx_kp_s_sigfd_2, __pyx_k_sigfd_2, sizeof(__pyx_k_sigfd_2), 0, 0, 1, 0}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_n_s_signal, __pyx_k_signal, sizeof(__pyx_k_signal), 0, 0, 1, 1}, + {&__pyx_n_s_signalfd, __pyx_k_signalfd, sizeof(__pyx_k_signalfd), 0, 0, 1, 1}, + {&__pyx_n_s_signalmodule, __pyx_k_signalmodule, sizeof(__pyx_k_signalmodule), 0, 0, 1, 1}, + {&__pyx_n_s_signalnum, __pyx_k_signalnum, sizeof(__pyx_k_signalnum), 0, 0, 1, 1}, + {&__pyx_n_s_signum, __pyx_k_signum, sizeof(__pyx_k_signum), 0, 0, 1, 1}, + {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, + {&__pyx_n_s_stop_watchers, __pyx_k_stop_watchers, sizeof(__pyx_k_stop_watchers), 0, 0, 1, 1}, + {&__pyx_kp_s_stopped, __pyx_k_stopped, sizeof(__pyx_k_stopped), 0, 0, 1, 0}, + {&__pyx_n_s_strerror, __pyx_k_strerror, sizeof(__pyx_k_strerror), 0, 0, 1, 1}, + {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1}, + {&__pyx_n_s_supported_backends, __pyx_k_supported_backends, sizeof(__pyx_k_supported_backends), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_tb, __pyx_k_tb, sizeof(__pyx_k_tb), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_n_s_trace, __pyx_k_trace, sizeof(__pyx_k_trace), 0, 0, 1, 1}, +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, + {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 16, __pyx_L1_error) + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 183, __pyx_L1_error) + __pyx_builtin_hex = __Pyx_GetBuiltinName(__pyx_n_s_hex); if (!__pyx_builtin_hex) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_builtin_SystemError = __Pyx_GetBuiltinName(__pyx_n_s_SystemError); if (!__pyx_builtin_SystemError) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 431, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 561, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 759, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 783, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 403, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 421, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 438, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 462, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 534, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 737, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 604, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 613, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 613, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 765, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 621, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 621, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 783, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 737, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 789, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 803, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 737, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 805, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 765, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 765, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_io_watcher_attribute_fd_is_read); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 871, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 783, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 783, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_io_watcher_attribute_events_is); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 883, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 789, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 789, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 922, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 803, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 803, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 950, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 805, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 805, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 968, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_io_watcher_attribute_fd_is_read); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 871, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_io_watcher_attribute_fd_is_read); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 871, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 974, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_io_watcher_attribute_events_is); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 883, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_io_watcher_attribute_events_is); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 883, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 988, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 922, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 922, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 990, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 950, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 950, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 1036, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 968, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 968, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 1067, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 974, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 974, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 1095, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 988, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 988, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 1113, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 990, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 990, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 1119, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 1036, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 1036, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 1133, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 1067, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 1067, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 1135, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 1095, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 1095, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 1192, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 1113, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 1113, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 1220, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 1119, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 1119, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 1238, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 1133, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 1133, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 1244, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 1135, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 1135, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 1258, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 1192, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 1192, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 1260, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 1220, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 1220, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 1311, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 1238, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 1238, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 1339, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 1244, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 1244, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 1357, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 1258, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 1258, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 1363, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 1260, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 1260, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 1377, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 1311, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 1311, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 1379, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 1339, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 1339, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 1430, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 1357, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 1357, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 1458, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 1363, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 1363, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 1476, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 1377, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 1377, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 1482, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 1379, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 1379, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 1496, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 1430, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 1430, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 1498, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 1458, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 1458, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 1549, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 1476, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 1476, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 1577, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 1482, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 1482, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 1595, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 1496, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 1496, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 1601, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 1498, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 1498, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 1615, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 1549, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 1549, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 1617, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 1577, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 1577, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 1668, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 1595, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 1595, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 1696, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 1601, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__70); + __Pyx_GIVEREF(__pyx_tuple__70); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 1601, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 1714, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 1615, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 1615, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 1720, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 1617, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__72); + __Pyx_GIVEREF(__pyx_tuple__72); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 1617, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 1734, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 1668, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 1668, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 1736, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 1696, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__74); + __Pyx_GIVEREF(__pyx_tuple__74); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 1696, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 1771, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 1714, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__75); + __Pyx_GIVEREF(__pyx_tuple__75); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 1714, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 1794, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 1939, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 1720, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__76); + __Pyx_GIVEREF(__pyx_tuple__76); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 1720, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 1822, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 1967, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 1734, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 1734, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 1840, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 1985, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 1736, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__78); + __Pyx_GIVEREF(__pyx_tuple__78); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 1736, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 1846, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 1991, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 1771, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 1771, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 1860, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 2005, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 1939, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 1794, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__80); + __Pyx_GIVEREF(__pyx_tuple__80); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 1794, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 1939, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 1862, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 2007, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 1967, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 1822, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__81); + __Pyx_GIVEREF(__pyx_tuple__81); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 1822, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 1967, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_child_watchers_are_only_availabl); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 1886, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__82 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 16, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 1985, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 1840, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__82); + __Pyx_GIVEREF(__pyx_tuple__82); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 1840, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 1985, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 1939, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__83 = PyTuple_Pack(1, __pyx_n_s_os); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 17, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 1991, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 1846, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__83); + __Pyx_GIVEREF(__pyx_tuple__83); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 1846, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 1991, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 1967, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__84 = PyTuple_Pack(1, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 18, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 2005, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 1860, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__84); + __Pyx_GIVEREF(__pyx_tuple__84); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 1860, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 2005, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 1985, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__85 = PyTuple_Pack(1, __pyx_n_s_signal); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 19, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 2007, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 1862, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__85); + __Pyx_GIVEREF(__pyx_tuple__85); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 1862, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 2007, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 1991, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__86 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 16, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_child_watchers_are_only_availabl); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 1886, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__86); + __Pyx_GIVEREF(__pyx_tuple__86); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_child_watchers_are_only_availabl); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 1886, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__87 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 16, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 2005, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__87 = PyTuple_Pack(1, __pyx_n_s_os); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 17, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 1939, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__87); + __Pyx_GIVEREF(__pyx_tuple__87); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 1939, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__88 = PyTuple_Pack(1, __pyx_n_s_os); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 17, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 2007, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__88 = PyTuple_Pack(1, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 18, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 1967, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__88); + __Pyx_GIVEREF(__pyx_tuple__88); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__89 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 1967, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__89 = PyTuple_Pack(1, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 18, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__89 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 16, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__89 = PyTuple_Pack(1, __pyx_n_s_signal); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 19, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__89 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 1985, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__89); + __Pyx_GIVEREF(__pyx_tuple__89); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__90 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 1985, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_tuple__90 = PyTuple_Pack(1, __pyx_n_s_signal); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 19, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__90 = PyTuple_Pack(1, __pyx_n_s_os); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 17, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_get_version, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(0, 107, __pyx_L1_error) + + __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_get_header_version, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 111, __pyx_L1_error) + + __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_supported_backends, 220, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(0, 220, __pyx_L1_error) + + __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_recommended_backends, 224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 224, __pyx_L1_error) + + __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_embeddable_backends, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 228, __pyx_L1_error) + + __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_time, 232, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 232, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__90 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 1991, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__90); + __Pyx_GIVEREF(__pyx_tuple__90); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__91 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 1991, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__91 = PyTuple_Pack(1, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 18, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__91 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 2005, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__91); + __Pyx_GIVEREF(__pyx_tuple__91); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__92 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 2005, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__92 = PyTuple_Pack(1, __pyx_n_s_signal); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 19, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__92 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 2007, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__92); + __Pyx_GIVEREF(__pyx_tuple__92); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__93 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 2007, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_get_version, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 107, __pyx_L1_error) + + __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_get_header_version, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 111, __pyx_L1_error) + + __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_supported_backends, 220, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 220, __pyx_L1_error) + + __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_recommended_backends, 224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 224, __pyx_L1_error) + + __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_embeddable_backends, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 228, __pyx_L1_error) + + __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_time, 232, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 232, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_get_version, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 107, __pyx_L1_error) + + __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_get_header_version, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 111, __pyx_L1_error) + + __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_supported_backends, 220, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(0, 220, __pyx_L1_error) + + __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_recommended_backends, 224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 224, __pyx_L1_error) + + __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_embeddable_backends, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(0, 228, __pyx_L1_error) + + __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_time, 232, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 232, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__93 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 16, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__93); + __Pyx_GIVEREF(__pyx_tuple__93); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__94 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 16, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__94 = PyTuple_Pack(1, __pyx_n_s_os); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 17, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__94); + __Pyx_GIVEREF(__pyx_tuple__94); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__95 = PyTuple_Pack(1, __pyx_n_s_os); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 17, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__95 = PyTuple_Pack(1, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 18, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__95); + __Pyx_GIVEREF(__pyx_tuple__95); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__96 = PyTuple_Pack(1, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 18, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__96 = PyTuple_Pack(1, __pyx_n_s_signal); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 19, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_tuple__96); + __Pyx_GIVEREF(__pyx_tuple__96); + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_tuple__97 = PyTuple_Pack(1, __pyx_n_s_signal); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__97); + __Pyx_GIVEREF(__pyx_tuple__97); + + __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_get_version, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 107, __pyx_L1_error) + + __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_get_header_version, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 111, __pyx_L1_error) + + __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_supported_backends, 220, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(0, 220, __pyx_L1_error) + + __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_recommended_backends, 224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 224, __pyx_L1_error) + + __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_embeddable_backends, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 228, __pyx_L1_error) + + __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_time, 232, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 232, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_get_version, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 107, __pyx_L1_error) + + __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_get_header_version, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(0, 111, __pyx_L1_error) + + __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_supported_backends, 220, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 220, __pyx_L1_error) + + __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_recommended_backends, 224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 224, __pyx_L1_error) + + __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_embeddable_backends, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 228, __pyx_L1_error) + + __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_time, 232, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 232, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_get_version, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 107, __pyx_L1_error) + + __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_get_header_version, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 111, __pyx_L1_error) + + __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_supported_backends, 220, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 220, __pyx_L1_error) + + __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_recommended_backends, 224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(0, 224, __pyx_L1_error) + + __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_embeddable_backends, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 228, __pyx_L1_error) + + __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_appveyor_AppData_Local_T, __pyx_n_s_time, 232, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 232, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initcorecext(void); /*proto*/ +PyMODINIT_FUNC initcorecext(void) +#else +PyMODINIT_FUNC PyInit_corecext(void); /*proto*/ +PyMODINIT_FUNC PyInit_corecext(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_corecext(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("corecext", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent__libev__corecext) { + if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent.libev.corecext")) { + if (unlikely(PyDict_SetItemString(modules, "gevent.libev.corecext", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global init code ---*/ + __pyx_v_6gevent_5libev_8corecext_integer_types = ((PyObject*)Py_None); Py_INCREF(Py_None); + GEVENT_CORE_EVENTS = Py_None; Py_INCREF(Py_None); + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_6gevent_5libev_8corecext__EVENTSType) < 0) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_type_6gevent_5libev_8corecext__EVENTSType.tp_print = 0; + __pyx_ptype_6gevent_5libev_8corecext__EVENTSType = &__pyx_type_6gevent_5libev_8corecext__EVENTSType; + __pyx_vtabptr_6gevent_5libev_8corecext_loop = &__pyx_vtable_6gevent_5libev_8corecext_loop; + __pyx_vtable_6gevent_5libev_8corecext_loop._run_callbacks = (PyObject *(*)(struct PyGeventLoopObject *))__pyx_f_6gevent_5libev_8corecext_4loop__run_callbacks; + __pyx_vtable_6gevent_5libev_8corecext_loop.handle_error = (PyObject *(*)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_5libev_8corecext_4loop_handle_error; + __pyx_vtable_6gevent_5libev_8corecext_loop._default_handle_error = (PyObject *(*)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_5libev_8corecext_4loop__default_handle_error; + if (PyType_Ready(&PyGeventLoop_Type) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + PyGeventLoop_Type.tp_print = 0; + if (__Pyx_SetVtable(PyGeventLoop_Type.tp_dict, __pyx_vtabptr_6gevent_5libev_8corecext_loop) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "loop", (PyObject *)&PyGeventLoop_Type) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_loop = &PyGeventLoop_Type; + if (PyType_Ready(&PyGeventCallback_Type) < 0) __PYX_ERR(0, 627, __pyx_L1_error) + PyGeventCallback_Type.tp_print = 0; + if (PyObject_SetAttrString(__pyx_m, "callback", (PyObject *)&PyGeventCallback_Type) < 0) __PYX_ERR(0, 627, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_callback = &PyGeventCallback_Type; + if (PyType_Ready(&PyGeventWatcher_Type) < 0) __PYX_ERR(0, 695, __pyx_L1_error) + PyGeventWatcher_Type.tp_print = 0; + if (PyObject_SetAttrString(__pyx_m, "watcher", (PyObject *)&PyGeventWatcher_Type) < 0) __PYX_ERR(0, 695, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_watcher = &PyGeventWatcher_Type; + PyGeventIO_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventIO_Type) < 0) __PYX_ERR(0, 720, __pyx_L1_error) + PyGeventIO_Type.tp_print = 0; + if (PyObject_SetAttrString(__pyx_m, "io", (PyObject *)&PyGeventIO_Type) < 0) __PYX_ERR(0, 720, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_io = &PyGeventIO_Type; + PyGeventTimer_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventTimer_Type) < 0) __PYX_ERR(0, 905, __pyx_L1_error) + PyGeventTimer_Type.tp_print = 0; + if (PyObject_SetAttrString(__pyx_m, "timer", (PyObject *)&PyGeventTimer_Type) < 0) __PYX_ERR(0, 905, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_timer = &PyGeventTimer_Type; + PyGeventSignal_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventSignal_Type) < 0) __PYX_ERR(0, 1050, __pyx_L1_error) + PyGeventSignal_Type.tp_print = 0; + if (PyObject_SetAttrString(__pyx_m, "signal", (PyObject *)&PyGeventSignal_Type) < 0) __PYX_ERR(0, 1050, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_signal = &PyGeventSignal_Type; + PyGeventIdle_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventIdle_Type) < 0) __PYX_ERR(0, 1175, __pyx_L1_error) + PyGeventIdle_Type.tp_print = 0; + if (PyObject_SetAttrString(__pyx_m, "idle", (PyObject *)&PyGeventIdle_Type) < 0) __PYX_ERR(0, 1175, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_idle = &PyGeventIdle_Type; + PyGeventPrepare_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventPrepare_Type) < 0) __PYX_ERR(0, 1294, __pyx_L1_error) + PyGeventPrepare_Type.tp_print = 0; + if (PyObject_SetAttrString(__pyx_m, "prepare", (PyObject *)&PyGeventPrepare_Type) < 0) __PYX_ERR(0, 1294, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_prepare = &PyGeventPrepare_Type; + PyGeventCheck_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventCheck_Type) < 0) __PYX_ERR(0, 1413, __pyx_L1_error) + PyGeventCheck_Type.tp_print = 0; + if (PyObject_SetAttrString(__pyx_m, "check", (PyObject *)&PyGeventCheck_Type) < 0) __PYX_ERR(0, 1413, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_check = &PyGeventCheck_Type; + PyGeventFork_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventFork_Type) < 0) __PYX_ERR(0, 1532, __pyx_L1_error) + PyGeventFork_Type.tp_print = 0; + if (PyObject_SetAttrString(__pyx_m, "fork", (PyObject *)&PyGeventFork_Type) < 0) __PYX_ERR(0, 1532, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_fork = &PyGeventFork_Type; + PyGeventAsync_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventAsync_Type) < 0) __PYX_ERR(0, 1651, __pyx_L1_error) + PyGeventAsync_Type.tp_print = 0; + if (PyObject_SetAttrString(__pyx_m, "async", (PyObject *)&PyGeventAsync_Type) < 0) __PYX_ERR(0, 1651, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_async = &PyGeventAsync_Type; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + PyGeventChild_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventChild_Type) < 0) __PYX_ERR(0, 1777, __pyx_L1_error) + PyGeventChild_Type.tp_print = 0; + if (PyObject_SetAttrString(__pyx_m, "child", (PyObject *)&PyGeventChild_Type) < 0) __PYX_ERR(0, 1777, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_child = &PyGeventChild_Type; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + PyGeventStat_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventStat_Type) < 0) __PYX_ERR(0, 1922, __pyx_L1_error) + PyGeventStat_Type.tp_print = 0; + if (PyObject_SetAttrString(__pyx_m, "stat", (PyObject *)&PyGeventStat_Type) < 0) __PYX_ERR(0, 1922, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_stat = &PyGeventStat_Type; + if (PyType_Ready(&__pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr.tp_print = 0; + __pyx_ptype_6gevent_5libev_8corecext___pyx_scope_struct__genexpr = &__pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr; + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 16, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__94, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__87, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__89, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__82, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__86, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__93, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 17, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__95, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__88, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__90, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__83, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__87, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__94, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 18, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__96, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__89, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__91, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__84, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__88, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__95, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_traceback, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 19, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__97, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__90, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__92, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__85, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__89, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__96, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_signalmodule, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + __pyx_t_1 = PyList_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_get_version); + __Pyx_GIVEREF(__pyx_n_s_get_version); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_version); + __Pyx_INCREF(__pyx_n_s_get_header_version); + __Pyx_GIVEREF(__pyx_n_s_get_header_version); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_get_header_version); + __Pyx_INCREF(__pyx_n_s_supported_backends); + __Pyx_GIVEREF(__pyx_n_s_supported_backends); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_supported_backends); + __Pyx_INCREF(__pyx_n_s_recommended_backends); + __Pyx_GIVEREF(__pyx_n_s_recommended_backends); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_recommended_backends); + __Pyx_INCREF(__pyx_n_s_embeddable_backends); + __Pyx_GIVEREF(__pyx_n_s_embeddable_backends); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_embeddable_backends); + __Pyx_INCREF(__pyx_n_s_time); + __Pyx_GIVEREF(__pyx_n_s_time); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_time); + __Pyx_INCREF(__pyx_n_s_loop); + __Pyx_GIVEREF(__pyx_n_s_loop); + PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_loop); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)(&PyInt_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyInt_Type))); + __Pyx_XGOTREF(__pyx_v_6gevent_5libev_8corecext_integer_types); + __Pyx_DECREF_SET(__pyx_v_6gevent_5libev_8corecext_integer_types, ((PyObject*)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + goto __pyx_L2; + } + + /*else*/ { + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)(&PyInt_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyInt_Type))); + __Pyx_INCREF(((PyObject *)(&PyLong_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyLong_Type))); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)(&PyLong_Type))); + __Pyx_XGOTREF(__pyx_v_6gevent_5libev_8corecext_integer_types); + __Pyx_DECREF_SET(__pyx_v_6gevent_5libev_8corecext_integer_types, ((PyObject*)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + } + __pyx_L2:; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_UNDEF); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNDEF, __pyx_t_2) < 0) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_NONE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NONE, __pyx_t_2) < 0) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_READ); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_READ, __pyx_t_2) < 0) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_WRITE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_WRITE, __pyx_t_2) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_TIMER); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TIMER, __pyx_t_2) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_PERIODIC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PERIODIC, __pyx_t_2) < 0) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_SIGNAL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIGNAL, __pyx_t_2) < 0) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_CHILD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CHILD, __pyx_t_2) < 0) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_STAT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_STAT, __pyx_t_2) < 0) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_IDLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_IDLE, __pyx_t_2) < 0) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_PREPARE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PREPARE, __pyx_t_2) < 0) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_CHECK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CHECK, __pyx_t_2) < 0) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_EMBED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EMBED, __pyx_t_2) < 0) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_FORK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORK, __pyx_t_2) < 0) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_CLEANUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CLEANUP, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_ASYNC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASYNC, __pyx_t_2) < 0) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_CUSTOM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CUSTOM, __pyx_t_2) < 0) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_ERROR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR, __pyx_t_2) < 0) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int((EV_READ | EV_WRITE)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_READWRITE, __pyx_t_2) < 0) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_MINPRI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MINPRI, __pyx_t_2) < 0) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_MAXPRI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAXPRI, __pyx_t_2) < 0) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_PORT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_PORT, __pyx_t_2) < 0) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_KQUEUE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_KQUEUE, __pyx_t_2) < 0) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_EPOLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_EPOLL, __pyx_t_2) < 0) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_POLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_POLL, __pyx_t_2) < 0) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_SELECT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_SELECT, __pyx_t_2) < 0) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_FORKCHECK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORKCHECK, __pyx_t_2) < 0) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOINOTIFY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOINOTIFY, __pyx_t_2) < 0) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_SIGNALFD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIGNALFD, __pyx_t_2) < 0) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOSIGMASK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOSIGMASK, __pyx_t_2) < 0) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext__EVENTSType), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(GEVENT_CORE_EVENTS); + __Pyx_DECREF_SET(GEVENT_CORE_EVENTS, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EVENTS, GEVENT_CORE_EVENTS) < 0) __PYX_ERR(0, 104, __pyx_L1_error) + + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_1get_version, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_version, __pyx_t_2) < 0) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_3get_header_version, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_header_version, __pyx_t_2) < 0) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_PORT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_port); + __Pyx_GIVEREF(__pyx_n_s_port); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_port); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_KQUEUE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_kqueue); + __Pyx_GIVEREF(__pyx_n_s_kqueue); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_kqueue); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_EPOLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_epoll); + __Pyx_GIVEREF(__pyx_n_s_epoll); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_epoll); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_POLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_poll); + __Pyx_GIVEREF(__pyx_n_s_poll); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_poll); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_SELECT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_select); + __Pyx_GIVEREF(__pyx_n_s_select); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_select); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOENV); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_noenv); + __Pyx_GIVEREF(__pyx_n_s_noenv); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_noenv); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_FORKCHECK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_forkcheck); + __Pyx_GIVEREF(__pyx_n_s_forkcheck); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_forkcheck); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOINOTIFY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_noinotify); + __Pyx_GIVEREF(__pyx_n_s_noinotify); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_n_s_noinotify); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_SIGNALFD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_signalfd); + __Pyx_GIVEREF(__pyx_n_s_signalfd); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_signalfd); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOSIGMASK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_nosigmask); + __Pyx_GIVEREF(__pyx_n_s_nosigmask); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_n_s_nosigmask); + __pyx_t_2 = 0; + + __pyx_t_2 = PyList_New(10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_2, 3, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyList_SET_ITEM(__pyx_t_2, 4, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyList_SET_ITEM(__pyx_t_2, 5, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyList_SET_ITEM(__pyx_t_2, 6, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyList_SET_ITEM(__pyx_t_2, 7, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyList_SET_ITEM(__pyx_t_2, 8, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyList_SET_ITEM(__pyx_t_2, 9, __pyx_t_12); + __pyx_t_1 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_t_11 = 0; + __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_flags, __pyx_t_2) < 0) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __pyx_pf_6gevent_5libev_8corecext_22genexpr(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_flags_str2int, __pyx_t_12) < 0) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_READ); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_READ); + __Pyx_GIVEREF(__pyx_n_s_READ); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_READ); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_WRITE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_WRITE); + __Pyx_GIVEREF(__pyx_n_s_WRITE); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_WRITE); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV__IOFDSET); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_IOFDSET); + __Pyx_GIVEREF(__pyx_n_s_IOFDSET); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_n_s_IOFDSET); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_PERIODIC); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_PERIODIC); + __Pyx_GIVEREF(__pyx_n_s_PERIODIC); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_PERIODIC); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_SIGNAL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_SIGNAL); + __Pyx_GIVEREF(__pyx_n_s_SIGNAL); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_SIGNAL); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_CHILD); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_CHILD); + __Pyx_GIVEREF(__pyx_n_s_CHILD); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_CHILD); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_STAT); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_STAT); + __Pyx_GIVEREF(__pyx_n_s_STAT); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_STAT); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_IDLE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_IDLE); + __Pyx_GIVEREF(__pyx_n_s_IDLE); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_IDLE); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_PREPARE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_PREPARE); + __Pyx_GIVEREF(__pyx_n_s_PREPARE); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_PREPARE); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_CHECK); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_CHECK); + __Pyx_GIVEREF(__pyx_n_s_CHECK); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_CHECK); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_EMBED); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_EMBED); + __Pyx_GIVEREF(__pyx_n_s_EMBED); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_n_s_EMBED); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_FORK); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_FORK); + __Pyx_GIVEREF(__pyx_n_s_FORK); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_n_s_FORK); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_CLEANUP); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_CLEANUP); + __Pyx_GIVEREF(__pyx_n_s_CLEANUP); + PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_n_s_CLEANUP); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_ASYNC); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_ASYNC); + __Pyx_GIVEREF(__pyx_n_s_ASYNC); + PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_n_s_ASYNC); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_CUSTOM); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_17); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_CUSTOM); + __Pyx_GIVEREF(__pyx_n_s_CUSTOM); + PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_n_s_CUSTOM); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_ERROR); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_ERROR); + __Pyx_GIVEREF(__pyx_n_s_ERROR); + PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_n_s_ERROR); + __pyx_t_12 = 0; + + __pyx_t_12 = PyList_New(16); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_11); + PyList_SET_ITEM(__pyx_t_12, 1, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_10); + PyList_SET_ITEM(__pyx_t_12, 2, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_9); + PyList_SET_ITEM(__pyx_t_12, 3, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_8); + PyList_SET_ITEM(__pyx_t_12, 4, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_7); + PyList_SET_ITEM(__pyx_t_12, 5, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_12, 6, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_12, 7, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_12, 8, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_12, 9, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_13); + PyList_SET_ITEM(__pyx_t_12, 10, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_14); + PyList_SET_ITEM(__pyx_t_12, 11, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_15); + PyList_SET_ITEM(__pyx_t_12, 12, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_16); + PyList_SET_ITEM(__pyx_t_12, 13, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_17); + PyList_SET_ITEM(__pyx_t_12, 14, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_18); + PyList_SET_ITEM(__pyx_t_12, 15, __pyx_t_18); + __pyx_t_2 = 0; + __pyx_t_11 = 0; + __pyx_t_10 = 0; + __pyx_t_9 = 0; + __pyx_t_8 = 0; + __pyx_t_7 = 0; + __pyx_t_6 = 0; + __pyx_t_5 = 0; + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_t_13 = 0; + __pyx_t_14 = 0; + __pyx_t_15 = 0; + __pyx_t_16 = 0; + __pyx_t_17 = 0; + __pyx_t_18 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_events, __pyx_t_12) < 0) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_version_info); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_18, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = PyObject_RichCompare(__pyx_t_12, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_18); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + if (__pyx_t_3) { + + __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_INCREF(((PyObject *)(&PyBytes_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type))); + PyTuple_SET_ITEM(__pyx_t_18, 0, ((PyObject *)(&PyBytes_Type))); + __Pyx_INCREF(((PyObject *)(&PyString_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyString_Type))); + PyTuple_SET_ITEM(__pyx_t_18, 1, ((PyObject *)(&PyString_Type))); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, __pyx_t_18) < 0) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + goto __pyx_L3; + } + + /*else*/ { + __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_builtins); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_basestring); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, __pyx_t_12) < 0) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + __pyx_L3:; + + __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_13supported_backends, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_supported_backends, __pyx_t_12) < 0) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_15recommended_backends, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_recommended_backends, __pyx_t_12) < 0) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_17embeddable_backends, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_embeddable_backends, __pyx_t_12) < 0) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_19time, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_12) < 0) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __pyx_v_6gevent_5libev_8corecext__default_loop_destroyed = 0; + + __pyx_k__9 = EVBREAK_ONE; + + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSERR_CALLBACK, Py_None) < 0) __PYX_ERR(0, 2072, __pyx_L1_error) + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBEV_EMBED, Py_False) < 0) __PYX_ERR(0, 2109, __pyx_L1_error) +#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBEV_EMBED, Py_True) < 0) __PYX_ERR(0, 2098, __pyx_L1_error) + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_USE_FLOOR); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2099, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_FLOOR, __pyx_t_12) < 0) __PYX_ERR(0, 2099, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_USE_CLOCK_SYSCALL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_CLOCK_SYSCALL, __pyx_t_12) < 0) __PYX_ERR(0, 2100, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_USE_REALTIME); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_REALTIME, __pyx_t_12) < 0) __PYX_ERR(0, 2101, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_USE_MONOTONIC); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_MONOTONIC, __pyx_t_12) < 0) __PYX_ERR(0, 2102, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_USE_NANOSLEEP); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_NANOSLEEP, __pyx_t_12) < 0) __PYX_ERR(0, 2103, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_USE_INOTIFY); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_INOTIFY, __pyx_t_12) < 0) __PYX_ERR(0, 2104, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_USE_SIGNALFD); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_SIGNALFD, __pyx_t_12) < 0) __PYX_ERR(0, 2105, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_USE_EVENTFD); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_EVENTFD, __pyx_t_12) < 0) __PYX_ERR(0, 2106, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_USE_4HEAP); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_4HEAP, __pyx_t_12) < 0) __PYX_ERR(0, 2107, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_12) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent.libev.corecext", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent.libev.corecext"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* GetModuleGlobalName */ +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS + result = PyDict_GetItem(__pyx_d, name); + if (likely(result)) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +/* RaiseTooManyValuesToUnpack */ + static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* RaiseNeedMoreValuesToUnpack */ + static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* IterFinish */ + static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +/* UnpackItemEndCheck */ + static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +/* PyObjectCall */ + #if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyCFunctionFastCall */ + #if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); +/* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); +} +#endif // CYTHON_FAST_PYCCALL + +/* PyFunctionFastCall */ + #if CYTHON_FAST_PYCALL +#include "frameobject.h" +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = PyThreadState_GET(); + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); +/* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = f->f_localsplus; + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { +/* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif // CPython < 3.6 +#endif // CYTHON_FAST_PYCALL + +/* PyObjectCallMethO */ + #if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ + #if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { +#else + if (likely(PyCFunction_Check(func))) { +#endif + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyObjectCallNoArg */ + #if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { +#else + if (likely(PyCFunction_Check(func))) { +#endif + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* SaveResetException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { + PyObject *exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + return PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetException */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { +#endif + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* StringJoin */ + #if !CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { + return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); +} +#endif + +/* PyErrFetchRestore */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ + #if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* RaiseDoubleKeywords */ + static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ + static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* RaiseArgTupleInvalid */ + static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* ExtTypeTest */ + static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* WriteUnraisableException */ + static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* GetItemInt */ + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* GetAttr */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + +/* ArgTypeTest */ + static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); +} +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 + else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(PyObject_TypeCheck(obj, type))) return 1; + } + __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + return 0; +} + +/* SwapException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) +/* KeywordStringCheck */ + static CYTHON_INLINE int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) +/* CallNextTpTraverse */ + static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_traverse != current_tp_traverse) + type = type->tp_base; + while (type && type->tp_traverse == current_tp_traverse) + type = type->tp_base; + if (type && type->tp_traverse) + return type->tp_traverse(obj, v, a); + return 0; +} + +/* CallNextTpClear */ + static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_clear != current_tp_clear) + type = type->tp_base; + while (type && type->tp_clear == current_tp_clear) + type = type->tp_base; + if (type && type->tp_clear) + type->tp_clear(obj); +} + +/* SetVTable */ + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* CodeObjectCache */ + static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ + #include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) { + const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(unsigned int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(unsigned int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(unsigned int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(unsigned int), +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_vfd_socket_t(vfd_socket_t value) { + const vfd_socket_t neg_one = (vfd_socket_t) -1, const_zero = (vfd_socket_t) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(vfd_socket_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(vfd_socket_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(vfd_socket_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(vfd_socket_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(vfd_socket_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(vfd_socket_t), +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + little, !is_unsigned); + } +} + +/* CIntFromPy */ + static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) { + const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(unsigned int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (unsigned int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (unsigned int) 0; + case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0]) + case 2: + if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT) { + return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT) { + return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT) { + return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (unsigned int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(unsigned int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (unsigned int) 0; + case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, +digits[0]) + case -2: + if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { + return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { + return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { + return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { + return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) { + return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) { + return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(unsigned int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + unsigned int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (unsigned int) -1; + } + } else { + unsigned int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (unsigned int) -1; + val = __Pyx_PyInt_As_unsigned_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to unsigned int"); + return (unsigned int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to unsigned int"); + return (unsigned int) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { + const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(size_t) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (size_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (size_t) 0; + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0]) + case 2: + if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) { + return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) { + return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) { + return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (size_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(size_t) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (size_t) 0; + case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0]) + case -2: + if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { + return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + } +#endif + if (sizeof(size_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + size_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (size_t) -1; + } + } else { + size_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (size_t) -1; + val = __Pyx_PyInt_As_size_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to size_t"); + return (size_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to size_t"); + return (size_t) -1; +} + +/* CIntFromPy */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) + static CYTHON_INLINE vfd_socket_t __Pyx_PyInt_As_vfd_socket_t(PyObject *x) { + const vfd_socket_t neg_one = (vfd_socket_t) -1, const_zero = (vfd_socket_t) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(vfd_socket_t) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(vfd_socket_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (vfd_socket_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (vfd_socket_t) 0; + case 1: __PYX_VERIFY_RETURN_INT(vfd_socket_t, digit, digits[0]) + case 2: + if (8 * sizeof(vfd_socket_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(vfd_socket_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(vfd_socket_t) >= 2 * PyLong_SHIFT) { + return (vfd_socket_t) (((((vfd_socket_t)digits[1]) << PyLong_SHIFT) | (vfd_socket_t)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(vfd_socket_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(vfd_socket_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(vfd_socket_t) >= 3 * PyLong_SHIFT) { + return (vfd_socket_t) (((((((vfd_socket_t)digits[2]) << PyLong_SHIFT) | (vfd_socket_t)digits[1]) << PyLong_SHIFT) | (vfd_socket_t)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(vfd_socket_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(vfd_socket_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(vfd_socket_t) >= 4 * PyLong_SHIFT) { + return (vfd_socket_t) (((((((((vfd_socket_t)digits[3]) << PyLong_SHIFT) | (vfd_socket_t)digits[2]) << PyLong_SHIFT) | (vfd_socket_t)digits[1]) << PyLong_SHIFT) | (vfd_socket_t)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (vfd_socket_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(vfd_socket_t) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(vfd_socket_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(vfd_socket_t) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(vfd_socket_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (vfd_socket_t) 0; + case -1: __PYX_VERIFY_RETURN_INT(vfd_socket_t, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(vfd_socket_t, digit, +digits[0]) + case -2: + if (8 * sizeof(vfd_socket_t) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(vfd_socket_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(vfd_socket_t) - 1 > 2 * PyLong_SHIFT) { + return (vfd_socket_t) (((vfd_socket_t)-1)*(((((vfd_socket_t)digits[1]) << PyLong_SHIFT) | (vfd_socket_t)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(vfd_socket_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(vfd_socket_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(vfd_socket_t) - 1 > 2 * PyLong_SHIFT) { + return (vfd_socket_t) ((((((vfd_socket_t)digits[1]) << PyLong_SHIFT) | (vfd_socket_t)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(vfd_socket_t) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(vfd_socket_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(vfd_socket_t) - 1 > 3 * PyLong_SHIFT) { + return (vfd_socket_t) (((vfd_socket_t)-1)*(((((((vfd_socket_t)digits[2]) << PyLong_SHIFT) | (vfd_socket_t)digits[1]) << PyLong_SHIFT) | (vfd_socket_t)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(vfd_socket_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(vfd_socket_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(vfd_socket_t) - 1 > 3 * PyLong_SHIFT) { + return (vfd_socket_t) ((((((((vfd_socket_t)digits[2]) << PyLong_SHIFT) | (vfd_socket_t)digits[1]) << PyLong_SHIFT) | (vfd_socket_t)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(vfd_socket_t) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(vfd_socket_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(vfd_socket_t) - 1 > 4 * PyLong_SHIFT) { + return (vfd_socket_t) (((vfd_socket_t)-1)*(((((((((vfd_socket_t)digits[3]) << PyLong_SHIFT) | (vfd_socket_t)digits[2]) << PyLong_SHIFT) | (vfd_socket_t)digits[1]) << PyLong_SHIFT) | (vfd_socket_t)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(vfd_socket_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(vfd_socket_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(vfd_socket_t) - 1 > 4 * PyLong_SHIFT) { + return (vfd_socket_t) ((((((((((vfd_socket_t)digits[3]) << PyLong_SHIFT) | (vfd_socket_t)digits[2]) << PyLong_SHIFT) | (vfd_socket_t)digits[1]) << PyLong_SHIFT) | (vfd_socket_t)digits[0]))); + } + } + break; + } +#endif + if (sizeof(vfd_socket_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(vfd_socket_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(vfd_socket_t) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(vfd_socket_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + vfd_socket_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (vfd_socket_t) -1; + } + } else { + vfd_socket_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (vfd_socket_t) -1; + val = __Pyx_PyInt_As_vfd_socket_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to vfd_socket_t"); + return (vfd_socket_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to vfd_socket_t"); + return (vfd_socket_t) -1; +} + +/* CIntFromPy */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */ +#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) + static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* FetchCommonType */ + static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* PyObjectCallMethod1 */ + static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { + PyObject *method, *result = NULL; + method = __Pyx_PyObject_GetAttrStr(obj, method_name); + if (unlikely(!method)) goto done; +#if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(method))) { + PyObject *self = PyMethod_GET_SELF(method); + if (likely(self)) { + PyObject *args; + PyObject *function = PyMethod_GET_FUNCTION(method); + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {self, arg}; + result = __Pyx_PyFunction_FastCall(function, args, 2); + goto done; + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {self, arg}; + result = __Pyx_PyCFunction_FastCall(function, args, 2); + goto done; + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 1, arg); + Py_INCREF(function); + Py_DECREF(method); method = NULL; + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); + return result; + } + } +#endif + result = __Pyx_PyObject_CallOneArg(method, arg); +done: + Py_XDECREF(method); + return result; +} + +/* CoroutineBase */ + #include <structmember.h> +#include <frameobject.h> +static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); +static PyObject *__Pyx_Coroutine_Close(PyObject *self); +static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); +#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) +#if 1 || PY_VERSION_HEX < 0x030300B0 +static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) { + PyObject *et, *ev, *tb; + PyObject *value = NULL; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&et, &ev, &tb); + if (!et) { + Py_XDECREF(tb); + Py_XDECREF(ev); + Py_INCREF(Py_None); + *pvalue = Py_None; + return 0; + } + if (likely(et == PyExc_StopIteration)) { + if (!ev) { + Py_INCREF(Py_None); + value = Py_None; + } +#if PY_VERSION_HEX >= 0x030300A0 + else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) { + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); + } +#endif + else if (unlikely(PyTuple_Check(ev))) { + if (PyTuple_GET_SIZE(ev) >= 1) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + value = PyTuple_GET_ITEM(ev, 0); + Py_INCREF(value); +#else + value = PySequence_ITEM(ev, 0); +#endif + } else { + Py_INCREF(Py_None); + value = Py_None; + } + Py_DECREF(ev); + } + else if (!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) { + value = ev; + } + if (likely(value)) { + Py_XDECREF(tb); + Py_DECREF(et); + *pvalue = value; + return 0; + } + } else if (!PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + PyErr_NormalizeException(&et, &ev, &tb); + if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + Py_XDECREF(tb); + Py_DECREF(et); +#if PY_VERSION_HEX >= 0x030300A0 + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); +#else + { + PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); + Py_DECREF(ev); + if (likely(args)) { + value = PySequence_GetItem(args, 0); + Py_DECREF(args); + } + if (unlikely(!value)) { + __Pyx_ErrRestore(NULL, NULL, NULL); + Py_INCREF(Py_None); + value = Py_None; + } + } +#endif + *pvalue = value; + return 0; +} +#endif +static CYTHON_INLINE +void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *self) { + PyObject *exc_type = self->exc_type; + PyObject *exc_value = self->exc_value; + PyObject *exc_traceback = self->exc_traceback; + self->exc_type = NULL; + self->exc_value = NULL; + self->exc_traceback = NULL; + Py_XDECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_traceback); +} +static CYTHON_INLINE +int __Pyx_Coroutine_CheckRunning(__pyx_CoroutineObject *gen) { + if (unlikely(gen->is_running)) { + PyErr_SetString(PyExc_ValueError, + "generator already executing"); + return 1; + } + return 0; +} +static CYTHON_INLINE +PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value) { + PyObject *retval; + __Pyx_PyThreadState_declare + assert(!self->is_running); + if (unlikely(self->resume_label == 0)) { + if (unlikely(value && value != Py_None)) { + PyErr_SetString(PyExc_TypeError, + "can't send non-None value to a " + "just-started generator"); + return NULL; + } + } + if (unlikely(self->resume_label == -1)) { + PyErr_SetNone(PyExc_StopIteration); + return NULL; + } + __Pyx_PyThreadState_assign + if (value) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON +#else + if (self->exc_traceback) { + PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; + PyFrameObject *f = tb->tb_frame; + Py_XINCREF(__pyx_tstate->frame); + assert(f->f_back == NULL); + f->f_back = __pyx_tstate->frame; + } +#endif + __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, + &self->exc_traceback); + } else { + __Pyx_Coroutine_ExceptionClear(self); + } + self->is_running = 1; + retval = self->body((PyObject *) self, value); + self->is_running = 0; + if (retval) { + __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, + &self->exc_traceback); +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON +#else + if (self->exc_traceback) { + PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; + PyFrameObject *f = tb->tb_frame; + Py_CLEAR(f->f_back); + } +#endif + } else { + __Pyx_Coroutine_ExceptionClear(self); + } + return retval; +} +static CYTHON_INLINE +PyObject *__Pyx_Coroutine_MethodReturn(PyObject *retval) { + if (unlikely(!retval && !PyErr_Occurred())) { + PyErr_SetNone(PyExc_StopIteration); + } + return retval; +} +static CYTHON_INLINE +PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { + PyObject *ret; + PyObject *val = NULL; + __Pyx_Coroutine_Undelegate(gen); + __Pyx_PyGen_FetchStopIterationValue(&val); + ret = __Pyx_Coroutine_SendEx(gen, val); + Py_XDECREF(val); + return ret; +} +static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { + PyObject *retval; + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(__Pyx_Coroutine_CheckRunning(gen))) + return NULL; + if (yf) { + PyObject *ret; + gen->is_running = 1; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Coroutine_Send(yf, value); + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_CheckExact(yf)) { + ret = __Pyx_Coroutine_Send(yf, value); + } else + #endif + { + if (value == Py_None) + ret = Py_TYPE(yf)->tp_iternext(yf); + else + ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); + } + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + retval = __Pyx_Coroutine_FinishDelegation(gen); + } else { + retval = __Pyx_Coroutine_SendEx(gen, value); + } + return __Pyx_Coroutine_MethodReturn(retval); +} +static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { + PyObject *retval = NULL; + int err = 0; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + retval = __Pyx_Coroutine_Close(yf); + if (!retval) + return -1; + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_CheckExact(yf)) { + retval = __Pyx_Coroutine_Close(yf); + if (!retval) + return -1; + } else + #endif + { + PyObject *meth; + gen->is_running = 1; + meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close); + if (unlikely(!meth)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_WriteUnraisable(yf); + } + PyErr_Clear(); + } else { + retval = PyObject_CallFunction(meth, NULL); + Py_DECREF(meth); + if (!retval) + err = -1; + } + gen->is_running = 0; + } + Py_XDECREF(retval); + return err; +} +static PyObject *__Pyx_Generator_Next(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(__Pyx_Coroutine_CheckRunning(gen))) + return NULL; + if (yf) { + PyObject *ret; + gen->is_running = 1; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Generator_Next(yf); + } else + #endif + ret = Py_TYPE(yf)->tp_iternext(yf); + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + return __Pyx_Coroutine_FinishDelegation(gen); + } + return __Pyx_Coroutine_SendEx(gen, Py_None); +} +static PyObject *__Pyx_Coroutine_Close(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject *retval, *raised_exception; + PyObject *yf = gen->yieldfrom; + int err = 0; + if (unlikely(__Pyx_Coroutine_CheckRunning(gen))) + return NULL; + if (yf) { + Py_INCREF(yf); + err = __Pyx_Coroutine_CloseIter(gen, yf); + __Pyx_Coroutine_Undelegate(gen); + Py_DECREF(yf); + } + if (err == 0) + PyErr_SetNone(PyExc_GeneratorExit); + retval = __Pyx_Coroutine_SendEx(gen, NULL); + if (retval) { + Py_DECREF(retval); + PyErr_SetString(PyExc_RuntimeError, + "generator ignored GeneratorExit"); + return NULL; + } + raised_exception = PyErr_Occurred(); + if (!raised_exception + || raised_exception == PyExc_StopIteration + || raised_exception == PyExc_GeneratorExit + || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit) + || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration)) + { + if (raised_exception) PyErr_Clear(); + Py_INCREF(Py_None); + return Py_None; + } + return NULL; +} +static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject *typ; + PyObject *tb = NULL; + PyObject *val = NULL; + PyObject *yf = gen->yieldfrom; + if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb)) + return NULL; + if (unlikely(__Pyx_Coroutine_CheckRunning(gen))) + return NULL; + if (yf) { + PyObject *ret; + Py_INCREF(yf); + if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) { + int err = __Pyx_Coroutine_CloseIter(gen, yf); + Py_DECREF(yf); + __Pyx_Coroutine_Undelegate(gen); + if (err < 0) + return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL)); + goto throw_here; + } + gen->is_running = 1; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Coroutine_Throw(yf, args); + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_CheckExact(yf)) { + ret = __Pyx_Coroutine_Throw(yf, args); + } else + #endif + { + PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw); + if (unlikely(!meth)) { + Py_DECREF(yf); + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { + gen->is_running = 0; + return NULL; + } + PyErr_Clear(); + __Pyx_Coroutine_Undelegate(gen); + gen->is_running = 0; + goto throw_here; + } + ret = PyObject_CallObject(meth, args); + Py_DECREF(meth); + } + gen->is_running = 0; + Py_DECREF(yf); + if (!ret) { + ret = __Pyx_Coroutine_FinishDelegation(gen); + } + return __Pyx_Coroutine_MethodReturn(ret); + } +throw_here: + __Pyx_Raise(typ, val, tb, NULL); + return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL)); +} +static int __Pyx_Coroutine_traverse(PyObject *self, visitproc visit, void *arg) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + Py_VISIT(gen->closure); + Py_VISIT(gen->classobj); + Py_VISIT(gen->yieldfrom); + Py_VISIT(gen->exc_type); + Py_VISIT(gen->exc_value); + Py_VISIT(gen->exc_traceback); + return 0; +} +static int __Pyx_Coroutine_clear(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + Py_CLEAR(gen->closure); + Py_CLEAR(gen->classobj); + Py_CLEAR(gen->yieldfrom); + Py_CLEAR(gen->exc_type); + Py_CLEAR(gen->exc_value); + Py_CLEAR(gen->exc_traceback); + Py_CLEAR(gen->gi_name); + Py_CLEAR(gen->gi_qualname); + return 0; +} +static void __Pyx_Coroutine_dealloc(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject_GC_UnTrack(gen); + if (gen->gi_weakreflist != NULL) + PyObject_ClearWeakRefs(self); + if (gen->resume_label > 0) { + PyObject_GC_Track(self); +#if PY_VERSION_HEX >= 0x030400a1 + if (PyObject_CallFinalizerFromDealloc(self)) +#else + Py_TYPE(gen)->tp_del(self); + if (self->ob_refcnt > 0) +#endif + { + return; + } + PyObject_GC_UnTrack(self); + } + __Pyx_Coroutine_clear(self); + PyObject_GC_Del(gen); +} +static void __Pyx_Coroutine_del(PyObject *self) { + PyObject *res; + PyObject *error_type, *error_value, *error_traceback; + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + __Pyx_PyThreadState_declare + if (gen->resume_label <= 0) + return ; +#if PY_VERSION_HEX < 0x030400a1 + assert(self->ob_refcnt == 0); + self->ob_refcnt = 1; +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); + res = __Pyx_Coroutine_Close(self); + if (res == NULL) + PyErr_WriteUnraisable(self); + else + Py_DECREF(res); + __Pyx_ErrRestore(error_type, error_value, error_traceback); +#if PY_VERSION_HEX < 0x030400a1 + assert(self->ob_refcnt > 0); + if (--self->ob_refcnt == 0) { + return; + } + { + Py_ssize_t refcnt = self->ob_refcnt; + _Py_NewReference(self); + self->ob_refcnt = refcnt; + } +#if CYTHON_COMPILING_IN_CPYTHON + assert(PyType_IS_GC(self->ob_type) && + _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); + _Py_DEC_REFTOTAL; +#endif +#ifdef COUNT_ALLOCS + --Py_TYPE(self)->tp_frees; + --Py_TYPE(self)->tp_allocs; +#endif +#endif +} +static PyObject * +__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self) +{ + PyObject *name = self->gi_name; + if (unlikely(!name)) name = Py_None; + Py_INCREF(name); + return name; +} +static int +__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = self->gi_name; + Py_INCREF(value); + self->gi_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self) +{ + PyObject *name = self->gi_qualname; + if (unlikely(!name)) name = Py_None; + Py_INCREF(name); + return name; +} +static int +__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = self->gi_qualname; + Py_INCREF(value); + self->gi_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static __pyx_CoroutineObject *__Pyx__Coroutine_New( + PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name) { + __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type); + if (gen == NULL) + return NULL; + gen->body = body; + gen->closure = closure; + Py_XINCREF(closure); + gen->is_running = 0; + gen->resume_label = 0; + gen->classobj = NULL; + gen->yieldfrom = NULL; + gen->exc_type = NULL; + gen->exc_value = NULL; + gen->exc_traceback = NULL; + gen->gi_weakreflist = NULL; + Py_XINCREF(qualname); + gen->gi_qualname = qualname; + Py_XINCREF(name); + gen->gi_name = name; + Py_XINCREF(module_name); + gen->gi_modulename = module_name; + PyObject_GC_Track(gen); + return gen; +} + +/* PatchModuleWithCoroutine */ + static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + int result; + PyObject *globals, *result_obj; + globals = PyDict_New(); if (unlikely(!globals)) goto ignore; + result = PyDict_SetItemString(globals, "_cython_coroutine_type", + #ifdef __Pyx_Coroutine_USED + (PyObject*)__pyx_CoroutineType); + #else + Py_None); + #endif + if (unlikely(result < 0)) goto ignore; + result = PyDict_SetItemString(globals, "_cython_generator_type", + #ifdef __Pyx_Generator_USED + (PyObject*)__pyx_GeneratorType); + #else + Py_None); + #endif + if (unlikely(result < 0)) goto ignore; + if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; + if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; + result_obj = PyRun_String(py_code, Py_file_input, globals, globals); + if (unlikely(!result_obj)) goto ignore; + Py_DECREF(result_obj); + Py_DECREF(globals); + return module; +ignore: + Py_XDECREF(globals); + PyErr_WriteUnraisable(module); + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { + Py_DECREF(module); + module = NULL; + } +#else + py_code++; +#endif + return module; +} + +/* PatchGeneratorABC */ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) +static PyObject* __Pyx_patch_abc_module(PyObject *module); +static PyObject* __Pyx_patch_abc_module(PyObject *module) { + module = __Pyx_Coroutine_patch_module( + module, "" +"if _cython_generator_type is not None:\n" +" try: Generator = _module.Generator\n" +" except AttributeError: pass\n" +" else: Generator.register(_cython_generator_type)\n" +"if _cython_coroutine_type is not None:\n" +" try: Coroutine = _module.Coroutine\n" +" except AttributeError: pass\n" +" else: Coroutine.register(_cython_coroutine_type)\n" + ); + return module; +} +#endif +static int __Pyx_patch_abc(void) { +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + static int abc_patched = 0; + if (!abc_patched) { + PyObject *module; + module = PyImport_ImportModule((PY_VERSION_HEX >= 0x03030000) ? "collections.abc" : "collections"); + if (!module) { + PyErr_WriteUnraisable(NULL); + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, + ((PY_VERSION_HEX >= 0x03030000) ? + "Cython module failed to register with collections.abc module" : + "Cython module failed to register with collections module"), 1) < 0)) { + return -1; + } + } else { + module = __Pyx_patch_abc_module(module); + abc_patched = 1; + if (unlikely(!module)) + return -1; + Py_DECREF(module); + } + module = PyImport_ImportModule("backports_abc"); + if (module) { + module = __Pyx_patch_abc_module(module); + Py_XDECREF(module); + } + if (!module) { + PyErr_Clear(); + } + } +#else + if (0) __Pyx_Coroutine_patch_module(NULL, NULL); +#endif + return 0; +} + +/* Generator */ + static PyMethodDef __pyx_Generator_methods[] = { + {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, + (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, + {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, + (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, + {"close", (PyCFunction) __Pyx_Coroutine_Close, METH_NOARGS, + (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, + {0, 0, 0, 0} +}; +static PyMemberDef __pyx_Generator_memberlist[] = { + {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, + {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, + (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, + {0, 0, 0, 0, 0} +}; +static PyGetSetDef __pyx_Generator_getsets[] = { + {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, + (char*) PyDoc_STR("name of the generator"), 0}, + {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, + (char*) PyDoc_STR("qualified name of the generator"), 0}, + {0, 0, 0, 0, 0} +}; +static PyTypeObject __pyx_GeneratorType_type = { + PyVarObject_HEAD_INIT(0, 0) + "generator", + sizeof(__pyx_CoroutineObject), + 0, + (destructor) __Pyx_Coroutine_dealloc, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, + 0, + (traverseproc) __Pyx_Coroutine_traverse, + 0, + 0, + offsetof(__pyx_CoroutineObject, gi_weakreflist), + 0, + (iternextfunc) __Pyx_Generator_Next, + __pyx_Generator_methods, + __pyx_Generator_memberlist, + __pyx_Generator_getsets, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#else + __Pyx_Coroutine_del, +#endif + 0, +#if PY_VERSION_HEX >= 0x030400a1 + __Pyx_Coroutine_del, +#endif +}; +static int __pyx_Generator_init(void) { + __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr; + __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; + __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); + if (unlikely(!__pyx_GeneratorType)) { + return -1; + } + return 0; +} + +/* CheckBinaryVersion */ + static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + return PyErr_WarnEx(NULL, message, 1); + } + return 0; +} + +/* InitStrings */ + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else + if (__Pyx_PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +#endif + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } + #else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } + #endif +#else + res = PyNumber_Int(x); +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(x); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ +#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */ +/* Copyright (c) 2011-2012 Denis Bilenko. See LICENSE for details. */ +#ifdef Py_PYTHON_H + +/* the name changes depending on our file layout and --module-name option */ +#define _GEVENTLOOP struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop + + +static void gevent_handle_error(struct PyGeventLoopObject* loop, PyObject* context) { + PyThreadState *tstate; + PyObject *type, *value, *traceback, *result; + tstate = PyThreadState_GET(); + type = tstate->curexc_type; + if (!type) + return; + value = tstate->curexc_value; + traceback = tstate->curexc_traceback; + if (!value) value = Py_None; + if (!traceback) traceback = Py_None; + + Py_INCREF(type); + Py_INCREF(value); + Py_INCREF(traceback); + + PyErr_Clear(); + + result = ((_GEVENTLOOP *)loop->__pyx_vtab)->handle_error(loop, context, type, value, traceback, 0); + + if (result) { + Py_DECREF(result); + } + else { + PyErr_Print(); + PyErr_Clear(); + } + + Py_DECREF(type); + Py_DECREF(value); + Py_DECREF(traceback); +} + + +static CYTHON_INLINE void gevent_check_signals(struct PyGeventLoopObject* loop) { + if (!ev_is_default_loop(loop->_ptr)) { + /* only reporting signals on the default loop */ + return; + } + PyErr_CheckSignals(); + if (PyErr_Occurred()) gevent_handle_error(loop, Py_None); +} + +#define GET_OBJECT(PY_TYPE, EV_PTR, MEMBER) \ + ((struct PY_TYPE *)(((char *)EV_PTR) - offsetof(struct PY_TYPE, MEMBER))) + + +#ifdef WITH_THREAD +#define GIL_DECLARE PyGILState_STATE ___save +#define GIL_ENSURE ___save = PyGILState_Ensure(); +#define GIL_RELEASE PyGILState_Release(___save); +#else +#define GIL_DECLARE +#define GIL_ENSURE +#define GIL_RELEASE +#endif + + +static void gevent_stop(PyObject* watcher, struct PyGeventLoopObject* loop) { + PyObject *result, *method; + int error; + error = 1; + method = PyObject_GetAttrString(watcher, "stop"); + if (method) { + result = PyObject_Call(method, __pyx_empty_tuple, NULL); + if (result) { + Py_DECREF(result); + error = 0; + } + Py_DECREF(method); + } + if (error) { + gevent_handle_error(loop, watcher); + } +} + + +static void gevent_callback(struct PyGeventLoopObject* loop, PyObject* callback, PyObject* args, PyObject* watcher, void *c_watcher, int revents) { + GIL_DECLARE; + PyObject *result, *py_events; + long length; + py_events = 0; + GIL_ENSURE; + Py_INCREF(loop); + Py_INCREF(callback); + Py_INCREF(args); + Py_INCREF(watcher); + gevent_check_signals(loop); + if (args == Py_None) { + args = __pyx_empty_tuple; + } + length = PyTuple_Size(args); + if (length < 0) { + gevent_handle_error(loop, watcher); + goto end; + } + if (length > 0 && PyTuple_GET_ITEM(args, 0) == GEVENT_CORE_EVENTS) { + py_events = PyInt_FromLong(revents); + if (!py_events) { + gevent_handle_error(loop, watcher); + goto end; + } + PyTuple_SET_ITEM(args, 0, py_events); + } + else { + py_events = NULL; + } + result = PyObject_Call(callback, args, NULL); + if (result) { + Py_DECREF(result); + } + else { + gevent_handle_error(loop, watcher); + if (revents & (EV_READ|EV_WRITE)) { + /* io watcher: not stopping it may cause the failing callback to be called repeatedly */ + gevent_stop(watcher, loop); + goto end; + } + } + if (!ev_is_active(c_watcher)) { + /* Watcher was stopped, maybe by libev. Let's call stop() to clean up + * 'callback' and 'args' properties, do Py_DECREF() and ev_ref() if necessary. + * BTW, we don't need to check for EV_ERROR, because libev stops the watcher in that case. */ + gevent_stop(watcher, loop); + } +end: + if (py_events) { + Py_DECREF(py_events); + PyTuple_SET_ITEM(args, 0, GEVENT_CORE_EVENTS); + } + Py_DECREF(watcher); + Py_DECREF(args); + Py_DECREF(callback); + Py_DECREF(loop); + GIL_RELEASE; +} + + +static void gevent_call(struct PyGeventLoopObject* loop, struct PyGeventCallbackObject* cb) { + /* no need for GIL here because it is only called from run_callbacks which already has GIL */ + PyObject *result, *callback, *args; + if (!loop || !cb) + return; + callback = cb->callback; + args = cb->args; + if (!callback || !args) + return; + if (callback == Py_None || args == Py_None) + return; + Py_INCREF(loop); + Py_INCREF(callback); + Py_INCREF(args); + + Py_INCREF(Py_None); + Py_DECREF(cb->callback); + cb->callback = Py_None; + + result = PyObject_Call(callback, args, NULL); + if (result) { + Py_DECREF(result); + } + else { + gevent_handle_error(loop, (PyObject*)cb); + } + + Py_INCREF(Py_None); + Py_DECREF(cb->args); + cb->args = Py_None; + + Py_DECREF(callback); + Py_DECREF(args); + Py_DECREF(loop); +} + + +#undef DEFINE_CALLBACK +#define DEFINE_CALLBACK(WATCHER_LC, WATCHER_TYPE) \ + static void gevent_callback_##WATCHER_LC(struct ev_loop *_loop, void *c_watcher, int revents) { \ + struct PyGevent##WATCHER_TYPE##Object* watcher = GET_OBJECT(PyGevent##WATCHER_TYPE##Object, c_watcher, _watcher); \ + gevent_callback(watcher->loop, watcher->_callback, watcher->args, (PyObject*)watcher, c_watcher, revents); \ + } + + +DEFINE_CALLBACKS + + +static void gevent_run_callbacks(struct ev_loop *_loop, void *watcher, int revents) { + struct PyGeventLoopObject* loop; + PyObject *result; + GIL_DECLARE; + GIL_ENSURE; + loop = GET_OBJECT(PyGeventLoopObject, watcher, _prepare); + Py_INCREF(loop); + gevent_check_signals(loop); + result = ((_GEVENTLOOP *)loop->__pyx_vtab)->_run_callbacks(loop); + if (result) { + Py_DECREF(result); + } + else { + PyErr_Print(); + PyErr_Clear(); + } + Py_DECREF(loop); + GIL_RELEASE; +} + +#if defined(_WIN32) + +static void gevent_periodic_signal_check(struct ev_loop *_loop, void *watcher, int revents) { + GIL_DECLARE; + GIL_ENSURE; + gevent_check_signals(GET_OBJECT(PyGeventLoopObject, watcher, _periodic_signal_checker)); + GIL_RELEASE; +} + +#endif /* _WIN32 */ + +#endif /* Py_PYTHON_H */ diff --git a/python/gevent/libev/libev.h b/python/gevent/libev/libev.h new file mode 100644 index 0000000..657aaad --- /dev/null +++ b/python/gevent/libev/libev.h @@ -0,0 +1,66 @@ +#if defined(LIBEV_EMBED) +#include "ev.c" +#else +#include "ev.h" + +#ifndef _WIN32 +#include <signal.h> +#endif + +#endif + +#ifndef _WIN32 + +static struct sigaction libev_sigchld; +/* + * Track the state of whether we have installed + * the libev sigchld handler specifically. + * If it's non-zero, libev_sigchld will be valid and set to the action + * that libev needs to do. + * If it's 1, we need to install libev_sigchld to make libev + * child handlers work (on request). + */ +static int sigchld_state = 0; + +static struct ev_loop* gevent_ev_default_loop(unsigned int flags) +{ + struct ev_loop* result; + struct sigaction tmp; + + if (sigchld_state) + return ev_default_loop(flags); + + // Request the old SIGCHLD handler + sigaction(SIGCHLD, NULL, &tmp); + // Get the loop, which will install a SIGCHLD handler + result = ev_default_loop(flags); + // XXX what if SIGCHLD received there? + // Now restore the previous SIGCHLD handler + sigaction(SIGCHLD, &tmp, &libev_sigchld); + sigchld_state = 1; + return result; +} + + +static void gevent_install_sigchld_handler(void) { + if (sigchld_state == 1) { + sigaction(SIGCHLD, &libev_sigchld, NULL); + sigchld_state = 2; + } +} + +static void gevent_reset_sigchld_handler(void) { + // We could have any state at this point, depending on + // whether the default loop has been used. If it has, + // then always be in state 1 ("need to install) + if (sigchld_state) { + sigchld_state = 1; + } +} + +#else + +#define gevent_ev_default_loop ev_default_loop +static void gevent_install_sigchld_handler(void) { } + +#endif diff --git a/python/gevent/libev/libev.pxd b/python/gevent/libev/libev.pxd new file mode 100644 index 0000000..d8914b6 --- /dev/null +++ b/python/gevent/libev/libev.pxd @@ -0,0 +1,208 @@ +cdef extern from "libev_vfd.h": +#ifdef _WIN32 +#ifdef _WIN64 + ctypedef long long vfd_socket_t +#else + ctypedef long vfd_socket_t +#endif +#else + ctypedef int vfd_socket_t +#endif + long vfd_get(int) + int vfd_open(long) except -1 + void vfd_free(int) + +cdef extern from "libev.h": + int EV_MINPRI + int EV_MAXPRI + + int EV_VERSION_MAJOR + int EV_VERSION_MINOR + + int EV_USE_FLOOR + int EV_USE_CLOCK_SYSCALL + int EV_USE_REALTIME + int EV_USE_MONOTONIC + int EV_USE_NANOSLEEP + int EV_USE_SELECT + int EV_USE_POLL + int EV_USE_EPOLL + int EV_USE_KQUEUE + int EV_USE_PORT + int EV_USE_INOTIFY + int EV_USE_SIGNALFD + int EV_USE_EVENTFD + int EV_USE_4HEAP + int EV_USE_IOCP + int EV_SELECT_IS_WINSOCKET + + int EV_UNDEF + int EV_NONE + int EV_READ + int EV_WRITE + int EV__IOFDSET + int EV_TIMER + int EV_PERIODIC + int EV_SIGNAL + int EV_CHILD + int EV_STAT + int EV_IDLE + int EV_PREPARE + int EV_CHECK + int EV_EMBED + int EV_FORK + int EV_CLEANUP + int EV_ASYNC + int EV_CUSTOM + int EV_ERROR + + int EVFLAG_AUTO + int EVFLAG_NOENV + int EVFLAG_FORKCHECK + int EVFLAG_NOINOTIFY + int EVFLAG_SIGNALFD + int EVFLAG_NOSIGMASK + + int EVBACKEND_SELECT + int EVBACKEND_POLL + int EVBACKEND_EPOLL + int EVBACKEND_KQUEUE + int EVBACKEND_DEVPOLL + int EVBACKEND_PORT + int EVBACKEND_IOCP + int EVBACKEND_ALL + int EVBACKEND_MASK + + int EVRUN_NOWAIT + int EVRUN_ONCE + + int EVBREAK_CANCEL + int EVBREAK_ONE + int EVBREAK_ALL + + struct ev_loop: + int activecnt + int sig_pending + int backend_fd + int sigfd + unsigned int origflags + + struct ev_io: + int fd + int events + + struct ev_timer: + double at + + struct ev_signal: + pass + + struct ev_idle: + pass + + struct ev_prepare: + pass + + struct ev_check: + pass + + struct ev_fork: + pass + + struct ev_async: + pass + + struct ev_child: + int pid + int rpid + int rstatus + + struct stat: + int st_nlink + + struct ev_stat: + stat attr + stat prev + double interval + + int ev_version_major() + int ev_version_minor() + + unsigned int ev_supported_backends() + unsigned int ev_recommended_backends() + unsigned int ev_embeddable_backends() + + double ev_time() + void ev_set_syserr_cb(void *) + + int ev_priority(void*) + void ev_set_priority(void*, int) + + int ev_is_pending(void*) + int ev_is_active(void*) + void ev_io_init(ev_io*, void* callback, int fd, int events) + void ev_io_start(ev_loop*, ev_io*) + void ev_io_stop(ev_loop*, ev_io*) + void ev_feed_event(ev_loop*, void*, int) + + void ev_timer_init(ev_timer*, void* callback, double, double) + void ev_timer_start(ev_loop*, ev_timer*) + void ev_timer_stop(ev_loop*, ev_timer*) + void ev_timer_again(ev_loop*, ev_timer*) + + void ev_signal_init(ev_signal*, void* callback, int) + void ev_signal_start(ev_loop*, ev_signal*) + void ev_signal_stop(ev_loop*, ev_signal*) + + void ev_idle_init(ev_idle*, void* callback) + void ev_idle_start(ev_loop*, ev_idle*) + void ev_idle_stop(ev_loop*, ev_idle*) + + void ev_prepare_init(ev_prepare*, void* callback) + void ev_prepare_start(ev_loop*, ev_prepare*) + void ev_prepare_stop(ev_loop*, ev_prepare*) + + void ev_check_init(ev_check*, void* callback) + void ev_check_start(ev_loop*, ev_check*) + void ev_check_stop(ev_loop*, ev_check*) + + void ev_fork_init(ev_fork*, void* callback) + void ev_fork_start(ev_loop*, ev_fork*) + void ev_fork_stop(ev_loop*, ev_fork*) + + void ev_async_init(ev_async*, void* callback) + void ev_async_start(ev_loop*, ev_async*) + void ev_async_stop(ev_loop*, ev_async*) + void ev_async_send(ev_loop*, ev_async*) + int ev_async_pending(ev_async*) + + void ev_child_init(ev_child*, void* callback, int, int) + void ev_child_start(ev_loop*, ev_child*) + void ev_child_stop(ev_loop*, ev_child*) + + void ev_stat_init(ev_stat*, void* callback, char*, double) + void ev_stat_start(ev_loop*, ev_stat*) + void ev_stat_stop(ev_loop*, ev_stat*) + + ev_loop* ev_default_loop(unsigned int flags) + ev_loop* ev_loop_new(unsigned int flags) + void ev_loop_destroy(ev_loop*) + void ev_loop_fork(ev_loop*) + int ev_is_default_loop(ev_loop*) + unsigned int ev_iteration(ev_loop*) + unsigned int ev_depth(ev_loop*) + unsigned int ev_backend(ev_loop*) + void ev_verify(ev_loop*) + void ev_run(ev_loop*, int flags) nogil + + double ev_now(ev_loop*) + void ev_now_update(ev_loop*) + + void ev_ref(ev_loop*) + void ev_unref(ev_loop*) + void ev_break(ev_loop*, int) + unsigned int ev_pending_count(ev_loop*) + + ev_loop* gevent_ev_default_loop(unsigned int flags) + void gevent_install_sigchld_handler() + void gevent_reset_sigchld_handler() diff --git a/python/gevent/libev/libev_vfd.h b/python/gevent/libev/libev_vfd.h new file mode 100644 index 0000000..ec16a28 --- /dev/null +++ b/python/gevent/libev/libev_vfd.h @@ -0,0 +1,223 @@ +#ifdef _WIN32 +#ifdef _WIN64 +typedef PY_LONG_LONG vfd_socket_t; +#define vfd_socket_object PyLong_FromLongLong +#else +typedef long vfd_socket_t; +#define vfd_socket_object PyInt_FromLong +#endif +#ifdef LIBEV_EMBED +/* + * If libev on win32 is embedded, then we can use an + * arbitrary mapping between integer fds and OS + * handles. Then by defining special macros libev + * will use our functions. + */ + +#define WIN32_LEAN_AND_MEAN +#include <winsock2.h> +#include <windows.h> + +typedef struct vfd_entry_t +{ + vfd_socket_t handle; /* OS handle, i.e. SOCKET */ + int count; /* Reference count, 0 if free */ + int next; /* Next free fd, -1 if last */ +} vfd_entry; + +#define VFD_INCREMENT 128 +static int vfd_num = 0; /* num allocated fds */ +static int vfd_max = 0; /* max allocated fds */ +static int vfd_next = -1; /* next free fd for reuse */ +static PyObject* vfd_map = NULL; /* map OS handle -> virtual fd */ +static vfd_entry* vfd_entries = NULL; /* list of virtual fd entries */ + +#ifdef WITH_THREAD +static CRITICAL_SECTION* volatile vfd_lock = NULL; +static CRITICAL_SECTION* vfd_make_lock() +{ + if (vfd_lock == NULL) { + /* must use malloc and not PyMem_Malloc here */ + CRITICAL_SECTION* lock = malloc(sizeof(CRITICAL_SECTION)); + InitializeCriticalSection(lock); + if (InterlockedCompareExchangePointer(&vfd_lock, lock, NULL) != NULL) { + /* another thread initialized lock first */ + DeleteCriticalSection(lock); + free(lock); + } + } + return vfd_lock; +} +#define VFD_LOCK_ENTER EnterCriticalSection(vfd_make_lock()) +#define VFD_LOCK_LEAVE LeaveCriticalSection(vfd_lock) +#define VFD_GIL_DECLARE PyGILState_STATE ___save +#define VFD_GIL_ENSURE ___save = PyGILState_Ensure() +#define VFD_GIL_RELEASE PyGILState_Release(___save) +#else +#define VFD_LOCK_ENTER +#define VFD_LOCK_LEAVE +#define VFD_GIL_DECLARE +#define VFD_GIL_ENSURE +#define VFD_GIL_RELEASE +#endif + +/* + * Given a virtual fd returns an OS handle or -1 + * This function is speed critical, so it cannot use GIL + */ +static vfd_socket_t vfd_get(int fd) +{ + int handle = -1; + VFD_LOCK_ENTER; + if (vfd_entries != NULL && fd >= 0 && fd < vfd_num) + handle = vfd_entries[fd].handle; + VFD_LOCK_LEAVE; + return handle; +} + +#define EV_FD_TO_WIN32_HANDLE(fd) vfd_get((fd)) + +/* + * Given an OS handle finds or allocates a virtual fd + * Returns -1 on failure and sets Python exception if pyexc is non-zero + */ +static int vfd_open_(vfd_socket_t handle, int pyexc) +{ + VFD_GIL_DECLARE; + int fd = -1; + unsigned long arg; + PyObject* key = NULL; + PyObject* value; + + if (!pyexc) { + VFD_GIL_ENSURE; + } + if (ioctlsocket(handle, FIONREAD, &arg) != 0) { + if (pyexc) + PyErr_Format(PyExc_IOError, +#ifdef _WIN64 + "%lld is not a socket (files are not supported)", +#else + "%ld is not a socket (files are not supported)", +#endif + handle); + goto done; + } + if (vfd_map == NULL) { + vfd_map = PyDict_New(); + if (vfd_map == NULL) + goto done; + } + key = vfd_socket_object(handle); + /* check if it's already in the dict */ + value = PyDict_GetItem(vfd_map, key); + if (value != NULL) { + /* is it safe to use PyInt_AS_LONG(value) here? */ + fd = PyInt_AsLong(value); + if (fd >= 0) { + ++vfd_entries[fd].count; + goto done; + } + } + /* use the free entry, if available */ + if (vfd_next >= 0) { + fd = vfd_next; + vfd_next = vfd_entries[fd].next; + VFD_LOCK_ENTER; + goto allocated; + } + /* check if it would be out of bounds */ + if (vfd_num >= FD_SETSIZE) { + /* libev's select doesn't support more that FD_SETSIZE fds */ + if (pyexc) + PyErr_Format(PyExc_IOError, "cannot watch more than %d sockets", (int)FD_SETSIZE); + goto done; + } + /* allocate more space if needed */ + VFD_LOCK_ENTER; + if (vfd_num >= vfd_max) { + int newsize = vfd_max + VFD_INCREMENT; + vfd_entry* entries = PyMem_Realloc(vfd_entries, sizeof(vfd_entry) * newsize); + if (entries == NULL) { + VFD_LOCK_LEAVE; + if (pyexc) + PyErr_NoMemory(); + goto done; + } + vfd_entries = entries; + vfd_max = newsize; + } + fd = vfd_num++; +allocated: + /* vfd_lock must be acquired when entering here */ + vfd_entries[fd].handle = handle; + vfd_entries[fd].count = 1; + VFD_LOCK_LEAVE; + value = PyInt_FromLong(fd); + PyDict_SetItem(vfd_map, key, value); + Py_DECREF(value); +done: + Py_XDECREF(key); + if (!pyexc) { + VFD_GIL_RELEASE; + } + return fd; +} + +#define vfd_open(fd) vfd_open_((fd), 1) +#define EV_WIN32_HANDLE_TO_FD(handle) vfd_open_((handle), 0) + +static void vfd_free_(int fd, int needclose) +{ + VFD_GIL_DECLARE; + PyObject* key; + + if (needclose) { + VFD_GIL_ENSURE; + } + if (fd < 0 || fd >= vfd_num) + goto done; /* out of bounds */ + if (vfd_entries[fd].count <= 0) + goto done; /* free entry, ignore */ + if (!--vfd_entries[fd].count) { + /* fd has just been freed */ + vfd_socket_t handle = vfd_entries[fd].handle; + vfd_entries[fd].handle = -1; + vfd_entries[fd].next = vfd_next; + vfd_next = fd; + if (needclose) + closesocket(handle); + /* vfd_map is assumed to be != NULL */ + key = vfd_socket_object(handle); + PyDict_DelItem(vfd_map, key); + Py_DECREF(key); + } +done: + if (needclose) { + VFD_GIL_RELEASE; + } +} + +#define vfd_free(fd) vfd_free_((fd), 0) +#define EV_WIN32_CLOSE_FD(fd) vfd_free_((fd), 1) + +#else +/* + * If libev on win32 is not embedded in gevent, then + * the only way to map vfds is to use the default of + * using runtime fds in libev. Note that it will leak + * fds, because there's no way of closing them safely + */ +#define vfd_get(fd) _get_osfhandle((fd)) +#define vfd_open(fd) _open_osfhandle((fd), 0) +#define vfd_free(fd) +#endif +#else +/* + * On non-win32 platforms vfd_* are noop macros + */ +typedef int vfd_socket_t; +#define vfd_get(fd) (fd) +#define vfd_open(fd) ((int)(fd)) +#define vfd_free(fd) +#endif diff --git a/python/gevent/libev/stathelper.c b/python/gevent/libev/stathelper.c new file mode 100644 index 0000000..1a70b55 --- /dev/null +++ b/python/gevent/libev/stathelper.c @@ -0,0 +1,187 @@ +/* copied from Python-2.7.2/Modules/posixmodule.c */ +#include "structseq.h" + +#define STRUCT_STAT struct stat + +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE +#define ST_BLKSIZE_IDX 13 +#else +#define ST_BLKSIZE_IDX 12 +#endif + +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS +#define ST_BLOCKS_IDX (ST_BLKSIZE_IDX+1) +#else +#define ST_BLOCKS_IDX ST_BLKSIZE_IDX +#endif + +#ifdef HAVE_STRUCT_STAT_ST_RDEV +#define ST_RDEV_IDX (ST_BLOCKS_IDX+1) +#else +#define ST_RDEV_IDX ST_BLOCKS_IDX +#endif + +#ifdef HAVE_STRUCT_STAT_ST_FLAGS +#define ST_FLAGS_IDX (ST_RDEV_IDX+1) +#else +#define ST_FLAGS_IDX ST_RDEV_IDX +#endif + +#ifdef HAVE_STRUCT_STAT_ST_GEN +#define ST_GEN_IDX (ST_FLAGS_IDX+1) +#else +#define ST_GEN_IDX ST_FLAGS_IDX +#endif + +#ifdef HAVE_STRUCT_STAT_ST_BIRTHTIME +#define ST_BIRTHTIME_IDX (ST_GEN_IDX+1) +#else +#define ST_BIRTHTIME_IDX ST_GEN_IDX +#endif + + + +static PyObject* posixmodule = NULL; +static PyTypeObject* pStatResultType = NULL; + + +static PyObject* import_posixmodule(void) +{ + if (!posixmodule) { + posixmodule = PyImport_ImportModule("posix"); + } + return posixmodule; +} + + +static PyObject* import_StatResultType(void) +{ + PyObject* p = NULL; + if (!pStatResultType) { + PyObject* module; + module = import_posixmodule(); + if (module) { + p = PyObject_GetAttrString(module, "stat_result"); + } + } + return p; +} + +static void +fill_time(PyObject *v, int index, time_t sec, unsigned long nsec) +{ + PyObject *fval,*ival; +#if SIZEOF_TIME_T > SIZEOF_LONG + ival = PyLong_FromLongLong((PY_LONG_LONG)sec); +#else + ival = PyInt_FromLong((long)sec); +#endif + if (!ival) + return; + fval = PyFloat_FromDouble(sec + 1e-9*nsec); + PyStructSequence_SET_ITEM(v, index, ival); + PyStructSequence_SET_ITEM(v, index+3, fval); +} + +/* pack a system stat C structure into the Python stat tuple + (used by posix_stat() and posix_fstat()) */ +static PyObject* +_pystat_fromstructstat(STRUCT_STAT *st) +{ + unsigned long ansec, mnsec, cnsec; + PyObject *v; + + PyTypeObject* StatResultType = (PyTypeObject*)import_StatResultType(); + if (StatResultType == NULL) { + return NULL; + } + + v = PyStructSequence_New(StatResultType); + if (v == NULL) + return NULL; + + PyStructSequence_SET_ITEM(v, 0, PyInt_FromLong((long)st->st_mode)); +#ifdef HAVE_LARGEFILE_SUPPORT + PyStructSequence_SET_ITEM(v, 1, + PyLong_FromLongLong((PY_LONG_LONG)st->st_ino)); +#else + PyStructSequence_SET_ITEM(v, 1, PyInt_FromLong((long)st->st_ino)); +#endif +#if defined(HAVE_LONG_LONG) && !defined(MS_WINDOWS) + PyStructSequence_SET_ITEM(v, 2, + PyLong_FromLongLong((PY_LONG_LONG)st->st_dev)); +#else + PyStructSequence_SET_ITEM(v, 2, PyInt_FromLong((long)st->st_dev)); +#endif + PyStructSequence_SET_ITEM(v, 3, PyInt_FromLong((long)st->st_nlink)); + PyStructSequence_SET_ITEM(v, 4, PyInt_FromLong((long)st->st_uid)); + PyStructSequence_SET_ITEM(v, 5, PyInt_FromLong((long)st->st_gid)); +#ifdef HAVE_LARGEFILE_SUPPORT + PyStructSequence_SET_ITEM(v, 6, + PyLong_FromLongLong((PY_LONG_LONG)st->st_size)); +#else + PyStructSequence_SET_ITEM(v, 6, PyInt_FromLong(st->st_size)); +#endif + +#if defined(HAVE_STAT_TV_NSEC) + ansec = st->st_atim.tv_nsec; + mnsec = st->st_mtim.tv_nsec; + cnsec = st->st_ctim.tv_nsec; +#elif defined(HAVE_STAT_TV_NSEC2) + ansec = st->st_atimespec.tv_nsec; + mnsec = st->st_mtimespec.tv_nsec; + cnsec = st->st_ctimespec.tv_nsec; +#elif defined(HAVE_STAT_NSEC) + ansec = st->st_atime_nsec; + mnsec = st->st_mtime_nsec; + cnsec = st->st_ctime_nsec; +#else + ansec = mnsec = cnsec = 0; +#endif + fill_time(v, 7, st->st_atime, ansec); + fill_time(v, 8, st->st_mtime, mnsec); + fill_time(v, 9, st->st_ctime, cnsec); + +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE + PyStructSequence_SET_ITEM(v, ST_BLKSIZE_IDX, + PyInt_FromLong((long)st->st_blksize)); +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS + PyStructSequence_SET_ITEM(v, ST_BLOCKS_IDX, + PyInt_FromLong((long)st->st_blocks)); +#endif +#ifdef HAVE_STRUCT_STAT_ST_RDEV + PyStructSequence_SET_ITEM(v, ST_RDEV_IDX, + PyInt_FromLong((long)st->st_rdev)); +#endif +#ifdef HAVE_STRUCT_STAT_ST_GEN + PyStructSequence_SET_ITEM(v, ST_GEN_IDX, + PyInt_FromLong((long)st->st_gen)); +#endif +#ifdef HAVE_STRUCT_STAT_ST_BIRTHTIME + { + PyObject *val; + unsigned long bsec,bnsec; + bsec = (long)st->st_birthtime; +#ifdef HAVE_STAT_TV_NSEC2 + bnsec = st->st_birthtimespec.tv_nsec; +#else + bnsec = 0; +#endif + val = PyFloat_FromDouble(bsec + 1e-9*bnsec); + PyStructSequence_SET_ITEM(v, ST_BIRTHTIME_IDX, + val); + } +#endif +#ifdef HAVE_STRUCT_STAT_ST_FLAGS + PyStructSequence_SET_ITEM(v, ST_FLAGS_IDX, + PyInt_FromLong((long)st->st_flags)); +#endif + + if (PyErr_Occurred()) { + Py_DECREF(v); + return NULL; + } + + return v; +} |