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___device
235aec3c8f4Simarom#define __PYX_HAVE_API__zmq__backend__cython___device
236aec3c8f4Simarom#include "zmq_compat.h"
237aec3c8f4Simarom#include "zmq.h"
238aec3c8f4Simarom#include "zmq_utils.h"
239aec3c8f4Simarom#include "errno.h"
240aec3c8f4Simarom#include "string.h"
241aec3c8f4Simarom#include "stdio.h"
242aec3c8f4Simarom#include "pythread.h"
243aec3c8f4Simarom#ifdef _OPENMP
244aec3c8f4Simarom#include <omp.h>
245aec3c8f4Simarom#endif /* _OPENMP */
246aec3c8f4Simarom
247aec3c8f4Simarom#ifdef PYREX_WITHOUT_ASSERTIONS
248aec3c8f4Simarom#define CYTHON_WITHOUT_ASSERTIONS
249aec3c8f4Simarom#endif
250aec3c8f4Simarom
251aec3c8f4Simarom#ifndef CYTHON_UNUSED
252aec3c8f4Simarom# if defined(__GNUC__)
253aec3c8f4Simarom#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
254aec3c8f4Simarom#     define CYTHON_UNUSED __attribute__ ((__unused__))
255aec3c8f4Simarom#   else
256aec3c8f4Simarom#     define CYTHON_UNUSED
257aec3c8f4Simarom#   endif
258aec3c8f4Simarom# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
259aec3c8f4Simarom#   define CYTHON_UNUSED __attribute__ ((__unused__))
260aec3c8f4Simarom# else
261aec3c8f4Simarom#   define CYTHON_UNUSED
262aec3c8f4Simarom# endif
263aec3c8f4Simarom#endif
264aec3c8f4Simaromtypedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
265aec3c8f4Simarom                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
266aec3c8f4Simarom
267aec3c8f4Simarom#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
268aec3c8f4Simarom#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
269aec3c8f4Simarom#define __PYX_DEFAULT_STRING_ENCODING ""
270aec3c8f4Simarom#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
271aec3c8f4Simarom#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
272aec3c8f4Simarom#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (    \
273aec3c8f4Simarom    (sizeof(type) < sizeof(Py_ssize_t))  ||             \
274aec3c8f4Simarom    (sizeof(type) > sizeof(Py_ssize_t) &&               \
275aec3c8f4Simarom          likely(v < (type)PY_SSIZE_T_MAX ||            \
276aec3c8f4Simarom                 v == (type)PY_SSIZE_T_MAX)  &&         \
277aec3c8f4Simarom          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||       \
278aec3c8f4Simarom                                v == (type)PY_SSIZE_T_MIN)))  ||  \
279aec3c8f4Simarom    (sizeof(type) == sizeof(Py_ssize_t) &&              \
280aec3c8f4Simarom          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||        \
281aec3c8f4Simarom                               v == (type)PY_SSIZE_T_MAX)))  )
282aec3c8f4Simaromstatic CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
283aec3c8f4Simaromstatic CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
284aec3c8f4Simarom#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
285aec3c8f4Simarom#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
286aec3c8f4Simarom#define __Pyx_PyBytes_FromString        PyBytes_FromString
287aec3c8f4Simarom#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
288aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
289aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
290aec3c8f4Simarom    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
291aec3c8f4Simarom    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
292aec3c8f4Simarom#else
293aec3c8f4Simarom    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
294aec3c8f4Simarom    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
295aec3c8f4Simarom#endif
296aec3c8f4Simarom#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
297aec3c8f4Simarom#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
298aec3c8f4Simarom#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((const char*)s)
299aec3c8f4Simarom#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((const char*)s)
300aec3c8f4Simarom#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((const char*)s)
301aec3c8f4Simarom#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((const char*)s)
302aec3c8f4Simarom#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
303aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
304aec3c8f4Simaromstatic CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
305aec3c8f4Simarom{
306aec3c8f4Simarom    const Py_UNICODE *u_end = u;
307aec3c8f4Simarom    while (*u_end++) ;
308aec3c8f4Simarom    return (size_t)(u_end - u - 1);
309aec3c8f4Simarom}
310aec3c8f4Simarom#else
311aec3c8f4Simarom#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
312aec3c8f4Simarom#endif
313aec3c8f4Simarom#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
314aec3c8f4Simarom#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
315aec3c8f4Simarom#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
316aec3c8f4Simarom#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
317aec3c8f4Simarom#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
318aec3c8f4Simaromstatic CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
319aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
320aec3c8f4Simaromstatic CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
321aec3c8f4Simaromstatic CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
322aec3c8f4Simarom#if CYTHON_COMPILING_IN_CPYTHON
323aec3c8f4Simarom#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
324aec3c8f4Simarom#else
325aec3c8f4Simarom#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
326aec3c8f4Simarom#endif
327aec3c8f4Simarom#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
328aec3c8f4Simarom#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
329aec3c8f4Simaromstatic int __Pyx_sys_getdefaultencoding_not_ascii;
330aec3c8f4Simaromstatic int __Pyx_init_sys_getdefaultencoding_params(void) {
331aec3c8f4Simarom    PyObject* sys;
332aec3c8f4Simarom    PyObject* default_encoding = NULL;
333aec3c8f4Simarom    PyObject* ascii_chars_u = NULL;
334aec3c8f4Simarom    PyObject* ascii_chars_b = NULL;
335aec3c8f4Simarom    const char* default_encoding_c;
336aec3c8f4Simarom    sys = PyImport_ImportModule("sys");
337aec3c8f4Simarom    if (!sys) goto bad;
338aec3c8f4Simarom    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
339aec3c8f4Simarom    Py_DECREF(sys);
340aec3c8f4Simarom    if (!default_encoding) goto bad;
341aec3c8f4Simarom    default_encoding_c = PyBytes_AsString(default_encoding);
342aec3c8f4Simarom    if (!default_encoding_c) goto bad;
343aec3c8f4Simarom    if (strcmp(default_encoding_c, "ascii") == 0) {
344aec3c8f4Simarom        __Pyx_sys_getdefaultencoding_not_ascii = 0;
345aec3c8f4Simarom    } else {
346aec3c8f4Simarom        char ascii_chars[128];
347aec3c8f4Simarom        int c;
348aec3c8f4Simarom        for (c = 0; c < 128; c++) {
349aec3c8f4Simarom            ascii_chars[c] = c;
350aec3c8f4Simarom        }
351aec3c8f4Simarom        __Pyx_sys_getdefaultencoding_not_ascii = 1;
352aec3c8f4Simarom        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
353aec3c8f4Simarom        if (!ascii_chars_u) goto bad;
354aec3c8f4Simarom        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
355aec3c8f4Simarom        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
356aec3c8f4Simarom            PyErr_Format(
357aec3c8f4Simarom                PyExc_ValueError,
358aec3c8f4Simarom                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
359aec3c8f4Simarom                default_encoding_c);
360aec3c8f4Simarom            goto bad;
361aec3c8f4Simarom        }
362aec3c8f4Simarom        Py_DECREF(ascii_chars_u);
363aec3c8f4Simarom        Py_DECREF(ascii_chars_b);
364aec3c8f4Simarom    }
365aec3c8f4Simarom    Py_DECREF(default_encoding);
366aec3c8f4Simarom    return 0;
367aec3c8f4Simarombad:
368aec3c8f4Simarom    Py_XDECREF(default_encoding);
369aec3c8f4Simarom    Py_XDECREF(ascii_chars_u);
370aec3c8f4Simarom    Py_XDECREF(ascii_chars_b);
371aec3c8f4Simarom    return -1;
372aec3c8f4Simarom}
373aec3c8f4Simarom#endif
374aec3c8f4Simarom#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
375aec3c8f4Simarom#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
376aec3c8f4Simarom#else
377aec3c8f4Simarom#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
378aec3c8f4Simarom#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
379aec3c8f4Simaromstatic char* __PYX_DEFAULT_STRING_ENCODING;
380aec3c8f4Simaromstatic int __Pyx_init_sys_getdefaultencoding_params(void) {
381aec3c8f4Simarom    PyObject* sys;
382aec3c8f4Simarom    PyObject* default_encoding = NULL;
383aec3c8f4Simarom    char* default_encoding_c;
384aec3c8f4Simarom    sys = PyImport_ImportModule("sys");
385aec3c8f4Simarom    if (!sys) goto bad;
386aec3c8f4Simarom    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
387aec3c8f4Simarom    Py_DECREF(sys);
388aec3c8f4Simarom    if (!default_encoding) goto bad;
389aec3c8f4Simarom    default_encoding_c = PyBytes_AsString(default_encoding);
390aec3c8f4Simarom    if (!default_encoding_c) goto bad;
391aec3c8f4Simarom    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
392aec3c8f4Simarom    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
393aec3c8f4Simarom    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
394aec3c8f4Simarom    Py_DECREF(default_encoding);
395aec3c8f4Simarom    return 0;
396aec3c8f4Simarombad:
397aec3c8f4Simarom    Py_XDECREF(default_encoding);
398aec3c8f4Simarom    return -1;
399aec3c8f4Simarom}
400aec3c8f4Simarom#endif
401aec3c8f4Simarom#endif
402aec3c8f4Simarom
403aec3c8f4Simarom
404aec3c8f4Simarom/* Test for GCC > 2.95 */
405aec3c8f4Simarom#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
406aec3c8f4Simarom  #define likely(x)   __builtin_expect(!!(x), 1)
407aec3c8f4Simarom  #define unlikely(x) __builtin_expect(!!(x), 0)
408aec3c8f4Simarom#else /* !__GNUC__ or GCC < 2.95 */
409aec3c8f4Simarom  #define likely(x)   (x)
410aec3c8f4Simarom  #define unlikely(x) (x)
411aec3c8f4Simarom#endif /* __GNUC__ */
412aec3c8f4Simarom
413aec3c8f4Simaromstatic PyObject *__pyx_m;
414aec3c8f4Simaromstatic PyObject *__pyx_d;
415aec3c8f4Simaromstatic PyObject *__pyx_b;
416aec3c8f4Simaromstatic PyObject *__pyx_empty_tuple;
417aec3c8f4Simaromstatic PyObject *__pyx_empty_bytes;
418aec3c8f4Simaromstatic int __pyx_lineno;
419aec3c8f4Simaromstatic int __pyx_clineno = 0;
420aec3c8f4Simaromstatic const char * __pyx_cfilenm= __FILE__;
421aec3c8f4Simaromstatic const char *__pyx_filename;
422aec3c8f4Simarom
423aec3c8f4Simarom
424aec3c8f4Simaromstatic const char *__pyx_f[] = {
425aec3c8f4Simarom  "zmq/backend/cython/_device.pyx",
426aec3c8f4Simarom  "zmq/backend/cython/checkrc.pxd",
427aec3c8f4Simarom  "zmq/backend/cython/context.pxd",
428aec3c8f4Simarom  "zmq/backend/cython/socket.pxd",
429aec3c8f4Simarom  "type.pxd",
430aec3c8f4Simarom  "bool.pxd",
431aec3c8f4Simarom  "complex.pxd",
432aec3c8f4Simarom};
433aec3c8f4Simarom
434aec3c8f4Simarom/*--- Type declarations ---*/
435aec3c8f4Simaromstruct __pyx_obj_3zmq_7backend_6cython_7context_Context;
436aec3c8f4Simaromstruct __pyx_obj_3zmq_7backend_6cython_6socket_Socket;
437aec3c8f4Simaromstruct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_send;
438aec3c8f4Simaromstruct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_recv;
439aec3c8f4Simarom
440aec3c8f4Simarom/* "zmq/backend/cython/socket.pxd":45
441aec3c8f4Simarom *
442aec3c8f4Simarom *     # cpdef methods for direct-cython access:
443aec3c8f4Simarom *     cpdef object send(self, object data, int flags=*, copy=*, track=*)             # <<<<<<<<<<<<<<
444aec3c8f4Simarom *     cpdef object recv(self, int flags=*, copy=*, track=*)
445aec3c8f4Simarom *
446aec3c8f4Simarom */
447aec3c8f4Simaromstruct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_send {
448aec3c8f4Simarom  int __pyx_n;
449aec3c8f4Simarom  int flags;
450aec3c8f4Simarom  PyObject *copy;
451aec3c8f4Simarom  PyObject *track;
452aec3c8f4Simarom};
453aec3c8f4Simarom
454aec3c8f4Simarom/* "zmq/backend/cython/socket.pxd":46
455aec3c8f4Simarom *     # cpdef methods for direct-cython access:
456aec3c8f4Simarom *     cpdef object send(self, object data, int flags=*, copy=*, track=*)
457aec3c8f4Simarom *     cpdef object recv(self, int flags=*, copy=*, track=*)             # <<<<<<<<<<<<<<
458aec3c8f4Simarom *
459aec3c8f4Simarom */
460aec3c8f4Simaromstruct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_recv {
461aec3c8f4Simarom  int __pyx_n;
462aec3c8f4Simarom  int flags;
463aec3c8f4Simarom  PyObject *copy;
464aec3c8f4Simarom  PyObject *track;
465aec3c8f4Simarom};
466aec3c8f4Simarom
467aec3c8f4Simarom/* "context.pxd":26
468aec3c8f4Simarom * #-----------------------------------------------------------------------------
469aec3c8f4Simarom *
470aec3c8f4Simarom * cdef class Context:             # <<<<<<<<<<<<<<
471aec3c8f4Simarom *
472aec3c8f4Simarom *     cdef object __weakref__     # enable weakref
473aec3c8f4Simarom */
474aec3c8f4Simaromstruct __pyx_obj_3zmq_7backend_6cython_7context_Context {
475aec3c8f4Simarom  PyObject_HEAD
476aec3c8f4Simarom  struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context *__pyx_vtab;
477aec3c8f4Simarom  PyObject *__weakref__;
478aec3c8f4Simarom  void *handle;
479aec3c8f4Simarom  int _shadow;
480aec3c8f4Simarom  void **_sockets;
481aec3c8f4Simarom  size_t _n_sockets;
482aec3c8f4Simarom  size_t _max_sockets;
483aec3c8f4Simarom  int _pid;
484aec3c8f4Simarom  int closed;
485aec3c8f4Simarom};
486aec3c8f4Simarom
487aec3c8f4Simarom
488aec3c8f4Simarom/* "zmq/backend/cython/socket.pxd":33
489aec3c8f4Simarom *
490aec3c8f4Simarom *
491aec3c8f4Simarom * cdef class Socket:             # <<<<<<<<<<<<<<
492aec3c8f4Simarom *
493aec3c8f4Simarom *     cdef object __weakref__     # enable weakref
494aec3c8f4Simarom */
495aec3c8f4Simaromstruct __pyx_obj_3zmq_7backend_6cython_6socket_Socket {
496aec3c8f4Simarom  PyObject_HEAD
497aec3c8f4Simarom  struct __pyx_vtabstruct_3zmq_7backend_6cython_6socket_Socket *__pyx_vtab;
498aec3c8f4Simarom  PyObject *__weakref__;
499aec3c8f4Simarom  void *handle;
500aec3c8f4Simarom  int _shadow;
501aec3c8f4Simarom  struct __pyx_obj_3zmq_7backend_6cython_7context_Context *context;
502aec3c8f4Simarom  int _closed;
503aec3c8f4Simarom  int _pid;
504aec3c8f4Simarom};
505aec3c8f4Simarom
506aec3c8f4Simarom
507aec3c8f4Simarom
508aec3c8f4Simarom/* "context.pxd":26
509aec3c8f4Simarom * #-----------------------------------------------------------------------------
510aec3c8f4Simarom *
511aec3c8f4Simarom * cdef class Context:             # <<<<<<<<<<<<<<
512aec3c8f4Simarom *
513aec3c8f4Simarom *     cdef object __weakref__     # enable weakref
514aec3c8f4Simarom */
515aec3c8f4Simarom
516aec3c8f4Simaromstruct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context {
517aec3c8f4Simarom  int (*_term)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *);
518aec3c8f4Simarom  void (*_add_socket)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *, void *);
519aec3c8f4Simarom  void (*_remove_socket)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *, void *);
520aec3c8f4Simarom};
521aec3c8f4Simaromstatic struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context *__pyx_vtabptr_3zmq_7backend_6cython_7context_Context;
522aec3c8f4Simarom
523aec3c8f4Simarom
524aec3c8f4Simarom/* "zmq/backend/cython/socket.pxd":33
525aec3c8f4Simarom *
526aec3c8f4Simarom *
527aec3c8f4Simarom * cdef class Socket:             # <<<<<<<<<<<<<<
528aec3c8f4Simarom *
529aec3c8f4Simarom *     cdef object __weakref__     # enable weakref
530aec3c8f4Simarom */
531aec3c8f4Simarom
532aec3c8f4Simaromstruct __pyx_vtabstruct_3zmq_7backend_6cython_6socket_Socket {
533aec3c8f4Simarom  PyObject *(*send)(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_send *__pyx_optional_args);
534aec3c8f4Simarom  PyObject *(*recv)(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *, int __pyx_skip_dispatch, struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_recv *__pyx_optional_args);
535aec3c8f4Simarom};
536aec3c8f4Simaromstatic struct __pyx_vtabstruct_3zmq_7backend_6cython_6socket_Socket *__pyx_vtabptr_3zmq_7backend_6cython_6socket_Socket;
537aec3c8f4Simarom#ifndef CYTHON_REFNANNY
538aec3c8f4Simarom  #define CYTHON_REFNANNY 0
539aec3c8f4Simarom#endif
540aec3c8f4Simarom#if CYTHON_REFNANNY
541aec3c8f4Simarom  typedef struct {
542aec3c8f4Simarom    void (*INCREF)(void*, PyObject*, int);
543aec3c8f4Simarom    void (*DECREF)(void*, PyObject*, int);
544aec3c8f4Simarom    void (*GOTREF)(void*, PyObject*, int);
545aec3c8f4Simarom    void (*GIVEREF)(void*, PyObject*, int);
546aec3c8f4Simarom    void* (*SetupContext)(const char*, int, const char*);
547aec3c8f4Simarom    void (*FinishContext)(void**);
548aec3c8f4Simarom  } __Pyx_RefNannyAPIStruct;
549aec3c8f4Simarom  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
550aec3c8f4Simarom  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
551aec3c8f4Simarom  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
552aec3c8f4Simarom#ifdef WITH_THREAD
553aec3c8f4Simarom  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
554aec3c8f4Simarom          if (acquire_gil) { \
555aec3c8f4Simarom              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
556aec3c8f4Simarom              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
557aec3c8f4Simarom              PyGILState_Release(__pyx_gilstate_save); \
558aec3c8f4Simarom          } else { \
559aec3c8f4Simarom              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
560aec3c8f4Simarom          }
561aec3c8f4Simarom#else
562aec3c8f4Simarom  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
563aec3c8f4Simarom          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
564aec3c8f4Simarom#endif
565aec3c8f4Simarom  #define __Pyx_RefNannyFinishContext() \
566aec3c8f4Simarom          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
567aec3c8f4Simarom  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
568aec3c8f4Simarom  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
569aec3c8f4Simarom  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
570aec3c8f4Simarom  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
571aec3c8f4Simarom  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
572aec3c8f4Simarom  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
573aec3c8f4Simarom  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
574aec3c8f4Simarom  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
575aec3c8f4Simarom#else
576aec3c8f4Simarom  #define __Pyx_RefNannyDeclarations
577aec3c8f4Simarom  #define __Pyx_RefNannySetupContext(name, acquire_gil)
578aec3c8f4Simarom  #define __Pyx_RefNannyFinishContext()
579aec3c8f4Simarom  #define __Pyx_INCREF(r) Py_INCREF(r)
580aec3c8f4Simarom  #define __Pyx_DECREF(r) Py_DECREF(r)
581aec3c8f4Simarom  #define __Pyx_GOTREF(r)
582aec3c8f4Simarom  #define __Pyx_GIVEREF(r)
583aec3c8f4Simarom  #define __Pyx_XINCREF(r) Py_XINCREF(r)
584aec3c8f4Simarom  #define __Pyx_XDECREF(r) Py_XDECREF(r)
585aec3c8f4Simarom  #define __Pyx_XGOTREF(r)
586aec3c8f4Simarom  #define __Pyx_XGIVEREF(r)
587aec3c8f4Simarom#endif
588aec3c8f4Simarom#define __Pyx_XDECREF_SET(r, v) do {                            \
589aec3c8f4Simarom        PyObject *tmp = (PyObject *) r;                         \
590aec3c8f4Simarom        r = v; __Pyx_XDECREF(tmp);                              \
591aec3c8f4Simarom    } while (0)
592aec3c8f4Simarom#define __Pyx_DECREF_SET(r, v) do {                             \
593aec3c8f4Simarom        PyObject *tmp = (PyObject *) r;                         \
594aec3c8f4Simarom        r = v; __Pyx_DECREF(tmp);                               \
595aec3c8f4Simarom    } while (0)
596aec3c8f4Simarom#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
597aec3c8f4Simarom#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
598aec3c8f4Simarom
599aec3c8f4Simaromstatic void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
600aec3c8f4Simarom    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
601aec3c8f4Simarom
602aec3c8f4Simaromstatic void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
603aec3c8f4Simarom
604aec3c8f4Simaromstatic int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
605aec3c8f4Simarom    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
606aec3c8f4Simarom    const char* function_name);
607aec3c8f4Simarom
608aec3c8f4Simaromstatic CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
609aec3c8f4Simarom    const char *name, int exact);
610aec3c8f4Simarom
611aec3c8f4Simarom#if CYTHON_COMPILING_IN_CPYTHON
612aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
613aec3c8f4Simarom    PyTypeObject* tp = Py_TYPE(obj);
614aec3c8f4Simarom    if (likely(tp->tp_getattro))
615aec3c8f4Simarom        return tp->tp_getattro(obj, attr_name);
616aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
617aec3c8f4Simarom    if (likely(tp->tp_getattr))
618aec3c8f4Simarom        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
619aec3c8f4Simarom#endif
620aec3c8f4Simarom    return PyObject_GetAttr(obj, attr_name);
621aec3c8f4Simarom}
622aec3c8f4Simarom#else
623aec3c8f4Simarom#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
624aec3c8f4Simarom#endif
625aec3c8f4Simarom
626aec3c8f4Simaromstatic PyObject *__Pyx_GetBuiltinName(PyObject *name);
627aec3c8f4Simarom
628aec3c8f4Simaromstatic CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
629aec3c8f4Simarom
630aec3c8f4Simarom#if CYTHON_COMPILING_IN_CPYTHON
631aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
632aec3c8f4Simarom#else
633aec3c8f4Simarom#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
634aec3c8f4Simarom#endif
635aec3c8f4Simarom
636aec3c8f4Simaromstatic PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
637aec3c8f4Simarom
638aec3c8f4Simarom#if CYTHON_COMPILING_IN_CPYTHON
639aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
640aec3c8f4Simarom#endif
641aec3c8f4Simarom
642aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
643aec3c8f4Simarom
644aec3c8f4Simaromstatic CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
645aec3c8f4Simaromstatic CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
646aec3c8f4Simarom
647aec3c8f4Simaromstatic void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
648aec3c8f4Simarom
649aec3c8f4Simaromstatic void* __Pyx_GetVtable(PyObject *dict);
650aec3c8f4Simarom
651aec3c8f4Simaromtypedef struct {
652aec3c8f4Simarom    int code_line;
653aec3c8f4Simarom    PyCodeObject* code_object;
654aec3c8f4Simarom} __Pyx_CodeObjectCacheEntry;
655aec3c8f4Simaromstruct __Pyx_CodeObjectCache {
656aec3c8f4Simarom    int count;
657aec3c8f4Simarom    int max_count;
658aec3c8f4Simarom    __Pyx_CodeObjectCacheEntry* entries;
659aec3c8f4Simarom};
660aec3c8f4Simaromstatic struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
661aec3c8f4Simaromstatic int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
662aec3c8f4Simaromstatic PyCodeObject *__pyx_find_code_object(int code_line);
663aec3c8f4Simaromstatic void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
664aec3c8f4Simarom
665aec3c8f4Simaromstatic void __Pyx_AddTraceback(const char *funcname, int c_line,
666aec3c8f4Simarom                               int py_line, const char *filename);
667aec3c8f4Simarom
668aec3c8f4Simaromstatic CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
669aec3c8f4Simarom
670aec3c8f4Simarom#ifndef __PYX_FORCE_INIT_THREADS
671aec3c8f4Simarom  #define __PYX_FORCE_INIT_THREADS 0
672aec3c8f4Simarom#endif
673aec3c8f4Simarom
674aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
675aec3c8f4Simarom
676aec3c8f4Simaromstatic PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
677aec3c8f4Simarom
678aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
679aec3c8f4Simarom
680aec3c8f4Simaromstatic CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
681aec3c8f4Simarom
682aec3c8f4Simaromstatic int __Pyx_check_binary_version(void);
683aec3c8f4Simarom
684aec3c8f4Simarom#if !defined(__Pyx_PyIdentifier_FromString)
685aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
686aec3c8f4Simarom  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
687aec3c8f4Simarom#else
688aec3c8f4Simarom  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
689aec3c8f4Simarom#endif
690aec3c8f4Simarom#endif
691aec3c8f4Simarom
692aec3c8f4Simaromstatic PyObject *__Pyx_ImportModule(const char *name);
693aec3c8f4Simarom
694aec3c8f4Simaromstatic PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
695aec3c8f4Simarom
696aec3c8f4Simaromstatic int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
697aec3c8f4Simarom
698aec3c8f4Simarom
699aec3c8f4Simarom/* Module declarations from 'zmq.backend.cython.libzmq' */
700aec3c8f4Simarom
701aec3c8f4Simarom/* Module declarations from 'zmq.backend.cython.context' */
702aec3c8f4Simaromstatic PyTypeObject *__pyx_ptype_3zmq_7backend_6cython_7context_Context = 0;
703aec3c8f4Simarom
704aec3c8f4Simarom/* Module declarations from 'zmq.backend.cython.socket' */
705aec3c8f4Simaromstatic PyTypeObject *__pyx_ptype_3zmq_7backend_6cython_6socket_Socket = 0;
706aec3c8f4Simarom
707aec3c8f4Simarom/* Module declarations from 'libc.errno' */
708aec3c8f4Simarom
709aec3c8f4Simarom/* Module declarations from 'cpython.version' */
710aec3c8f4Simarom
711aec3c8f4Simarom/* Module declarations from 'cpython.ref' */
712aec3c8f4Simarom
713aec3c8f4Simarom/* Module declarations from 'cpython.exc' */
714aec3c8f4Simarom
715aec3c8f4Simarom/* Module declarations from 'cpython.module' */
716aec3c8f4Simarom
717aec3c8f4Simarom/* Module declarations from 'cpython.mem' */
718aec3c8f4Simarom
719aec3c8f4Simarom/* Module declarations from 'cpython.tuple' */
720aec3c8f4Simarom
721aec3c8f4Simarom/* Module declarations from 'cpython.list' */
722aec3c8f4Simarom
723aec3c8f4Simarom/* Module declarations from 'libc.string' */
724aec3c8f4Simarom
725aec3c8f4Simarom/* Module declarations from 'libc.stdio' */
726aec3c8f4Simarom
727aec3c8f4Simarom/* Module declarations from 'cpython.object' */
728aec3c8f4Simarom
729aec3c8f4Simarom/* Module declarations from 'cpython.sequence' */
730aec3c8f4Simarom
731aec3c8f4Simarom/* Module declarations from 'cpython.mapping' */
732aec3c8f4Simarom
733aec3c8f4Simarom/* Module declarations from 'cpython.iterator' */
734aec3c8f4Simarom
735aec3c8f4Simarom/* Module declarations from '__builtin__' */
736aec3c8f4Simarom
737aec3c8f4Simarom/* Module declarations from 'cpython.type' */
738aec3c8f4Simaromstatic PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
739aec3c8f4Simarom
740aec3c8f4Simarom/* Module declarations from 'cpython.number' */
741aec3c8f4Simarom
742aec3c8f4Simarom/* Module declarations from 'cpython.int' */
743aec3c8f4Simarom
744aec3c8f4Simarom/* Module declarations from '__builtin__' */
745aec3c8f4Simarom
746aec3c8f4Simarom/* Module declarations from 'cpython.bool' */
747aec3c8f4Simaromstatic PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
748aec3c8f4Simarom
749aec3c8f4Simarom/* Module declarations from 'cpython.long' */
750aec3c8f4Simarom
751aec3c8f4Simarom/* Module declarations from 'cpython.float' */
752aec3c8f4Simarom
753aec3c8f4Simarom/* Module declarations from '__builtin__' */
754aec3c8f4Simarom
755aec3c8f4Simarom/* Module declarations from 'cpython.complex' */
756aec3c8f4Simaromstatic PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
757aec3c8f4Simarom
758aec3c8f4Simarom/* Module declarations from 'cpython.string' */
759aec3c8f4Simarom
760aec3c8f4Simarom/* Module declarations from 'cpython.unicode' */
761aec3c8f4Simarom
762aec3c8f4Simarom/* Module declarations from 'cpython.dict' */
763aec3c8f4Simarom
764aec3c8f4Simarom/* Module declarations from 'cpython.instance' */
765aec3c8f4Simarom
766aec3c8f4Simarom/* Module declarations from 'cpython.function' */
767aec3c8f4Simarom
768aec3c8f4Simarom/* Module declarations from 'cpython.method' */
769aec3c8f4Simarom
770aec3c8f4Simarom/* Module declarations from 'cpython.weakref' */
771aec3c8f4Simarom
772aec3c8f4Simarom/* Module declarations from 'cpython.getargs' */
773aec3c8f4Simarom
774aec3c8f4Simarom/* Module declarations from 'cpython.pythread' */
775aec3c8f4Simarom
776aec3c8f4Simarom/* Module declarations from 'cpython.pystate' */
777aec3c8f4Simarom
778aec3c8f4Simarom/* Module declarations from 'cpython.cobject' */
779aec3c8f4Simarom
780aec3c8f4Simarom/* Module declarations from 'cpython.oldbuffer' */
781aec3c8f4Simarom
782aec3c8f4Simarom/* Module declarations from 'cpython.set' */
783aec3c8f4Simarom
784aec3c8f4Simarom/* Module declarations from 'cpython.buffer' */
785aec3c8f4Simarom
786aec3c8f4Simarom/* Module declarations from 'cpython.bytes' */
787aec3c8f4Simarom
788aec3c8f4Simarom/* Module declarations from 'cpython.pycapsule' */
789aec3c8f4Simarom
790aec3c8f4Simarom/* Module declarations from 'cpython' */
791aec3c8f4Simarom
792aec3c8f4Simarom/* Module declarations from 'zmq.backend.cython.checkrc' */
793aec3c8f4Simaromstatic CYTHON_INLINE int __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(int); /*proto*/
794aec3c8f4Simarom
795aec3c8f4Simarom/* Module declarations from 'zmq.backend.cython._device' */
796aec3c8f4Simarom#define __Pyx_MODULE_NAME "zmq.backend.cython._device"
797aec3c8f4Simaromint __pyx_module_is_main_zmq__backend__cython___device = 0;
798aec3c8f4Simarom
799aec3c8f4Simarom/* Implementation of 'zmq.backend.cython._device' */
800aec3c8f4Simaromstatic PyObject *__pyx_pf_3zmq_7backend_6cython_7_device_device(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_device_type, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_frontend, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_backend); /* proto */
801aec3c8f4Simaromstatic PyObject *__pyx_pf_3zmq_7backend_6cython_7_device_2proxy(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_frontend, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_backend, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_capture); /* proto */
802aec3c8f4Simaromstatic char __pyx_k_rc[] = "rc";
803aec3c8f4Simaromstatic char __pyx_k_all[] = "__all__";
804aec3c8f4Simaromstatic char __pyx_k_main[] = "__main__";
805aec3c8f4Simaromstatic char __pyx_k_test[] = "__test__";
806aec3c8f4Simaromstatic char __pyx_k_Again[] = "Again";
807aec3c8f4Simaromstatic char __pyx_k_proxy[] = "proxy";
808aec3c8f4Simaromstatic char __pyx_k_device[] = "device";
809aec3c8f4Simaromstatic char __pyx_k_import[] = "__import__";
810aec3c8f4Simaromstatic char __pyx_k_backend[] = "backend";
811aec3c8f4Simaromstatic char __pyx_k_capture[] = "capture";
812aec3c8f4Simaromstatic char __pyx_k_ZMQError[] = "ZMQError";
813aec3c8f4Simaromstatic char __pyx_k_frontend[] = "frontend";
814aec3c8f4Simaromstatic char __pyx_k_zmq_error[] = "zmq.error";
815aec3c8f4Simaromstatic char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
816aec3c8f4Simaromstatic char __pyx_k_device_type[] = "device_type";
817aec3c8f4Simaromstatic char __pyx_k_capture_handle[] = "capture_handle";
818aec3c8f4Simaromstatic char __pyx_k_ContextTerminated[] = "ContextTerminated";
819aec3c8f4Simaromstatic char __pyx_k_zmq_backend_cython__device[] = "zmq.backend.cython._device";
820aec3c8f4Simaromstatic char __pyx_k_private_tmp_pyzmq_release_zmq_b[] = "/private/tmp/pyzmq-release/zmq/backend/cython/_device.pyx";
821aec3c8f4Simaromstatic char __pyx_k_Python_binding_for_0MQ_device_fu[] = "Python binding for 0MQ device function.";
822aec3c8f4Simaromstatic PyObject *__pyx_n_s_Again;
823aec3c8f4Simaromstatic PyObject *__pyx_n_s_ContextTerminated;
824aec3c8f4Simaromstatic PyObject *__pyx_n_s_ZMQError;
825aec3c8f4Simaromstatic PyObject *__pyx_n_s_all;
826aec3c8f4Simaromstatic PyObject *__pyx_n_s_backend;
827aec3c8f4Simaromstatic PyObject *__pyx_n_s_capture;
828aec3c8f4Simaromstatic PyObject *__pyx_n_s_capture_handle;
829aec3c8f4Simaromstatic PyObject *__pyx_n_s_device;
830aec3c8f4Simaromstatic PyObject *__pyx_n_s_device_type;
831aec3c8f4Simaromstatic PyObject *__pyx_n_s_frontend;
832aec3c8f4Simaromstatic PyObject *__pyx_n_s_import;
833aec3c8f4Simaromstatic PyObject *__pyx_n_s_main;
834aec3c8f4Simaromstatic PyObject *__pyx_kp_s_private_tmp_pyzmq_release_zmq_b;
835aec3c8f4Simaromstatic PyObject *__pyx_n_s_proxy;
836aec3c8f4Simaromstatic PyObject *__pyx_n_s_pyx_vtable;
837aec3c8f4Simaromstatic PyObject *__pyx_n_s_rc;
838aec3c8f4Simaromstatic PyObject *__pyx_n_s_test;
839aec3c8f4Simaromstatic PyObject *__pyx_n_s_zmq_backend_cython__device;
840aec3c8f4Simaromstatic PyObject *__pyx_n_s_zmq_error;
841aec3c8f4Simaromstatic PyObject *__pyx_tuple_;
842aec3c8f4Simaromstatic PyObject *__pyx_tuple__3;
843aec3c8f4Simaromstatic PyObject *__pyx_codeobj__2;
844aec3c8f4Simaromstatic PyObject *__pyx_codeobj__4;
845aec3c8f4Simarom
846aec3c8f4Simarom/* "zmq/backend/cython/_device.pyx":34
847aec3c8f4Simarom * #-----------------------------------------------------------------------------
848aec3c8f4Simarom *
849aec3c8f4Simarom * def device(int device_type, cSocket frontend, cSocket backend=None):             # <<<<<<<<<<<<<<
850aec3c8f4Simarom *     """device(device_type, frontend, backend)
851aec3c8f4Simarom *
852aec3c8f4Simarom */
853aec3c8f4Simarom
854aec3c8f4Simarom/* Python wrapper */
855aec3c8f4Simaromstatic PyObject *__pyx_pw_3zmq_7backend_6cython_7_device_1device(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
856aec3c8f4Simaromstatic char __pyx_doc_3zmq_7backend_6cython_7_device_device[] = "device(device_type, frontend, backend)\n\n    Start a zeromq device.\n    \n    .. deprecated:: libzmq-3.2\n        Use zmq.proxy\n\n    Parameters\n    ----------\n    device_type : (QUEUE, FORWARDER, STREAMER)\n        The type of device to start.\n    frontend : Socket\n        The Socket instance for the incoming traffic.\n    backend : Socket\n        The Socket instance for the outbound traffic.\n    ";
857aec3c8f4Simaromstatic PyMethodDef __pyx_mdef_3zmq_7backend_6cython_7_device_1device = {"device", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_7_device_1device, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3zmq_7backend_6cython_7_device_device};
858aec3c8f4Simaromstatic PyObject *__pyx_pw_3zmq_7backend_6cython_7_device_1device(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
859aec3c8f4Simarom  int __pyx_v_device_type;
860aec3c8f4Simarom  struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_frontend = 0;
861aec3c8f4Simarom  struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_backend = 0;
862aec3c8f4Simarom  int __pyx_lineno = 0;
863aec3c8f4Simarom  const char *__pyx_filename = NULL;
864aec3c8f4Simarom  int __pyx_clineno = 0;
865aec3c8f4Simarom  PyObject *__pyx_r = 0;
866aec3c8f4Simarom  __Pyx_RefNannyDeclarations
867aec3c8f4Simarom  __Pyx_RefNannySetupContext("device (wrapper)", 0);
868aec3c8f4Simarom  {
869aec3c8f4Simarom    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_device_type,&__pyx_n_s_frontend,&__pyx_n_s_backend,0};
870aec3c8f4Simarom    PyObject* values[3] = {0,0,0};
871aec3c8f4Simarom    values[2] = (PyObject *)((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)Py_None);
872aec3c8f4Simarom    if (unlikely(__pyx_kwds)) {
873aec3c8f4Simarom      Py_ssize_t kw_args;
874aec3c8f4Simarom      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
875aec3c8f4Simarom      switch (pos_args) {
876aec3c8f4Simarom        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
877aec3c8f4Simarom        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
878aec3c8f4Simarom        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
879aec3c8f4Simarom        case  0: break;
880aec3c8f4Simarom        default: goto __pyx_L5_argtuple_error;
881aec3c8f4Simarom      }
882aec3c8f4Simarom      kw_args = PyDict_Size(__pyx_kwds);
883aec3c8f4Simarom      switch (pos_args) {
884aec3c8f4Simarom        case  0:
885aec3c8f4Simarom        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_device_type)) != 0)) kw_args--;
886aec3c8f4Simarom        else goto __pyx_L5_argtuple_error;
887aec3c8f4Simarom        case  1:
888aec3c8f4Simarom        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_frontend)) != 0)) kw_args--;
889aec3c8f4Simarom        else {
890aec3c8f4Simarom          __Pyx_RaiseArgtupleInvalid("device", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
891aec3c8f4Simarom        }
892aec3c8f4Simarom        case  2:
893aec3c8f4Simarom        if (kw_args > 0) {
894aec3c8f4Simarom          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_backend);
895aec3c8f4Simarom          if (value) { values[2] = value; kw_args--; }
896aec3c8f4Simarom        }
897aec3c8f4Simarom      }
898aec3c8f4Simarom      if (unlikely(kw_args > 0)) {
899aec3c8f4Simarom        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "device") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
900aec3c8f4Simarom      }
901aec3c8f4Simarom    } else {
902aec3c8f4Simarom      switch (PyTuple_GET_SIZE(__pyx_args)) {
903aec3c8f4Simarom        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
904aec3c8f4Simarom        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
905aec3c8f4Simarom        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
906aec3c8f4Simarom        break;
907aec3c8f4Simarom        default: goto __pyx_L5_argtuple_error;
908aec3c8f4Simarom      }
909aec3c8f4Simarom    }
910aec3c8f4Simarom    __pyx_v_device_type = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_device_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
911aec3c8f4Simarom    __pyx_v_frontend = ((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)values[1]);
912aec3c8f4Simarom    __pyx_v_backend = ((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)values[2]);
913aec3c8f4Simarom  }
914aec3c8f4Simarom  goto __pyx_L4_argument_unpacking_done;
915aec3c8f4Simarom  __pyx_L5_argtuple_error:;
916aec3c8f4Simarom  __Pyx_RaiseArgtupleInvalid("device", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
917aec3c8f4Simarom  __pyx_L3_error:;
918aec3c8f4Simarom  __Pyx_AddTraceback("zmq.backend.cython._device.device", __pyx_clineno, __pyx_lineno, __pyx_filename);
919aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
920aec3c8f4Simarom  return NULL;
921aec3c8f4Simarom  __pyx_L4_argument_unpacking_done:;
922aec3c8f4Simarom  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_frontend), __pyx_ptype_3zmq_7backend_6cython_6socket_Socket, 1, "frontend", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
923aec3c8f4Simarom  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_backend), __pyx_ptype_3zmq_7backend_6cython_6socket_Socket, 1, "backend", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
924aec3c8f4Simarom  __pyx_r = __pyx_pf_3zmq_7backend_6cython_7_device_device(__pyx_self, __pyx_v_device_type, __pyx_v_frontend, __pyx_v_backend);
925aec3c8f4Simarom
926aec3c8f4Simarom  /* function exit code */
927aec3c8f4Simarom  goto __pyx_L0;
928aec3c8f4Simarom  __pyx_L1_error:;
929aec3c8f4Simarom  __pyx_r = NULL;
930aec3c8f4Simarom  __pyx_L0:;
931aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
932aec3c8f4Simarom  return __pyx_r;
933aec3c8f4Simarom}
934aec3c8f4Simarom
935aec3c8f4Simaromstatic PyObject *__pyx_pf_3zmq_7backend_6cython_7_device_device(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_device_type, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_frontend, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_backend) {
936aec3c8f4Simarom  int __pyx_v_rc;
937aec3c8f4Simarom  PyObject *__pyx_r = NULL;
938aec3c8f4Simarom  __Pyx_RefNannyDeclarations
939aec3c8f4Simarom  int __pyx_t_1;
940aec3c8f4Simarom  PyObject *__pyx_t_2 = NULL;
941aec3c8f4Simarom  PyObject *__pyx_t_3 = NULL;
942aec3c8f4Simarom  PyObject *__pyx_t_4 = NULL;
943aec3c8f4Simarom  Py_ssize_t __pyx_t_5;
944aec3c8f4Simarom  PyObject *__pyx_t_6 = NULL;
945aec3c8f4Simarom  int __pyx_t_7;
946aec3c8f4Simarom  int __pyx_lineno = 0;
947aec3c8f4Simarom  const char *__pyx_filename = NULL;
948aec3c8f4Simarom  int __pyx_clineno = 0;
949aec3c8f4Simarom  __Pyx_RefNannySetupContext("device", 0);
950aec3c8f4Simarom
951aec3c8f4Simarom  /* "zmq/backend/cython/_device.pyx":51
952aec3c8f4Simarom *         The Socket instance for the outbound traffic.
953aec3c8f4Simarom *     """
954aec3c8f4Simarom *     if ZMQ_VERSION_MAJOR >= 3:             # <<<<<<<<<<<<<<
955aec3c8f4Simarom *         return proxy(frontend, backend)
956aec3c8f4Simarom *
957aec3c8f4Simarom */
958aec3c8f4Simarom  __pyx_t_1 = ((ZMQ_VERSION_MAJOR >= 3) != 0);
959aec3c8f4Simarom  if (__pyx_t_1) {
960aec3c8f4Simarom
961aec3c8f4Simarom    /* "zmq/backend/cython/_device.pyx":52
962aec3c8f4Simarom *     """
963aec3c8f4Simarom *     if ZMQ_VERSION_MAJOR >= 3:
964aec3c8f4Simarom *         return proxy(frontend, backend)             # <<<<<<<<<<<<<<
965aec3c8f4Simarom *
966aec3c8f4Simarom *     cdef int rc = 0
967aec3c8f4Simarom */
968aec3c8f4Simarom    __Pyx_XDECREF(__pyx_r);
969aec3c8f4Simarom    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_proxy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
970aec3c8f4Simarom    __Pyx_GOTREF(__pyx_t_3);
971aec3c8f4Simarom    __pyx_t_4 = NULL;
972aec3c8f4Simarom    __pyx_t_5 = 0;
973aec3c8f4Simarom    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
974aec3c8f4Simarom      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
975aec3c8f4Simarom      if (likely(__pyx_t_4)) {
976aec3c8f4Simarom        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
977aec3c8f4Simarom        __Pyx_INCREF(__pyx_t_4);
978aec3c8f4Simarom        __Pyx_INCREF(function);
979aec3c8f4Simarom        __Pyx_DECREF_SET(__pyx_t_3, function);
980aec3c8f4Simarom        __pyx_t_5 = 1;
981aec3c8f4Simarom      }
982aec3c8f4Simarom    }
983aec3c8f4Simarom    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
984aec3c8f4Simarom    __Pyx_GOTREF(__pyx_t_6);
985aec3c8f4Simarom    if (__pyx_t_4) {
986aec3c8f4Simarom      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
987aec3c8f4Simarom    }
988aec3c8f4Simarom    __Pyx_INCREF(((PyObject *)__pyx_v_frontend));
989aec3c8f4Simarom    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_frontend));
990aec3c8f4Simarom    __Pyx_GIVEREF(((PyObject *)__pyx_v_frontend));
991aec3c8f4Simarom    __Pyx_INCREF(((PyObject *)__pyx_v_backend));
992aec3c8f4Simarom    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_backend));
993aec3c8f4Simarom    __Pyx_GIVEREF(((PyObject *)__pyx_v_backend));
994aec3c8f4Simarom    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
995aec3c8f4Simarom    __Pyx_GOTREF(__pyx_t_2);
996aec3c8f4Simarom    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
997aec3c8f4Simarom    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
998aec3c8f4Simarom    __pyx_r = __pyx_t_2;
999aec3c8f4Simarom    __pyx_t_2 = 0;
1000aec3c8f4Simarom    goto __pyx_L0;
1001aec3c8f4Simarom  }
1002aec3c8f4Simarom
1003aec3c8f4Simarom  /* "zmq/backend/cython/_device.pyx":54
1004aec3c8f4Simarom *         return proxy(frontend, backend)
1005aec3c8f4Simarom *
1006aec3c8f4Simarom *     cdef int rc = 0             # <<<<<<<<<<<<<<
1007aec3c8f4Simarom *     with nogil:
1008aec3c8f4Simarom *         rc = zmq_device(device_type, frontend.handle, backend.handle)
1009aec3c8f4Simarom */
1010aec3c8f4Simarom  __pyx_v_rc = 0;
1011aec3c8f4Simarom
1012aec3c8f4Simarom  /* "zmq/backend/cython/_device.pyx":55
1013aec3c8f4Simarom *
1014aec3c8f4Simarom *     cdef int rc = 0
1015aec3c8f4Simarom *     with nogil:             # <<<<<<<<<<<<<<
1016aec3c8f4Simarom *         rc = zmq_device(device_type, frontend.handle, backend.handle)
1017aec3c8f4Simarom *     _check_rc(rc)
1018aec3c8f4Simarom */
1019aec3c8f4Simarom  {
1020aec3c8f4Simarom      #ifdef WITH_THREAD
1021aec3c8f4Simarom      PyThreadState *_save;
1022aec3c8f4Simarom      Py_UNBLOCK_THREADS
1023aec3c8f4Simarom      #endif
1024aec3c8f4Simarom      /*try:*/ {
1025aec3c8f4Simarom
1026aec3c8f4Simarom        /* "zmq/backend/cython/_device.pyx":56
1027aec3c8f4Simarom *     cdef int rc = 0
1028aec3c8f4Simarom *     with nogil:
1029aec3c8f4Simarom *         rc = zmq_device(device_type, frontend.handle, backend.handle)             # <<<<<<<<<<<<<<
1030aec3c8f4Simarom *     _check_rc(rc)
1031aec3c8f4Simarom *     return rc
1032aec3c8f4Simarom */
1033aec3c8f4Simarom        __pyx_v_rc = zmq_device(__pyx_v_device_type, __pyx_v_frontend->handle, __pyx_v_backend->handle);
1034aec3c8f4Simarom      }
1035aec3c8f4Simarom
1036aec3c8f4Simarom      /* "zmq/backend/cython/_device.pyx":55
1037aec3c8f4Simarom *
1038aec3c8f4Simarom *     cdef int rc = 0
1039aec3c8f4Simarom *     with nogil:             # <<<<<<<<<<<<<<
1040aec3c8f4Simarom *         rc = zmq_device(device_type, frontend.handle, backend.handle)
1041aec3c8f4Simarom *     _check_rc(rc)
1042aec3c8f4Simarom */
1043aec3c8f4Simarom      /*finally:*/ {
1044aec3c8f4Simarom        /*normal exit:*/{
1045aec3c8f4Simarom          #ifdef WITH_THREAD
1046aec3c8f4Simarom          Py_BLOCK_THREADS
1047aec3c8f4Simarom          #endif
1048aec3c8f4Simarom          goto __pyx_L6;
1049aec3c8f4Simarom        }
1050aec3c8f4Simarom        __pyx_L6:;
1051aec3c8f4Simarom      }
1052aec3c8f4Simarom  }
1053aec3c8f4Simarom
1054aec3c8f4Simarom  /* "zmq/backend/cython/_device.pyx":57
1055aec3c8f4Simarom *     with nogil:
1056aec3c8f4Simarom *         rc = zmq_device(device_type, frontend.handle, backend.handle)
1057aec3c8f4Simarom *     _check_rc(rc)             # <<<<<<<<<<<<<<
1058aec3c8f4Simarom *     return rc
1059aec3c8f4Simarom *
1060aec3c8f4Simarom */
1061aec3c8f4Simarom  __pyx_t_7 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1062aec3c8f4Simarom
1063aec3c8f4Simarom  /* "zmq/backend/cython/_device.pyx":58
1064aec3c8f4Simarom *         rc = zmq_device(device_type, frontend.handle, backend.handle)
1065aec3c8f4Simarom *     _check_rc(rc)
1066aec3c8f4Simarom *     return rc             # <<<<<<<<<<<<<<
1067aec3c8f4Simarom *
1068aec3c8f4Simarom * def proxy(cSocket frontend, cSocket backend, cSocket capture=None):
1069aec3c8f4Simarom */
1070aec3c8f4Simarom  __Pyx_XDECREF(__pyx_r);
1071aec3c8f4Simarom  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1072aec3c8f4Simarom  __Pyx_GOTREF(__pyx_t_2);
1073aec3c8f4Simarom  __pyx_r = __pyx_t_2;
1074aec3c8f4Simarom  __pyx_t_2 = 0;
1075aec3c8f4Simarom  goto __pyx_L0;
1076aec3c8f4Simarom
1077aec3c8f4Simarom  /* "zmq/backend/cython/_device.pyx":34
1078aec3c8f4Simarom * #-----------------------------------------------------------------------------
1079aec3c8f4Simarom *
1080aec3c8f4Simarom * def device(int device_type, cSocket frontend, cSocket backend=None):             # <<<<<<<<<<<<<<
1081aec3c8f4Simarom *     """device(device_type, frontend, backend)
1082aec3c8f4Simarom *
1083aec3c8f4Simarom */
1084aec3c8f4Simarom
1085aec3c8f4Simarom  /* function exit code */
1086aec3c8f4Simarom  __pyx_L1_error:;
1087aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_2);
1088aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_3);
1089aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_4);
1090aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_6);
1091aec3c8f4Simarom  __Pyx_AddTraceback("zmq.backend.cython._device.device", __pyx_clineno, __pyx_lineno, __pyx_filename);
1092aec3c8f4Simarom  __pyx_r = NULL;
1093aec3c8f4Simarom  __pyx_L0:;
1094aec3c8f4Simarom  __Pyx_XGIVEREF(__pyx_r);
1095aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
1096aec3c8f4Simarom  return __pyx_r;
1097aec3c8f4Simarom}
1098aec3c8f4Simarom
1099aec3c8f4Simarom/* "zmq/backend/cython/_device.pyx":60
1100aec3c8f4Simarom *     return rc
1101aec3c8f4Simarom *
1102aec3c8f4Simarom * def proxy(cSocket frontend, cSocket backend, cSocket capture=None):             # <<<<<<<<<<<<<<
1103aec3c8f4Simarom *     """proxy(frontend, backend, capture)
1104aec3c8f4Simarom *
1105aec3c8f4Simarom */
1106aec3c8f4Simarom
1107aec3c8f4Simarom/* Python wrapper */
1108aec3c8f4Simaromstatic PyObject *__pyx_pw_3zmq_7backend_6cython_7_device_3proxy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1109aec3c8f4Simaromstatic char __pyx_doc_3zmq_7backend_6cython_7_device_2proxy[] = "proxy(frontend, backend, capture)\n    \n    Start a zeromq proxy (replacement for device).\n    \n    .. versionadded:: libzmq-3.2\n    .. versionadded:: 13.0\n    \n    Parameters\n    ----------\n    frontend : Socket\n        The Socket instance for the incoming traffic.\n    backend : Socket\n        The Socket instance for the outbound traffic.\n    capture : Socket (optional)\n        The Socket instance for capturing traffic.\n    ";
1110aec3c8f4Simaromstatic PyMethodDef __pyx_mdef_3zmq_7backend_6cython_7_device_3proxy = {"proxy", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_7_device_3proxy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3zmq_7backend_6cython_7_device_2proxy};
1111aec3c8f4Simaromstatic PyObject *__pyx_pw_3zmq_7backend_6cython_7_device_3proxy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1112aec3c8f4Simarom  struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_frontend = 0;
1113aec3c8f4Simarom  struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_backend = 0;
1114aec3c8f4Simarom  struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_capture = 0;
1115aec3c8f4Simarom  int __pyx_lineno = 0;
1116aec3c8f4Simarom  const char *__pyx_filename = NULL;
1117aec3c8f4Simarom  int __pyx_clineno = 0;
1118aec3c8f4Simarom  PyObject *__pyx_r = 0;
1119aec3c8f4Simarom  __Pyx_RefNannyDeclarations
1120aec3c8f4Simarom  __Pyx_RefNannySetupContext("proxy (wrapper)", 0);
1121aec3c8f4Simarom  {
1122aec3c8f4Simarom    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frontend,&__pyx_n_s_backend,&__pyx_n_s_capture,0};
1123aec3c8f4Simarom    PyObject* values[3] = {0,0,0};
1124aec3c8f4Simarom    values[2] = (PyObject *)((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)Py_None);
1125aec3c8f4Simarom    if (unlikely(__pyx_kwds)) {
1126aec3c8f4Simarom      Py_ssize_t kw_args;
1127aec3c8f4Simarom      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1128aec3c8f4Simarom      switch (pos_args) {
1129aec3c8f4Simarom        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1130aec3c8f4Simarom        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1131aec3c8f4Simarom        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1132aec3c8f4Simarom        case  0: break;
1133aec3c8f4Simarom        default: goto __pyx_L5_argtuple_error;
1134aec3c8f4Simarom      }
1135aec3c8f4Simarom      kw_args = PyDict_Size(__pyx_kwds);
1136aec3c8f4Simarom      switch (pos_args) {
1137aec3c8f4Simarom        case  0:
1138aec3c8f4Simarom        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_frontend)) != 0)) kw_args--;
1139aec3c8f4Simarom        else goto __pyx_L5_argtuple_error;
1140aec3c8f4Simarom        case  1:
1141aec3c8f4Simarom        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_backend)) != 0)) kw_args--;
1142aec3c8f4Simarom        else {
1143aec3c8f4Simarom          __Pyx_RaiseArgtupleInvalid("proxy", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1144aec3c8f4Simarom        }
1145aec3c8f4Simarom        case  2:
1146aec3c8f4Simarom        if (kw_args > 0) {
1147aec3c8f4Simarom          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_capture);
1148aec3c8f4Simarom          if (value) { values[2] = value; kw_args--; }
1149aec3c8f4Simarom        }
1150aec3c8f4Simarom      }
1151aec3c8f4Simarom      if (unlikely(kw_args > 0)) {
1152aec3c8f4Simarom        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "proxy") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1153aec3c8f4Simarom      }
1154aec3c8f4Simarom    } else {
1155aec3c8f4Simarom      switch (PyTuple_GET_SIZE(__pyx_args)) {
1156aec3c8f4Simarom        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1157aec3c8f4Simarom        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1158aec3c8f4Simarom        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1159aec3c8f4Simarom        break;
1160aec3c8f4Simarom        default: goto __pyx_L5_argtuple_error;
1161aec3c8f4Simarom      }
1162aec3c8f4Simarom    }
1163aec3c8f4Simarom    __pyx_v_frontend = ((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)values[0]);
1164aec3c8f4Simarom    __pyx_v_backend = ((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)values[1]);
1165aec3c8f4Simarom    __pyx_v_capture = ((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)values[2]);
1166aec3c8f4Simarom  }
1167aec3c8f4Simarom  goto __pyx_L4_argument_unpacking_done;
1168aec3c8f4Simarom  __pyx_L5_argtuple_error:;
1169aec3c8f4Simarom  __Pyx_RaiseArgtupleInvalid("proxy", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1170aec3c8f4Simarom  __pyx_L3_error:;
1171aec3c8f4Simarom  __Pyx_AddTraceback("zmq.backend.cython._device.proxy", __pyx_clineno, __pyx_lineno, __pyx_filename);
1172aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
1173aec3c8f4Simarom  return NULL;
1174aec3c8f4Simarom  __pyx_L4_argument_unpacking_done:;
1175aec3c8f4Simarom  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_frontend), __pyx_ptype_3zmq_7backend_6cython_6socket_Socket, 1, "frontend", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1176aec3c8f4Simarom  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_backend), __pyx_ptype_3zmq_7backend_6cython_6socket_Socket, 1, "backend", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1177aec3c8f4Simarom  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_capture), __pyx_ptype_3zmq_7backend_6cython_6socket_Socket, 1, "capture", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1178aec3c8f4Simarom  __pyx_r = __pyx_pf_3zmq_7backend_6cython_7_device_2proxy(__pyx_self, __pyx_v_frontend, __pyx_v_backend, __pyx_v_capture);
1179aec3c8f4Simarom
1180aec3c8f4Simarom  /* function exit code */
1181aec3c8f4Simarom  goto __pyx_L0;
1182aec3c8f4Simarom  __pyx_L1_error:;
1183aec3c8f4Simarom  __pyx_r = NULL;
1184aec3c8f4Simarom  __pyx_L0:;
1185aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
1186aec3c8f4Simarom  return __pyx_r;
1187aec3c8f4Simarom}
1188aec3c8f4Simarom
1189aec3c8f4Simaromstatic PyObject *__pyx_pf_3zmq_7backend_6cython_7_device_2proxy(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_frontend, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_backend, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_capture) {
1190aec3c8f4Simarom  int __pyx_v_rc;
1191aec3c8f4Simarom  void *__pyx_v_capture_handle;
1192aec3c8f4Simarom  PyObject *__pyx_r = NULL;
1193aec3c8f4Simarom  __Pyx_RefNannyDeclarations
1194aec3c8f4Simarom  int __pyx_t_1;
1195aec3c8f4Simarom  int __pyx_t_2;
1196aec3c8f4Simarom  void *__pyx_t_3;
1197aec3c8f4Simarom  int __pyx_t_4;
1198aec3c8f4Simarom  PyObject *__pyx_t_5 = NULL;
1199aec3c8f4Simarom  int __pyx_lineno = 0;
1200aec3c8f4Simarom  const char *__pyx_filename = NULL;
1201aec3c8f4Simarom  int __pyx_clineno = 0;
1202aec3c8f4Simarom  __Pyx_RefNannySetupContext("proxy", 0);
1203aec3c8f4Simarom
1204aec3c8f4Simarom  /* "zmq/backend/cython/_device.pyx":77
1205aec3c8f4Simarom *         The Socket instance for capturing traffic.
1206aec3c8f4Simarom *     """
1207aec3c8f4Simarom *     cdef int rc = 0             # <<<<<<<<<<<<<<
1208aec3c8f4Simarom *     cdef void* capture_handle
1209aec3c8f4Simarom *     if isinstance(capture, cSocket):
1210aec3c8f4Simarom */
1211aec3c8f4Simarom  __pyx_v_rc = 0;
1212aec3c8f4Simarom
1213aec3c8f4Simarom  /* "zmq/backend/cython/_device.pyx":79
1214aec3c8f4Simarom *     cdef int rc = 0
1215aec3c8f4Simarom *     cdef void* capture_handle
1216aec3c8f4Simarom *     if isinstance(capture, cSocket):             # <<<<<<<<<<<<<<
1217aec3c8f4Simarom *         capture_handle = capture.handle
1218aec3c8f4Simarom *     else:
1219aec3c8f4Simarom */
1220aec3c8f4Simarom  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_capture), ((PyObject*)__pyx_ptype_3zmq_7backend_6cython_6socket_Socket));
1221aec3c8f4Simarom  __pyx_t_2 = (__pyx_t_1 != 0);
1222aec3c8f4Simarom  if (__pyx_t_2) {
1223aec3c8f4Simarom
1224aec3c8f4Simarom    /* "zmq/backend/cython/_device.pyx":80
1225aec3c8f4Simarom *     cdef void* capture_handle
1226aec3c8f4Simarom *     if isinstance(capture, cSocket):
1227aec3c8f4Simarom *         capture_handle = capture.handle             # <<<<<<<<<<<<<<
1228aec3c8f4Simarom *     else:
1229aec3c8f4Simarom *         capture_handle = NULL
1230aec3c8f4Simarom */
1231aec3c8f4Simarom    __pyx_t_3 = __pyx_v_capture->handle;
1232aec3c8f4Simarom    __pyx_v_capture_handle = __pyx_t_3;
1233aec3c8f4Simarom    goto __pyx_L3;
1234aec3c8f4Simarom  }
1235aec3c8f4Simarom  /*else*/ {
1236aec3c8f4Simarom
1237aec3c8f4Simarom    /* "zmq/backend/cython/_device.pyx":82
1238aec3c8f4Simarom *         capture_handle = capture.handle
1239aec3c8f4Simarom *     else:
1240aec3c8f4Simarom *         capture_handle = NULL             # <<<<<<<<<<<<<<
1241aec3c8f4Simarom *     with nogil:
1242aec3c8f4Simarom *         rc = zmq_proxy(frontend.handle, backend.handle, capture_handle)
1243aec3c8f4Simarom */
1244aec3c8f4Simarom    __pyx_v_capture_handle = NULL;
1245aec3c8f4Simarom  }
1246aec3c8f4Simarom  __pyx_L3:;
1247aec3c8f4Simarom
1248aec3c8f4Simarom  /* "zmq/backend/cython/_device.pyx":83
1249aec3c8f4Simarom *     else:
1250aec3c8f4Simarom *         capture_handle = NULL
1251aec3c8f4Simarom *     with nogil:             # <<<<<<<<<<<<<<
1252aec3c8f4Simarom *         rc = zmq_proxy(frontend.handle, backend.handle, capture_handle)
1253aec3c8f4Simarom *     _check_rc(rc)
1254aec3c8f4Simarom */
1255aec3c8f4Simarom  {
1256aec3c8f4Simarom      #ifdef WITH_THREAD
1257aec3c8f4Simarom      PyThreadState *_save;
1258aec3c8f4Simarom      Py_UNBLOCK_THREADS
1259aec3c8f4Simarom      #endif
1260aec3c8f4Simarom      /*try:*/ {
1261aec3c8f4Simarom
1262aec3c8f4Simarom        /* "zmq/backend/cython/_device.pyx":84
1263aec3c8f4Simarom *         capture_handle = NULL
1264aec3c8f4Simarom *     with nogil:
1265aec3c8f4Simarom *         rc = zmq_proxy(frontend.handle, backend.handle, capture_handle)             # <<<<<<<<<<<<<<
1266aec3c8f4Simarom *     _check_rc(rc)
1267aec3c8f4Simarom *     return rc
1268aec3c8f4Simarom */
1269aec3c8f4Simarom        __pyx_v_rc = zmq_proxy(__pyx_v_frontend->handle, __pyx_v_backend->handle, __pyx_v_capture_handle);
1270aec3c8f4Simarom      }
1271aec3c8f4Simarom
1272aec3c8f4Simarom      /* "zmq/backend/cython/_device.pyx":83
1273aec3c8f4Simarom *     else:
1274aec3c8f4Simarom *         capture_handle = NULL
1275aec3c8f4Simarom *     with nogil:             # <<<<<<<<<<<<<<
1276aec3c8f4Simarom *         rc = zmq_proxy(frontend.handle, backend.handle, capture_handle)
1277aec3c8f4Simarom *     _check_rc(rc)
1278aec3c8f4Simarom */
1279aec3c8f4Simarom      /*finally:*/ {
1280aec3c8f4Simarom        /*normal exit:*/{
1281aec3c8f4Simarom          #ifdef WITH_THREAD
1282aec3c8f4Simarom          Py_BLOCK_THREADS
1283aec3c8f4Simarom          #endif
1284aec3c8f4Simarom          goto __pyx_L6;
1285aec3c8f4Simarom        }
1286aec3c8f4Simarom        __pyx_L6:;
1287aec3c8f4Simarom      }
1288aec3c8f4Simarom  }
1289aec3c8f4Simarom
1290aec3c8f4Simarom  /* "zmq/backend/cython/_device.pyx":85
1291aec3c8f4Simarom *     with nogil:
1292aec3c8f4Simarom *         rc = zmq_proxy(frontend.handle, backend.handle, capture_handle)
1293aec3c8f4Simarom *     _check_rc(rc)             # <<<<<<<<<<<<<<
1294aec3c8f4Simarom *     return rc
1295aec3c8f4Simarom *
1296aec3c8f4Simarom */
1297aec3c8f4Simarom  __pyx_t_4 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1298aec3c8f4Simarom
1299aec3c8f4Simarom  /* "zmq/backend/cython/_device.pyx":86
1300aec3c8f4Simarom *         rc = zmq_proxy(frontend.handle, backend.handle, capture_handle)
1301aec3c8f4Simarom *     _check_rc(rc)
1302aec3c8f4Simarom *     return rc             # <<<<<<<<<<<<<<
1303aec3c8f4Simarom *
1304aec3c8f4Simarom * __all__ = ['device', 'proxy']
1305aec3c8f4Simarom */
1306aec3c8f4Simarom  __Pyx_XDECREF(__pyx_r);
1307aec3c8f4Simarom  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1308aec3c8f4Simarom  __Pyx_GOTREF(__pyx_t_5);
1309aec3c8f4Simarom  __pyx_r = __pyx_t_5;
1310aec3c8f4Simarom  __pyx_t_5 = 0;
1311aec3c8f4Simarom  goto __pyx_L0;
1312aec3c8f4Simarom
1313aec3c8f4Simarom  /* "zmq/backend/cython/_device.pyx":60
1314aec3c8f4Simarom *     return rc
1315aec3c8f4Simarom *
1316aec3c8f4Simarom * def proxy(cSocket frontend, cSocket backend, cSocket capture=None):             # <<<<<<<<<<<<<<
1317aec3c8f4Simarom *     """proxy(frontend, backend, capture)
1318aec3c8f4Simarom *
1319aec3c8f4Simarom */
1320aec3c8f4Simarom
1321aec3c8f4Simarom  /* function exit code */
1322aec3c8f4Simarom  __pyx_L1_error:;
1323aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_5);
1324aec3c8f4Simarom  __Pyx_AddTraceback("zmq.backend.cython._device.proxy", __pyx_clineno, __pyx_lineno, __pyx_filename);
1325aec3c8f4Simarom  __pyx_r = NULL;
1326aec3c8f4Simarom  __pyx_L0:;
1327aec3c8f4Simarom  __Pyx_XGIVEREF(__pyx_r);
1328aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
1329aec3c8f4Simarom  return __pyx_r;
1330aec3c8f4Simarom}
1331aec3c8f4Simarom
1332aec3c8f4Simarom/* "zmq/backend/cython/checkrc.pxd":5
1333aec3c8f4Simarom * from libzmq cimport zmq_errno, ZMQ_ETERM
1334aec3c8f4Simarom *
1335aec3c8f4Simarom * cdef inline int _check_rc(int rc) except -1:             # <<<<<<<<<<<<<<
1336aec3c8f4Simarom *     """internal utility for checking zmq return condition
1337aec3c8f4Simarom *
1338aec3c8f4Simarom */
1339aec3c8f4Simarom
1340aec3c8f4Simaromstatic CYTHON_INLINE int __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(int __pyx_v_rc) {
1341aec3c8f4Simarom  int __pyx_v_errno;
1342aec3c8f4Simarom  PyObject *__pyx_v_Again = NULL;
1343aec3c8f4Simarom  PyObject *__pyx_v_ContextTerminated = NULL;
1344aec3c8f4Simarom  PyObject *__pyx_v_ZMQError = NULL;
1345aec3c8f4Simarom  int __pyx_r;
1346aec3c8f4Simarom  __Pyx_RefNannyDeclarations
1347aec3c8f4Simarom  int __pyx_t_1;
1348aec3c8f4Simarom  int __pyx_t_2;
1349aec3c8f4Simarom  PyObject *__pyx_t_3 = NULL;
1350aec3c8f4Simarom  PyObject *__pyx_t_4 = NULL;
1351aec3c8f4Simarom  PyObject *__pyx_t_5 = NULL;
1352aec3c8f4Simarom  PyObject *__pyx_t_6 = NULL;
1353aec3c8f4Simarom  PyObject *__pyx_t_7 = NULL;
1354aec3c8f4Simarom  int __pyx_lineno = 0;
1355aec3c8f4Simarom  const char *__pyx_filename = NULL;
1356aec3c8f4Simarom  int __pyx_clineno = 0;
1357aec3c8f4Simarom  __Pyx_RefNannySetupContext("_check_rc", 0);
1358aec3c8f4Simarom
1359aec3c8f4Simarom  /* "zmq/backend/cython/checkrc.pxd":10
1360aec3c8f4Simarom *     and raising the appropriate Exception class
1361aec3c8f4Simarom *     """
1362aec3c8f4Simarom *     cdef int errno = zmq_errno()             # <<<<<<<<<<<<<<
1363aec3c8f4Simarom *     PyErr_CheckSignals()
1364aec3c8f4Simarom *     if rc < 0:
1365aec3c8f4Simarom */
1366aec3c8f4Simarom  __pyx_v_errno = zmq_errno();
1367aec3c8f4Simarom
1368aec3c8f4Simarom  /* "zmq/backend/cython/checkrc.pxd":11
1369aec3c8f4Simarom *     """
1370aec3c8f4Simarom *     cdef int errno = zmq_errno()
1371aec3c8f4Simarom *     PyErr_CheckSignals()             # <<<<<<<<<<<<<<
1372aec3c8f4Simarom *     if rc < 0:
1373aec3c8f4Simarom *         if errno == EAGAIN:
1374aec3c8f4Simarom */
1375aec3c8f4Simarom  __pyx_t_1 = PyErr_CheckSignals(); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1376aec3c8f4Simarom
1377aec3c8f4Simarom  /* "zmq/backend/cython/checkrc.pxd":12
1378aec3c8f4Simarom *     cdef int errno = zmq_errno()
1379aec3c8f4Simarom *     PyErr_CheckSignals()
1380aec3c8f4Simarom *     if rc < 0:             # <<<<<<<<<<<<<<
1381aec3c8f4Simarom *         if errno == EAGAIN:
1382aec3c8f4Simarom *             from zmq.error import Again
1383aec3c8f4Simarom */
1384aec3c8f4Simarom  __pyx_t_2 = ((__pyx_v_rc < 0) != 0);
1385aec3c8f4Simarom  if (__pyx_t_2) {
1386aec3c8f4Simarom
1387aec3c8f4Simarom    /* "zmq/backend/cython/checkrc.pxd":16
1388aec3c8f4Simarom *             from zmq.error import Again
1389aec3c8f4Simarom *             raise Again(errno)
1390aec3c8f4Simarom *         elif errno == ZMQ_ETERM:             # <<<<<<<<<<<<<<
1391aec3c8f4Simarom *             from zmq.error import ContextTerminated
1392aec3c8f4Simarom *             raise ContextTerminated(errno)
1393aec3c8f4Simarom */
1394aec3c8f4Simarom    switch (__pyx_v_errno) {
1395aec3c8f4Simarom
1396aec3c8f4Simarom      /* "zmq/backend/cython/checkrc.pxd":13
1397aec3c8f4Simarom *     PyErr_CheckSignals()
1398aec3c8f4Simarom *     if rc < 0:
1399aec3c8f4Simarom *         if errno == EAGAIN:             # <<<<<<<<<<<<<<
1400aec3c8f4Simarom *             from zmq.error import Again
1401aec3c8f4Simarom *             raise Again(errno)
1402aec3c8f4Simarom */
1403aec3c8f4Simarom      case EAGAIN:
1404aec3c8f4Simarom
1405aec3c8f4Simarom      /* "zmq/backend/cython/checkrc.pxd":14
1406aec3c8f4Simarom *     if rc < 0:
1407aec3c8f4Simarom *         if errno == EAGAIN:
1408aec3c8f4Simarom *             from zmq.error import Again             # <<<<<<<<<<<<<<
1409aec3c8f4Simarom *             raise Again(errno)
1410aec3c8f4Simarom *         elif errno == ZMQ_ETERM:
1411aec3c8f4Simarom */
1412aec3c8f4Simarom      __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1413aec3c8f4Simarom      __Pyx_GOTREF(__pyx_t_3);
1414aec3c8f4Simarom      __Pyx_INCREF(__pyx_n_s_Again);
1415aec3c8f4Simarom      PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Again);
1416aec3c8f4Simarom      __Pyx_GIVEREF(__pyx_n_s_Again);
1417aec3c8f4Simarom      __pyx_t_4 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1418aec3c8f4Simarom      __Pyx_GOTREF(__pyx_t_4);
1419aec3c8f4Simarom      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1420aec3c8f4Simarom      __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Again); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1421aec3c8f4Simarom      __Pyx_GOTREF(__pyx_t_3);
1422aec3c8f4Simarom      __Pyx_INCREF(__pyx_t_3);
1423aec3c8f4Simarom      __pyx_v_Again = __pyx_t_3;
1424aec3c8f4Simarom      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1425aec3c8f4Simarom      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1426aec3c8f4Simarom
1427aec3c8f4Simarom      /* "zmq/backend/cython/checkrc.pxd":15
1428aec3c8f4Simarom *         if errno == EAGAIN:
1429aec3c8f4Simarom *             from zmq.error import Again
1430aec3c8f4Simarom *             raise Again(errno)             # <<<<<<<<<<<<<<
1431aec3c8f4Simarom *         elif errno == ZMQ_ETERM:
1432aec3c8f4Simarom *             from zmq.error import ContextTerminated
1433aec3c8f4Simarom */
1434aec3c8f4Simarom      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1435aec3c8f4Simarom      __Pyx_GOTREF(__pyx_t_3);
1436aec3c8f4Simarom      __Pyx_INCREF(__pyx_v_Again);
1437aec3c8f4Simarom      __pyx_t_5 = __pyx_v_Again; __pyx_t_6 = NULL;
1438aec3c8f4Simarom      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
1439aec3c8f4Simarom        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
1440aec3c8f4Simarom        if (likely(__pyx_t_6)) {
1441aec3c8f4Simarom          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
1442aec3c8f4Simarom          __Pyx_INCREF(__pyx_t_6);
1443aec3c8f4Simarom          __Pyx_INCREF(function);
1444aec3c8f4Simarom          __Pyx_DECREF_SET(__pyx_t_5, function);
1445aec3c8f4Simarom        }
1446aec3c8f4Simarom      }
1447aec3c8f4Simarom      if (!__pyx_t_6) {
1448aec3c8f4Simarom        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1449aec3c8f4Simarom        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1450aec3c8f4Simarom        __Pyx_GOTREF(__pyx_t_4);
1451aec3c8f4Simarom      } else {
1452aec3c8f4Simarom        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1453aec3c8f4Simarom        __Pyx_GOTREF(__pyx_t_7);
1454aec3c8f4Simarom        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
1455aec3c8f4Simarom        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
1456aec3c8f4Simarom        __Pyx_GIVEREF(__pyx_t_3);
1457aec3c8f4Simarom        __pyx_t_3 = 0;
1458aec3c8f4Simarom        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1459aec3c8f4Simarom        __Pyx_GOTREF(__pyx_t_4);
1460aec3c8f4Simarom        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1461aec3c8f4Simarom      }
1462aec3c8f4Simarom      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1463aec3c8f4Simarom      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
1464aec3c8f4Simarom      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1465aec3c8f4Simarom      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1466aec3c8f4Simarom      break;
1467aec3c8f4Simarom
1468aec3c8f4Simarom      /* "zmq/backend/cython/checkrc.pxd":16
1469aec3c8f4Simarom *             from zmq.error import Again
1470aec3c8f4Simarom *             raise Again(errno)
1471aec3c8f4Simarom *         elif errno == ZMQ_ETERM:             # <<<<<<<<<<<<<<
1472aec3c8f4Simarom *             from zmq.error import ContextTerminated
1473aec3c8f4Simarom *             raise ContextTerminated(errno)
1474aec3c8f4Simarom */
1475aec3c8f4Simarom      case ETERM:
1476aec3c8f4Simarom
1477aec3c8f4Simarom      /* "zmq/backend/cython/checkrc.pxd":17
1478aec3c8f4Simarom *             raise Again(errno)
1479aec3c8f4Simarom *         elif errno == ZMQ_ETERM:
1480aec3c8f4Simarom *             from zmq.error import ContextTerminated             # <<<<<<<<<<<<<<
1481aec3c8f4Simarom *             raise ContextTerminated(errno)
1482aec3c8f4Simarom *         else:
1483aec3c8f4Simarom */
1484aec3c8f4Simarom      __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1485aec3c8f4Simarom      __Pyx_GOTREF(__pyx_t_4);
1486aec3c8f4Simarom      __Pyx_INCREF(__pyx_n_s_ContextTerminated);
1487aec3c8f4Simarom      PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_ContextTerminated);
1488aec3c8f4Simarom      __Pyx_GIVEREF(__pyx_n_s_ContextTerminated);
1489aec3c8f4Simarom      __pyx_t_5 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1490aec3c8f4Simarom      __Pyx_GOTREF(__pyx_t_5);
1491aec3c8f4Simarom      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1492aec3c8f4Simarom      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_ContextTerminated); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1493aec3c8f4Simarom      __Pyx_GOTREF(__pyx_t_4);
1494aec3c8f4Simarom      __Pyx_INCREF(__pyx_t_4);
1495aec3c8f4Simarom      __pyx_v_ContextTerminated = __pyx_t_4;
1496aec3c8f4Simarom      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1497aec3c8f4Simarom      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1498aec3c8f4Simarom
1499aec3c8f4Simarom      /* "zmq/backend/cython/checkrc.pxd":18
1500aec3c8f4Simarom *         elif errno == ZMQ_ETERM:
1501aec3c8f4Simarom *             from zmq.error import ContextTerminated
1502aec3c8f4Simarom *             raise ContextTerminated(errno)             # <<<<<<<<<<<<<<
1503aec3c8f4Simarom *         else:
1504aec3c8f4Simarom *             from zmq.error import ZMQError
1505aec3c8f4Simarom */
1506aec3c8f4Simarom      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1507aec3c8f4Simarom      __Pyx_GOTREF(__pyx_t_4);
1508aec3c8f4Simarom      __Pyx_INCREF(__pyx_v_ContextTerminated);
1509aec3c8f4Simarom      __pyx_t_7 = __pyx_v_ContextTerminated; __pyx_t_3 = NULL;
1510aec3c8f4Simarom      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
1511aec3c8f4Simarom        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
1512aec3c8f4Simarom        if (likely(__pyx_t_3)) {
1513aec3c8f4Simarom          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
1514aec3c8f4Simarom          __Pyx_INCREF(__pyx_t_3);
1515aec3c8f4Simarom          __Pyx_INCREF(function);
1516aec3c8f4Simarom          __Pyx_DECREF_SET(__pyx_t_7, function);
1517aec3c8f4Simarom        }
1518aec3c8f4Simarom      }
1519aec3c8f4Simarom      if (!__pyx_t_3) {
1520aec3c8f4Simarom        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1521aec3c8f4Simarom        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1522aec3c8f4Simarom        __Pyx_GOTREF(__pyx_t_5);
1523aec3c8f4Simarom      } else {
1524aec3c8f4Simarom        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1525aec3c8f4Simarom        __Pyx_GOTREF(__pyx_t_6);
1526aec3c8f4Simarom        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
1527aec3c8f4Simarom        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
1528aec3c8f4Simarom        __Pyx_GIVEREF(__pyx_t_4);
1529aec3c8f4Simarom        __pyx_t_4 = 0;
1530aec3c8f4Simarom        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1531aec3c8f4Simarom        __Pyx_GOTREF(__pyx_t_5);
1532aec3c8f4Simarom        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1533aec3c8f4Simarom      }
1534aec3c8f4Simarom      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1535aec3c8f4Simarom      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
1536aec3c8f4Simarom      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1537aec3c8f4Simarom      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1538aec3c8f4Simarom      break;
1539aec3c8f4Simarom      default:
1540aec3c8f4Simarom
1541aec3c8f4Simarom      /* "zmq/backend/cython/checkrc.pxd":20
1542aec3c8f4Simarom *             raise ContextTerminated(errno)
1543aec3c8f4Simarom *         else:
1544aec3c8f4Simarom *             from zmq.error import ZMQError             # <<<<<<<<<<<<<<
1545aec3c8f4Simarom *             raise ZMQError(errno)
1546aec3c8f4Simarom *         # return -1
1547aec3c8f4Simarom */
1548aec3c8f4Simarom      __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1549aec3c8f4Simarom      __Pyx_GOTREF(__pyx_t_5);
1550aec3c8f4Simarom      __Pyx_INCREF(__pyx_n_s_ZMQError);
1551aec3c8f4Simarom      PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_ZMQError);
1552aec3c8f4Simarom      __Pyx_GIVEREF(__pyx_n_s_ZMQError);
1553aec3c8f4Simarom      __pyx_t_7 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_5, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1554aec3c8f4Simarom      __Pyx_GOTREF(__pyx_t_7);
1555aec3c8f4Simarom      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1556aec3c8f4Simarom      __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_ZMQError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1557aec3c8f4Simarom      __Pyx_GOTREF(__pyx_t_5);
1558aec3c8f4Simarom      __Pyx_INCREF(__pyx_t_5);
1559aec3c8f4Simarom      __pyx_v_ZMQError = __pyx_t_5;
1560aec3c8f4Simarom      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1561aec3c8f4Simarom      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1562aec3c8f4Simarom
1563aec3c8f4Simarom      /* "zmq/backend/cython/checkrc.pxd":21
1564aec3c8f4Simarom *         else:
1565aec3c8f4Simarom *             from zmq.error import ZMQError
1566aec3c8f4Simarom *             raise ZMQError(errno)             # <<<<<<<<<<<<<<
1567aec3c8f4Simarom *         # return -1
1568aec3c8f4Simarom *     return 0
1569aec3c8f4Simarom */
1570aec3c8f4Simarom      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1571aec3c8f4Simarom      __Pyx_GOTREF(__pyx_t_5);
1572aec3c8f4Simarom      __Pyx_INCREF(__pyx_v_ZMQError);
1573aec3c8f4Simarom      __pyx_t_6 = __pyx_v_ZMQError; __pyx_t_4 = NULL;
1574aec3c8f4Simarom      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
1575aec3c8f4Simarom        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
1576aec3c8f4Simarom        if (likely(__pyx_t_4)) {
1577aec3c8f4Simarom          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
1578aec3c8f4Simarom          __Pyx_INCREF(__pyx_t_4);
1579aec3c8f4Simarom          __Pyx_INCREF(function);
1580aec3c8f4Simarom          __Pyx_DECREF_SET(__pyx_t_6, function);
1581aec3c8f4Simarom        }
1582aec3c8f4Simarom      }
1583aec3c8f4Simarom      if (!__pyx_t_4) {
1584aec3c8f4Simarom        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1585aec3c8f4Simarom        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1586aec3c8f4Simarom        __Pyx_GOTREF(__pyx_t_7);
1587aec3c8f4Simarom      } else {
1588aec3c8f4Simarom        __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1589aec3c8f4Simarom        __Pyx_GOTREF(__pyx_t_3);
1590aec3c8f4Simarom        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
1591aec3c8f4Simarom        PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5);
1592aec3c8f4Simarom        __Pyx_GIVEREF(__pyx_t_5);
1593aec3c8f4Simarom        __pyx_t_5 = 0;
1594aec3c8f4Simarom        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1595aec3c8f4Simarom        __Pyx_GOTREF(__pyx_t_7);
1596aec3c8f4Simarom        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1597aec3c8f4Simarom      }
1598aec3c8f4Simarom      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1599aec3c8f4Simarom      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
1600aec3c8f4Simarom      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1601aec3c8f4Simarom      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1602aec3c8f4Simarom      break;
1603aec3c8f4Simarom    }
1604aec3c8f4Simarom  }
1605aec3c8f4Simarom
1606aec3c8f4Simarom  /* "zmq/backend/cython/checkrc.pxd":23
1607aec3c8f4Simarom *             raise ZMQError(errno)
1608aec3c8f4Simarom *         # return -1
1609aec3c8f4Simarom *     return 0             # <<<<<<<<<<<<<<
1610aec3c8f4Simarom */
1611aec3c8f4Simarom  __pyx_r = 0;
1612aec3c8f4Simarom  goto __pyx_L0;
1613aec3c8f4Simarom
1614aec3c8f4Simarom  /* "zmq/backend/cython/checkrc.pxd":5
1615aec3c8f4Simarom * from libzmq cimport zmq_errno, ZMQ_ETERM
1616aec3c8f4Simarom *
1617aec3c8f4Simarom * cdef inline int _check_rc(int rc) except -1:             # <<<<<<<<<<<<<<
1618aec3c8f4Simarom *     """internal utility for checking zmq return condition
1619aec3c8f4Simarom *
1620aec3c8f4Simarom */
1621aec3c8f4Simarom
1622aec3c8f4Simarom  /* function exit code */
1623aec3c8f4Simarom  __pyx_L1_error:;
1624aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_3);
1625aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_4);
1626aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_5);
1627aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_6);
1628aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_7);
1629aec3c8f4Simarom  __Pyx_AddTraceback("zmq.backend.cython.checkrc._check_rc", __pyx_clineno, __pyx_lineno, __pyx_filename);
1630aec3c8f4Simarom  __pyx_r = -1;
1631aec3c8f4Simarom  __pyx_L0:;
1632aec3c8f4Simarom  __Pyx_XDECREF(__pyx_v_Again);
1633aec3c8f4Simarom  __Pyx_XDECREF(__pyx_v_ContextTerminated);
1634aec3c8f4Simarom  __Pyx_XDECREF(__pyx_v_ZMQError);
1635aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
1636aec3c8f4Simarom  return __pyx_r;
1637aec3c8f4Simarom}
1638aec3c8f4Simarom
1639aec3c8f4Simaromstatic PyMethodDef __pyx_methods[] = {
1640aec3c8f4Simarom  {0, 0, 0, 0}
1641aec3c8f4Simarom};
1642aec3c8f4Simarom
1643aec3c8f4Simarom#if PY_MAJOR_VERSION >= 3
1644aec3c8f4Simaromstatic struct PyModuleDef __pyx_moduledef = {
1645aec3c8f4Simarom  #if PY_VERSION_HEX < 0x03020000
1646aec3c8f4Simarom    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
1647aec3c8f4Simarom  #else
1648aec3c8f4Simarom    PyModuleDef_HEAD_INIT,
1649aec3c8f4Simarom  #endif
1650aec3c8f4Simarom    "_device",
1651aec3c8f4Simarom    __pyx_k_Python_binding_for_0MQ_device_fu, /* m_doc */
1652aec3c8f4Simarom    -1, /* m_size */
1653aec3c8f4Simarom    __pyx_methods /* m_methods */,
1654aec3c8f4Simarom    NULL, /* m_reload */
1655aec3c8f4Simarom    NULL, /* m_traverse */
1656aec3c8f4Simarom    NULL, /* m_clear */
1657aec3c8f4Simarom    NULL /* m_free */
1658aec3c8f4Simarom};
1659aec3c8f4Simarom#endif
1660aec3c8f4Simarom
1661aec3c8f4Simaromstatic __Pyx_StringTabEntry __pyx_string_tab[] = {
1662aec3c8f4Simarom  {&__pyx_n_s_Again, __pyx_k_Again, sizeof(__pyx_k_Again), 0, 0, 1, 1},
1663aec3c8f4Simarom  {&__pyx_n_s_ContextTerminated, __pyx_k_ContextTerminated, sizeof(__pyx_k_ContextTerminated), 0, 0, 1, 1},
1664aec3c8f4Simarom  {&__pyx_n_s_ZMQError, __pyx_k_ZMQError, sizeof(__pyx_k_ZMQError), 0, 0, 1, 1},
1665aec3c8f4Simarom  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
1666aec3c8f4Simarom  {&__pyx_n_s_backend, __pyx_k_backend, sizeof(__pyx_k_backend), 0, 0, 1, 1},
1667aec3c8f4Simarom  {&__pyx_n_s_capture, __pyx_k_capture, sizeof(__pyx_k_capture), 0, 0, 1, 1},
1668aec3c8f4Simarom  {&__pyx_n_s_capture_handle, __pyx_k_capture_handle, sizeof(__pyx_k_capture_handle), 0, 0, 1, 1},
1669aec3c8f4Simarom  {&__pyx_n_s_device, __pyx_k_device, sizeof(__pyx_k_device), 0, 0, 1, 1},
1670aec3c8f4Simarom  {&__pyx_n_s_device_type, __pyx_k_device_type, sizeof(__pyx_k_device_type), 0, 0, 1, 1},
1671aec3c8f4Simarom  {&__pyx_n_s_frontend, __pyx_k_frontend, sizeof(__pyx_k_frontend), 0, 0, 1, 1},
1672aec3c8f4Simarom  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
1673aec3c8f4Simarom  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
1674aec3c8f4Simarom  {&__pyx_kp_s_private_tmp_pyzmq_release_zmq_b, __pyx_k_private_tmp_pyzmq_release_zmq_b, sizeof(__pyx_k_private_tmp_pyzmq_release_zmq_b), 0, 0, 1, 0},
1675aec3c8f4Simarom  {&__pyx_n_s_proxy, __pyx_k_proxy, sizeof(__pyx_k_proxy), 0, 0, 1, 1},
1676aec3c8f4Simarom  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
1677aec3c8f4Simarom  {&__pyx_n_s_rc, __pyx_k_rc, sizeof(__pyx_k_rc), 0, 0, 1, 1},
1678aec3c8f4Simarom  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
1679aec3c8f4Simarom  {&__pyx_n_s_zmq_backend_cython__device, __pyx_k_zmq_backend_cython__device, sizeof(__pyx_k_zmq_backend_cython__device), 0, 0, 1, 1},
1680aec3c8f4Simarom  {&__pyx_n_s_zmq_error, __pyx_k_zmq_error, sizeof(__pyx_k_zmq_error), 0, 0, 1, 1},
1681aec3c8f4Simarom  {0, 0, 0, 0, 0, 0, 0}
1682aec3c8f4Simarom};
1683aec3c8f4Simaromstatic int __Pyx_InitCachedBuiltins(void) {
1684aec3c8f4Simarom  return 0;
1685aec3c8f4Simarom}
1686aec3c8f4Simarom
1687aec3c8f4Simaromstatic int __Pyx_InitCachedConstants(void) {
1688aec3c8f4Simarom  __Pyx_RefNannyDeclarations
1689aec3c8f4Simarom  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
1690aec3c8f4Simarom
1691aec3c8f4Simarom  /* "zmq/backend/cython/_device.pyx":34
1692aec3c8f4Simarom * #-----------------------------------------------------------------------------
1693aec3c8f4Simarom *
1694aec3c8f4Simarom * def device(int device_type, cSocket frontend, cSocket backend=None):             # <<<<<<<<<<<<<<
1695aec3c8f4Simarom *     """device(device_type, frontend, backend)
1696aec3c8f4Simarom *
1697aec3c8f4Simarom */
1698aec3c8f4Simarom  __pyx_tuple_ = PyTuple_Pack(4, __pyx_n_s_device_type, __pyx_n_s_frontend, __pyx_n_s_backend, __pyx_n_s_rc); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1699aec3c8f4Simarom  __Pyx_GOTREF(__pyx_tuple_);
1700aec3c8f4Simarom  __Pyx_GIVEREF(__pyx_tuple_);
1701aec3c8f4Simarom  __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_pyzmq_release_zmq_b, __pyx_n_s_device, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1702aec3c8f4Simarom
1703aec3c8f4Simarom  /* "zmq/backend/cython/_device.pyx":60
1704aec3c8f4Simarom *     return rc
1705aec3c8f4Simarom *
1706aec3c8f4Simarom * def proxy(cSocket frontend, cSocket backend, cSocket capture=None):             # <<<<<<<<<<<<<<
1707aec3c8f4Simarom *     """proxy(frontend, backend, capture)
1708aec3c8f4Simarom *
1709aec3c8f4Simarom */
1710aec3c8f4Simarom  __pyx_tuple__3 = PyTuple_Pack(5, __pyx_n_s_frontend, __pyx_n_s_backend, __pyx_n_s_capture, __pyx_n_s_rc, __pyx_n_s_capture_handle); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1711aec3c8f4Simarom  __Pyx_GOTREF(__pyx_tuple__3);
1712aec3c8f4Simarom  __Pyx_GIVEREF(__pyx_tuple__3);
1713aec3c8f4Simarom  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_pyzmq_release_zmq_b, __pyx_n_s_proxy, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1714aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
1715aec3c8f4Simarom  return 0;
1716aec3c8f4Simarom  __pyx_L1_error:;
1717aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
1718aec3c8f4Simarom  return -1;
1719aec3c8f4Simarom}
1720aec3c8f4Simarom
1721aec3c8f4Simaromstatic int __Pyx_InitGlobals(void) {
1722aec3c8f4Simarom  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
1723aec3c8f4Simarom  return 0;
1724aec3c8f4Simarom  __pyx_L1_error:;
1725aec3c8f4Simarom  return -1;
1726aec3c8f4Simarom}
1727aec3c8f4Simarom
1728aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
1729aec3c8f4SimaromPyMODINIT_FUNC init_device(void); /*proto*/
1730aec3c8f4SimaromPyMODINIT_FUNC init_device(void)
1731aec3c8f4Simarom#else
1732aec3c8f4SimaromPyMODINIT_FUNC PyInit__device(void); /*proto*/
1733aec3c8f4SimaromPyMODINIT_FUNC PyInit__device(void)
1734aec3c8f4Simarom#endif
1735aec3c8f4Simarom{
1736aec3c8f4Simarom  PyObject *__pyx_t_1 = NULL;
1737aec3c8f4Simarom  int __pyx_lineno = 0;
1738aec3c8f4Simarom  const char *__pyx_filename = NULL;
1739aec3c8f4Simarom  int __pyx_clineno = 0;
1740aec3c8f4Simarom  __Pyx_RefNannyDeclarations
1741aec3c8f4Simarom  #if CYTHON_REFNANNY
1742aec3c8f4Simarom  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
1743aec3c8f4Simarom  if (!__Pyx_RefNanny) {
1744aec3c8f4Simarom      PyErr_Clear();
1745aec3c8f4Simarom      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
1746aec3c8f4Simarom      if (!__Pyx_RefNanny)
1747aec3c8f4Simarom          Py_FatalError("failed to import 'refnanny' module");
1748aec3c8f4Simarom  }
1749aec3c8f4Simarom  #endif
1750aec3c8f4Simarom  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__device(void)", 0);
1751aec3c8f4Simarom  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1752aec3c8f4Simarom  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1753aec3c8f4Simarom  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1754aec3c8f4Simarom  #ifdef __Pyx_CyFunction_USED
1755aec3c8f4Simarom  if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1756aec3c8f4Simarom  #endif
1757aec3c8f4Simarom  #ifdef __Pyx_FusedFunction_USED
1758aec3c8f4Simarom  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1759aec3c8f4Simarom  #endif
1760aec3c8f4Simarom  #ifdef __Pyx_Generator_USED
1761aec3c8f4Simarom  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1762aec3c8f4Simarom  #endif
1763aec3c8f4Simarom  /*--- Library function declarations ---*/
1764aec3c8f4Simarom  /*--- Threads initialization code ---*/
1765aec3c8f4Simarom  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
1766aec3c8f4Simarom  #ifdef WITH_THREAD /* Python build with threading support? */
1767aec3c8f4Simarom  PyEval_InitThreads();
1768aec3c8f4Simarom  #endif
1769aec3c8f4Simarom  #endif
1770aec3c8f4Simarom  /*--- Module creation code ---*/
1771aec3c8f4Simarom  #if PY_MAJOR_VERSION < 3
1772aec3c8f4Simarom  __pyx_m = Py_InitModule4("_device", __pyx_methods, __pyx_k_Python_binding_for_0MQ_device_fu, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
1773aec3c8f4Simarom  #else
1774aec3c8f4Simarom  __pyx_m = PyModule_Create(&__pyx_moduledef);
1775aec3c8f4Simarom  #endif
1776aec3c8f4Simarom  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1777aec3c8f4Simarom  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1778aec3c8f4Simarom  Py_INCREF(__pyx_d);
1779aec3c8f4Simarom  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1780aec3c8f4Simarom  #if CYTHON_COMPILING_IN_PYPY
1781aec3c8f4Simarom  Py_INCREF(__pyx_b);
1782aec3c8f4Simarom  #endif
1783aec3c8f4Simarom  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
1784aec3c8f4Simarom  /*--- Initialize various global constants etc. ---*/
1785aec3c8f4Simarom  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1786aec3c8f4Simarom  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
1787aec3c8f4Simarom  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1788aec3c8f4Simarom  #endif
1789aec3c8f4Simarom  if (__pyx_module_is_main_zmq__backend__cython___device) {
1790aec3c8f4Simarom    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
1791aec3c8f4Simarom  }
1792aec3c8f4Simarom  #if PY_MAJOR_VERSION >= 3
1793aec3c8f4Simarom  {
1794aec3c8f4Simarom    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1795aec3c8f4Simarom    if (!PyDict_GetItemString(modules, "zmq.backend.cython._device")) {
1796aec3c8f4Simarom      if (unlikely(PyDict_SetItemString(modules, "zmq.backend.cython._device", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1797aec3c8f4Simarom    }
1798aec3c8f4Simarom  }
1799aec3c8f4Simarom  #endif
1800aec3c8f4Simarom  /*--- Builtin init code ---*/
1801aec3c8f4Simarom  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1802aec3c8f4Simarom  /*--- Constants init code ---*/
1803aec3c8f4Simarom  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1804aec3c8f4Simarom  /*--- Global init code ---*/
1805aec3c8f4Simarom  /*--- Variable export code ---*/
1806aec3c8f4Simarom  /*--- Function export code ---*/
1807aec3c8f4Simarom  /*--- Type init code ---*/
1808aec3c8f4Simarom  /*--- Type import code ---*/
1809aec3c8f4Simarom  __pyx_ptype_3zmq_7backend_6cython_7context_Context = __Pyx_ImportType("zmq.backend.cython.context", "Context", sizeof(struct __pyx_obj_3zmq_7backend_6cython_7context_Context), 1); if (unlikely(!__pyx_ptype_3zmq_7backend_6cython_7context_Context)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1810aec3c8f4Simarom  __pyx_vtabptr_3zmq_7backend_6cython_7context_Context = (struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context*)__Pyx_GetVtable(__pyx_ptype_3zmq_7backend_6cython_7context_Context->tp_dict); if (unlikely(!__pyx_vtabptr_3zmq_7backend_6cython_7context_Context)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1811aec3c8f4Simarom  __pyx_ptype_3zmq_7backend_6cython_6socket_Socket = __Pyx_ImportType("zmq.backend.cython.socket", "Socket", sizeof(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket), 1); if (unlikely(!__pyx_ptype_3zmq_7backend_6cython_6socket_Socket)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1812aec3c8f4Simarom  __pyx_vtabptr_3zmq_7backend_6cython_6socket_Socket = (struct __pyx_vtabstruct_3zmq_7backend_6cython_6socket_Socket*)__Pyx_GetVtable(__pyx_ptype_3zmq_7backend_6cython_6socket_Socket->tp_dict); if (unlikely(!__pyx_vtabptr_3zmq_7backend_6cython_6socket_Socket)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1813aec3c8f4Simarom  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
1814aec3c8f4Simarom  #if CYTHON_COMPILING_IN_PYPY
1815aec3c8f4Simarom  sizeof(PyTypeObject),
1816aec3c8f4Simarom  #else
1817aec3c8f4Simarom  sizeof(PyHeapTypeObject),
1818aec3c8f4Simarom  #endif
1819aec3c8f4Simarom  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1820aec3c8f4Simarom  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1821aec3c8f4Simarom  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1822aec3c8f4Simarom  /*--- Variable import code ---*/
1823aec3c8f4Simarom  /*--- Function import code ---*/
1824aec3c8f4Simarom  /*--- Execution code ---*/
1825aec3c8f4Simarom
1826aec3c8f4Simarom  /* "zmq/backend/cython/_device.pyx":34
1827aec3c8f4Simarom * #-----------------------------------------------------------------------------
1828aec3c8f4Simarom *
1829aec3c8f4Simarom * def device(int device_type, cSocket frontend, cSocket backend=None):             # <<<<<<<<<<<<<<
1830aec3c8f4Simarom *     """device(device_type, frontend, backend)
1831aec3c8f4Simarom *
1832aec3c8f4Simarom */
1833aec3c8f4Simarom  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3zmq_7backend_6cython_7_device_1device, NULL, __pyx_n_s_zmq_backend_cython__device); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1834aec3c8f4Simarom  __Pyx_GOTREF(__pyx_t_1);
1835aec3c8f4Simarom  if (PyDict_SetItem(__pyx_d, __pyx_n_s_device, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1836aec3c8f4Simarom  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1837aec3c8f4Simarom
1838aec3c8f4Simarom  /* "zmq/backend/cython/_device.pyx":60
1839aec3c8f4Simarom *     return rc
1840aec3c8f4Simarom *
1841aec3c8f4Simarom * def proxy(cSocket frontend, cSocket backend, cSocket capture=None):             # <<<<<<<<<<<<<<
1842aec3c8f4Simarom *     """proxy(frontend, backend, capture)
1843aec3c8f4Simarom *
1844aec3c8f4Simarom */
1845aec3c8f4Simarom  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3zmq_7backend_6cython_7_device_3proxy, NULL, __pyx_n_s_zmq_backend_cython__device); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1846aec3c8f4Simarom  __Pyx_GOTREF(__pyx_t_1);
1847aec3c8f4Simarom  if (PyDict_SetItem(__pyx_d, __pyx_n_s_proxy, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1848aec3c8f4Simarom  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1849aec3c8f4Simarom
1850aec3c8f4Simarom  /* "zmq/backend/cython/_device.pyx":88
1851aec3c8f4Simarom *     return rc
1852aec3c8f4Simarom *
1853aec3c8f4Simarom * __all__ = ['device', 'proxy']             # <<<<<<<<<<<<<<
1854aec3c8f4Simarom *
1855aec3c8f4Simarom */
1856aec3c8f4Simarom  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1857aec3c8f4Simarom  __Pyx_GOTREF(__pyx_t_1);
1858aec3c8f4Simarom  __Pyx_INCREF(__pyx_n_s_device);
1859aec3c8f4Simarom  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_device);
1860aec3c8f4Simarom  __Pyx_GIVEREF(__pyx_n_s_device);
1861aec3c8f4Simarom  __Pyx_INCREF(__pyx_n_s_proxy);
1862aec3c8f4Simarom  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_proxy);
1863aec3c8f4Simarom  __Pyx_GIVEREF(__pyx_n_s_proxy);
1864aec3c8f4Simarom  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1865aec3c8f4Simarom  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1866aec3c8f4Simarom
1867aec3c8f4Simarom  /* "zmq/backend/cython/_device.pyx":1
1868aec3c8f4Simarom * """Python binding for 0MQ device function."""             # <<<<<<<<<<<<<<
1869aec3c8f4Simarom *
1870aec3c8f4Simarom * #
1871aec3c8f4Simarom */
1872aec3c8f4Simarom  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1873aec3c8f4Simarom  __Pyx_GOTREF(__pyx_t_1);
1874aec3c8f4Simarom  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1875aec3c8f4Simarom  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1876aec3c8f4Simarom
1877aec3c8f4Simarom  /* "zmq/backend/cython/checkrc.pxd":5
1878aec3c8f4Simarom * from libzmq cimport zmq_errno, ZMQ_ETERM
1879aec3c8f4Simarom *
1880aec3c8f4Simarom * cdef inline int _check_rc(int rc) except -1:             # <<<<<<<<<<<<<<
1881aec3c8f4Simarom *     """internal utility for checking zmq return condition
1882aec3c8f4Simarom *
1883aec3c8f4Simarom */
1884aec3c8f4Simarom
1885aec3c8f4Simarom  /*--- Wrapped vars code ---*/
1886aec3c8f4Simarom
1887aec3c8f4Simarom  goto __pyx_L0;
1888aec3c8f4Simarom  __pyx_L1_error:;
1889aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_1);
1890aec3c8f4Simarom  if (__pyx_m) {
1891aec3c8f4Simarom    if (__pyx_d) {
1892aec3c8f4Simarom      __Pyx_AddTraceback("init zmq.backend.cython._device", __pyx_clineno, __pyx_lineno, __pyx_filename);
1893aec3c8f4Simarom    }
1894aec3c8f4Simarom    Py_DECREF(__pyx_m); __pyx_m = 0;
1895aec3c8f4Simarom  } else if (!PyErr_Occurred()) {
1896aec3c8f4Simarom    PyErr_SetString(PyExc_ImportError, "init zmq.backend.cython._device");
1897aec3c8f4Simarom  }
1898aec3c8f4Simarom  __pyx_L0:;
1899aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
1900aec3c8f4Simarom  #if PY_MAJOR_VERSION < 3
1901aec3c8f4Simarom  return;
1902aec3c8f4Simarom  #else
1903aec3c8f4Simarom  return __pyx_m;
1904aec3c8f4Simarom  #endif
1905aec3c8f4Simarom}
1906aec3c8f4Simarom
1907aec3c8f4Simarom/* Runtime support code */
1908aec3c8f4Simarom#if CYTHON_REFNANNY
1909aec3c8f4Simaromstatic __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
1910aec3c8f4Simarom    PyObject *m = NULL, *p = NULL;
1911aec3c8f4Simarom    void *r = NULL;
1912aec3c8f4Simarom    m = PyImport_ImportModule((char *)modname);
1913aec3c8f4Simarom    if (!m) goto end;
1914aec3c8f4Simarom    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
1915aec3c8f4Simarom    if (!p) goto end;
1916aec3c8f4Simarom    r = PyLong_AsVoidPtr(p);
1917aec3c8f4Simaromend:
1918aec3c8f4Simarom    Py_XDECREF(p);
1919aec3c8f4Simarom    Py_XDECREF(m);
1920aec3c8f4Simarom    return (__Pyx_RefNannyAPIStruct *)r;
1921aec3c8f4Simarom}
1922aec3c8f4Simarom#endif
1923aec3c8f4Simarom
1924aec3c8f4Simaromstatic void __Pyx_RaiseArgtupleInvalid(
1925aec3c8f4Simarom    const char* func_name,
1926aec3c8f4Simarom    int exact,
1927aec3c8f4Simarom    Py_ssize_t num_min,
1928aec3c8f4Simarom    Py_ssize_t num_max,
1929aec3c8f4Simarom    Py_ssize_t num_found)
1930aec3c8f4Simarom{
1931aec3c8f4Simarom    Py_ssize_t num_expected;
1932aec3c8f4Simarom    const char *more_or_less;
1933aec3c8f4Simarom    if (num_found < num_min) {
1934aec3c8f4Simarom        num_expected = num_min;
1935aec3c8f4Simarom        more_or_less = "at least";
1936aec3c8f4Simarom    } else {
1937aec3c8f4Simarom        num_expected = num_max;
1938aec3c8f4Simarom        more_or_less = "at most";
1939aec3c8f4Simarom    }
1940aec3c8f4Simarom    if (exact) {
1941aec3c8f4Simarom        more_or_less = "exactly";
1942aec3c8f4Simarom    }
1943aec3c8f4Simarom    PyErr_Format(PyExc_TypeError,
1944aec3c8f4Simarom                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
1945aec3c8f4Simarom                 func_name, more_or_less, num_expected,
1946aec3c8f4Simarom                 (num_expected == 1) ? "" : "s", num_found);
1947aec3c8f4Simarom}
1948aec3c8f4Simarom
1949aec3c8f4Simaromstatic void __Pyx_RaiseDoubleKeywordsError(
1950aec3c8f4Simarom    const char* func_name,
1951aec3c8f4Simarom    PyObject* kw_name)
1952aec3c8f4Simarom{
1953aec3c8f4Simarom    PyErr_Format(PyExc_TypeError,
1954aec3c8f4Simarom        #if PY_MAJOR_VERSION >= 3
1955aec3c8f4Simarom        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
1956aec3c8f4Simarom        #else
1957aec3c8f4Simarom        "%s() got multiple values for keyword argument '%s'", func_name,
1958aec3c8f4Simarom        PyString_AsString(kw_name));
1959aec3c8f4Simarom        #endif
1960aec3c8f4Simarom}
1961aec3c8f4Simarom
1962aec3c8f4Simaromstatic int __Pyx_ParseOptionalKeywords(
1963aec3c8f4Simarom    PyObject *kwds,
1964aec3c8f4Simarom    PyObject **argnames[],
1965aec3c8f4Simarom    PyObject *kwds2,
1966aec3c8f4Simarom    PyObject *values[],
1967aec3c8f4Simarom    Py_ssize_t num_pos_args,
1968aec3c8f4Simarom    const char* function_name)
1969aec3c8f4Simarom{
1970aec3c8f4Simarom    PyObject *key = 0, *value = 0;
1971aec3c8f4Simarom    Py_ssize_t pos = 0;
1972aec3c8f4Simarom    PyObject*** name;
1973aec3c8f4Simarom    PyObject*** first_kw_arg = argnames + num_pos_args;
1974aec3c8f4Simarom    while (PyDict_Next(kwds, &pos, &key, &value)) {
1975aec3c8f4Simarom        name = first_kw_arg;
1976aec3c8f4Simarom        while (*name && (**name != key)) name++;
1977aec3c8f4Simarom        if (*name) {
1978aec3c8f4Simarom            values[name-argnames] = value;
1979aec3c8f4Simarom            continue;
1980aec3c8f4Simarom        }
1981aec3c8f4Simarom        name = first_kw_arg;
1982aec3c8f4Simarom        #if PY_MAJOR_VERSION < 3
1983aec3c8f4Simarom        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
1984aec3c8f4Simarom            while (*name) {
1985aec3c8f4Simarom                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
1986aec3c8f4Simarom                        && _PyString_Eq(**name, key)) {
1987aec3c8f4Simarom                    values[name-argnames] = value;
1988aec3c8f4Simarom                    break;
1989aec3c8f4Simarom                }
1990aec3c8f4