1aec3c8f4Simarom/* Generated by Cython 0.21.2 */
2aec3c8f4Simarom
3aec3c8f4Simarom#define PY_SSIZE_T_CLEAN
4aec3c8f4Simarom#ifndef CYTHON_USE_PYLONG_INTERNALS
5aec3c8f4Simarom#ifdef PYLONG_BITS_IN_DIGIT
6aec3c8f4Simarom#define CYTHON_USE_PYLONG_INTERNALS 0
7aec3c8f4Simarom#else
8aec3c8f4Simarom#include "pyconfig.h"
9aec3c8f4Simarom#ifdef PYLONG_BITS_IN_DIGIT
10aec3c8f4Simarom#define CYTHON_USE_PYLONG_INTERNALS 1
11aec3c8f4Simarom#else
12aec3c8f4Simarom#define CYTHON_USE_PYLONG_INTERNALS 0
13aec3c8f4Simarom#endif
14aec3c8f4Simarom#endif
15aec3c8f4Simarom#endif
16aec3c8f4Simarom#include "Python.h"
17aec3c8f4Simarom#ifndef Py_PYTHON_H
18aec3c8f4Simarom    #error Python headers needed to compile C extensions, please install development version of Python.
19aec3c8f4Simarom#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
20aec3c8f4Simarom    #error Cython requires Python 2.6+ or Python 3.2+.
21aec3c8f4Simarom#else
22aec3c8f4Simarom#define CYTHON_ABI "0_21_2"
23aec3c8f4Simarom#include <stddef.h>
24aec3c8f4Simarom#ifndef offsetof
25aec3c8f4Simarom#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
26aec3c8f4Simarom#endif
27aec3c8f4Simarom#if !defined(WIN32) && !defined(MS_WINDOWS)
28aec3c8f4Simarom  #ifndef __stdcall
29aec3c8f4Simarom    #define __stdcall
30aec3c8f4Simarom  #endif
31aec3c8f4Simarom  #ifndef __cdecl
32aec3c8f4Simarom    #define __cdecl
33aec3c8f4Simarom  #endif
34aec3c8f4Simarom  #ifndef __fastcall
35aec3c8f4Simarom    #define __fastcall
36aec3c8f4Simarom  #endif
37aec3c8f4Simarom#endif
38aec3c8f4Simarom#ifndef DL_IMPORT
39aec3c8f4Simarom  #define DL_IMPORT(t) t
40aec3c8f4Simarom#endif
41aec3c8f4Simarom#ifndef DL_EXPORT
42aec3c8f4Simarom  #define DL_EXPORT(t) t
43aec3c8f4Simarom#endif
44aec3c8f4Simarom#ifndef PY_LONG_LONG
45aec3c8f4Simarom  #define PY_LONG_LONG LONG_LONG
46aec3c8f4Simarom#endif
47aec3c8f4Simarom#ifndef Py_HUGE_VAL
48aec3c8f4Simarom  #define Py_HUGE_VAL HUGE_VAL
49aec3c8f4Simarom#endif
50aec3c8f4Simarom#ifdef PYPY_VERSION
51aec3c8f4Simarom#define CYTHON_COMPILING_IN_PYPY 1
52aec3c8f4Simarom#define CYTHON_COMPILING_IN_CPYTHON 0
53aec3c8f4Simarom#else
54aec3c8f4Simarom#define CYTHON_COMPILING_IN_PYPY 0
55aec3c8f4Simarom#define CYTHON_COMPILING_IN_CPYTHON 1
56aec3c8f4Simarom#endif
57aec3c8f4Simarom#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
58aec3c8f4Simarom#define Py_OptimizeFlag 0
59aec3c8f4Simarom#endif
60aec3c8f4Simarom#define __PYX_BUILD_PY_SSIZE_T "n"
61aec3c8f4Simarom#define CYTHON_FORMAT_SSIZE_T "z"
62aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
63aec3c8f4Simarom  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
64aec3c8f4Simarom  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
65aec3c8f4Simarom          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
66aec3c8f4Simarom  #define __Pyx_DefaultClassType PyClass_Type
67aec3c8f4Simarom#else
68aec3c8f4Simarom  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
69aec3c8f4Simarom  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
70aec3c8f4Simarom          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
71aec3c8f4Simarom  #define __Pyx_DefaultClassType PyType_Type
72aec3c8f4Simarom#endif
73aec3c8f4Simarom#if PY_MAJOR_VERSION >= 3
74aec3c8f4Simarom  #define Py_TPFLAGS_CHECKTYPES 0
75aec3c8f4Simarom  #define Py_TPFLAGS_HAVE_INDEX 0
76aec3c8f4Simarom  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
77aec3c8f4Simarom#endif
78aec3c8f4Simarom#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
79aec3c8f4Simarom  #define Py_TPFLAGS_HAVE_FINALIZE 0
80aec3c8f4Simarom#endif
81aec3c8f4Simarom#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
82aec3c8f4Simarom  #define CYTHON_PEP393_ENABLED 1
83aec3c8f4Simarom  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
84aec3c8f4Simarom                                              0 : _PyUnicode_Ready((PyObject *)(op)))
85aec3c8f4Simarom  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
86aec3c8f4Simarom  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
87aec3c8f4Simarom  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
88aec3c8f4Simarom  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
89aec3c8f4Simarom  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
90aec3c8f4Simarom#else
91aec3c8f4Simarom  #define CYTHON_PEP393_ENABLED 0
92aec3c8f4Simarom  #define __Pyx_PyUnicode_READY(op)       (0)
93aec3c8f4Simarom  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
94aec3c8f4Simarom  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
95aec3c8f4Simarom  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
96aec3c8f4Simarom  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
97aec3c8f4Simarom  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
98aec3c8f4Simarom#endif
99aec3c8f4Simarom#if CYTHON_COMPILING_IN_PYPY
100aec3c8f4Simarom  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
101aec3c8f4Simarom  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
102aec3c8f4Simarom  #define __Pyx_PyFrozenSet_Size(s)         PyObject_Size(s)
103aec3c8f4Simarom#else
104aec3c8f4Simarom  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
105aec3c8f4Simarom  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
106aec3c8f4Simarom      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
107aec3c8f4Simarom  #define __Pyx_PyFrozenSet_Size(s)         PySet_Size(s)
108aec3c8f4Simarom#endif
109aec3c8f4Simarom#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
110aec3c8f4Simarom#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
111aec3c8f4Simarom#if PY_MAJOR_VERSION >= 3
112aec3c8f4Simarom  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
113aec3c8f4Simarom#else
114aec3c8f4Simarom  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
115aec3c8f4Simarom#endif
116aec3c8f4Simarom#if PY_MAJOR_VERSION >= 3
117aec3c8f4Simarom  #define PyBaseString_Type            PyUnicode_Type
118aec3c8f4Simarom  #define PyStringObject               PyUnicodeObject
119aec3c8f4Simarom  #define PyString_Type                PyUnicode_Type
120aec3c8f4Simarom  #define PyString_Check               PyUnicode_Check
121aec3c8f4Simarom  #define PyString_CheckExact          PyUnicode_CheckExact
122aec3c8f4Simarom#endif
123aec3c8f4Simarom#if PY_MAJOR_VERSION >= 3
124aec3c8f4Simarom  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
125aec3c8f4Simarom  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
126aec3c8f4Simarom#else
127aec3c8f4Simarom  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
128aec3c8f4Simarom  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
129aec3c8f4Simarom#endif
130aec3c8f4Simarom#ifndef PySet_CheckExact
131aec3c8f4Simarom  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
132aec3c8f4Simarom#endif
133aec3c8f4Simarom#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
134aec3c8f4Simarom#if PY_MAJOR_VERSION >= 3
135aec3c8f4Simarom  #define PyIntObject                  PyLongObject
136aec3c8f4Simarom  #define PyInt_Type                   PyLong_Type
137aec3c8f4Simarom  #define PyInt_Check(op)              PyLong_Check(op)
138aec3c8f4Simarom  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
139aec3c8f4Simarom  #define PyInt_FromString             PyLong_FromString
140aec3c8f4Simarom  #define PyInt_FromUnicode            PyLong_FromUnicode
141aec3c8f4Simarom  #define PyInt_FromLong               PyLong_FromLong
142aec3c8f4Simarom  #define PyInt_FromSize_t             PyLong_FromSize_t
143aec3c8f4Simarom  #define PyInt_FromSsize_t            PyLong_FromSsize_t
144aec3c8f4Simarom  #define PyInt_AsLong                 PyLong_AsLong
145aec3c8f4Simarom  #define PyInt_AS_LONG                PyLong_AS_LONG
146aec3c8f4Simarom  #define PyInt_AsSsize_t              PyLong_AsSsize_t
147aec3c8f4Simarom  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
148aec3c8f4Simarom  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
149aec3c8f4Simarom  #define PyNumber_Int                 PyNumber_Long
150aec3c8f4Simarom#endif
151aec3c8f4Simarom#if PY_MAJOR_VERSION >= 3
152aec3c8f4Simarom  #define PyBoolObject                 PyLongObject
153aec3c8f4Simarom#endif
154aec3c8f4Simarom#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
155aec3c8f4Simarom  #ifndef PyUnicode_InternFromString
156aec3c8f4Simarom    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
157aec3c8f4Simarom  #endif
158aec3c8f4Simarom#endif
159aec3c8f4Simarom#if PY_VERSION_HEX < 0x030200A4
160aec3c8f4Simarom  typedef long Py_hash_t;
161aec3c8f4Simarom  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
162aec3c8f4Simarom  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
163aec3c8f4Simarom#else
164aec3c8f4Simarom  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
165aec3c8f4Simarom  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
166aec3c8f4Simarom#endif
167aec3c8f4Simarom#if PY_MAJOR_VERSION >= 3
168aec3c8f4Simarom  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
169aec3c8f4Simarom#else
170aec3c8f4Simarom  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
171aec3c8f4Simarom#endif
172aec3c8f4Simarom#ifndef CYTHON_INLINE
173aec3c8f4Simarom  #if defined(__GNUC__)
174aec3c8f4Simarom    #define CYTHON_INLINE __inline__
175aec3c8f4Simarom  #elif defined(_MSC_VER)
176aec3c8f4Simarom    #define CYTHON_INLINE __inline
177aec3c8f4Simarom  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
178aec3c8f4Simarom    #define CYTHON_INLINE inline
179aec3c8f4Simarom  #else
180aec3c8f4Simarom    #define CYTHON_INLINE
181aec3c8f4Simarom  #endif
182aec3c8f4Simarom#endif
183aec3c8f4Simarom#ifndef CYTHON_RESTRICT
184aec3c8f4Simarom  #if defined(__GNUC__)
185aec3c8f4Simarom    #define CYTHON_RESTRICT __restrict__
186aec3c8f4Simarom  #elif defined(_MSC_VER) && _MSC_VER >= 1400
187aec3c8f4Simarom    #define CYTHON_RESTRICT __restrict
188aec3c8f4Simarom  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
189aec3c8f4Simarom    #define CYTHON_RESTRICT restrict
190aec3c8f4Simarom  #else
191aec3c8f4Simarom    #define CYTHON_RESTRICT
192aec3c8f4Simarom  #endif
193aec3c8f4Simarom#endif
194aec3c8f4Simarom#ifdef NAN
195aec3c8f4Simarom#define __PYX_NAN() ((float) NAN)
196aec3c8f4Simarom#else
197aec3c8f4Simaromstatic CYTHON_INLINE float __PYX_NAN() {
198aec3c8f4Simarom  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
199aec3c8f4Simarom   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
200aec3c8f4Simarom   a quiet NaN. */
201aec3c8f4Simarom  float value;
202aec3c8f4Simarom  memset(&value, 0xFF, sizeof(value));
203aec3c8f4Simarom  return value;
204aec3c8f4Simarom}
205aec3c8f4Simarom#endif
206aec3c8f4Simarom#ifdef __cplusplus
207aec3c8f4Simaromtemplate<typename T>
208aec3c8f4Simaromvoid __Pyx_call_destructor(T* x) {
209aec3c8f4Simarom    x->~T();
210aec3c8f4Simarom}
211aec3c8f4Simarom#endif
212aec3c8f4Simarom
213aec3c8f4Simarom
214aec3c8f4Simarom#if PY_MAJOR_VERSION >= 3
215aec3c8f4Simarom  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
216aec3c8f4Simarom  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
217aec3c8f4Simarom#else
218aec3c8f4Simarom  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
219aec3c8f4Simarom  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
220aec3c8f4Simarom#endif
221aec3c8f4Simarom
222aec3c8f4Simarom#ifndef __PYX_EXTERN_C
223aec3c8f4Simarom  #ifdef __cplusplus
224aec3c8f4Simarom    #define __PYX_EXTERN_C extern "C"
225aec3c8f4Simarom  #else
226aec3c8f4Simarom    #define __PYX_EXTERN_C extern
227aec3c8f4Simarom  #endif
228aec3c8f4Simarom#endif
229aec3c8f4Simarom
230aec3c8f4Simarom#if defined(WIN32) || defined(MS_WINDOWS)
231aec3c8f4Simarom#define _USE_MATH_DEFINES
232aec3c8f4Simarom#endif
233aec3c8f4Simarom#include <math.h>
234aec3c8f4Simarom#define __PYX_HAVE__zmq__backend__cython__context
235aec3c8f4Simarom#define __PYX_HAVE_API__zmq__backend__cython__context
236aec3c8f4Simarom#include "string.h"
237aec3c8f4Simarom#include "stdlib.h"
238aec3c8f4Simarom#include "zmq_compat.h"
239aec3c8f4Simarom#include "zmq.h"
240aec3c8f4Simarom#include "zmq_utils.h"
241aec3c8f4Simarom#include "getpid_compat.h"
242aec3c8f4Simarom#include "errno.h"
243aec3c8f4Simarom#include "stdio.h"
244aec3c8f4Simarom#include "pythread.h"
245aec3c8f4Simarom#ifdef _OPENMP
246aec3c8f4Simarom#include <omp.h>
247aec3c8f4Simarom#endif /* _OPENMP */
248aec3c8f4Simarom
249aec3c8f4Simarom#ifdef PYREX_WITHOUT_ASSERTIONS
250aec3c8f4Simarom#define CYTHON_WITHOUT_ASSERTIONS
251aec3c8f4Simarom#endif
252aec3c8f4Simarom
253aec3c8f4Simarom#ifndef CYTHON_UNUSED
254aec3c8f4Simarom# if defined(__GNUC__)
255aec3c8f4Simarom#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
256aec3c8f4Simarom#     define CYTHON_UNUSED __attribute__ ((__unused__))
257aec3c8f4Simarom#   else
258aec3c8f4Simarom#     define CYTHON_UNUSED
259aec3c8f4Simarom#   endif
260aec3c8f4Simarom# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
261aec3c8f4Simarom#   define CYTHON_UNUSED __attribute__ ((__unused__))
262aec3c8f4Simarom# else
263aec3c8f4Simarom#   define CYTHON_UNUSED
264aec3c8f4Simarom# endif
265aec3c8f4Simarom#endif
266aec3c8f4Simaromtypedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
267aec3c8f4Simarom                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
268aec3c8f4Simarom
269aec3c8f4Simarom#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
270aec3c8f4Simarom#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
271aec3c8f4Simarom#define __PYX_DEFAULT_STRING_ENCODING ""
272aec3c8f4Simarom#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
273aec3c8f4Simarom#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
274aec3c8f4Simarom#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (    \
275aec3c8f4Simarom    (sizeof(type) < sizeof(Py_ssize_t))  ||             \
276aec3c8f4Simarom    (sizeof(type) > sizeof(Py_ssize_t) &&               \
277aec3c8f4Simarom          likely(v < (type)PY_SSIZE_T_MAX ||            \
278aec3c8f4Simarom                 v == (type)PY_SSIZE_T_MAX)  &&         \
279aec3c8f4Simarom          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||       \
280aec3c8f4Simarom                                v == (type)PY_SSIZE_T_MIN)))  ||  \
281aec3c8f4Simarom    (sizeof(type) == sizeof(Py_ssize_t) &&              \
282aec3c8f4Simarom          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||        \
283aec3c8f4Simarom                               v == (type)PY_SSIZE_T_MAX)))  )
284aec3c8f4Simaromstatic CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
285aec3c8f4Simaromstatic CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
286aec3c8f4Simarom#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
287aec3c8f4Simarom#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
288aec3c8f4Simarom#define __Pyx_PyBytes_FromString        PyBytes_FromString
289aec3c8f4Simarom#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
290aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
291aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
292aec3c8f4Simarom    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
293aec3c8f4Simarom    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
294aec3c8f4Simarom#else
295aec3c8f4Simarom    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
296aec3c8f4Simarom    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
297aec3c8f4Simarom#endif
298aec3c8f4Simarom#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
299aec3c8f4Simarom#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
300aec3c8f4Simarom#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((const char*)s)
301aec3c8f4Simarom#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((const char*)s)
302aec3c8f4Simarom#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((const char*)s)
303aec3c8f4Simarom#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((const char*)s)
304aec3c8f4Simarom#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
305aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
306aec3c8f4Simaromstatic CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
307aec3c8f4Simarom{
308aec3c8f4Simarom    const Py_UNICODE *u_end = u;
309aec3c8f4Simarom    while (*u_end++) ;
310aec3c8f4Simarom    return (size_t)(u_end - u - 1);
311aec3c8f4Simarom}
312aec3c8f4Simarom#else
313aec3c8f4Simarom#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
314aec3c8f4Simarom#endif
315aec3c8f4Simarom#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
316aec3c8f4Simarom#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
317aec3c8f4Simarom#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
318aec3c8f4Simarom#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
319aec3c8f4Simarom#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
320aec3c8f4Simaromstatic CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
321aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
322aec3c8f4Simaromstatic CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
323aec3c8f4Simaromstatic CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
324aec3c8f4Simarom#if CYTHON_COMPILING_IN_CPYTHON
325aec3c8f4Simarom#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
326aec3c8f4Simarom#else
327aec3c8f4Simarom#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
328aec3c8f4Simarom#endif
329aec3c8f4Simarom#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
330aec3c8f4Simarom#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
331aec3c8f4Simaromstatic int __Pyx_sys_getdefaultencoding_not_ascii;
332aec3c8f4Simaromstatic int __Pyx_init_sys_getdefaultencoding_params(void) {
333aec3c8f4Simarom    PyObject* sys;
334aec3c8f4Simarom    PyObject* default_encoding = NULL;
335aec3c8f4Simarom    PyObject* ascii_chars_u = NULL;
336aec3c8f4Simarom    PyObject* ascii_chars_b = NULL;
337aec3c8f4Simarom    const char* default_encoding_c;
338aec3c8f4Simarom    sys = PyImport_ImportModule("sys");
339aec3c8f4Simarom    if (!sys) goto bad;
340aec3c8f4Simarom    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
341aec3c8f4Simarom    Py_DECREF(sys);
342aec3c8f4Simarom    if (!default_encoding) goto bad;
343aec3c8f4Simarom    default_encoding_c = PyBytes_AsString(default_encoding);
344aec3c8f4Simarom    if (!default_encoding_c) goto bad;
345aec3c8f4Simarom    if (strcmp(default_encoding_c, "ascii") == 0) {
346aec3c8f4Simarom        __Pyx_sys_getdefaultencoding_not_ascii = 0;
347aec3c8f4Simarom    } else {
348aec3c8f4Simarom        char ascii_chars[128];
349aec3c8f4Simarom        int c;
350aec3c8f4Simarom        for (c = 0; c < 128; c++) {
351aec3c8f4Simarom            ascii_chars[c] = c;
352aec3c8f4Simarom        }
353aec3c8f4Simarom        __Pyx_sys_getdefaultencoding_not_ascii = 1;
354aec3c8f4Simarom        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
355aec3c8f4Simarom        if (!ascii_chars_u) goto bad;
356aec3c8f4Simarom        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
357aec3c8f4Simarom        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
358aec3c8f4Simarom            PyErr_Format(
359aec3c8f4Simarom                PyExc_ValueError,
360aec3c8f4Simarom                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
361aec3c8f4Simarom                default_encoding_c);
362aec3c8f4Simarom            goto bad;
363aec3c8f4Simarom        }
364aec3c8f4Simarom        Py_DECREF(ascii_chars_u);
365aec3c8f4Simarom        Py_DECREF(ascii_chars_b);
366aec3c8f4Simarom    }
367aec3c8f4Simarom    Py_DECREF(default_encoding);
368aec3c8f4Simarom    return 0;
369aec3c8f4Simarombad:
370aec3c8f4Simarom    Py_XDECREF(default_encoding);
371aec3c8f4Simarom    Py_XDECREF(ascii_chars_u);
372aec3c8f4Simarom    Py_XDECREF(ascii_chars_b);
373aec3c8f4Simarom    return -1;
374aec3c8f4Simarom}
375aec3c8f4Simarom#endif
376aec3c8f4Simarom#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
377aec3c8f4Simarom#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
378aec3c8f4Simarom#else
379aec3c8f4Simarom#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
380aec3c8f4Simarom#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
381aec3c8f4Simaromstatic char* __PYX_DEFAULT_STRING_ENCODING;
382aec3c8f4Simaromstatic int __Pyx_init_sys_getdefaultencoding_params(void) {
383aec3c8f4Simarom    PyObject* sys;
384aec3c8f4Simarom    PyObject* default_encoding = NULL;
385aec3c8f4Simarom    char* default_encoding_c;
386aec3c8f4Simarom    sys = PyImport_ImportModule("sys");
387aec3c8f4Simarom    if (!sys) goto bad;
388aec3c8f4Simarom    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
389aec3c8f4Simarom    Py_DECREF(sys);
390aec3c8f4Simarom    if (!default_encoding) goto bad;
391aec3c8f4Simarom    default_encoding_c = PyBytes_AsString(default_encoding);
392aec3c8f4Simarom    if (!default_encoding_c) goto bad;
393aec3c8f4Simarom    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
394aec3c8f4Simarom    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
395aec3c8f4Simarom    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
396aec3c8f4Simarom    Py_DECREF(default_encoding);
397aec3c8f4Simarom    return 0;
398aec3c8f4Simarombad:
399aec3c8f4Simarom    Py_XDECREF(default_encoding);
400aec3c8f4Simarom    return -1;
401aec3c8f4Simarom}
402aec3c8f4Simarom#endif
403aec3c8f4Simarom#endif
404aec3c8f4Simarom
405aec3c8f4Simarom
406aec3c8f4Simarom/* Test for GCC > 2.95 */
407aec3c8f4Simarom#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
408aec3c8f4Simarom  #define likely(x)   __builtin_expect(!!(x), 1)
409aec3c8f4Simarom  #define unlikely(x) __builtin_expect(!!(x), 0)
410aec3c8f4Simarom#else /* !__GNUC__ or GCC < 2.95 */
411aec3c8f4Simarom  #define likely(x)   (x)
412aec3c8f4Simarom  #define unlikely(x) (x)
413aec3c8f4Simarom#endif /* __GNUC__ */
414aec3c8f4Simarom
415aec3c8f4Simaromstatic PyObject *__pyx_m;
416aec3c8f4Simaromstatic PyObject *__pyx_d;
417aec3c8f4Simaromstatic PyObject *__pyx_b;
418aec3c8f4Simaromstatic PyObject *__pyx_empty_tuple;
419aec3c8f4Simaromstatic PyObject *__pyx_empty_bytes;
420aec3c8f4Simaromstatic int __pyx_lineno;
421aec3c8f4Simaromstatic int __pyx_clineno = 0;
422aec3c8f4Simaromstatic const char * __pyx_cfilenm= __FILE__;
423aec3c8f4Simaromstatic const char *__pyx_filename;
424aec3c8f4Simarom
425aec3c8f4Simarom
426aec3c8f4Simaromstatic const char *__pyx_f[] = {
427aec3c8f4Simarom  "zmq/backend/cython/context.pyx",
428aec3c8f4Simarom  "zmq/backend/cython/context.pxd",
429aec3c8f4Simarom  "zmq/backend/cython/checkrc.pxd",
430aec3c8f4Simarom  "type.pxd",
431aec3c8f4Simarom  "bool.pxd",
432aec3c8f4Simarom  "complex.pxd",
433aec3c8f4Simarom};
434aec3c8f4Simarom
435aec3c8f4Simarom/*--- Type declarations ---*/
436aec3c8f4Simaromstruct __pyx_obj_3zmq_7backend_6cython_7context_Context;
437aec3c8f4Simarom
438aec3c8f4Simarom/* "zmq/backend/cython/context.pxd":26
439aec3c8f4Simarom * #-----------------------------------------------------------------------------
440aec3c8f4Simarom *
441aec3c8f4Simarom * cdef class Context:             # <<<<<<<<<<<<<<
442aec3c8f4Simarom *
443aec3c8f4Simarom *     cdef object __weakref__     # enable weakref
444aec3c8f4Simarom */
445aec3c8f4Simaromstruct __pyx_obj_3zmq_7backend_6cython_7context_Context {
446aec3c8f4Simarom  PyObject_HEAD
447aec3c8f4Simarom  struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context *__pyx_vtab;
448aec3c8f4Simarom  PyObject *__weakref__;
449aec3c8f4Simarom  void *handle;
450aec3c8f4Simarom  int _shadow;
451aec3c8f4Simarom  void **_sockets;
452aec3c8f4Simarom  size_t _n_sockets;
453aec3c8f4Simarom  size_t _max_sockets;
454aec3c8f4Simarom  int _pid;
455aec3c8f4Simarom  int closed;
456aec3c8f4Simarom};
457aec3c8f4Simarom
458aec3c8f4Simarom
459aec3c8f4Simarom
460aec3c8f4Simarom/* "zmq/backend/cython/context.pyx":20
461aec3c8f4Simarom * _instance = None
462aec3c8f4Simarom *
463aec3c8f4Simarom * cdef class Context:             # <<<<<<<<<<<<<<
464aec3c8f4Simarom *     """Context(io_threads=1)
465aec3c8f4Simarom *
466aec3c8f4Simarom */
467aec3c8f4Simarom
468aec3c8f4Simaromstruct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context {
469aec3c8f4Simarom  int (*_term)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *);
470aec3c8f4Simarom  void (*_add_socket)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *, void *);
471aec3c8f4Simarom  void (*_remove_socket)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *, void *);
472aec3c8f4Simarom};
473aec3c8f4Simaromstatic struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context *__pyx_vtabptr_3zmq_7backend_6cython_7context_Context;
474aec3c8f4Simaromstatic CYTHON_INLINE int __pyx_f_3zmq_7backend_6cython_7context_7Context__term(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *);
475aec3c8f4Simaromstatic CYTHON_INLINE void __pyx_f_3zmq_7backend_6cython_7context_7Context__add_socket(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *, void *);
476aec3c8f4Simaromstatic CYTHON_INLINE void __pyx_f_3zmq_7backend_6cython_7context_7Context__remove_socket(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *, void *);
477aec3c8f4Simarom#ifndef CYTHON_REFNANNY
478aec3c8f4Simarom  #define CYTHON_REFNANNY 0
479aec3c8f4Simarom#endif
480aec3c8f4Simarom#if CYTHON_REFNANNY
481aec3c8f4Simarom  typedef struct {
482aec3c8f4Simarom    void (*INCREF)(void*, PyObject*, int);
483aec3c8f4Simarom    void (*DECREF)(void*, PyObject*, int);
484aec3c8f4Simarom    void (*GOTREF)(void*, PyObject*, int);
485aec3c8f4Simarom    void (*GIVEREF)(void*, PyObject*, int);
486aec3c8f4Simarom    void* (*SetupContext)(const char*, int, const char*);
487aec3c8f4Simarom    void (*FinishContext)(void**);
488aec3c8f4Simarom  } __Pyx_RefNannyAPIStruct;
489aec3c8f4Simarom  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
490aec3c8f4Simarom  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
491aec3c8f4Simarom  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
492aec3c8f4Simarom#ifdef WITH_THREAD
493aec3c8f4Simarom  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
494aec3c8f4Simarom          if (acquire_gil) { \
495aec3c8f4Simarom              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
496aec3c8f4Simarom              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
497aec3c8f4Simarom              PyGILState_Release(__pyx_gilstate_save); \
498aec3c8f4Simarom          } else { \
499aec3c8f4Simarom              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
500aec3c8f4Simarom          }
501aec3c8f4Simarom#else
502aec3c8f4Simarom  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
503aec3c8f4Simarom          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
504aec3c8f4Simarom#endif
505aec3c8f4Simarom  #define __Pyx_RefNannyFinishContext() \
506aec3c8f4Simarom          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
507aec3c8f4Simarom  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
508aec3c8f4Simarom  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
509aec3c8f4Simarom  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
510aec3c8f4Simarom  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
511aec3c8f4Simarom  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
512aec3c8f4Simarom  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
513aec3c8f4Simarom  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
514aec3c8f4Simarom  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
515aec3c8f4Simarom#else
516aec3c8f4Simarom  #define __Pyx_RefNannyDeclarations
517aec3c8f4Simarom  #define __Pyx_RefNannySetupContext(name, acquire_gil)
518aec3c8f4Simarom  #define __Pyx_RefNannyFinishContext()
519aec3c8f4Simarom  #define __Pyx_INCREF(r) Py_INCREF(r)
520aec3c8f4Simarom  #define __Pyx_DECREF(r) Py_DECREF(r)
521aec3c8f4Simarom  #define __Pyx_GOTREF(r)
522aec3c8f4Simarom  #define __Pyx_GIVEREF(r)
523aec3c8f4Simarom  #define __Pyx_XINCREF(r) Py_XINCREF(r)
524aec3c8f4Simarom  #define __Pyx_XDECREF(r) Py_XDECREF(r)
525aec3c8f4Simarom  #define __Pyx_XGOTREF(r)
526aec3c8f4Simarom  #define __Pyx_XGIVEREF(r)
527aec3c8f4Simarom#endif
528aec3c8f4Simarom#define __Pyx_XDECREF_SET(r, v) do {                            \
529aec3c8f4Simarom        PyObject *tmp = (PyObject *) r;                         \
530aec3c8f4Simarom        r = v; __Pyx_XDECREF(tmp);                              \
531aec3c8f4Simarom    } while (0)
532aec3c8f4Simarom#define __Pyx_DECREF_SET(r, v) do {                             \
533aec3c8f4Simarom        PyObject *tmp = (PyObject *) r;                         \
534aec3c8f4Simarom        r = v; __Pyx_DECREF(tmp);                               \
535aec3c8f4Simarom    } while (0)
536aec3c8f4Simarom#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
537aec3c8f4Simarom#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
538aec3c8f4Simarom
539aec3c8f4Simarom#if CYTHON_COMPILING_IN_CPYTHON
540aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
541aec3c8f4Simarom    PyTypeObject* tp = Py_TYPE(obj);
542aec3c8f4Simarom    if (likely(tp->tp_getattro))
543aec3c8f4Simarom        return tp->tp_getattro(obj, attr_name);
544aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
545aec3c8f4Simarom    if (likely(tp->tp_getattr))
546aec3c8f4Simarom        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
547aec3c8f4Simarom#endif
548aec3c8f4Simarom    return PyObject_GetAttr(obj, attr_name);
549aec3c8f4Simarom}
550aec3c8f4Simarom#else
551aec3c8f4Simarom#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
552aec3c8f4Simarom#endif
553aec3c8f4Simarom
554aec3c8f4Simaromstatic PyObject *__Pyx_GetBuiltinName(PyObject *name);
555aec3c8f4Simarom
556aec3c8f4Simaromstatic void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
557aec3c8f4Simarom
558aec3c8f4Simaromstatic int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
559aec3c8f4Simarom    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
560aec3c8f4Simarom    const char* function_name);
561aec3c8f4Simarom
562aec3c8f4Simaromstatic void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
563aec3c8f4Simarom    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
564aec3c8f4Simarom
565aec3c8f4Simaromstatic CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
566aec3c8f4Simarom
567aec3c8f4Simarom#if CYTHON_COMPILING_IN_CPYTHON
568aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
569aec3c8f4Simarom#else
570aec3c8f4Simarom#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
571aec3c8f4Simarom#endif
572aec3c8f4Simarom
573aec3c8f4Simarom#if CYTHON_COMPILING_IN_CPYTHON
574aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
575aec3c8f4Simarom#endif
576aec3c8f4Simarom
577aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
578aec3c8f4Simarom
579aec3c8f4Simarom#if CYTHON_COMPILING_IN_CPYTHON
580aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
581aec3c8f4Simarom#else
582aec3c8f4Simarom#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
583aec3c8f4Simarom#endif
584aec3c8f4Simarom
585aec3c8f4Simaromstatic CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
586aec3c8f4Simaromstatic CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
587aec3c8f4Simarom
588aec3c8f4Simaromstatic void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
589aec3c8f4Simarom
590aec3c8f4Simaromstatic void __Pyx_WriteUnraisable(const char *name, int clineno,
591aec3c8f4Simarom                                  int lineno, const char *filename,
592aec3c8f4Simarom                                  int full_traceback);
593aec3c8f4Simarom
594aec3c8f4Simaromstatic PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
595aec3c8f4Simarom
596aec3c8f4Simaromstatic int __Pyx_SetVtable(PyObject *dict, void *vtable);
597aec3c8f4Simarom
598aec3c8f4Simaromstatic PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name);
599aec3c8f4Simarom
600aec3c8f4Simaromtypedef struct {
601aec3c8f4Simarom    int code_line;
602aec3c8f4Simarom    PyCodeObject* code_object;
603aec3c8f4Simarom} __Pyx_CodeObjectCacheEntry;
604aec3c8f4Simaromstruct __Pyx_CodeObjectCache {
605aec3c8f4Simarom    int count;
606aec3c8f4Simarom    int max_count;
607aec3c8f4Simarom    __Pyx_CodeObjectCacheEntry* entries;
608aec3c8f4Simarom};
609aec3c8f4Simaromstatic struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
610aec3c8f4Simaromstatic int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
611aec3c8f4Simaromstatic PyCodeObject *__pyx_find_code_object(int code_line);
612aec3c8f4Simaromstatic void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
613aec3c8f4Simarom
614aec3c8f4Simaromstatic void __Pyx_AddTraceback(const char *funcname, int c_line,
615aec3c8f4Simarom                               int py_line, const char *filename);
616aec3c8f4Simarom
617aec3c8f4Simaromstatic PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
618aec3c8f4Simarom
619aec3c8f4Simaromstatic CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
620aec3c8f4Simarom
621aec3c8f4Simaromstatic CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);
622aec3c8f4Simarom
623aec3c8f4Simarom#ifndef __PYX_FORCE_INIT_THREADS
624aec3c8f4Simarom  #define __PYX_FORCE_INIT_THREADS 0
625aec3c8f4Simarom#endif
626aec3c8f4Simarom
627aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
628aec3c8f4Simarom
629aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
630aec3c8f4Simarom
631aec3c8f4Simaromstatic CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
632aec3c8f4Simarom
633aec3c8f4Simaromstatic int __Pyx_check_binary_version(void);
634aec3c8f4Simarom
635aec3c8f4Simarom#if !defined(__Pyx_PyIdentifier_FromString)
636aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
637aec3c8f4Simarom  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
638aec3c8f4Simarom#else
639aec3c8f4Simarom  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
640aec3c8f4Simarom#endif
641aec3c8f4Simarom#endif
642aec3c8f4Simarom
643aec3c8f4Simaromstatic PyObject *__Pyx_ImportModule(const char *name);
644aec3c8f4Simarom
645aec3c8f4Simaromstatic PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
646aec3c8f4Simarom
647aec3c8f4Simaromstatic int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
648aec3c8f4Simarom
649aec3c8f4Simaromstatic CYTHON_INLINE void __pyx_f_3zmq_7backend_6cython_7context_7Context__add_socket(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, void *__pyx_v_handle); /* proto*/
650aec3c8f4Simaromstatic CYTHON_INLINE void __pyx_f_3zmq_7backend_6cython_7context_7Context__remove_socket(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, void *__pyx_v_handle); /* proto*/
651aec3c8f4Simaromstatic CYTHON_INLINE int __pyx_f_3zmq_7backend_6cython_7context_7Context__term(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self); /* proto*/
652aec3c8f4Simarom
653aec3c8f4Simarom/* Module declarations from 'libc.string' */
654aec3c8f4Simarom
655aec3c8f4Simarom/* Module declarations from 'libc.stdlib' */
656aec3c8f4Simarom
657aec3c8f4Simarom/* Module declarations from 'zmq.backend.cython.libzmq' */
658aec3c8f4Simarom
659aec3c8f4Simarom/* Module declarations from 'libc.errno' */
660aec3c8f4Simarom
661aec3c8f4Simarom/* Module declarations from 'cpython.version' */
662aec3c8f4Simarom
663aec3c8f4Simarom/* Module declarations from 'cpython.ref' */
664aec3c8f4Simarom
665aec3c8f4Simarom/* Module declarations from 'cpython.exc' */
666aec3c8f4Simarom
667aec3c8f4Simarom/* Module declarations from 'cpython.module' */
668aec3c8f4Simarom
669aec3c8f4Simarom/* Module declarations from 'cpython.mem' */
670aec3c8f4Simarom
671aec3c8f4Simarom/* Module declarations from 'cpython.tuple' */
672aec3c8f4Simarom
673aec3c8f4Simarom/* Module declarations from 'cpython.list' */
674aec3c8f4Simarom
675aec3c8f4Simarom/* Module declarations from 'libc.stdio' */
676aec3c8f4Simarom
677aec3c8f4Simarom/* Module declarations from 'cpython.object' */
678aec3c8f4Simarom
679aec3c8f4Simarom/* Module declarations from 'cpython.sequence' */
680aec3c8f4Simarom
681aec3c8f4Simarom/* Module declarations from 'cpython.mapping' */
682aec3c8f4Simarom
683aec3c8f4Simarom/* Module declarations from 'cpython.iterator' */
684aec3c8f4Simarom
685aec3c8f4Simarom/* Module declarations from '__builtin__' */
686aec3c8f4Simarom
687aec3c8f4Simarom/* Module declarations from 'cpython.type' */
688aec3c8f4Simaromstatic PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
689aec3c8f4Simarom
690aec3c8f4Simarom/* Module declarations from 'cpython.number' */
691aec3c8f4Simarom
692aec3c8f4Simarom/* Module declarations from 'cpython.int' */
693aec3c8f4Simarom
694aec3c8f4Simarom/* Module declarations from '__builtin__' */
695aec3c8f4Simarom
696aec3c8f4Simarom/* Module declarations from 'cpython.bool' */
697aec3c8f4Simaromstatic PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
698aec3c8f4Simarom
699aec3c8f4Simarom/* Module declarations from 'cpython.long' */
700aec3c8f4Simarom
701aec3c8f4Simarom/* Module declarations from 'cpython.float' */
702aec3c8f4Simarom
703aec3c8f4Simarom/* Module declarations from '__builtin__' */
704aec3c8f4Simarom
705aec3c8f4Simarom/* Module declarations from 'cpython.complex' */
706aec3c8f4Simaromstatic PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
707aec3c8f4Simarom
708aec3c8f4Simarom/* Module declarations from 'cpython.string' */
709aec3c8f4Simarom
710aec3c8f4Simarom/* Module declarations from 'cpython.unicode' */
711aec3c8f4Simarom
712aec3c8f4Simarom/* Module declarations from 'cpython.dict' */
713aec3c8f4Simarom
714aec3c8f4Simarom/* Module declarations from 'cpython.instance' */
715aec3c8f4Simarom
716aec3c8f4Simarom/* Module declarations from 'cpython.function' */
717aec3c8f4Simarom
718aec3c8f4Simarom/* Module declarations from 'cpython.method' */
719aec3c8f4Simarom
720aec3c8f4Simarom/* Module declarations from 'cpython.weakref' */
721aec3c8f4Simarom
722aec3c8f4Simarom/* Module declarations from 'cpython.getargs' */
723aec3c8f4Simarom
724aec3c8f4Simarom/* Module declarations from 'cpython.pythread' */
725aec3c8f4Simarom
726aec3c8f4Simarom/* Module declarations from 'cpython.pystate' */
727aec3c8f4Simarom
728aec3c8f4Simarom/* Module declarations from 'cpython.cobject' */
729aec3c8f4Simarom
730aec3c8f4Simarom/* Module declarations from 'cpython.oldbuffer' */
731aec3c8f4Simarom
732aec3c8f4Simarom/* Module declarations from 'cpython.set' */
733aec3c8f4Simarom
734aec3c8f4Simarom/* Module declarations from 'cpython.buffer' */
735aec3c8f4Simarom
736aec3c8f4Simarom/* Module declarations from 'cpython.bytes' */
737aec3c8f4Simarom
738aec3c8f4Simarom/* Module declarations from 'cpython.pycapsule' */
739aec3c8f4Simarom
740aec3c8f4Simarom/* Module declarations from 'cpython' */
741aec3c8f4Simarom
742aec3c8f4Simarom/* Module declarations from 'zmq.backend.cython.checkrc' */
743aec3c8f4Simaromstatic CYTHON_INLINE int __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(int); /*proto*/
744aec3c8f4Simarom
745aec3c8f4Simarom/* Module declarations from 'zmq.backend.cython.context' */
746aec3c8f4Simaromstatic PyTypeObject *__pyx_ptype_3zmq_7backend_6cython_7context_Context = 0;
747aec3c8f4Simarom#define __Pyx_MODULE_NAME "zmq.backend.cython.context"
748aec3c8f4Simaromint __pyx_module_is_main_zmq__backend__cython__context = 0;
749aec3c8f4Simarom
750aec3c8f4Simarom/* Implementation of 'zmq.backend.cython.context' */
751aec3c8f4Simaromstatic PyObject *__pyx_builtin_property;
752aec3c8f4Simaromstatic PyObject *__pyx_builtin_MemoryError;
753aec3c8f4Simaromstatic PyObject *__pyx_builtin_range;
754aec3c8f4Simaromstatic PyObject *__pyx_builtin_RuntimeError;
755aec3c8f4Simaromstatic PyObject *__pyx_builtin_TypeError;
756aec3c8f4Simaromstatic int __pyx_pf_3zmq_7backend_6cython_7context_7Context___init__(CYTHON_UNUSED struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_io_threads, CYTHON_UNUSED PyObject *__pyx_v_shadow); /* proto */
757aec3c8f4Simaromstatic int __pyx_pf_3zmq_7backend_6cython_7context_7Context_2__cinit__(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, int __pyx_v_io_threads, size_t __pyx_v_shadow, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
758aec3c8f4Simaromstatic void __pyx_pf_3zmq_7backend_6cython_7context_7Context_4__dealloc__(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self); /* proto */
759aec3c8f4Simaromstatic PyObject *__pyx_pf_3zmq_7backend_6cython_7context_7Context_6underlying(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self); /* proto */
760aec3c8f4Simaromstatic PyObject *__pyx_pf_3zmq_7backend_6cython_7context_7Context_8term(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self); /* proto */
761aec3c8f4Simaromstatic PyObject *__pyx_pf_3zmq_7backend_6cython_7context_7Context_10set(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, int __pyx_v_option, PyObject *__pyx_v_optval); /* proto */
762aec3c8f4Simaromstatic PyObject *__pyx_pf_3zmq_7backend_6cython_7context_7Context_12get(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, int __pyx_v_option); /* proto */
763aec3c8f4Simaromstatic PyObject *__pyx_pf_3zmq_7backend_6cython_7context_7Context_14destroy(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, PyObject *__pyx_v_linger); /* proto */
764aec3c8f4Simaromstatic PyObject *__pyx_pf_3zmq_7backend_6cython_7context_7Context_6closed___get__(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self); /* proto */
765aec3c8f4Simaromstatic int __pyx_pf_3zmq_7backend_6cython_7context_7Context_6closed_2__set__(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
766aec3c8f4Simaromstatic PyObject *__pyx_tp_new_3zmq_7backend_6cython_7context_Context(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
767aec3c8f4Simaromstatic char __pyx_k_all[] = "__all__";
768aec3c8f4Simaromstatic char __pyx_k_main[] = "__main__";
769aec3c8f4Simaromstatic char __pyx_k_term[] = "term";
770aec3c8f4Simaromstatic char __pyx_k_test[] = "__test__";
771aec3c8f4Simaromstatic char __pyx_k_Again[] = "Again";
772aec3c8f4Simaromstatic char __pyx_k_range[] = "range";
773aec3c8f4Simaromstatic char __pyx_k_handle[] = "_handle";
774aec3c8f4Simaromstatic char __pyx_k_import[] = "__import__";
775aec3c8f4Simaromstatic char __pyx_k_linger[] = "linger";
776aec3c8f4Simaromstatic char __pyx_k_option[] = "option";
777aec3c8f4Simaromstatic char __pyx_k_optval[] = "optval";
778aec3c8f4Simaromstatic char __pyx_k_shadow[] = "shadow";
779aec3c8f4Simaromstatic char __pyx_k_Context[] = "Context";
780aec3c8f4Simaromstatic char __pyx_k_ZMQError[] = "ZMQError";
781aec3c8f4Simaromstatic char __pyx_k_instance[] = "_instance";
782aec3c8f4Simaromstatic char __pyx_k_property[] = "property";
783aec3c8f4Simaromstatic char __pyx_k_TypeError[] = "TypeError";
784aec3c8f4Simaromstatic char __pyx_k_zmq_error[] = "zmq.error";
785aec3c8f4Simaromstatic char __pyx_k_io_threads[] = "io_threads";
786aec3c8f4Simaromstatic char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
787aec3c8f4Simaromstatic char __pyx_k_underlying[] = "underlying";
788aec3c8f4Simaromstatic char __pyx_k_MemoryError[] = "MemoryError";
789aec3c8f4Simaromstatic char __pyx_k_RuntimeError[] = "RuntimeError";
790aec3c8f4Simaromstatic char __pyx_k_0MQ_Context_class[] = "0MQ Context class.";
791aec3c8f4Simaromstatic char __pyx_k_ContextTerminated[] = "ContextTerminated";
792aec3c8f4Simaromstatic char __pyx_k_expected_int_got_r[] = "expected int, got: %r";
793aec3c8f4Simaromstatic char __pyx_k_Context_has_been_destroyed[] = "Context has been destroyed";
794aec3c8f4Simaromstatic char __pyx_k_Could_not_allocate__sockets_arra[] = "Could not allocate _sockets array";
795aec3c8f4Simaromstatic char __pyx_k_Could_not_reallocate__sockets_ar[] = "Could not reallocate _sockets array";
796aec3c8f4Simaromstatic PyObject *__pyx_n_s_Again;
797aec3c8f4Simaromstatic PyObject *__pyx_n_s_Context;
798aec3c8f4Simaromstatic PyObject *__pyx_n_s_ContextTerminated;
799aec3c8f4Simaromstatic PyObject *__pyx_kp_s_Context_has_been_destroyed;
800aec3c8f4Simaromstatic PyObject *__pyx_kp_s_Could_not_allocate__sockets_arra;
801aec3c8f4Simaromstatic PyObject *__pyx_kp_s_Could_not_reallocate__sockets_ar;
802aec3c8f4Simaromstatic PyObject *__pyx_n_s_MemoryError;
803aec3c8f4Simaromstatic PyObject *__pyx_n_s_RuntimeError;
804aec3c8f4Simaromstatic PyObject *__pyx_n_s_TypeError;
805aec3c8f4Simaromstatic PyObject *__pyx_n_s_ZMQError;
806aec3c8f4Simaromstatic PyObject *__pyx_n_s_all;
807aec3c8f4Simaromstatic PyObject *__pyx_kp_s_expected_int_got_r;
808aec3c8f4Simaromstatic PyObject *__pyx_n_s_handle;
809aec3c8f4Simaromstatic PyObject *__pyx_n_s_import;
810aec3c8f4Simaromstatic PyObject *__pyx_n_s_instance;
811aec3c8f4Simaromstatic PyObject *__pyx_n_s_io_threads;
812aec3c8f4Simaromstatic PyObject *__pyx_n_s_linger;
813aec3c8f4Simaromstatic PyObject *__pyx_n_s_main;
814aec3c8f4Simaromstatic PyObject *__pyx_n_s_option;
815aec3c8f4Simaromstatic PyObject *__pyx_n_s_optval;
816aec3c8f4Simaromstatic PyObject *__pyx_n_s_property;
817aec3c8f4Simaromstatic PyObject *__pyx_n_s_pyx_vtable;
818aec3c8f4Simaromstatic PyObject *__pyx_n_s_range;
819aec3c8f4Simaromstatic PyObject *__pyx_n_s_shadow;
820aec3c8f4Simaromstatic PyObject *__pyx_n_s_term;
821aec3c8f4Simaromstatic PyObject *__pyx_n_s_test;
822aec3c8f4Simaromstatic PyObject *__pyx_n_s_underlying;
823aec3c8f4Simaromstatic PyObject *__pyx_n_s_zmq_error;
824aec3c8f4Simaromstatic PyObject *__pyx_int_0;
825aec3c8f4Simaromstatic PyObject *__pyx_int_1;
826aec3c8f4Simaromstatic PyObject *__pyx_tuple_;
827aec3c8f4Simaromstatic PyObject *__pyx_tuple__2;
828aec3c8f4Simaromstatic PyObject *__pyx_tuple__3;
829aec3c8f4Simaromstatic PyObject *__pyx_tuple__4;
830aec3c8f4Simarom
831aec3c8f4Simarom/* "zmq/backend/cython/context.pyx":32
832aec3c8f4Simarom *
833aec3c8f4Simarom *     # no-op for the signature
834aec3c8f4Simarom *     def __init__(self, io_threads=1, shadow=0):             # <<<<<<<<<<<<<<
835aec3c8f4Simarom *         pass
836aec3c8f4Simarom *
837aec3c8f4Simarom */
838aec3c8f4Simarom
839aec3c8f4Simarom/* Python wrapper */
840aec3c8f4Simaromstatic int __pyx_pw_3zmq_7backend_6cython_7context_7Context_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
841aec3c8f4Simaromstatic int __pyx_pw_3zmq_7backend_6cython_7context_7Context_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
842aec3c8f4Simarom  CYTHON_UNUSED PyObject *__pyx_v_io_threads = 0;
843aec3c8f4Simarom  CYTHON_UNUSED PyObject *__pyx_v_shadow = 0;
844aec3c8f4Simarom  int __pyx_lineno = 0;
845aec3c8f4Simarom  const char *__pyx_filename = NULL;
846aec3c8f4Simarom  int __pyx_clineno = 0;
847aec3c8f4Simarom  int __pyx_r;
848aec3c8f4Simarom  __Pyx_RefNannyDeclarations
849aec3c8f4Simarom  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
850aec3c8f4Simarom  {
851aec3c8f4Simarom    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_io_threads,&__pyx_n_s_shadow,0};
852aec3c8f4Simarom    PyObject* values[2] = {0,0};
853aec3c8f4Simarom    values[0] = ((PyObject *)__pyx_int_1);
854aec3c8f4Simarom    values[1] = ((PyObject *)__pyx_int_0);
855aec3c8f4Simarom    if (unlikely(__pyx_kwds)) {
856aec3c8f4Simarom      Py_ssize_t kw_args;
857aec3c8f4Simarom      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
858aec3c8f4Simarom      switch (pos_args) {
859aec3c8f4Simarom        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
860aec3c8f4Simarom        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
861aec3c8f4Simarom        case  0: break;
862aec3c8f4Simarom        default: goto __pyx_L5_argtuple_error;
863aec3c8f4Simarom      }
864aec3c8f4Simarom      kw_args = PyDict_Size(__pyx_kwds);
865aec3c8f4Simarom      switch (pos_args) {
866aec3c8f4Simarom        case  0:
867aec3c8f4Simarom        if (kw_args > 0) {
868aec3c8f4Simarom          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_io_threads);
869aec3c8f4Simarom          if (value) { values[0] = value; kw_args--; }
870aec3c8f4Simarom        }
871aec3c8f4Simarom        case  1:
872aec3c8f4Simarom        if (kw_args > 0) {
873aec3c8f4Simarom          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shadow);
874aec3c8f4Simarom          if (value) { values[1] = value; kw_args--; }
875aec3c8f4Simarom        }
876aec3c8f4Simarom      }
877aec3c8f4Simarom      if (unlikely(kw_args > 0)) {
878aec3c8f4Simarom        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
879aec3c8f4Simarom      }
880aec3c8f4Simarom    } else {
881aec3c8f4Simarom      switch (PyTuple_GET_SIZE(__pyx_args)) {
882aec3c8f4Simarom        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
883aec3c8f4Simarom        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
884aec3c8f4Simarom        case  0: break;
885aec3c8f4Simarom        default: goto __pyx_L5_argtuple_error;
886aec3c8f4Simarom      }
887aec3c8f4Simarom    }
888aec3c8f4Simarom    __pyx_v_io_threads = values[0];
889aec3c8f4Simarom    __pyx_v_shadow = values[1];
890aec3c8f4Simarom  }
891aec3c8f4Simarom  goto __pyx_L4_argument_unpacking_done;
892aec3c8f4Simarom  __pyx_L5_argtuple_error:;
893aec3c8f4Simarom  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
894aec3c8f4Simarom  __pyx_L3_error:;
895aec3c8f4Simarom  __Pyx_AddTraceback("zmq.backend.cython.context.Context.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
896aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
897aec3c8f4Simarom  return -1;
898aec3c8f4Simarom  __pyx_L4_argument_unpacking_done:;
899aec3c8f4Simarom  __pyx_r = __pyx_pf_3zmq_7backend_6cython_7context_7Context___init__(((struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)__pyx_v_self), __pyx_v_io_threads, __pyx_v_shadow);
900aec3c8f4Simarom
901aec3c8f4Simarom  /* function exit code */
902aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
903aec3c8f4Simarom  return __pyx_r;
904aec3c8f4Simarom}
905aec3c8f4Simarom
906aec3c8f4Simaromstatic int __pyx_pf_3zmq_7backend_6cython_7context_7Context___init__(CYTHON_UNUSED struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_io_threads, CYTHON_UNUSED PyObject *__pyx_v_shadow) {
907aec3c8f4Simarom  int __pyx_r;
908aec3c8f4Simarom  __Pyx_RefNannyDeclarations
909aec3c8f4Simarom  __Pyx_RefNannySetupContext("__init__", 0);
910aec3c8f4Simarom
911aec3c8f4Simarom  /* function exit code */
912aec3c8f4Simarom  __pyx_r = 0;
913aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
914aec3c8f4Simarom  return __pyx_r;
915aec3c8f4Simarom}
916aec3c8f4Simarom
917aec3c8f4Simarom/* "zmq/backend/cython/context.pyx":35
918aec3c8f4Simarom *         pass
919aec3c8f4Simarom *
920aec3c8f4Simarom *     def __cinit__(self, int io_threads=1, size_t shadow=0, **kwargs):             # <<<<<<<<<<<<<<
921aec3c8f4Simarom *         self.handle = NULL
922aec3c8f4Simarom *         self._sockets = NULL
923aec3c8f4Simarom */
924aec3c8f4Simarom
925aec3c8f4Simarom/* Python wrapper */
926aec3c8f4Simaromstatic int __pyx_pw_3zmq_7backend_6cython_7context_7Context_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
927aec3c8f4Simaromstatic int __pyx_pw_3zmq_7backend_6cython_7context_7Context_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
928aec3c8f4Simarom  int __pyx_v_io_threads;
929aec3c8f4Simarom  size_t __pyx_v_shadow;
930aec3c8f4Simarom  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
931aec3c8f4Simarom  int __pyx_lineno = 0;
932aec3c8f4Simarom  const char *__pyx_filename = NULL;
933aec3c8f4Simarom  int __pyx_clineno = 0;
934aec3c8f4Simarom  int __pyx_r;
935aec3c8f4Simarom  __Pyx_RefNannyDeclarations
936aec3c8f4Simarom  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
937aec3c8f4Simarom  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
938aec3c8f4Simarom  __Pyx_GOTREF(__pyx_v_kwargs);
939aec3c8f4Simarom  {
940aec3c8f4Simarom    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_io_threads,&__pyx_n_s_shadow,0};
941aec3c8f4Simarom    PyObject* values[2] = {0,0};
942aec3c8f4Simarom    if (unlikely(__pyx_kwds)) {
943aec3c8f4Simarom      Py_ssize_t kw_args;
944aec3c8f4Simarom      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
945aec3c8f4Simarom      switch (pos_args) {
946aec3c8f4Simarom        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
947aec3c8f4Simarom        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
948aec3c8f4Simarom        case  0: break;
949aec3c8f4Simarom        default: goto __pyx_L5_argtuple_error;
950aec3c8f4Simarom      }
951aec3c8f4Simarom      kw_args = PyDict_Size(__pyx_kwds);
952aec3c8f4Simarom      switch (pos_args) {
953aec3c8f4Simarom        case  0:
954aec3c8f4Simarom        if (kw_args > 0) {
955aec3c8f4Simarom          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_io_threads);
956aec3c8f4Simarom          if (value) { values[0] = value; kw_args--; }
957aec3c8f4Simarom        }
958aec3c8f4Simarom        case  1:
959aec3c8f4Simarom        if (kw_args > 0) {
960aec3c8f4Simarom          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shadow);
961aec3c8f4Simarom          if (value) { values[1] = value; kw_args--; }
962aec3c8f4Simarom        }
963aec3c8f4Simarom      }
964aec3c8f4Simarom      if (unlikely(kw_args > 0)) {
965aec3c8f4Simarom        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
966aec3c8f4Simarom      }
967aec3c8f4Simarom    } else {
968aec3c8f4Simarom      switch (PyTuple_GET_SIZE(__pyx_args)) {
969aec3c8f4Simarom        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
970aec3c8f4Simarom        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
971aec3c8f4Simarom        case  0: break;
972aec3c8f4Simarom        default: goto __pyx_L5_argtuple_error;
973aec3c8f4Simarom      }
974aec3c8f4Simarom    }
975aec3c8f4Simarom    if (values[0]) {
976aec3c8f4Simarom      __pyx_v_io_threads = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_io_threads == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
977aec3c8f4Simarom    } else {
978aec3c8f4Simarom      __pyx_v_io_threads = ((int)1);
979aec3c8f4Simarom    }
980aec3c8f4Simarom    if (values[1]) {
981aec3c8f4Simarom      __pyx_v_shadow = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_shadow == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
982aec3c8f4Simarom    } else {
983aec3c8f4Simarom      __pyx_v_shadow = ((size_t)0);
984aec3c8f4Simarom    }
985aec3c8f4Simarom  }
986aec3c8f4Simarom  goto __pyx_L4_argument_unpacking_done;
987aec3c8f4Simarom  __pyx_L5_argtuple_error:;
988aec3c8f4Simarom  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
989aec3c8f4Simarom  __pyx_L3_error:;
990aec3c8f4Simarom  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
991aec3c8f4Simarom  __Pyx_AddTraceback("zmq.backend.cython.context.Context.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
992aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
993aec3c8f4Simarom  return -1;
994aec3c8f4Simarom  __pyx_L4_argument_unpacking_done:;
995aec3c8f4Simarom  __pyx_r = __pyx_pf_3zmq_7backend_6cython_7context_7Context_2__cinit__(((struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)__pyx_v_self), __pyx_v_io_threads, __pyx_v_shadow, __pyx_v_kwargs);
996aec3c8f4Simarom
997aec3c8f4Simarom  /* function exit code */
998aec3c8f4Simarom  __Pyx_XDECREF(__pyx_v_kwargs);
999aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
1000aec3c8f4Simarom  return __pyx_r;
1001aec3c8f4Simarom}
1002aec3c8f4Simarom
1003aec3c8f4Simaromstatic int __pyx_pf_3zmq_7backend_6cython_7context_7Context_2__cinit__(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, int __pyx_v_io_threads, size_t __pyx_v_shadow, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
1004aec3c8f4Simarom  int __pyx_v_rc;
1005aec3c8f4Simarom  int __pyx_r;
1006aec3c8f4Simarom  __Pyx_RefNannyDeclarations
1007aec3c8f4Simarom  int __pyx_t_1;
1008aec3c8f4Simarom  PyObject *__pyx_t_2 = NULL;
1009aec3c8f4Simarom  PyObject *__pyx_t_3 = NULL;
1010aec3c8f4Simarom  PyObject *__pyx_t_4 = NULL;
1011aec3c8f4Simarom  int __pyx_t_5;
1012aec3c8f4Simarom  int __pyx_t_6;
1013aec3c8f4Simarom  int __pyx_lineno = 0;
1014aec3c8f4Simarom  const char *__pyx_filename = NULL;
1015aec3c8f4Simarom  int __pyx_clineno = 0;
1016aec3c8f4Simarom  __Pyx_RefNannySetupContext("__cinit__", 0);
1017aec3c8f4Simarom
1018aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":36
1019aec3c8f4Simarom *
1020aec3c8f4Simarom *     def __cinit__(self, int io_threads=1, size_t shadow=0, **kwargs):
1021aec3c8f4Simarom *         self.handle = NULL             # <<<<<<<<<<<<<<
1022aec3c8f4Simarom *         self._sockets = NULL
1023aec3c8f4Simarom *         if shadow:
1024aec3c8f4Simarom */
1025aec3c8f4Simarom  __pyx_v_self->handle = NULL;
1026aec3c8f4Simarom
1027aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":37
1028aec3c8f4Simarom *     def __cinit__(self, int io_threads=1, size_t shadow=0, **kwargs):
1029aec3c8f4Simarom *         self.handle = NULL
1030aec3c8f4Simarom *         self._sockets = NULL             # <<<<<<<<<<<<<<
1031aec3c8f4Simarom *         if shadow:
1032aec3c8f4Simarom *             self.handle = <void *>shadow
1033aec3c8f4Simarom */
1034aec3c8f4Simarom  __pyx_v_self->_sockets = NULL;
1035aec3c8f4Simarom
1036aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":38
1037aec3c8f4Simarom *         self.handle = NULL
1038aec3c8f4Simarom *         self._sockets = NULL
1039aec3c8f4Simarom *         if shadow:             # <<<<<<<<<<<<<<
1040aec3c8f4Simarom *             self.handle = <void *>shadow
1041aec3c8f4Simarom *             self._shadow = True
1042aec3c8f4Simarom */
1043aec3c8f4Simarom  __pyx_t_1 = (__pyx_v_shadow != 0);
1044aec3c8f4Simarom  if (__pyx_t_1) {
1045aec3c8f4Simarom
1046aec3c8f4Simarom    /* "zmq/backend/cython/context.pyx":39
1047aec3c8f4Simarom *         self._sockets = NULL
1048aec3c8f4Simarom *         if shadow:
1049aec3c8f4Simarom *             self.handle = <void *>shadow             # <<<<<<<<<<<<<<
1050aec3c8f4Simarom *             self._shadow = True
1051aec3c8f4Simarom *         else:
1052aec3c8f4Simarom */
1053aec3c8f4Simarom    __pyx_v_self->handle = ((void *)__pyx_v_shadow);
1054aec3c8f4Simarom
1055aec3c8f4Simarom    /* "zmq/backend/cython/context.pyx":40
1056aec3c8f4Simarom *         if shadow:
1057aec3c8f4Simarom *             self.handle = <void *>shadow
1058aec3c8f4Simarom *             self._shadow = True             # <<<<<<<<<<<<<<
1059aec3c8f4Simarom *         else:
1060aec3c8f4Simarom *             self._shadow = False
1061aec3c8f4Simarom */
1062aec3c8f4Simarom    __pyx_v_self->_shadow = 1;
1063aec3c8f4Simarom    goto __pyx_L3;
1064aec3c8f4Simarom  }
1065aec3c8f4Simarom  /*else*/ {
1066aec3c8f4Simarom
1067aec3c8f4Simarom    /* "zmq/backend/cython/context.pyx":42
1068aec3c8f4Simarom *             self._shadow = True
1069aec3c8f4Simarom *         else:
1070aec3c8f4Simarom *             self._shadow = False             # <<<<<<<<<<<<<<
1071aec3c8f4Simarom *             if ZMQ_VERSION_MAJOR >= 3:
1072aec3c8f4Simarom *                 self.handle = zmq_ctx_new()
1073aec3c8f4Simarom */
1074aec3c8f4Simarom    __pyx_v_self->_shadow = 0;
1075aec3c8f4Simarom
1076aec3c8f4Simarom    /* "zmq/backend/cython/context.pyx":43
1077aec3c8f4Simarom *         else:
1078aec3c8f4Simarom *             self._shadow = False
1079aec3c8f4Simarom *             if ZMQ_VERSION_MAJOR >= 3:             # <<<<<<<<<<<<<<
1080aec3c8f4Simarom *                 self.handle = zmq_ctx_new()
1081aec3c8f4Simarom *             else:
1082aec3c8f4Simarom */
1083aec3c8f4Simarom    __pyx_t_1 = ((ZMQ_VERSION_MAJOR >= 3) != 0);
1084aec3c8f4Simarom    if (__pyx_t_1) {
1085aec3c8f4Simarom
1086aec3c8f4Simarom      /* "zmq/backend/cython/context.pyx":44
1087aec3c8f4Simarom *             self._shadow = False
1088aec3c8f4Simarom *             if ZMQ_VERSION_MAJOR >= 3:
1089aec3c8f4Simarom *                 self.handle = zmq_ctx_new()             # <<<<<<<<<<<<<<
1090aec3c8f4Simarom *             else:
1091aec3c8f4Simarom *                 self.handle = zmq_init(io_threads)
1092aec3c8f4Simarom */
1093aec3c8f4Simarom      __pyx_v_self->handle = zmq_ctx_new();
1094aec3c8f4Simarom      goto __pyx_L4;
1095aec3c8f4Simarom    }
1096aec3c8f4Simarom    /*else*/ {
1097aec3c8f4Simarom
1098aec3c8f4Simarom      /* "zmq/backend/cython/context.pyx":46
1099aec3c8f4Simarom *                 self.handle = zmq_ctx_new()
1100aec3c8f4Simarom *             else:
1101aec3c8f4Simarom *                 self.handle = zmq_init(io_threads)             # <<<<<<<<<<<<<<
1102aec3c8f4Simarom *
1103aec3c8f4Simarom *         if self.handle == NULL:
1104aec3c8f4Simarom */
1105aec3c8f4Simarom      __pyx_v_self->handle = zmq_init(__pyx_v_io_threads);
1106aec3c8f4Simarom    }
1107aec3c8f4Simarom    __pyx_L4:;
1108aec3c8f4Simarom  }
1109aec3c8f4Simarom  __pyx_L3:;
1110aec3c8f4Simarom
1111aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":48
1112aec3c8f4Simarom *                 self.handle = zmq_init(io_threads)
1113aec3c8f4Simarom *
1114aec3c8f4Simarom *         if self.handle == NULL:             # <<<<<<<<<<<<<<
1115aec3c8f4Simarom *             raise ZMQError()
1116aec3c8f4Simarom *
1117aec3c8f4Simarom */
1118aec3c8f4Simarom  __pyx_t_1 = ((__pyx_v_self->handle == NULL) != 0);
1119aec3c8f4Simarom  if (__pyx_t_1) {
1120aec3c8f4Simarom
1121aec3c8f4Simarom    /* "zmq/backend/cython/context.pyx":49
1122aec3c8f4Simarom *
1123aec3c8f4Simarom *         if self.handle == NULL:
1124aec3c8f4Simarom *             raise ZMQError()             # <<<<<<<<<<<<<<
1125aec3c8f4Simarom *
1126aec3c8f4Simarom *         cdef int rc = 0
1127aec3c8f4Simarom */
1128aec3c8f4Simarom    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_ZMQError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1129aec3c8f4Simarom    __Pyx_GOTREF(__pyx_t_3);
1130aec3c8f4Simarom    __pyx_t_4 = NULL;
1131aec3c8f4Simarom    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
1132aec3c8f4Simarom      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
1133aec3c8f4Simarom      if (likely(__pyx_t_4)) {
1134aec3c8f4Simarom        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
1135aec3c8f4Simarom        __Pyx_INCREF(__pyx_t_4);
1136aec3c8f4Simarom        __Pyx_INCREF(function);
1137aec3c8f4Simarom        __Pyx_DECREF_SET(__pyx_t_3, function);
1138aec3c8f4Simarom      }
1139aec3c8f4Simarom    }
1140aec3c8f4Simarom    if (__pyx_t_4) {
1141aec3c8f4Simarom      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1142aec3c8f4Simarom      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1143aec3c8f4Simarom    } else {
1144aec3c8f4Simarom      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1145aec3c8f4Simarom    }
1146aec3c8f4Simarom    __Pyx_GOTREF(__pyx_t_2);
1147aec3c8f4Simarom    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1148aec3c8f4Simarom    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
1149aec3c8f4Simarom    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1150aec3c8f4Simarom    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1151aec3c8f4Simarom  }
1152aec3c8f4Simarom
1153aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":51
1154aec3c8f4Simarom *             raise ZMQError()
1155aec3c8f4Simarom *
1156aec3c8f4Simarom *         cdef int rc = 0             # <<<<<<<<<<<<<<
1157aec3c8f4Simarom *         if ZMQ_VERSION_MAJOR >= 3 and not self._shadow:
1158aec3c8f4Simarom *             rc = zmq_ctx_set(self.handle, ZMQ_IO_THREADS, io_threads)
1159aec3c8f4Simarom */
1160aec3c8f4Simarom  __pyx_v_rc = 0;
1161aec3c8f4Simarom
1162aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":52
1163aec3c8f4Simarom *
1164aec3c8f4Simarom *         cdef int rc = 0
1165aec3c8f4Simarom *         if ZMQ_VERSION_MAJOR >= 3 and not self._shadow:             # <<<<<<<<<<<<<<
1166aec3c8f4Simarom *             rc = zmq_ctx_set(self.handle, ZMQ_IO_THREADS, io_threads)
1167aec3c8f4Simarom *             _check_rc(rc)
1168aec3c8f4Simarom */
1169aec3c8f4Simarom  __pyx_t_5 = ((ZMQ_VERSION_MAJOR >= 3) != 0);
1170aec3c8f4Simarom  if (__pyx_t_5) {
1171aec3c8f4Simarom  } else {
1172aec3c8f4Simarom    __pyx_t_1 = __pyx_t_5;
1173aec3c8f4Simarom    goto __pyx_L7_bool_binop_done;
1174aec3c8f4Simarom  }
1175aec3c8f4Simarom  __pyx_t_5 = ((!(__pyx_v_self->_shadow != 0)) != 0);
1176aec3c8f4Simarom  __pyx_t_1 = __pyx_t_5;
1177aec3c8f4Simarom  __pyx_L7_bool_binop_done:;
1178aec3c8f4Simarom  if (__pyx_t_1) {
1179aec3c8f4Simarom
1180aec3c8f4Simarom    /* "zmq/backend/cython/context.pyx":53
1181aec3c8f4Simarom *         cdef int rc = 0
1182aec3c8f4Simarom *         if ZMQ_VERSION_MAJOR >= 3 and not self._shadow:
1183aec3c8f4Simarom *             rc = zmq_ctx_set(self.handle, ZMQ_IO_THREADS, io_threads)             # <<<<<<<<<<<<<<
1184aec3c8f4Simarom *             _check_rc(rc)
1185aec3c8f4Simarom *
1186aec3c8f4Simarom */
1187aec3c8f4Simarom    __pyx_v_rc = zmq_ctx_set(__pyx_v_self->handle, ZMQ_IO_THREADS, __pyx_v_io_threads);
1188aec3c8f4Simarom
1189aec3c8f4Simarom    /* "zmq/backend/cython/context.pyx":54
1190aec3c8f4Simarom *         if ZMQ_VERSION_MAJOR >= 3 and not self._shadow:
1191aec3c8f4Simarom *             rc = zmq_ctx_set(self.handle, ZMQ_IO_THREADS, io_threads)
1192aec3c8f4Simarom *             _check_rc(rc)             # <<<<<<<<<<<<<<
1193aec3c8f4Simarom *
1194aec3c8f4Simarom *         self.closed = False
1195aec3c8f4Simarom */
1196aec3c8f4Simarom    __pyx_t_6 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1197aec3c8f4Simarom    goto __pyx_L6;
1198aec3c8f4Simarom  }
1199aec3c8f4Simarom  __pyx_L6:;
1200aec3c8f4Simarom
1201aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":56
1202aec3c8f4Simarom *             _check_rc(rc)
1203aec3c8f4Simarom *
1204aec3c8f4Simarom *         self.closed = False             # <<<<<<<<<<<<<<
1205aec3c8f4Simarom *         self._n_sockets = 0
1206aec3c8f4Simarom *         self._max_sockets = 32
1207aec3c8f4Simarom */
1208aec3c8f4Simarom  __pyx_v_self->closed = 0;
1209aec3c8f4Simarom
1210aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":57
1211aec3c8f4Simarom *
1212aec3c8f4Simarom *         self.closed = False
1213aec3c8f4Simarom *         self._n_sockets = 0             # <<<<<<<<<<<<<<
1214aec3c8f4Simarom *         self._max_sockets = 32
1215aec3c8f4Simarom *
1216aec3c8f4Simarom */
1217aec3c8f4Simarom  __pyx_v_self->_n_sockets = 0;
1218aec3c8f4Simarom
1219aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":58
1220aec3c8f4Simarom *         self.closed = False
1221aec3c8f4Simarom *         self._n_sockets = 0
1222aec3c8f4Simarom *         self._max_sockets = 32             # <<<<<<<<<<<<<<
1223aec3c8f4Simarom *
1224aec3c8f4Simarom *         self._sockets = <void **>malloc(self._max_sockets*sizeof(void *))
1225aec3c8f4Simarom */
1226aec3c8f4Simarom  __pyx_v_self->_max_sockets = 32;
1227aec3c8f4Simarom
1228aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":60
1229aec3c8f4Simarom *         self._max_sockets = 32
1230aec3c8f4Simarom *
1231aec3c8f4Simarom *         self._sockets = <void **>malloc(self._max_sockets*sizeof(void *))             # <<<<<<<<<<<<<<
1232aec3c8f4Simarom *         if self._sockets == NULL:
1233aec3c8f4Simarom *             raise MemoryError("Could not allocate _sockets array")
1234aec3c8f4Simarom */
1235aec3c8f4Simarom  __pyx_v_self->_sockets = ((void **)malloc((__pyx_v_self->_max_sockets * (sizeof(void *)))));
1236aec3c8f4Simarom
1237aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":61
1238aec3c8f4Simarom *
1239aec3c8f4Simarom *         self._sockets = <void **>malloc(self._max_sockets*sizeof(void *))
1240aec3c8f4Simarom *         if self._sockets == NULL:             # <<<<<<<<<<<<<<
1241aec3c8f4Simarom *             raise MemoryError("Could not allocate _sockets array")
1242aec3c8f4Simarom *
1243aec3c8f4Simarom */
1244aec3c8f4Simarom  __pyx_t_1 = ((__pyx_v_self->_sockets == NULL) != 0);
1245aec3c8f4Simarom  if (__pyx_t_1) {
1246aec3c8f4Simarom
1247aec3c8f4Simarom    /* "zmq/backend/cython/context.pyx":62
1248aec3c8f4Simarom *         self._sockets = <void **>malloc(self._max_sockets*sizeof(void *))
1249aec3c8f4Simarom *         if self._sockets == NULL:
1250aec3c8f4Simarom *             raise MemoryError("Could not allocate _sockets array")             # <<<<<<<<<<<<<<
1251aec3c8f4Simarom *
1252aec3c8f4Simarom *         self._pid = getpid()
1253aec3c8f4Simarom */
1254aec3c8f4Simarom    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1255aec3c8f4Simarom    __Pyx_GOTREF(__pyx_t_2);
1256aec3c8f4Simarom    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
1257aec3c8f4Simarom    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1258aec3c8f4Simarom    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1259aec3c8f4Simarom  }
1260aec3c8f4Simarom
1261aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":64
1262aec3c8f4Simarom *             raise MemoryError("Could not allocate _sockets array")
1263aec3c8f4Simarom *
1264aec3c8f4Simarom *         self._pid = getpid()             # <<<<<<<<<<<<<<
1265aec3c8f4Simarom *
1266aec3c8f4Simarom *     def __dealloc__(self):
1267aec3c8f4Simarom */
1268aec3c8f4Simarom  __pyx_v_self->_pid = getpid();
1269aec3c8f4Simarom
1270aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":35
1271aec3c8f4Simarom *         pass
1272aec3c8f4Simarom *
1273aec3c8f4Simarom *     def __cinit__(self, int io_threads=1, size_t shadow=0, **kwargs):             # <<<<<<<<<<<<<<
1274aec3c8f4Simarom *         self.handle = NULL
1275aec3c8f4Simarom *         self._sockets = NULL
1276aec3c8f4Simarom */
1277aec3c8f4Simarom
1278aec3c8f4Simarom  /* function exit code */
1279aec3c8f4Simarom  __pyx_r = 0;
1280aec3c8f4Simarom  goto __pyx_L0;
1281aec3c8f4Simarom  __pyx_L1_error:;
1282aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_2);
1283aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_3);
1284aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_4);
1285aec3c8f4Simarom  __Pyx_AddTraceback("zmq.backend.cython.context.Context.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1286aec3c8f4Simarom  __pyx_r = -1;
1287aec3c8f4Simarom  __pyx_L0:;
1288aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
1289aec3c8f4Simarom  return __pyx_r;
1290aec3c8f4Simarom}
1291aec3c8f4Simarom
1292aec3c8f4Simarom/* "zmq/backend/cython/context.pyx":66
1293aec3c8f4Simarom *         self._pid = getpid()
1294aec3c8f4Simarom *
1295aec3c8f4Simarom *     def __dealloc__(self):             # <<<<<<<<<<<<<<
1296aec3c8f4Simarom *         """don't touch members in dealloc, just cleanup allocations"""
1297aec3c8f4Simarom *         cdef int rc
1298aec3c8f4Simarom */
1299aec3c8f4Simarom
1300aec3c8f4Simarom/* Python wrapper */
1301aec3c8f4Simaromstatic void __pyx_pw_3zmq_7backend_6cython_7context_7Context_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
1302aec3c8f4Simaromstatic void __pyx_pw_3zmq_7backend_6cython_7context_7Context_5__dealloc__(PyObject *__pyx_v_self) {
1303aec3c8f4Simarom  __Pyx_RefNannyDeclarations
1304aec3c8f4Simarom  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
1305aec3c8f4Simarom  __pyx_pf_3zmq_7backend_6cython_7context_7Context_4__dealloc__(((struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)__pyx_v_self));
1306aec3c8f4Simarom
1307aec3c8f4Simarom  /* function exit code */
1308aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
1309aec3c8f4Simarom}
1310aec3c8f4Simarom
1311aec3c8f4Simaromstatic void __pyx_pf_3zmq_7backend_6cython_7context_7Context_4__dealloc__(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self) {
1312aec3c8f4Simarom  __Pyx_RefNannyDeclarations
1313aec3c8f4Simarom  int __pyx_t_1;
1314aec3c8f4Simarom  __Pyx_RefNannySetupContext("__dealloc__", 0);
1315aec3c8f4Simarom
1316aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":69
1317aec3c8f4Simarom *         """don't touch members in dealloc, just cleanup allocations"""
1318aec3c8f4Simarom *         cdef int rc
1319aec3c8f4Simarom *         if self._sockets != NULL:             # <<<<<<<<<<<<<<
1320aec3c8f4Simarom *             free(self._sockets)
1321aec3c8f4Simarom *             self._sockets = NULL
1322aec3c8f4Simarom */
1323aec3c8f4Simarom  __pyx_t_1 = ((__pyx_v_self->_sockets != NULL) != 0);
1324aec3c8f4Simarom  if (__pyx_t_1) {
1325aec3c8f4Simarom
1326aec3c8f4Simarom    /* "zmq/backend/cython/context.pyx":70
1327aec3c8f4Simarom *         cdef int rc
1328aec3c8f4Simarom *         if self._sockets != NULL:
1329aec3c8f4Simarom *             free(self._sockets)             # <<<<<<<<<<<<<<
1330aec3c8f4Simarom *             self._sockets = NULL
1331aec3c8f4Simarom *             self._n_sockets = 0
1332aec3c8f4Simarom */
1333aec3c8f4Simarom    free(__pyx_v_self->_sockets);
1334aec3c8f4Simarom
1335aec3c8f4Simarom    /* "zmq/backend/cython/context.pyx":71
1336aec3c8f4Simarom *         if self._sockets != NULL:
1337aec3c8f4Simarom *             free(self._sockets)
1338aec3c8f4Simarom *             self._sockets = NULL             # <<<<<<<<<<<<<<
1339aec3c8f4Simarom *             self._n_sockets = 0
1340aec3c8f4Simarom *
1341aec3c8f4Simarom */
1342aec3c8f4Simarom    __pyx_v_self->_sockets = NULL;
1343aec3c8f4Simarom
1344aec3c8f4Simarom    /* "zmq/backend/cython/context.pyx":72
1345aec3c8f4Simarom *             free(self._sockets)
1346aec3c8f4Simarom *             self._sockets = NULL
1347aec3c8f4Simarom *             self._n_sockets = 0             # <<<<<<<<<<<<<<
1348aec3c8f4Simarom *
1349aec3c8f4Simarom *         # we can't call object methods in dealloc as it
1350aec3c8f4Simarom */
1351aec3c8f4Simarom    __pyx_v_self->_n_sockets = 0;
1352aec3c8f4Simarom    goto __pyx_L3;
1353aec3c8f4Simarom  }
1354aec3c8f4Simarom  __pyx_L3:;
1355aec3c8f4Simarom
1356aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":76
1357aec3c8f4Simarom *         # we can't call object methods in dealloc as it
1358aec3c8f4Simarom *         # might already be partially deleted
1359aec3c8f4Simarom *         if not self._shadow:             # <<<<<<<<<<<<<<
1360aec3c8f4Simarom *             self._term()
1361aec3c8f4Simarom *
1362aec3c8f4Simarom */
1363aec3c8f4Simarom  __pyx_t_1 = ((!(__pyx_v_self->_shadow != 0)) != 0);
1364aec3c8f4Simarom  if (__pyx_t_1) {
1365aec3c8f4Simarom
1366aec3c8f4Simarom    /* "zmq/backend/cython/context.pyx":77
1367aec3c8f4Simarom *         # might already be partially deleted
1368aec3c8f4Simarom *         if not self._shadow:
1369aec3c8f4Simarom *             self._term()             # <<<<<<<<<<<<<<
1370aec3c8f4Simarom *
1371aec3c8f4Simarom *     cdef inline void _add_socket(self, void* handle):
1372aec3c8f4Simarom */
1373aec3c8f4Simarom    __pyx_f_3zmq_7backend_6cython_7context_7Context__term(__pyx_v_self);
1374aec3c8f4Simarom    goto __pyx_L4;
1375aec3c8f4Simarom  }
1376aec3c8f4Simarom  __pyx_L4:;
1377aec3c8f4Simarom
1378aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":66
1379aec3c8f4Simarom *         self._pid = getpid()
1380aec3c8f4Simarom *
1381aec3c8f4Simarom *     def __dealloc__(self):             # <<<<<<<<<<<<<<
1382aec3c8f4Simarom *         """don't touch members in dealloc, just cleanup allocations"""
1383aec3c8f4Simarom *         cdef int rc
1384aec3c8f4Simarom */
1385aec3c8f4Simarom
1386aec3c8f4Simarom  /* function exit code */
1387aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
1388aec3c8f4Simarom}
1389aec3c8f4Simarom
1390aec3c8f4Simarom/* "zmq/backend/cython/context.pyx":79
1391aec3c8f4Simarom *             self._term()
1392aec3c8f4Simarom *
1393aec3c8f4Simarom *     cdef inline void _add_socket(self, void* handle):             # <<<<<<<<<<<<<<
1394aec3c8f4Simarom *         """Add a socket handle to be closed when Context terminates.
1395aec3c8f4Simarom *
1396aec3c8f4Simarom */
1397aec3c8f4Simarom
1398aec3c8f4Simaromstatic CYTHON_INLINE void __pyx_f_3zmq_7backend_6cython_7context_7Context__add_socket(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, void *__pyx_v_handle) {
1399aec3c8f4Simarom  __Pyx_RefNannyDeclarations
1400aec3c8f4Simarom  int __pyx_t_1;
1401aec3c8f4Simarom  PyObject *__pyx_t_2 = NULL;
1402aec3c8f4Simarom  int __pyx_lineno = 0;
1403aec3c8f4Simarom  const char *__pyx_filename = NULL;
1404aec3c8f4Simarom  int __pyx_clineno = 0;
1405aec3c8f4Simarom  __Pyx_RefNannySetupContext("_add_socket", 0);
1406aec3c8f4Simarom
1407aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":84
1408aec3c8f4Simarom *         This is to be called in the Socket constructor.
1409aec3c8f4Simarom *         """
1410aec3c8f4Simarom *         if self._n_sockets >= self._max_sockets:             # <<<<<<<<<<<<<<
1411aec3c8f4Simarom *             self._max_sockets *= 2
1412aec3c8f4Simarom *             self._sockets = <void **>realloc(self._sockets, self._max_sockets*sizeof(void *))
1413aec3c8f4Simarom */
1414aec3c8f4Simarom  __pyx_t_1 = ((__pyx_v_self->_n_sockets >= __pyx_v_self->_max_sockets) != 0);
1415aec3c8f4Simarom  if (__pyx_t_1) {
1416aec3c8f4Simarom
1417aec3c8f4Simarom    /* "zmq/backend/cython/context.pyx":85
1418aec3c8f4Simarom *         """
1419aec3c8f4Simarom *         if self._n_sockets >= self._max_sockets:
1420aec3c8f4Simarom *             self._max_sockets *= 2             # <<<<<<<<<<<<<<
1421aec3c8f4Simarom *             self._sockets = <void **>realloc(self._sockets, self._max_sockets*sizeof(void *))
1422aec3c8f4Simarom *             if self._sockets == NULL:
1423aec3c8f4Simarom */
1424aec3c8f4Simarom    __pyx_v_self->_max_sockets = (__pyx_v_self->_max_sockets * 2);
1425aec3c8f4Simarom
1426aec3c8f4Simarom    /* "zmq/backend/cython/context.pyx":86
1427aec3c8f4Simarom *         if self._n_sockets >= self._max_sockets:
1428aec3c8f4Simarom *             self._max_sockets *= 2
1429aec3c8f4Simarom *             self._sockets = <void **>realloc(self._sockets, self._max_sockets*sizeof(void *))             # <<<<<<<<<<<<<<
1430aec3c8f4Simarom *             if self._sockets == NULL:
1431aec3c8f4Simarom *                 raise MemoryError("Could not reallocate _sockets array")
1432aec3c8f4Simarom */
1433aec3c8f4Simarom    __pyx_v_self->_sockets = ((void **)realloc(__pyx_v_self->_sockets, (__pyx_v_self->_max_sockets * (sizeof(void *)))));
1434aec3c8f4Simarom
1435aec3c8f4Simarom    /* "zmq/backend/cython/context.pyx":87
1436aec3c8f4Simarom *             self._max_sockets *= 2
1437aec3c8f4Simarom *             self._sockets = <void **>realloc(self._sockets, self._max_sockets*sizeof(void *))
1438aec3c8f4Simarom *             if self._sockets == NULL:             # <<<<<<<<<<<<<<
1439aec3c8f4Simarom *                 raise MemoryError("Could not reallocate _sockets array")
1440aec3c8f4Simarom *
1441aec3c8f4Simarom */
1442aec3c8f4Simarom    __pyx_t_1 = ((__pyx_v_self->_sockets == NULL) != 0);
1443aec3c8f4Simarom    if (__pyx_t_1) {
1444aec3c8f4Simarom
1445aec3c8f4Simarom      /* "zmq/backend/cython/context.pyx":88
1446aec3c8f4Simarom *             self._sockets = <void **>realloc(self._sockets, self._max_sockets*sizeof(void *))
1447aec3c8f4Simarom *             if self._sockets == NULL:
1448aec3c8f4Simarom *                 raise MemoryError("Could not reallocate _sockets array")             # <<<<<<<<<<<<<<
1449aec3c8f4Simarom *
1450aec3c8f4Simarom *         self._sockets[self._n_sockets] = handle
1451aec3c8f4Simarom */
1452aec3c8f4Simarom      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1453aec3c8f4Simarom      __Pyx_GOTREF(__pyx_t_2);
1454aec3c8f4Simarom      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
1455aec3c8f4Simarom      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1456aec3c8f4Simarom      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1457aec3c8f4Simarom    }
1458aec3c8f4Simarom    goto __pyx_L3;
1459aec3c8f4Simarom  }
1460aec3c8f4Simarom  __pyx_L3:;
1461aec3c8f4Simarom
1462aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":90
1463aec3c8f4Simarom *                 raise MemoryError("Could not reallocate _sockets array")
1464aec3c8f4Simarom *
1465aec3c8f4Simarom *         self._sockets[self._n_sockets] = handle             # <<<<<<<<<<<<<<
1466aec3c8f4Simarom *         self._n_sockets += 1
1467aec3c8f4Simarom *
1468aec3c8f4Simarom */
1469aec3c8f4Simarom  (__pyx_v_self->_sockets[__pyx_v_self->_n_sockets]) = __pyx_v_handle;
1470aec3c8f4Simarom
1471aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":91
1472aec3c8f4Simarom *
1473aec3c8f4Simarom *         self._sockets[self._n_sockets] = handle
1474aec3c8f4Simarom *         self._n_sockets += 1             # <<<<<<<<<<<<<<
1475aec3c8f4Simarom *
1476aec3c8f4Simarom *     cdef inline void _remove_socket(self, void* handle):
1477aec3c8f4Simarom */
1478aec3c8f4Simarom  __pyx_v_self->_n_sockets = (__pyx_v_self->_n_sockets + 1);
1479aec3c8f4Simarom
1480aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":79
1481aec3c8f4Simarom *             self._term()
1482aec3c8f4Simarom *
1483aec3c8f4Simarom *     cdef inline void _add_socket(self, void* handle):             # <<<<<<<<<<<<<<
1484aec3c8f4Simarom *         """Add a socket handle to be closed when Context terminates.
1485aec3c8f4Simarom *
1486aec3c8f4Simarom */
1487aec3c8f4Simarom
1488aec3c8f4Simarom  /* function exit code */
1489aec3c8f4Simarom  goto __pyx_L0;
1490aec3c8f4Simarom  __pyx_L1_error:;
1491aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_2);
1492aec3c8f4Simarom  __Pyx_WriteUnraisable("zmq.backend.cython.context.Context._add_socket", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
1493aec3c8f4Simarom  __pyx_L0:;
1494aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
1495aec3c8f4Simarom}
1496aec3c8f4Simarom
1497aec3c8f4Simarom/* "zmq/backend/cython/context.pyx":93
1498aec3c8f4Simarom *         self._n_sockets += 1
1499aec3c8f4Simarom *
1500aec3c8f4Simarom *     cdef inline void _remove_socket(self, void* handle):             # <<<<<<<<<<<<<<
1501aec3c8f4Simarom *         """Remove a socket from the collected handles.
1502aec3c8f4Simarom *
1503aec3c8f4Simarom */
1504aec3c8f4Simarom
1505aec3c8f4Simaromstatic CYTHON_INLINE void __pyx_f_3zmq_7backend_6cython_7context_7Context__remove_socket(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, void *__pyx_v_handle) {
1506aec3c8f4Simarom  int __pyx_v_found;
1507aec3c8f4Simarom  size_t __pyx_v_idx;
1508aec3c8f4Simarom  __Pyx_RefNannyDeclarations
1509aec3c8f4Simarom  size_t __pyx_t_1;
1510aec3c8f4Simarom  size_t __pyx_t_2;
1511aec3c8f4Simarom  int __pyx_t_3;
1512aec3c8f4Simarom  __Pyx_RefNannySetupContext("_remove_socket", 0);
1513aec3c8f4Simarom
1514aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":99
1515aec3c8f4Simarom *         close a socket a second time.
1516aec3c8f4Simarom *         """
1517aec3c8f4Simarom *         cdef bint found = False             # <<<<<<<<<<<<<<
1518aec3c8f4Simarom *
1519aec3c8f4Simarom *         for idx in range(self._n_sockets):
1520aec3c8f4Simarom */
1521aec3c8f4Simarom  __pyx_v_found = 0;
1522aec3c8f4Simarom
1523aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":101
1524aec3c8f4Simarom *         cdef bint found = False
1525aec3c8f4Simarom *
1526aec3c8f4Simarom *         for idx in range(self._n_sockets):             # <<<<<<<<<<<<<<
1527aec3c8f4Simarom *             if self._sockets[idx] == handle:
1528aec3c8f4Simarom *                 found=True
1529aec3c8f4Simarom */
1530aec3c8f4Simarom  __pyx_t_1 = __pyx_v_self->_n_sockets;
1531aec3c8f4Simarom  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
1532aec3c8f4Simarom    __pyx_v_idx = __pyx_t_2;
1533aec3c8f4Simarom
1534aec3c8f4Simarom    /* "zmq/backend/cython/context.pyx":102
1535aec3c8f4Simarom *
1536aec3c8f4Simarom *         for idx in range(self._n_sockets):
1537aec3c8f4Simarom *             if self._sockets[idx] == handle:             # <<<<<<<<<<<<<<
1538aec3c8f4Simarom *                 found=True
1539aec3c8f4Simarom *                 break
1540aec3c8f4Simarom */
1541aec3c8f4Simarom    __pyx_t_3 = (((__pyx_v_self->_sockets[__pyx_v_idx]) == __pyx_v_handle) != 0);
1542aec3c8f4Simarom    if (__pyx_t_3) {
1543aec3c8f4Simarom
1544aec3c8f4Simarom      /* "zmq/backend/cython/context.pyx":103
1545aec3c8f4Simarom *         for idx in range(self._n_sockets):
1546aec3c8f4Simarom *             if self._sockets[idx] == handle:
1547aec3c8f4Simarom *                 found=True             # <<<<<<<<<<<<<<
1548aec3c8f4Simarom *                 break
1549aec3c8f4Simarom *
1550aec3c8f4Simarom */
1551aec3c8f4Simarom      __pyx_v_found = 1;
1552aec3c8f4Simarom
1553aec3c8f4Simarom      /* "zmq/backend/cython/context.pyx":104
1554aec3c8f4Simarom *             if self._sockets[idx] == handle:
1555aec3c8f4Simarom *                 found=True
1556aec3c8f4Simarom *                 break             # <<<<<<<<<<<<<<
1557aec3c8f4Simarom *
1558aec3c8f4Simarom *         if found:
1559aec3c8f4Simarom */
1560aec3c8f4Simarom      goto __pyx_L4_break;
1561aec3c8f4Simarom    }
1562aec3c8f4Simarom  }
1563aec3c8f4Simarom  __pyx_L4_break:;
1564aec3c8f4Simarom
1565aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":106
1566aec3c8f4Simarom *                 break
1567aec3c8f4Simarom *
1568aec3c8f4Simarom *         if found:             # <<<<<<<<<<<<<<
1569aec3c8f4Simarom *             self._n_sockets -= 1
1570aec3c8f4Simarom *             if self._n_sockets:
1571aec3c8f4Simarom */
1572aec3c8f4Simarom  __pyx_t_3 = (__pyx_v_found != 0);
1573aec3c8f4Simarom  if (__pyx_t_3) {
1574aec3c8f4Simarom
1575aec3c8f4Simarom    /* "zmq/backend/cython/context.pyx":107
1576aec3c8f4Simarom *
1577aec3c8f4Simarom *         if found:
1578aec3c8f4Simarom *             self._n_sockets -= 1             # <<<<<<<<<<<<<<
1579aec3c8f4Simarom *             if self._n_sockets:
1580aec3c8f4Simarom *                 # move last handle to closed socket's index
1581aec3c8f4Simarom */
1582aec3c8f4Simarom    __pyx_v_self->_n_sockets = (__pyx_v_self->_n_sockets - 1);
1583aec3c8f4Simarom
1584aec3c8f4Simarom    /* "zmq/backend/cython/context.pyx":108
1585aec3c8f4Simarom *         if found:
1586aec3c8f4Simarom *             self._n_sockets -= 1
1587aec3c8f4Simarom *             if self._n_sockets:             # <<<<<<<<<<<<<<
1588aec3c8f4Simarom *                 # move last handle to closed socket's index
1589aec3c8f4Simarom *                 self._sockets[idx] = self._sockets[self._n_sockets]
1590aec3c8f4Simarom */
1591aec3c8f4Simarom    __pyx_t_3 = (__pyx_v_self->_n_sockets != 0);
1592aec3c8f4Simarom    if (__pyx_t_3) {
1593aec3c8f4Simarom
1594aec3c8f4Simarom      /* "zmq/backend/cython/context.pyx":110
1595aec3c8f4Simarom *             if self._n_sockets:
1596aec3c8f4Simarom *                 # move last handle to closed socket's index
1597aec3c8f4Simarom *                 self._sockets[idx] = self._sockets[self._n_sockets]             # <<<<<<<<<<<<<<
1598aec3c8f4Simarom *
1599aec3c8f4Simarom *
1600aec3c8f4Simarom */
1601aec3c8f4Simarom      (__pyx_v_self->_sockets[__pyx_v_idx]) = (__pyx_v_self->_sockets[__pyx_v_self->_n_sockets]);
1602aec3c8f4Simarom      goto __pyx_L7;
1603aec3c8f4Simarom    }
1604aec3c8f4Simarom    __pyx_L7:;
1605aec3c8f4Simarom    goto __pyx_L6;
1606aec3c8f4Simarom  }
1607aec3c8f4Simarom  __pyx_L6:;
1608aec3c8f4Simarom
1609aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":93
1610aec3c8f4Simarom *         self._n_sockets += 1
1611aec3c8f4Simarom *
1612aec3c8f4Simarom *     cdef inline void _remove_socket(self, void* handle):             # <<<<<<<<<<<<<<
1613aec3c8f4Simarom *         """Remove a socket from the collected handles.
1614aec3c8f4Simarom *
1615aec3c8f4Simarom */
1616aec3c8f4Simarom
1617aec3c8f4Simarom  /* function exit code */
1618aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
1619aec3c8f4Simarom}
1620aec3c8f4Simarom
1621aec3c8f4Simarom/* "zmq/backend/cython/context.pyx":114
1622aec3c8f4Simarom *
1623aec3c8f4Simarom *     @property
1624aec3c8f4Simarom *     def underlying(self):             # <<<<<<<<<<<<<<
1625aec3c8f4Simarom *         """The address of the underlying libzmq context"""
1626aec3c8f4Simarom *         return <size_t> self.handle
1627aec3c8f4Simarom */
1628aec3c8f4Simarom
1629aec3c8f4Simarom/* Python wrapper */
1630aec3c8f4Simaromstatic PyObject *__pyx_pw_3zmq_7backend_6cython_7context_7Context_7underlying(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
1631aec3c8f4Simaromstatic char __pyx_doc_3zmq_7backend_6cython_7context_7Context_6underlying[] = "The address of the underlying libzmq context";
1632aec3c8f4Simaromstatic PyObject *__pyx_pw_3zmq_7backend_6cython_7context_7Context_7underlying(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
1633aec3c8f4Simarom  PyObject *__pyx_r = 0;
1634aec3c8f4Simarom  __Pyx_RefNannyDeclarations
1635aec3c8f4Simarom  __Pyx_RefNannySetupContext("underlying (wrapper)", 0);
1636aec3c8f4Simarom  __pyx_r = __pyx_pf_3zmq_7backend_6cython_7context_7Context_6underlying(((struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)__pyx_v_self));
1637aec3c8f4Simarom
1638aec3c8f4Simarom  /* function exit code */
1639aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
1640aec3c8f4Simarom  return __pyx_r;
1641aec3c8f4Simarom}
1642aec3c8f4Simarom
1643aec3c8f4Simaromstatic PyObject *__pyx_pf_3zmq_7backend_6cython_7context_7Context_6underlying(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self) {
1644aec3c8f4Simarom  PyObject *__pyx_r = NULL;
1645aec3c8f4Simarom  __Pyx_RefNannyDeclarations
1646aec3c8f4Simarom  PyObject *__pyx_t_1 = NULL;
1647aec3c8f4Simarom  int __pyx_lineno = 0;
1648aec3c8f4Simarom  const char *__pyx_filename = NULL;
1649aec3c8f4Simarom  int __pyx_clineno = 0;
1650aec3c8f4Simarom  __Pyx_RefNannySetupContext("underlying", 0);
1651aec3c8f4Simarom
1652aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":116
1653aec3c8f4Simarom *     def underlying(self):
1654aec3c8f4Simarom *         """The address of the underlying libzmq context"""
1655aec3c8f4Simarom *         return <size_t> self.handle             # <<<<<<<<<<<<<<
1656aec3c8f4Simarom *
1657aec3c8f4Simarom *     # backward-compat, though nobody is using it
1658aec3c8f4Simarom */
1659aec3c8f4Simarom  __Pyx_XDECREF(__pyx_r);
1660aec3c8f4Simarom  __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_self->handle)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1661aec3c8f4Simarom  __Pyx_GOTREF(__pyx_t_1);
1662aec3c8f4Simarom  __pyx_r = __pyx_t_1;
1663aec3c8f4Simarom  __pyx_t_1 = 0;
1664aec3c8f4Simarom  goto __pyx_L0;
1665aec3c8f4Simarom
1666aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":114
1667aec3c8f4Simarom *
1668aec3c8f4Simarom *     @property
1669aec3c8f4Simarom *     def underlying(self):             # <<<<<<<<<<<<<<
1670aec3c8f4Simarom *         """The address of the underlying libzmq context"""
1671aec3c8f4Simarom *         return <size_t> self.handle
1672aec3c8f4Simarom */
1673aec3c8f4Simarom
1674aec3c8f4Simarom  /* function exit code */
1675aec3c8f4Simarom  __pyx_L1_error:;
1676aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_1);
1677aec3c8f4Simarom  __Pyx_AddTraceback("zmq.backend.cython.context.Context.underlying", __pyx_clineno, __pyx_lineno, __pyx_filename);
1678aec3c8f4Simarom  __pyx_r = NULL;
1679aec3c8f4Simarom  __pyx_L0:;
1680aec3c8f4Simarom  __Pyx_XGIVEREF(__pyx_r);
1681aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
1682aec3c8f4Simarom  return __pyx_r;
1683aec3c8f4Simarom}
1684aec3c8f4Simarom
1685aec3c8f4Simarom/* "zmq/backend/cython/context.pyx":121
1686aec3c8f4Simarom *     _handle = underlying
1687aec3c8f4Simarom *
1688aec3c8f4Simarom *     cdef inline int _term(self):             # <<<<<<<<<<<<<<
1689aec3c8f4Simarom *         cdef int rc=0
1690aec3c8f4Simarom *         if self.handle != NULL and not self.closed and getpid() == self._pid:
1691aec3c8f4Simarom */
1692aec3c8f4Simarom
1693aec3c8f4Simaromstatic CYTHON_INLINE int __pyx_f_3zmq_7backend_6cython_7context_7Context__term(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self) {
1694aec3c8f4Simarom  int __pyx_v_rc;
1695aec3c8f4Simarom  int __pyx_r;
1696aec3c8f4Simarom  __Pyx_RefNannyDeclarations
1697aec3c8f4Simarom  int __pyx_t_1;
1698aec3c8f4Simarom  int __pyx_t_2;
1699aec3c8f4Simarom  __Pyx_RefNannySetupContext("_term", 0);
1700aec3c8f4Simarom
1701aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":122
1702aec3c8f4Simarom *
1703aec3c8f4Simarom *     cdef inline int _term(self):
1704aec3c8f4Simarom *         cdef int rc=0             # <<<<<<<<<<<<<<
1705aec3c8f4Simarom *         if self.handle != NULL and not self.closed and getpid() == self._pid:
1706aec3c8f4Simarom *             with nogil:
1707aec3c8f4Simarom */
1708aec3c8f4Simarom  __pyx_v_rc = 0;
1709aec3c8f4Simarom
1710aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":123
1711aec3c8f4Simarom *     cdef inline int _term(self):
1712aec3c8f4Simarom *         cdef int rc=0
1713aec3c8f4Simarom *         if self.handle != NULL and not self.closed and getpid() == self._pid:             # <<<<<<<<<<<<<<
1714aec3c8f4Simarom *             with nogil:
1715aec3c8f4Simarom *                 rc = zmq_ctx_destroy(self.handle)
1716aec3c8f4Simarom */
1717aec3c8f4Simarom  __pyx_t_2 = ((__pyx_v_self->handle != NULL) != 0);
1718aec3c8f4Simarom  if (__pyx_t_2) {
1719aec3c8f4Simarom  } else {
1720aec3c8f4Simarom    __pyx_t_1 = __pyx_t_2;
1721aec3c8f4Simarom    goto __pyx_L4_bool_binop_done;
1722aec3c8f4Simarom  }
1723aec3c8f4Simarom  __pyx_t_2 = ((!(__pyx_v_self->closed != 0)) != 0);
1724aec3c8f4Simarom  if (__pyx_t_2) {
1725aec3c8f4Simarom  } else {
1726aec3c8f4Simarom    __pyx_t_1 = __pyx_t_2;
1727aec3c8f4Simarom    goto __pyx_L4_bool_binop_done;
1728aec3c8f4Simarom  }
1729aec3c8f4Simarom  __pyx_t_2 = ((getpid() == __pyx_v_self->_pid) != 0);
1730aec3c8f4Simarom  __pyx_t_1 = __pyx_t_2;
1731aec3c8f4Simarom  __pyx_L4_bool_binop_done:;
1732aec3c8f4Simarom  if (__pyx_t_1) {
1733aec3c8f4Simarom
1734aec3c8f4Simarom    /* "zmq/backend/cython/context.pyx":124
1735aec3c8f4Simarom *         cdef int rc=0
1736aec3c8f4Simarom *         if self.handle != NULL and not self.closed and getpid() == self._pid:
1737aec3c8f4Simarom *             with nogil:             # <<<<<<<<<<<<<<
1738aec3c8f4Simarom *                 rc = zmq_ctx_destroy(self.handle)
1739aec3c8f4Simarom *         self.handle = NULL
1740aec3c8f4Simarom */
1741aec3c8f4Simarom    {
1742aec3c8f4Simarom        #ifdef WITH_THREAD
1743aec3c8f4Simarom        PyThreadState *_save;
1744aec3c8f4Simarom        Py_UNBLOCK_THREADS
1745aec3c8f4Simarom        #endif
1746aec3c8f4Simarom        /*try:*/ {
1747aec3c8f4Simarom
1748aec3c8f4Simarom          /* "zmq/backend/cython/context.pyx":125
1749aec3c8f4Simarom *         if self.handle != NULL and not self.closed and getpid() == self._pid:
1750aec3c8f4Simarom *             with nogil:
1751aec3c8f4Simarom *                 rc = zmq_ctx_destroy(self.handle)             # <<<<<<<<<<<<<<
1752aec3c8f4Simarom *         self.handle = NULL
1753aec3c8f4Simarom *         return rc
1754aec3c8f4Simarom */
1755aec3c8f4Simarom          __pyx_v_rc = zmq_ctx_destroy(__pyx_v_self->handle);
1756aec3c8f4Simarom        }
1757aec3c8f4Simarom
1758aec3c8f4Simarom        /* "zmq/backend/cython/context.pyx":124
1759aec3c8f4Simarom *         cdef int rc=0
1760aec3c8f4Simarom *         if self.handle != NULL and not self.closed and getpid() == self._pid:
1761aec3c8f4Simarom *             with nogil:             # <<<<<<<<<<<<<<
1762aec3c8f4Simarom *                 rc = zmq_ctx_destroy(self.handle)
1763aec3c8f4Simarom *         self.handle = NULL
1764aec3c8f4Simarom */
1765aec3c8f4Simarom        /*finally:*/ {
1766aec3c8f4Simarom          /*normal exit:*/{
1767aec3c8f4Simarom            #ifdef WITH_THREAD
1768aec3c8f4Simarom            Py_BLOCK_THREADS
1769aec3c8f4Simarom            #endif
1770aec3c8f4Simarom            goto __pyx_L9;
1771aec3c8f4Simarom          }
1772aec3c8f4Simarom          __pyx_L9:;
1773aec3c8f4Simarom        }
1774aec3c8f4Simarom    }
1775aec3c8f4Simarom    goto __pyx_L3;
1776aec3c8f4Simarom  }
1777aec3c8f4Simarom  __pyx_L3:;
1778aec3c8f4Simarom
1779aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":126
1780aec3c8f4Simarom *             with nogil:
1781aec3c8f4Simarom *                 rc = zmq_ctx_destroy(self.handle)
1782aec3c8f4Simarom *         self.handle = NULL             # <<<<<<<<<<<<<<
1783aec3c8f4Simarom *         return rc
1784aec3c8f4Simarom *
1785aec3c8f4Simarom */
1786aec3c8f4Simarom  __pyx_v_self->handle = NULL;
1787aec3c8f4Simarom
1788aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":127
1789aec3c8f4Simarom *                 rc = zmq_ctx_destroy(self.handle)
1790aec3c8f4Simarom *         self.handle = NULL
1791aec3c8f4Simarom *         return rc             # <<<<<<<<<<<<<<
1792aec3c8f4Simarom *
1793aec3c8f4Simarom *     def term(self):
1794aec3c8f4Simarom */
1795aec3c8f4Simarom  __pyx_r = __pyx_v_rc;
1796aec3c8f4Simarom  goto __pyx_L0;
1797aec3c8f4Simarom
1798aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":121
1799aec3c8f4Simarom *     _handle = underlying
1800aec3c8f4Simarom *
1801aec3c8f4Simarom *     cdef inline int _term(self):             # <<<<<<<<<<<<<<
1802aec3c8f4Simarom *         cdef int rc=0
1803aec3c8f4Simarom *         if self.handle != NULL and not self.closed and getpid() == self._pid:
1804aec3c8f4Simarom */
1805aec3c8f4Simarom
1806aec3c8f4Simarom  /* function exit code */
1807aec3c8f4Simarom  __pyx_L0:;
1808aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
1809aec3c8f4Simarom  return __pyx_r;
1810aec3c8f4Simarom}
1811aec3c8f4Simarom
1812aec3c8f4Simarom/* "zmq/backend/cython/context.pyx":129
1813aec3c8f4Simarom *         return rc
1814aec3c8f4Simarom *
1815aec3c8f4Simarom *     def term(self):             # <<<<<<<<<<<<<<
1816aec3c8f4Simarom *         """ctx.term()
1817aec3c8f4Simarom *
1818aec3c8f4Simarom */
1819aec3c8f4Simarom
1820aec3c8f4Simarom/* Python wrapper */
1821aec3c8f4Simaromstatic PyObject *__pyx_pw_3zmq_7backend_6cython_7context_7Context_9term(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
1822aec3c8f4Simaromstatic char __pyx_doc_3zmq_7backend_6cython_7context_7Context_8term[] = "ctx.term()\n\n        Close or terminate the context.\n        \n        This can be called to close the context by hand. If this is not called,\n        the context will automatically be closed when it is garbage collected.\n        ";
1823aec3c8f4Simaromstatic PyObject *__pyx_pw_3zmq_7backend_6cython_7context_7Context_9term(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
1824aec3c8f4Simarom  PyObject *__pyx_r = 0;
1825aec3c8f4Simarom  __Pyx_RefNannyDeclarations
1826aec3c8f4Simarom  __Pyx_RefNannySetupContext("term (wrapper)", 0);
1827aec3c8f4Simarom  __pyx_r = __pyx_pf_3zmq_7backend_6cython_7context_7Context_8term(((struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)__pyx_v_self));
1828aec3c8f4Simarom
1829aec3c8f4Simarom  /* function exit code */
1830aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
1831aec3c8f4Simarom  return __pyx_r;
1832aec3c8f4Simarom}
1833aec3c8f4Simarom
1834aec3c8f4Simaromstatic PyObject *__pyx_pf_3zmq_7backend_6cython_7context_7Context_8term(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self) {
1835aec3c8f4Simarom  CYTHON_UNUSED int __pyx_v_rc;
1836aec3c8f4Simarom  PyObject *__pyx_r = NULL;
1837aec3c8f4Simarom  __Pyx_RefNannyDeclarations
1838aec3c8f4Simarom  __Pyx_RefNannySetupContext("term", 0);
1839aec3c8f4Simarom
1840aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":138
1841aec3c8f4Simarom *         """
1842aec3c8f4Simarom *         cdef int rc
1843aec3c8f4Simarom *         rc = self._term()             # <<<<<<<<<<<<<<
1844aec3c8f4Simarom *         self.closed = True
1845aec3c8f4Simarom *
1846aec3c8f4Simarom */
1847aec3c8f4Simarom  __pyx_v_rc = __pyx_f_3zmq_7backend_6cython_7context_7Context__term(__pyx_v_self);
1848aec3c8f4Simarom
1849aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":139
1850aec3c8f4Simarom *         cdef int rc
1851aec3c8f4Simarom *         rc = self._term()
1852aec3c8f4Simarom *         self.closed = True             # <<<<<<<<<<<<<<
1853aec3c8f4Simarom *
1854aec3c8f4Simarom *     def set(self, int option, optval):
1855aec3c8f4Simarom */
1856aec3c8f4Simarom  __pyx_v_self->closed = 1;
1857aec3c8f4Simarom
1858aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":129
1859aec3c8f4Simarom *         return rc
1860aec3c8f4Simarom *
1861aec3c8f4Simarom *     def term(self):             # <<<<<<<<<<<<<<
1862aec3c8f4Simarom *         """ctx.term()
1863aec3c8f4Simarom *
1864aec3c8f4Simarom */
1865aec3c8f4Simarom
1866aec3c8f4Simarom  /* function exit code */
1867aec3c8f4Simarom  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1868aec3c8f4Simarom  __Pyx_XGIVEREF(__pyx_r);
1869aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
1870aec3c8f4Simarom  return __pyx_r;
1871aec3c8f4Simarom}
1872aec3c8f4Simarom
1873aec3c8f4Simarom/* "zmq/backend/cython/context.pyx":141
1874aec3c8f4Simarom *         self.closed = True
1875aec3c8f4Simarom *
1876aec3c8f4Simarom *     def set(self, int option, optval):             # <<<<<<<<<<<<<<
1877aec3c8f4Simarom *         """ctx.set(option, optval)
1878aec3c8f4Simarom *
1879aec3c8f4Simarom */
1880aec3c8f4Simarom
1881aec3c8f4Simarom/* Python wrapper */
1882aec3c8f4Simaromstatic PyObject *__pyx_pw_3zmq_7backend_6cython_7context_7Context_11set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1883aec3c8f4Simaromstatic char __pyx_doc_3zmq_7backend_6cython_7context_7Context_10set[] = "ctx.set(option, optval)\n\n        Set a context option.\n\n        See the 0MQ API documentation for zmq_ctx_set\n        for details on specific options.\n        \n        .. versionadded:: libzmq-3.2\n        .. versionadded:: 13.0\n\n        Parameters\n        ----------\n        option : int\n            The option to set.  Available values will depend on your\n            version of libzmq.  Examples include::\n            \n                zmq.IO_THREADS, zmq.MAX_SOCKETS\n        \n        optval : int\n            The value of the option to set.\n        ";
1884aec3c8f4Simaromstatic PyObject *__pyx_pw_3zmq_7backend_6cython_7context_7Context_11set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1885aec3c8f4Simarom  int __pyx_v_option;
1886aec3c8f4Simarom  PyObject *__pyx_v_optval = 0;
1887aec3c8f4Simarom  int __pyx_lineno = 0;
1888aec3c8f4Simarom  const char *__pyx_filename = NULL;
1889aec3c8f4Simarom  int __pyx_clineno = 0;
1890aec3c8f4Simarom  PyObject *__pyx_r = 0;
1891aec3c8f4Simarom  __Pyx_RefNannyDeclarations
1892aec3c8f4Simarom  __Pyx_RefNannySetupContext("set (wrapper)", 0);
1893aec3c8f4Simarom  {
1894aec3c8f4Simarom    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_option,&__pyx_n_s_optval,0};
1895aec3c8f4Simarom    PyObject* values[2] = {0,0};
1896aec3c8f4Simarom    if (unlikely(__pyx_kwds)) {
1897aec3c8f4Simarom      Py_ssize_t kw_args;
1898aec3c8f4Simarom      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1899aec3c8f4Simarom      switch (pos_args) {
1900aec3c8f4Simarom        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1901aec3c8f4Simarom        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1902aec3c8f4Simarom        case  0: break;
1903aec3c8f4Simarom        default: goto __pyx_L5_argtuple_error;
1904aec3c8f4Simarom      }
1905aec3c8f4Simarom      kw_args = PyDict_Size(__pyx_kwds);
1906aec3c8f4Simarom      switch (pos_args) {
1907aec3c8f4Simarom        case  0:
1908aec3c8f4Simarom        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_option)) != 0)) kw_args--;
1909aec3c8f4Simarom        else goto __pyx_L5_argtuple_error;
1910aec3c8f4Simarom        case  1:
1911aec3c8f4Simarom        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_optval)) != 0)) kw_args--;
1912aec3c8f4Simarom        else {
1913aec3c8f4Simarom          __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1914aec3c8f4Simarom        }
1915aec3c8f4Simarom      }
1916aec3c8f4Simarom      if (unlikely(kw_args > 0)) {
1917aec3c8f4Simarom        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1918aec3c8f4Simarom      }
1919aec3c8f4Simarom    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
1920aec3c8f4Simarom      goto __pyx_L5_argtuple_error;
1921aec3c8f4Simarom    } else {
1922aec3c8f4Simarom      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1923aec3c8f4Simarom      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1924aec3c8f4Simarom    }
1925aec3c8f4Simarom    __pyx_v_option = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_option == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1926aec3c8f4Simarom    __pyx_v_optval = values[1];
1927aec3c8f4Simarom  }
1928aec3c8f4Simarom  goto __pyx_L4_argument_unpacking_done;
1929aec3c8f4Simarom  __pyx_L5_argtuple_error:;
1930aec3c8f4Simarom  __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1931aec3c8f4Simarom  __pyx_L3_error:;
1932aec3c8f4Simarom  __Pyx_AddTraceback("zmq.backend.cython.context.Context.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
1933aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
1934aec3c8f4Simarom  return NULL;
1935aec3c8f4Simarom  __pyx_L4_argument_unpacking_done:;
1936aec3c8f4Simarom  __pyx_r = __pyx_pf_3zmq_7backend_6cython_7context_7Context_10set(((struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)__pyx_v_self), __pyx_v_option, __pyx_v_optval);
1937aec3c8f4Simarom
1938aec3c8f4Simarom  /* function exit code */
1939aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
1940aec3c8f4Simarom  return __pyx_r;
1941aec3c8f4Simarom}
1942aec3c8f4Simarom
1943aec3c8f4Simaromstatic PyObject *__pyx_pf_3zmq_7backend_6cython_7context_7Context_10set(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, int __pyx_v_option, PyObject *__pyx_v_optval) {
1944aec3c8f4Simarom  int __pyx_v_optval_int_c;
1945aec3c8f4Simarom  int __pyx_v_rc;
1946aec3c8f4Simarom  PyObject *__pyx_r = NULL;
1947aec3c8f4Simarom  __Pyx_RefNannyDeclarations
1948aec3c8f4Simarom  int __pyx_t_1;
1949aec3c8f4Simarom  PyObject *__pyx_t_2 = NULL;
1950aec3c8f4Simarom  int __pyx_t_3;
1951aec3c8f4Simarom  PyObject *__pyx_t_4 = NULL;
1952aec3c8f4Simarom  int __pyx_t_5;
1953aec3c8f4Simarom  int __pyx_lineno = 0;
1954aec3c8f4Simarom  const char *__pyx_filename = NULL;
1955aec3c8f4Simarom  int __pyx_clineno = 0;
1956aec3c8f4Simarom  __Pyx_RefNannySetupContext("set", 0);
1957aec3c8f4Simarom
1958aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":167
1959aec3c8f4Simarom *         cdef char* optval_c
1960aec3c8f4Simarom *
1961aec3c8f4Simarom *         if self.closed:             # <<<<<<<<<<<<<<
1962aec3c8f4Simarom *             raise RuntimeError("Context has been destroyed")
1963aec3c8f4Simarom *
1964aec3c8f4Simarom */
1965aec3c8f4Simarom  __pyx_t_1 = (__pyx_v_self->closed != 0);
1966aec3c8f4Simarom  if (__pyx_t_1) {
1967aec3c8f4Simarom
1968aec3c8f4Simarom    /* "zmq/backend/cython/context.pyx":168
1969aec3c8f4Simarom *
1970aec3c8f4Simarom *         if self.closed:
1971aec3c8f4Simarom *             raise RuntimeError("Context has been destroyed")             # <<<<<<<<<<<<<<
1972aec3c8f4Simarom *
1973aec3c8f4Simarom *         if not isinstance(optval, int):
1974aec3c8f4Simarom */
1975aec3c8f4Simarom    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1976aec3c8f4Simarom    __Pyx_GOTREF(__pyx_t_2);
1977aec3c8f4Simarom    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
1978aec3c8f4Simarom    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1979aec3c8f4Simarom    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1980aec3c8f4Simarom  }
1981aec3c8f4Simarom
1982aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":170
1983aec3c8f4Simarom *             raise RuntimeError("Context has been destroyed")
1984aec3c8f4Simarom *
1985aec3c8f4Simarom *         if not isinstance(optval, int):             # <<<<<<<<<<<<<<
1986aec3c8f4Simarom *             raise TypeError('expected int, got: %r' % optval)
1987aec3c8f4Simarom *         optval_int_c = optval
1988aec3c8f4Simarom */
1989aec3c8f4Simarom  __pyx_t_1 = PyInt_Check(__pyx_v_optval);
1990aec3c8f4Simarom  __pyx_t_3 = ((!(__pyx_t_1 != 0)) != 0);
1991aec3c8f4Simarom  if (__pyx_t_3) {
1992aec3c8f4Simarom
1993aec3c8f4Simarom    /* "zmq/backend/cython/context.pyx":171
1994aec3c8f4Simarom *
1995aec3c8f4Simarom *         if not isinstance(optval, int):
1996aec3c8f4Simarom *             raise TypeError('expected int, got: %r' % optval)             # <<<<<<<<<<<<<<
1997aec3c8f4Simarom *         optval_int_c = optval
1998aec3c8f4Simarom *         rc = zmq_ctx_set(self.handle, option, optval_int_c)
1999aec3c8f4Simarom */
2000aec3c8f4Simarom    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_expected_int_got_r, __pyx_v_optval); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2001aec3c8f4Simarom    __Pyx_GOTREF(__pyx_t_2);
2002aec3c8f4Simarom    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2003aec3c8f4Simarom    __Pyx_GOTREF(__pyx_t_4);
2004aec3c8f4Simarom    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
2005aec3c8f4Simarom    __Pyx_GIVEREF(__pyx_t_2);
2006aec3c8f4Simarom    __pyx_t_2 = 0;
2007aec3c8f4Simarom    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2008aec3c8f4Simarom    __Pyx_GOTREF(__pyx_t_2);
2009aec3c8f4Simarom    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2010aec3c8f4Simarom    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
2011aec3c8f4Simarom    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2012aec3c8f4Simarom    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2013aec3c8f4Simarom  }
2014aec3c8f4Simarom
2015aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":172
2016aec3c8f4Simarom *         if not isinstance(optval, int):
2017aec3c8f4Simarom *             raise TypeError('expected int, got: %r' % optval)
2018aec3c8f4Simarom *         optval_int_c = optval             # <<<<<<<<<<<<<<
2019aec3c8f4Simarom *         rc = zmq_ctx_set(self.handle, option, optval_int_c)
2020aec3c8f4Simarom *         _check_rc(rc)
2021aec3c8f4Simarom */
2022aec3c8f4Simarom  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_optval); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2023aec3c8f4Simarom  __pyx_v_optval_int_c = __pyx_t_5;
2024aec3c8f4Simarom
2025aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":173
2026aec3c8f4Simarom *             raise TypeError('expected int, got: %r' % optval)
2027aec3c8f4Simarom *         optval_int_c = optval
2028aec3c8f4Simarom *         rc = zmq_ctx_set(self.handle, option, optval_int_c)             # <<<<<<<<<<<<<<
2029aec3c8f4Simarom *         _check_rc(rc)
2030aec3c8f4Simarom *
2031aec3c8f4Simarom */
2032aec3c8f4Simarom  __pyx_v_rc = zmq_ctx_set(__pyx_v_self->handle, __pyx_v_option, __pyx_v_optval_int_c);
2033aec3c8f4Simarom
2034aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":174
2035aec3c8f4Simarom *         optval_int_c = optval
2036aec3c8f4Simarom *         rc = zmq_ctx_set(self.handle, option, optval_int_c)
2037aec3c8f4Simarom *         _check_rc(rc)             # <<<<<<<<<<<<<<
2038aec3c8f4Simarom *
2039aec3c8f4Simarom *     def get(self, int option):
2040aec3c8f4Simarom */
2041aec3c8f4Simarom  __pyx_t_5 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2042aec3c8f4Simarom
2043aec3c8f4Simarom  /* "zmq/backend/cython/context.pyx":141
2044aec3c8f4Simarom *         self.closed = True
2045aec3c8f4Simarom *
2046aec3c8f4Simarom *     def set(self, int option, optval):             # <<<<<<<<<<<<<<
2047aec3c8f4Simarom *         """ctx.set(option, optval)
2048aec3c8f4Simarom *
2049aec3c8f4Simarom */
2050aec3c8f4Simarom
2051aec3c8f4Simarom  /* function exit code */
2052aec3c8f4Simarom  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2053aec3c8f4Simarom  goto __pyx_L0;
2054aec3c8f4Simarom  __pyx_L1_error:;
2055aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_2);
2056aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_4);
2057aec3c8f4Simarom  __Pyx_AddTraceback("zmq.backend.cython.context.Context.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
2058aec3c8f4Simarom  __pyx_r = NULL;
2059aec3c8f4Simarom  __pyx_L0:;
2060aec3c8f4Simarom  __Pyx_XGIVEREF(__pyx_r);
2061aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
2062aec3c8f4Simarom  return __pyx_r;
2063aec3c8f4Simarom}
2064aec3c8f4Simarom
2065aec3c8f4Simarom/* "zmq/backend/cython/context.pyx":176
2066aec3c8f4Simarom *         _check_rc(rc)
2067aec3c8f4Simarom *
2068aec3c8f4Simarom *     def get(self, int option):             # <<<<<<<<<<<<<<
2069aec3c8f4Simarom *         """ctx.get(option)
2070aec3c8f4Simarom *
2071aec3c8f4Simarom */
2072aec3c8f4Simarom
2073aec3c8f4Simarom/* Python wrapper */
2074aec3c8f4Simaromstatic PyObject *__pyx_pw_3zmq_7backend_6cython_7context_7Context_13get(PyObject *__pyx_v_self, PyObject *__pyx_arg_option); /*proto*/
2075aec3c8f4Simaromstatic char __pyx_doc_3zmq_7backend_6cython_7context_7Context_12get[] = "ctx.get(option)\n\n        Get the value of a context option.\n\n        See the 0MQ API documentation for zmq_ctx_get\n        for details on specific options.\n        \n        .. versionadded:: libzmq-3.2\n        .. versionadded:: 13.0\n\n        Parameters\n        ----------\n        option : int\n            The option to get.  Available values will depend on your\n            version of libzmq.  Examples include::\n            \n                zmq.IO_THREADS, zmq.MAX_SOCKETS\n            \n        Returns\n        -------\n        optval : int\n            The value of the option as an integer.\n        ";
2076aec3c8f4Simaromstatic PyObject *__pyx_pw_3zmq_7backend_6cython_7context_7Context_13get(PyObject *__pyx_v_self, PyObject *__pyx_arg_option) {
2077