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__error
235aec3c8f4Simarom#define __PYX_HAVE_API__zmq__backend__cython__error
236aec3c8f4Simarom#include "zmq_compat.h"
237aec3c8f4Simarom#include "zmq.h"
238aec3c8f4Simarom#include "zmq_utils.h"
239aec3c8f4Simarom#ifdef _OPENMP
240aec3c8f4Simarom#include <omp.h>
241aec3c8f4Simarom#endif /* _OPENMP */
242aec3c8f4Simarom
243aec3c8f4Simarom#ifdef PYREX_WITHOUT_ASSERTIONS
244aec3c8f4Simarom#define CYTHON_WITHOUT_ASSERTIONS
245aec3c8f4Simarom#endif
246aec3c8f4Simarom
247aec3c8f4Simarom#ifndef CYTHON_UNUSED
248aec3c8f4Simarom# if defined(__GNUC__)
249aec3c8f4Simarom#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
250aec3c8f4Simarom#     define CYTHON_UNUSED __attribute__ ((__unused__))
251aec3c8f4Simarom#   else
252aec3c8f4Simarom#     define CYTHON_UNUSED
253aec3c8f4Simarom#   endif
254aec3c8f4Simarom# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
255aec3c8f4Simarom#   define CYTHON_UNUSED __attribute__ ((__unused__))
256aec3c8f4Simarom# else
257aec3c8f4Simarom#   define CYTHON_UNUSED
258aec3c8f4Simarom# endif
259aec3c8f4Simarom#endif
260aec3c8f4Simaromtypedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
261aec3c8f4Simarom                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
262aec3c8f4Simarom
263aec3c8f4Simarom#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
264aec3c8f4Simarom#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
265aec3c8f4Simarom#define __PYX_DEFAULT_STRING_ENCODING ""
266aec3c8f4Simarom#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
267aec3c8f4Simarom#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
268aec3c8f4Simarom#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (    \
269aec3c8f4Simarom    (sizeof(type) < sizeof(Py_ssize_t))  ||             \
270aec3c8f4Simarom    (sizeof(type) > sizeof(Py_ssize_t) &&               \
271aec3c8f4Simarom          likely(v < (type)PY_SSIZE_T_MAX ||            \
272aec3c8f4Simarom                 v == (type)PY_SSIZE_T_MAX)  &&         \
273aec3c8f4Simarom          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||       \
274aec3c8f4Simarom                                v == (type)PY_SSIZE_T_MIN)))  ||  \
275aec3c8f4Simarom    (sizeof(type) == sizeof(Py_ssize_t) &&              \
276aec3c8f4Simarom          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||        \
277aec3c8f4Simarom                               v == (type)PY_SSIZE_T_MAX)))  )
278aec3c8f4Simaromstatic CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
279aec3c8f4Simaromstatic CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
280aec3c8f4Simarom#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
281aec3c8f4Simarom#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
282aec3c8f4Simarom#define __Pyx_PyBytes_FromString        PyBytes_FromString
283aec3c8f4Simarom#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
284aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
285aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
286aec3c8f4Simarom    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
287aec3c8f4Simarom    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
288aec3c8f4Simarom#else
289aec3c8f4Simarom    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
290aec3c8f4Simarom    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
291aec3c8f4Simarom#endif
292aec3c8f4Simarom#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
293aec3c8f4Simarom#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
294aec3c8f4Simarom#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((const char*)s)
295aec3c8f4Simarom#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((const char*)s)
296aec3c8f4Simarom#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((const char*)s)
297aec3c8f4Simarom#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((const char*)s)
298aec3c8f4Simarom#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
299aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
300aec3c8f4Simaromstatic CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
301aec3c8f4Simarom{
302aec3c8f4Simarom    const Py_UNICODE *u_end = u;
303aec3c8f4Simarom    while (*u_end++) ;
304aec3c8f4Simarom    return (size_t)(u_end - u - 1);
305aec3c8f4Simarom}
306aec3c8f4Simarom#else
307aec3c8f4Simarom#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
308aec3c8f4Simarom#endif
309aec3c8f4Simarom#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
310aec3c8f4Simarom#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
311aec3c8f4Simarom#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
312aec3c8f4Simarom#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
313aec3c8f4Simarom#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
314aec3c8f4Simaromstatic CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
315aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
316aec3c8f4Simaromstatic CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
317aec3c8f4Simaromstatic CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
318aec3c8f4Simarom#if CYTHON_COMPILING_IN_CPYTHON
319aec3c8f4Simarom#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
320aec3c8f4Simarom#else
321aec3c8f4Simarom#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
322aec3c8f4Simarom#endif
323aec3c8f4Simarom#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
324aec3c8f4Simarom#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
325aec3c8f4Simaromstatic int __Pyx_sys_getdefaultencoding_not_ascii;
326aec3c8f4Simaromstatic int __Pyx_init_sys_getdefaultencoding_params(void) {
327aec3c8f4Simarom    PyObject* sys;
328aec3c8f4Simarom    PyObject* default_encoding = NULL;
329aec3c8f4Simarom    PyObject* ascii_chars_u = NULL;
330aec3c8f4Simarom    PyObject* ascii_chars_b = NULL;
331aec3c8f4Simarom    const char* default_encoding_c;
332aec3c8f4Simarom    sys = PyImport_ImportModule("sys");
333aec3c8f4Simarom    if (!sys) goto bad;
334aec3c8f4Simarom    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
335aec3c8f4Simarom    Py_DECREF(sys);
336aec3c8f4Simarom    if (!default_encoding) goto bad;
337aec3c8f4Simarom    default_encoding_c = PyBytes_AsString(default_encoding);
338aec3c8f4Simarom    if (!default_encoding_c) goto bad;
339aec3c8f4Simarom    if (strcmp(default_encoding_c, "ascii") == 0) {
340aec3c8f4Simarom        __Pyx_sys_getdefaultencoding_not_ascii = 0;
341aec3c8f4Simarom    } else {
342aec3c8f4Simarom        char ascii_chars[128];
343aec3c8f4Simarom        int c;
344aec3c8f4Simarom        for (c = 0; c < 128; c++) {
345aec3c8f4Simarom            ascii_chars[c] = c;
346aec3c8f4Simarom        }
347aec3c8f4Simarom        __Pyx_sys_getdefaultencoding_not_ascii = 1;
348aec3c8f4Simarom        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
349aec3c8f4Simarom        if (!ascii_chars_u) goto bad;
350aec3c8f4Simarom        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
351aec3c8f4Simarom        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
352aec3c8f4Simarom            PyErr_Format(
353aec3c8f4Simarom                PyExc_ValueError,
354aec3c8f4Simarom                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
355aec3c8f4Simarom                default_encoding_c);
356aec3c8f4Simarom            goto bad;
357aec3c8f4Simarom        }
358aec3c8f4Simarom        Py_DECREF(ascii_chars_u);
359aec3c8f4Simarom        Py_DECREF(ascii_chars_b);
360aec3c8f4Simarom    }
361aec3c8f4Simarom    Py_DECREF(default_encoding);
362aec3c8f4Simarom    return 0;
363aec3c8f4Simarombad:
364aec3c8f4Simarom    Py_XDECREF(default_encoding);
365aec3c8f4Simarom    Py_XDECREF(ascii_chars_u);
366aec3c8f4Simarom    Py_XDECREF(ascii_chars_b);
367aec3c8f4Simarom    return -1;
368aec3c8f4Simarom}
369aec3c8f4Simarom#endif
370aec3c8f4Simarom#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
371aec3c8f4Simarom#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
372aec3c8f4Simarom#else
373aec3c8f4Simarom#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
374aec3c8f4Simarom#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
375aec3c8f4Simaromstatic char* __PYX_DEFAULT_STRING_ENCODING;
376aec3c8f4Simaromstatic int __Pyx_init_sys_getdefaultencoding_params(void) {
377aec3c8f4Simarom    PyObject* sys;
378aec3c8f4Simarom    PyObject* default_encoding = NULL;
379aec3c8f4Simarom    char* default_encoding_c;
380aec3c8f4Simarom    sys = PyImport_ImportModule("sys");
381aec3c8f4Simarom    if (!sys) goto bad;
382aec3c8f4Simarom    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
383aec3c8f4Simarom    Py_DECREF(sys);
384aec3c8f4Simarom    if (!default_encoding) goto bad;
385aec3c8f4Simarom    default_encoding_c = PyBytes_AsString(default_encoding);
386aec3c8f4Simarom    if (!default_encoding_c) goto bad;
387aec3c8f4Simarom    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
388aec3c8f4Simarom    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
389aec3c8f4Simarom    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
390aec3c8f4Simarom    Py_DECREF(default_encoding);
391aec3c8f4Simarom    return 0;
392aec3c8f4Simarombad:
393aec3c8f4Simarom    Py_XDECREF(default_encoding);
394aec3c8f4Simarom    return -1;
395aec3c8f4Simarom}
396aec3c8f4Simarom#endif
397aec3c8f4Simarom#endif
398aec3c8f4Simarom
399aec3c8f4Simarom
400aec3c8f4Simarom/* Test for GCC > 2.95 */
401aec3c8f4Simarom#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
402aec3c8f4Simarom  #define likely(x)   __builtin_expect(!!(x), 1)
403aec3c8f4Simarom  #define unlikely(x) __builtin_expect(!!(x), 0)
404aec3c8f4Simarom#else /* !__GNUC__ or GCC < 2.95 */
405aec3c8f4Simarom  #define likely(x)   (x)
406aec3c8f4Simarom  #define unlikely(x) (x)
407aec3c8f4Simarom#endif /* __GNUC__ */
408aec3c8f4Simarom
409aec3c8f4Simaromstatic PyObject *__pyx_m;
410aec3c8f4Simaromstatic PyObject *__pyx_d;
411aec3c8f4Simaromstatic PyObject *__pyx_b;
412aec3c8f4Simaromstatic PyObject *__pyx_empty_tuple;
413aec3c8f4Simaromstatic PyObject *__pyx_empty_bytes;
414aec3c8f4Simaromstatic int __pyx_lineno;
415aec3c8f4Simaromstatic int __pyx_clineno = 0;
416aec3c8f4Simaromstatic const char * __pyx_cfilenm= __FILE__;
417aec3c8f4Simaromstatic const char *__pyx_filename;
418aec3c8f4Simarom
419aec3c8f4Simarom
420aec3c8f4Simaromstatic const char *__pyx_f[] = {
421aec3c8f4Simarom  "zmq/backend/cython/error.pyx",
422aec3c8f4Simarom};
423aec3c8f4Simarom
424aec3c8f4Simarom/*--- Type declarations ---*/
425aec3c8f4Simarom#ifndef CYTHON_REFNANNY
426aec3c8f4Simarom  #define CYTHON_REFNANNY 0
427aec3c8f4Simarom#endif
428aec3c8f4Simarom#if CYTHON_REFNANNY
429aec3c8f4Simarom  typedef struct {
430aec3c8f4Simarom    void (*INCREF)(void*, PyObject*, int);
431aec3c8f4Simarom    void (*DECREF)(void*, PyObject*, int);
432aec3c8f4Simarom    void (*GOTREF)(void*, PyObject*, int);
433aec3c8f4Simarom    void (*GIVEREF)(void*, PyObject*, int);
434aec3c8f4Simarom    void* (*SetupContext)(const char*, int, const char*);
435aec3c8f4Simarom    void (*FinishContext)(void**);
436aec3c8f4Simarom  } __Pyx_RefNannyAPIStruct;
437aec3c8f4Simarom  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
438aec3c8f4Simarom  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
439aec3c8f4Simarom  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
440aec3c8f4Simarom#ifdef WITH_THREAD
441aec3c8f4Simarom  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
442aec3c8f4Simarom          if (acquire_gil) { \
443aec3c8f4Simarom              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
444aec3c8f4Simarom              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
445aec3c8f4Simarom              PyGILState_Release(__pyx_gilstate_save); \
446aec3c8f4Simarom          } else { \
447aec3c8f4Simarom              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
448aec3c8f4Simarom          }
449aec3c8f4Simarom#else
450aec3c8f4Simarom  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
451aec3c8f4Simarom          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
452aec3c8f4Simarom#endif
453aec3c8f4Simarom  #define __Pyx_RefNannyFinishContext() \
454aec3c8f4Simarom          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
455aec3c8f4Simarom  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
456aec3c8f4Simarom  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
457aec3c8f4Simarom  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
458aec3c8f4Simarom  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
459aec3c8f4Simarom  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
460aec3c8f4Simarom  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
461aec3c8f4Simarom  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
462aec3c8f4Simarom  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
463aec3c8f4Simarom#else
464aec3c8f4Simarom  #define __Pyx_RefNannyDeclarations
465aec3c8f4Simarom  #define __Pyx_RefNannySetupContext(name, acquire_gil)
466aec3c8f4Simarom  #define __Pyx_RefNannyFinishContext()
467aec3c8f4Simarom  #define __Pyx_INCREF(r) Py_INCREF(r)
468aec3c8f4Simarom  #define __Pyx_DECREF(r) Py_DECREF(r)
469aec3c8f4Simarom  #define __Pyx_GOTREF(r)
470aec3c8f4Simarom  #define __Pyx_GIVEREF(r)
471aec3c8f4Simarom  #define __Pyx_XINCREF(r) Py_XINCREF(r)
472aec3c8f4Simarom  #define __Pyx_XDECREF(r) Py_XDECREF(r)
473aec3c8f4Simarom  #define __Pyx_XGOTREF(r)
474aec3c8f4Simarom  #define __Pyx_XGIVEREF(r)
475aec3c8f4Simarom#endif
476aec3c8f4Simarom#define __Pyx_XDECREF_SET(r, v) do {                            \
477aec3c8f4Simarom        PyObject *tmp = (PyObject *) r;                         \
478aec3c8f4Simarom        r = v; __Pyx_XDECREF(tmp);                              \
479aec3c8f4Simarom    } while (0)
480aec3c8f4Simarom#define __Pyx_DECREF_SET(r, v) do {                             \
481aec3c8f4Simarom        PyObject *tmp = (PyObject *) r;                         \
482aec3c8f4Simarom        r = v; __Pyx_DECREF(tmp);                               \
483aec3c8f4Simarom    } while (0)
484aec3c8f4Simarom#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
485aec3c8f4Simarom#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
486aec3c8f4Simarom
487aec3c8f4Simarom#if CYTHON_COMPILING_IN_CPYTHON
488aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
489aec3c8f4Simarom    PyTypeObject* tp = Py_TYPE(obj);
490aec3c8f4Simarom    if (likely(tp->tp_getattro))
491aec3c8f4Simarom        return tp->tp_getattro(obj, attr_name);
492aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
493aec3c8f4Simarom    if (likely(tp->tp_getattr))
494aec3c8f4Simarom        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
495aec3c8f4Simarom#endif
496aec3c8f4Simarom    return PyObject_GetAttr(obj, attr_name);
497aec3c8f4Simarom}
498aec3c8f4Simarom#else
499aec3c8f4Simarom#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
500aec3c8f4Simarom#endif
501aec3c8f4Simarom
502aec3c8f4Simaromstatic PyObject *__Pyx_GetBuiltinName(PyObject *name);
503aec3c8f4Simarom
504aec3c8f4Simaromstatic CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
505aec3c8f4Simarom
506aec3c8f4Simarom#include <string.h>
507aec3c8f4Simarom
508aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_decode_c_string(
509aec3c8f4Simarom         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
510aec3c8f4Simarom         const char* encoding, const char* errors,
511aec3c8f4Simarom         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
512aec3c8f4Simarom
513aec3c8f4Simaromstatic PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
514aec3c8f4Simarom
515aec3c8f4Simaromtypedef struct {
516aec3c8f4Simarom    int code_line;
517aec3c8f4Simarom    PyCodeObject* code_object;
518aec3c8f4Simarom} __Pyx_CodeObjectCacheEntry;
519aec3c8f4Simaromstruct __Pyx_CodeObjectCache {
520aec3c8f4Simarom    int count;
521aec3c8f4Simarom    int max_count;
522aec3c8f4Simarom    __Pyx_CodeObjectCacheEntry* entries;
523aec3c8f4Simarom};
524aec3c8f4Simaromstatic struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
525aec3c8f4Simaromstatic int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
526aec3c8f4Simaromstatic PyCodeObject *__pyx_find_code_object(int code_line);
527aec3c8f4Simaromstatic void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
528aec3c8f4Simarom
529aec3c8f4Simaromstatic void __Pyx_AddTraceback(const char *funcname, int c_line,
530aec3c8f4Simarom                               int py_line, const char *filename);
531aec3c8f4Simarom
532aec3c8f4Simaromstatic PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
533aec3c8f4Simarom
534aec3c8f4Simaromstatic CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
535aec3c8f4Simarom
536aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
537aec3c8f4Simarom
538aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
539aec3c8f4Simarom
540aec3c8f4Simaromstatic CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
541aec3c8f4Simarom
542aec3c8f4Simaromstatic int __Pyx_check_binary_version(void);
543aec3c8f4Simarom
544aec3c8f4Simaromstatic int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
545aec3c8f4Simarom
546aec3c8f4Simarom
547aec3c8f4Simarom/* Module declarations from 'zmq.backend.cython.libzmq' */
548aec3c8f4Simarom
549aec3c8f4Simarom/* Module declarations from 'zmq.backend.cython.error' */
550aec3c8f4Simarom#define __Pyx_MODULE_NAME "zmq.backend.cython.error"
551aec3c8f4Simaromint __pyx_module_is_main_zmq__backend__cython__error = 0;
552aec3c8f4Simarom
553aec3c8f4Simarom/* Implementation of 'zmq.backend.cython.error' */
554aec3c8f4Simaromstatic PyObject *__pyx_pf_3zmq_7backend_6cython_5error_strerror(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_errno); /* proto */
555aec3c8f4Simaromstatic PyObject *__pyx_pf_3zmq_7backend_6cython_5error_2zmq_errno(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
556aec3c8f4Simaromstatic char __pyx_k_all[] = "__all__";
557aec3c8f4Simaromstatic char __pyx_k_main[] = "__main__";
558aec3c8f4Simaromstatic char __pyx_k_test[] = "__test__";
559aec3c8f4Simaromstatic char __pyx_k_bytes[] = "bytes";
560aec3c8f4Simaromstatic char __pyx_k_errno[] = "errno";
561aec3c8f4Simaromstatic char __pyx_k_str_e[] = "str_e";
562aec3c8f4Simaromstatic char __pyx_k_import[] = "__import__";
563aec3c8f4Simaromstatic char __pyx_k_strerror[] = "strerror";
564aec3c8f4Simaromstatic char __pyx_k_zmq_errno[] = "zmq_errno";
565aec3c8f4Simaromstatic char __pyx_k_zmq_utils_strtypes[] = "zmq.utils.strtypes";
566aec3c8f4Simaromstatic char __pyx_k_zmq_backend_cython_error[] = "zmq.backend.cython.error";
567aec3c8f4Simaromstatic char __pyx_k_0MQ_Error_classes_and_functions[] = "0MQ Error classes and functions.";
568aec3c8f4Simaromstatic char __pyx_k_private_tmp_pyzmq_release_zmq_b[] = "/private/tmp/pyzmq-release/zmq/backend/cython/error.pyx";
569aec3c8f4Simaromstatic PyObject *__pyx_n_s_all;
570aec3c8f4Simaromstatic PyObject *__pyx_n_s_bytes;
571aec3c8f4Simaromstatic PyObject *__pyx_n_s_errno;
572aec3c8f4Simaromstatic PyObject *__pyx_n_s_import;
573aec3c8f4Simaromstatic PyObject *__pyx_n_s_main;
574aec3c8f4Simaromstatic PyObject *__pyx_kp_s_private_tmp_pyzmq_release_zmq_b;
575aec3c8f4Simaromstatic PyObject *__pyx_n_s_str_e;
576aec3c8f4Simaromstatic PyObject *__pyx_n_s_strerror;
577aec3c8f4Simaromstatic PyObject *__pyx_n_s_test;
578aec3c8f4Simaromstatic PyObject *__pyx_n_s_zmq_backend_cython_error;
579aec3c8f4Simaromstatic PyObject *__pyx_n_s_zmq_errno;
580aec3c8f4Simaromstatic PyObject *__pyx_n_s_zmq_utils_strtypes;
581aec3c8f4Simaromstatic PyObject *__pyx_tuple_;
582aec3c8f4Simaromstatic PyObject *__pyx_codeobj__2;
583aec3c8f4Simaromstatic PyObject *__pyx_codeobj__3;
584aec3c8f4Simarom
585aec3c8f4Simarom/* "zmq/backend/cython/error.pyx":34
586aec3c8f4Simarom * from zmq.utils.strtypes import bytes
587aec3c8f4Simarom *
588aec3c8f4Simarom * def strerror(int errno):             # <<<<<<<<<<<<<<
589aec3c8f4Simarom *     """strerror(errno)
590aec3c8f4Simarom *
591aec3c8f4Simarom */
592aec3c8f4Simarom
593aec3c8f4Simarom/* Python wrapper */
594aec3c8f4Simaromstatic PyObject *__pyx_pw_3zmq_7backend_6cython_5error_1strerror(PyObject *__pyx_self, PyObject *__pyx_arg_errno); /*proto*/
595aec3c8f4Simaromstatic char __pyx_doc_3zmq_7backend_6cython_5error_strerror[] = "strerror(errno)\n\n    Return the error string given the error number.\n    ";
596aec3c8f4Simaromstatic PyMethodDef __pyx_mdef_3zmq_7backend_6cython_5error_1strerror = {"strerror", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_5error_1strerror, METH_O, __pyx_doc_3zmq_7backend_6cython_5error_strerror};
597aec3c8f4Simaromstatic PyObject *__pyx_pw_3zmq_7backend_6cython_5error_1strerror(PyObject *__pyx_self, PyObject *__pyx_arg_errno) {
598aec3c8f4Simarom  int __pyx_v_errno;
599aec3c8f4Simarom  int __pyx_lineno = 0;
600aec3c8f4Simarom  const char *__pyx_filename = NULL;
601aec3c8f4Simarom  int __pyx_clineno = 0;
602aec3c8f4Simarom  PyObject *__pyx_r = 0;
603aec3c8f4Simarom  __Pyx_RefNannyDeclarations
604aec3c8f4Simarom  __Pyx_RefNannySetupContext("strerror (wrapper)", 0);
605aec3c8f4Simarom  assert(__pyx_arg_errno); {
606aec3c8f4Simarom    __pyx_v_errno = __Pyx_PyInt_As_int(__pyx_arg_errno); if (unlikely((__pyx_v_errno == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
607aec3c8f4Simarom  }
608aec3c8f4Simarom  goto __pyx_L4_argument_unpacking_done;
609aec3c8f4Simarom  __pyx_L3_error:;
610aec3c8f4Simarom  __Pyx_AddTraceback("zmq.backend.cython.error.strerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
611aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
612aec3c8f4Simarom  return NULL;
613aec3c8f4Simarom  __pyx_L4_argument_unpacking_done:;
614aec3c8f4Simarom  __pyx_r = __pyx_pf_3zmq_7backend_6cython_5error_strerror(__pyx_self, ((int)__pyx_v_errno));
615aec3c8f4Simarom
616aec3c8f4Simarom  /* function exit code */
617aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
618aec3c8f4Simarom  return __pyx_r;
619aec3c8f4Simarom}
620aec3c8f4Simarom
621aec3c8f4Simaromstatic PyObject *__pyx_pf_3zmq_7backend_6cython_5error_strerror(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_errno) {
622aec3c8f4Simarom  const char* __pyx_v_str_e;
623aec3c8f4Simarom  PyObject *__pyx_r = NULL;
624aec3c8f4Simarom  __Pyx_RefNannyDeclarations
625aec3c8f4Simarom  PyObject *__pyx_t_1 = NULL;
626aec3c8f4Simarom  int __pyx_t_2;
627aec3c8f4Simarom  int __pyx_t_3;
628aec3c8f4Simarom  int __pyx_lineno = 0;
629aec3c8f4Simarom  const char *__pyx_filename = NULL;
630aec3c8f4Simarom  int __pyx_clineno = 0;
631aec3c8f4Simarom  __Pyx_RefNannySetupContext("strerror", 0);
632aec3c8f4Simarom
633aec3c8f4Simarom  /* "zmq/backend/cython/error.pyx":41
634aec3c8f4Simarom *     cdef const_char_ptr str_e
635aec3c8f4Simarom *     # char * will be a bytes object:
636aec3c8f4Simarom *     str_e = zmq_strerror(errno)             # <<<<<<<<<<<<<<
637aec3c8f4Simarom *     if str is bytes:
638aec3c8f4Simarom *         # Python 2: str is bytes, so we already have the right type
639aec3c8f4Simarom */
640aec3c8f4Simarom  __pyx_v_str_e = zmq_strerror(__pyx_v_errno);
641aec3c8f4Simarom
642aec3c8f4Simarom  /* "zmq/backend/cython/error.pyx":42
643aec3c8f4Simarom *     # char * will be a bytes object:
644aec3c8f4Simarom *     str_e = zmq_strerror(errno)
645aec3c8f4Simarom *     if str is bytes:             # <<<<<<<<<<<<<<
646aec3c8f4Simarom *         # Python 2: str is bytes, so we already have the right type
647aec3c8f4Simarom *         return str_e
648aec3c8f4Simarom */
649aec3c8f4Simarom  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
650aec3c8f4Simarom  __Pyx_GOTREF(__pyx_t_1);
651aec3c8f4Simarom  __pyx_t_2 = (((PyObject*)(&PyString_Type)) == ((PyObject*)__pyx_t_1));
652aec3c8f4Simarom  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
653aec3c8f4Simarom  __pyx_t_3 = (__pyx_t_2 != 0);
654aec3c8f4Simarom  if (__pyx_t_3) {
655aec3c8f4Simarom
656aec3c8f4Simarom    /* "zmq/backend/cython/error.pyx":44
657aec3c8f4Simarom *     if str is bytes:
658aec3c8f4Simarom *         # Python 2: str is bytes, so we already have the right type
659aec3c8f4Simarom *         return str_e             # <<<<<<<<<<<<<<
660aec3c8f4Simarom *     else:
661aec3c8f4Simarom *         # Python 3: decode bytes to unicode str
662aec3c8f4Simarom */
663aec3c8f4Simarom    __Pyx_XDECREF(__pyx_r);
664aec3c8f4Simarom    __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_str_e); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
665aec3c8f4Simarom    __Pyx_GOTREF(__pyx_t_1);
666aec3c8f4Simarom    __pyx_r = __pyx_t_1;
667aec3c8f4Simarom    __pyx_t_1 = 0;
668aec3c8f4Simarom    goto __pyx_L0;
669aec3c8f4Simarom  }
670aec3c8f4Simarom  /*else*/ {
671aec3c8f4Simarom
672aec3c8f4Simarom    /* "zmq/backend/cython/error.pyx":47
673aec3c8f4Simarom *     else:
674aec3c8f4Simarom *         # Python 3: decode bytes to unicode str
675aec3c8f4Simarom *         return str_e.decode()             # <<<<<<<<<<<<<<
676aec3c8f4Simarom *
677aec3c8f4Simarom * def zmq_errno():
678aec3c8f4Simarom */
679aec3c8f4Simarom    __Pyx_XDECREF(__pyx_r);
680aec3c8f4Simarom    __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_str_e, 0, strlen(__pyx_v_str_e), NULL, NULL, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
681aec3c8f4Simarom    __Pyx_GOTREF(__pyx_t_1);
682aec3c8f4Simarom    __pyx_r = __pyx_t_1;
683aec3c8f4Simarom    __pyx_t_1 = 0;
684aec3c8f4Simarom    goto __pyx_L0;
685aec3c8f4Simarom  }
686aec3c8f4Simarom
687aec3c8f4Simarom  /* "zmq/backend/cython/error.pyx":34
688aec3c8f4Simarom * from zmq.utils.strtypes import bytes
689aec3c8f4Simarom *
690aec3c8f4Simarom * def strerror(int errno):             # <<<<<<<<<<<<<<
691aec3c8f4Simarom *     """strerror(errno)
692aec3c8f4Simarom *
693aec3c8f4Simarom */
694aec3c8f4Simarom
695aec3c8f4Simarom  /* function exit code */
696aec3c8f4Simarom  __pyx_L1_error:;
697aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_1);
698aec3c8f4Simarom  __Pyx_AddTraceback("zmq.backend.cython.error.strerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
699aec3c8f4Simarom  __pyx_r = NULL;
700aec3c8f4Simarom  __pyx_L0:;
701aec3c8f4Simarom  __Pyx_XGIVEREF(__pyx_r);
702aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
703aec3c8f4Simarom  return __pyx_r;
704aec3c8f4Simarom}
705aec3c8f4Simarom
706aec3c8f4Simarom/* "zmq/backend/cython/error.pyx":49
707aec3c8f4Simarom *         return str_e.decode()
708aec3c8f4Simarom *
709aec3c8f4Simarom * def zmq_errno():             # <<<<<<<<<<<<<<
710aec3c8f4Simarom *     """zmq_errno()
711aec3c8f4Simarom *
712aec3c8f4Simarom */
713aec3c8f4Simarom
714aec3c8f4Simarom/* Python wrapper */
715aec3c8f4Simaromstatic PyObject *__pyx_pw_3zmq_7backend_6cython_5error_3zmq_errno(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
716aec3c8f4Simaromstatic char __pyx_doc_3zmq_7backend_6cython_5error_2zmq_errno[] = "zmq_errno()\n    \n    Return the integer errno of the most recent zmq error.\n    ";
717aec3c8f4Simaromstatic PyMethodDef __pyx_mdef_3zmq_7backend_6cython_5error_3zmq_errno = {"zmq_errno", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_5error_3zmq_errno, METH_NOARGS, __pyx_doc_3zmq_7backend_6cython_5error_2zmq_errno};
718aec3c8f4Simaromstatic PyObject *__pyx_pw_3zmq_7backend_6cython_5error_3zmq_errno(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
719aec3c8f4Simarom  PyObject *__pyx_r = 0;
720aec3c8f4Simarom  __Pyx_RefNannyDeclarations
721aec3c8f4Simarom  __Pyx_RefNannySetupContext("zmq_errno (wrapper)", 0);
722aec3c8f4Simarom  __pyx_r = __pyx_pf_3zmq_7backend_6cython_5error_2zmq_errno(__pyx_self);
723aec3c8f4Simarom
724aec3c8f4Simarom  /* function exit code */
725aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
726aec3c8f4Simarom  return __pyx_r;
727aec3c8f4Simarom}
728aec3c8f4Simarom
729aec3c8f4Simaromstatic PyObject *__pyx_pf_3zmq_7backend_6cython_5error_2zmq_errno(CYTHON_UNUSED PyObject *__pyx_self) {
730aec3c8f4Simarom  PyObject *__pyx_r = NULL;
731aec3c8f4Simarom  __Pyx_RefNannyDeclarations
732aec3c8f4Simarom  PyObject *__pyx_t_1 = NULL;
733aec3c8f4Simarom  int __pyx_lineno = 0;
734aec3c8f4Simarom  const char *__pyx_filename = NULL;
735aec3c8f4Simarom  int __pyx_clineno = 0;
736aec3c8f4Simarom  __Pyx_RefNannySetupContext("zmq_errno", 0);
737aec3c8f4Simarom
738aec3c8f4Simarom  /* "zmq/backend/cython/error.pyx":54
739aec3c8f4Simarom *     Return the integer errno of the most recent zmq error.
740aec3c8f4Simarom *     """
741aec3c8f4Simarom *     return zmq_errno_c()             # <<<<<<<<<<<<<<
742aec3c8f4Simarom *
743aec3c8f4Simarom * __all__ = ['strerror', 'zmq_errno']
744aec3c8f4Simarom */
745aec3c8f4Simarom  __Pyx_XDECREF(__pyx_r);
746aec3c8f4Simarom  __pyx_t_1 = __Pyx_PyInt_From_int(zmq_errno()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
747aec3c8f4Simarom  __Pyx_GOTREF(__pyx_t_1);
748aec3c8f4Simarom  __pyx_r = __pyx_t_1;
749aec3c8f4Simarom  __pyx_t_1 = 0;
750aec3c8f4Simarom  goto __pyx_L0;
751aec3c8f4Simarom
752aec3c8f4Simarom  /* "zmq/backend/cython/error.pyx":49
753aec3c8f4Simarom *         return str_e.decode()
754aec3c8f4Simarom *
755aec3c8f4Simarom * def zmq_errno():             # <<<<<<<<<<<<<<
756aec3c8f4Simarom *     """zmq_errno()
757aec3c8f4Simarom *
758aec3c8f4Simarom */
759aec3c8f4Simarom
760aec3c8f4Simarom  /* function exit code */
761aec3c8f4Simarom  __pyx_L1_error:;
762aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_1);
763aec3c8f4Simarom  __Pyx_AddTraceback("zmq.backend.cython.error.zmq_errno", __pyx_clineno, __pyx_lineno, __pyx_filename);
764aec3c8f4Simarom  __pyx_r = NULL;
765aec3c8f4Simarom  __pyx_L0:;
766aec3c8f4Simarom  __Pyx_XGIVEREF(__pyx_r);
767aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
768aec3c8f4Simarom  return __pyx_r;
769aec3c8f4Simarom}
770aec3c8f4Simarom
771aec3c8f4Simaromstatic PyMethodDef __pyx_methods[] = {
772aec3c8f4Simarom  {0, 0, 0, 0}
773aec3c8f4Simarom};
774aec3c8f4Simarom
775aec3c8f4Simarom#if PY_MAJOR_VERSION >= 3
776aec3c8f4Simaromstatic struct PyModuleDef __pyx_moduledef = {
777aec3c8f4Simarom  #if PY_VERSION_HEX < 0x03020000
778aec3c8f4Simarom    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
779aec3c8f4Simarom  #else
780aec3c8f4Simarom    PyModuleDef_HEAD_INIT,
781aec3c8f4Simarom  #endif
782aec3c8f4Simarom    "error",
783aec3c8f4Simarom    __pyx_k_0MQ_Error_classes_and_functions, /* m_doc */
784aec3c8f4Simarom    -1, /* m_size */
785aec3c8f4Simarom    __pyx_methods /* m_methods */,
786aec3c8f4Simarom    NULL, /* m_reload */
787aec3c8f4Simarom    NULL, /* m_traverse */
788aec3c8f4Simarom    NULL, /* m_clear */
789aec3c8f4Simarom    NULL /* m_free */
790aec3c8f4Simarom};
791aec3c8f4Simarom#endif
792aec3c8f4Simarom
793aec3c8f4Simaromstatic __Pyx_StringTabEntry __pyx_string_tab[] = {
794aec3c8f4Simarom  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
795aec3c8f4Simarom  {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1},
796aec3c8f4Simarom  {&__pyx_n_s_errno, __pyx_k_errno, sizeof(__pyx_k_errno), 0, 0, 1, 1},
797aec3c8f4Simarom  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
798aec3c8f4Simarom  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
799aec3c8f4Simarom  {&__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},
800aec3c8f4Simarom  {&__pyx_n_s_str_e, __pyx_k_str_e, sizeof(__pyx_k_str_e), 0, 0, 1, 1},
801aec3c8f4Simarom  {&__pyx_n_s_strerror, __pyx_k_strerror, sizeof(__pyx_k_strerror), 0, 0, 1, 1},
802aec3c8f4Simarom  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
803aec3c8f4Simarom  {&__pyx_n_s_zmq_backend_cython_error, __pyx_k_zmq_backend_cython_error, sizeof(__pyx_k_zmq_backend_cython_error), 0, 0, 1, 1},
804aec3c8f4Simarom  {&__pyx_n_s_zmq_errno, __pyx_k_zmq_errno, sizeof(__pyx_k_zmq_errno), 0, 0, 1, 1},
805aec3c8f4Simarom  {&__pyx_n_s_zmq_utils_strtypes, __pyx_k_zmq_utils_strtypes, sizeof(__pyx_k_zmq_utils_strtypes), 0, 0, 1, 1},
806aec3c8f4Simarom  {0, 0, 0, 0, 0, 0, 0}
807aec3c8f4Simarom};
808aec3c8f4Simaromstatic int __Pyx_InitCachedBuiltins(void) {
809aec3c8f4Simarom  return 0;
810aec3c8f4Simarom}
811aec3c8f4Simarom
812aec3c8f4Simaromstatic int __Pyx_InitCachedConstants(void) {
813aec3c8f4Simarom  __Pyx_RefNannyDeclarations
814aec3c8f4Simarom  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
815aec3c8f4Simarom
816aec3c8f4Simarom  /* "zmq/backend/cython/error.pyx":34
817aec3c8f4Simarom * from zmq.utils.strtypes import bytes
818aec3c8f4Simarom *
819aec3c8f4Simarom * def strerror(int errno):             # <<<<<<<<<<<<<<
820aec3c8f4Simarom *     """strerror(errno)
821aec3c8f4Simarom *
822aec3c8f4Simarom */
823aec3c8f4Simarom  __pyx_tuple_ = PyTuple_Pack(3, __pyx_n_s_errno, __pyx_n_s_errno, __pyx_n_s_str_e); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
824aec3c8f4Simarom  __Pyx_GOTREF(__pyx_tuple_);
825aec3c8f4Simarom  __Pyx_GIVEREF(__pyx_tuple_);
826aec3c8f4Simarom  __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 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_strerror, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
827aec3c8f4Simarom
828aec3c8f4Simarom  /* "zmq/backend/cython/error.pyx":49
829aec3c8f4Simarom *         return str_e.decode()
830aec3c8f4Simarom *
831aec3c8f4Simarom * def zmq_errno():             # <<<<<<<<<<<<<<
832aec3c8f4Simarom *     """zmq_errno()
833aec3c8f4Simarom *
834aec3c8f4Simarom */
835aec3c8f4Simarom  __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_pyzmq_release_zmq_b, __pyx_n_s_zmq_errno, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
836aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
837aec3c8f4Simarom  return 0;
838aec3c8f4Simarom  __pyx_L1_error:;
839aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
840aec3c8f4Simarom  return -1;
841aec3c8f4Simarom}
842aec3c8f4Simarom
843aec3c8f4Simaromstatic int __Pyx_InitGlobals(void) {
844aec3c8f4Simarom  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
845aec3c8f4Simarom  return 0;
846aec3c8f4Simarom  __pyx_L1_error:;
847aec3c8f4Simarom  return -1;
848aec3c8f4Simarom}
849aec3c8f4Simarom
850aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
851aec3c8f4SimaromPyMODINIT_FUNC initerror(void); /*proto*/
852aec3c8f4SimaromPyMODINIT_FUNC initerror(void)
853aec3c8f4Simarom#else
854aec3c8f4SimaromPyMODINIT_FUNC PyInit_error(void); /*proto*/
855aec3c8f4SimaromPyMODINIT_FUNC PyInit_error(void)
856aec3c8f4Simarom#endif
857aec3c8f4Simarom{
858aec3c8f4Simarom  PyObject *__pyx_t_1 = NULL;
859aec3c8f4Simarom  PyObject *__pyx_t_2 = NULL;
860aec3c8f4Simarom  int __pyx_lineno = 0;
861aec3c8f4Simarom  const char *__pyx_filename = NULL;
862aec3c8f4Simarom  int __pyx_clineno = 0;
863aec3c8f4Simarom  __Pyx_RefNannyDeclarations
864aec3c8f4Simarom  #if CYTHON_REFNANNY
865aec3c8f4Simarom  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
866aec3c8f4Simarom  if (!__Pyx_RefNanny) {
867aec3c8f4Simarom      PyErr_Clear();
868aec3c8f4Simarom      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
869aec3c8f4Simarom      if (!__Pyx_RefNanny)
870aec3c8f4Simarom          Py_FatalError("failed to import 'refnanny' module");
871aec3c8f4Simarom  }
872aec3c8f4Simarom  #endif
873aec3c8f4Simarom  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_error(void)", 0);
874aec3c8f4Simarom  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
875aec3c8f4Simarom  __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;}
876aec3c8f4Simarom  __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;}
877aec3c8f4Simarom  #ifdef __Pyx_CyFunction_USED
878aec3c8f4Simarom  if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
879aec3c8f4Simarom  #endif
880aec3c8f4Simarom  #ifdef __Pyx_FusedFunction_USED
881aec3c8f4Simarom  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
882aec3c8f4Simarom  #endif
883aec3c8f4Simarom  #ifdef __Pyx_Generator_USED
884aec3c8f4Simarom  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
885aec3c8f4Simarom  #endif
886aec3c8f4Simarom  /*--- Library function declarations ---*/
887aec3c8f4Simarom  /*--- Threads initialization code ---*/
888aec3c8f4Simarom  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
889aec3c8f4Simarom  #ifdef WITH_THREAD /* Python build with threading support? */
890aec3c8f4Simarom  PyEval_InitThreads();
891aec3c8f4Simarom  #endif
892aec3c8f4Simarom  #endif
893aec3c8f4Simarom  /*--- Module creation code ---*/
894aec3c8f4Simarom  #if PY_MAJOR_VERSION < 3
895aec3c8f4Simarom  __pyx_m = Py_InitModule4("error", __pyx_methods, __pyx_k_0MQ_Error_classes_and_functions, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
896aec3c8f4Simarom  #else
897aec3c8f4Simarom  __pyx_m = PyModule_Create(&__pyx_moduledef);
898aec3c8f4Simarom  #endif
899aec3c8f4Simarom  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
900aec3c8f4Simarom  __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;}
901aec3c8f4Simarom  Py_INCREF(__pyx_d);
902aec3c8f4Simarom  __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;}
903aec3c8f4Simarom  #if CYTHON_COMPILING_IN_PYPY
904aec3c8f4Simarom  Py_INCREF(__pyx_b);
905aec3c8f4Simarom  #endif
906aec3c8f4Simarom  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
907aec3c8f4Simarom  /*--- Initialize various global constants etc. ---*/
908aec3c8f4Simarom  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
909aec3c8f4Simarom  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
910aec3c8f4Simarom  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
911aec3c8f4Simarom  #endif
912aec3c8f4Simarom  if (__pyx_module_is_main_zmq__backend__cython__error) {
913aec3c8f4Simarom    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;};
914aec3c8f4Simarom  }
915aec3c8f4Simarom  #if PY_MAJOR_VERSION >= 3
916aec3c8f4Simarom  {
917aec3c8f4Simarom    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
918aec3c8f4Simarom    if (!PyDict_GetItemString(modules, "zmq.backend.cython.error")) {
919aec3c8f4Simarom      if (unlikely(PyDict_SetItemString(modules, "zmq.backend.cython.error", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
920aec3c8f4Simarom    }
921aec3c8f4Simarom  }
922aec3c8f4Simarom  #endif
923aec3c8f4Simarom  /*--- Builtin init code ---*/
924aec3c8f4Simarom  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
925aec3c8f4Simarom  /*--- Constants init code ---*/
926aec3c8f4Simarom  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
927aec3c8f4Simarom  /*--- Global init code ---*/
928aec3c8f4Simarom  /*--- Variable export code ---*/
929aec3c8f4Simarom  /*--- Function export code ---*/
930aec3c8f4Simarom  /*--- Type init code ---*/
931aec3c8f4Simarom  /*--- Type import code ---*/
932aec3c8f4Simarom  /*--- Variable import code ---*/
933aec3c8f4Simarom  /*--- Function import code ---*/
934aec3c8f4Simarom  /*--- Execution code ---*/
935aec3c8f4Simarom
936aec3c8f4Simarom  /* "zmq/backend/cython/error.pyx":32
937aec3c8f4Simarom * from libzmq cimport zmq_strerror, zmq_errno as zmq_errno_c
938aec3c8f4Simarom *
939aec3c8f4Simarom * from zmq.utils.strtypes import bytes             # <<<<<<<<<<<<<<
940aec3c8f4Simarom *
941aec3c8f4Simarom * def strerror(int errno):
942aec3c8f4Simarom */
943aec3c8f4Simarom  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
944aec3c8f4Simarom  __Pyx_GOTREF(__pyx_t_1);
945aec3c8f4Simarom  __Pyx_INCREF(__pyx_n_s_bytes);
946aec3c8f4Simarom  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_bytes);
947aec3c8f4Simarom  __Pyx_GIVEREF(__pyx_n_s_bytes);
948aec3c8f4Simarom  __pyx_t_2 = __Pyx_Import(__pyx_n_s_zmq_utils_strtypes, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
949aec3c8f4Simarom  __Pyx_GOTREF(__pyx_t_2);
950aec3c8f4Simarom  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
951aec3c8f4Simarom  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
952aec3c8f4Simarom  __Pyx_GOTREF(__pyx_t_1);
953aec3c8f4Simarom  if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
954aec3c8f4Simarom  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
955aec3c8f4Simarom  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
956aec3c8f4Simarom
957aec3c8f4Simarom  /* "zmq/backend/cython/error.pyx":34
958aec3c8f4Simarom * from zmq.utils.strtypes import bytes
959aec3c8f4Simarom *
960aec3c8f4Simarom * def strerror(int errno):             # <<<<<<<<<<<<<<
961aec3c8f4Simarom *     """strerror(errno)
962aec3c8f4Simarom *
963aec3c8f4Simarom */
964aec3c8f4Simarom  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3zmq_7backend_6cython_5error_1strerror, NULL, __pyx_n_s_zmq_backend_cython_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
965aec3c8f4Simarom  __Pyx_GOTREF(__pyx_t_2);
966aec3c8f4Simarom  if (PyDict_SetItem(__pyx_d, __pyx_n_s_strerror, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
967aec3c8f4Simarom  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
968aec3c8f4Simarom
969aec3c8f4Simarom  /* "zmq/backend/cython/error.pyx":49
970aec3c8f4Simarom *         return str_e.decode()
971aec3c8f4Simarom *
972aec3c8f4Simarom * def zmq_errno():             # <<<<<<<<<<<<<<
973aec3c8f4Simarom *     """zmq_errno()
974aec3c8f4Simarom *
975aec3c8f4Simarom */
976aec3c8f4Simarom  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3zmq_7backend_6cython_5error_3zmq_errno, NULL, __pyx_n_s_zmq_backend_cython_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
977aec3c8f4Simarom  __Pyx_GOTREF(__pyx_t_2);
978aec3c8f4Simarom  if (PyDict_SetItem(__pyx_d, __pyx_n_s_zmq_errno, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
979aec3c8f4Simarom  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
980aec3c8f4Simarom
981aec3c8f4Simarom  /* "zmq/backend/cython/error.pyx":56
982aec3c8f4Simarom *     return zmq_errno_c()
983aec3c8f4Simarom *
984aec3c8f4Simarom * __all__ = ['strerror', 'zmq_errno']             # <<<<<<<<<<<<<<
985aec3c8f4Simarom */
986aec3c8f4Simarom  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
987aec3c8f4Simarom  __Pyx_GOTREF(__pyx_t_2);
988aec3c8f4Simarom  __Pyx_INCREF(__pyx_n_s_strerror);
989aec3c8f4Simarom  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_strerror);
990aec3c8f4Simarom  __Pyx_GIVEREF(__pyx_n_s_strerror);
991aec3c8f4Simarom  __Pyx_INCREF(__pyx_n_s_zmq_errno);
992aec3c8f4Simarom  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_zmq_errno);
993aec3c8f4Simarom  __Pyx_GIVEREF(__pyx_n_s_zmq_errno);
994aec3c8f4Simarom  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
995aec3c8f4Simarom  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
996aec3c8f4Simarom
997aec3c8f4Simarom  /* "zmq/backend/cython/error.pyx":1
998aec3c8f4Simarom * """0MQ Error classes and functions."""             # <<<<<<<<<<<<<<
999aec3c8f4Simarom *
1000aec3c8f4Simarom * #
1001aec3c8f4Simarom */
1002aec3c8f4Simarom  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1003aec3c8f4Simarom  __Pyx_GOTREF(__pyx_t_2);
1004aec3c8f4Simarom  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1005aec3c8f4Simarom  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1006aec3c8f4Simarom
1007aec3c8f4Simarom  /*--- Wrapped vars code ---*/
1008aec3c8f4Simarom
1009aec3c8f4Simarom  goto __pyx_L0;
1010aec3c8f4Simarom  __pyx_L1_error:;
1011aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_1);
1012aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_2);
1013aec3c8f4Simarom  if (__pyx_m) {
1014aec3c8f4Simarom    if (__pyx_d) {
1015aec3c8f4Simarom      __Pyx_AddTraceback("init zmq.backend.cython.error", __pyx_clineno, __pyx_lineno, __pyx_filename);
1016aec3c8f4Simarom    }
1017aec3c8f4Simarom    Py_DECREF(__pyx_m); __pyx_m = 0;
1018aec3c8f4Simarom  } else if (!PyErr_Occurred()) {
1019aec3c8f4Simarom    PyErr_SetString(PyExc_ImportError, "init zmq.backend.cython.error");
1020aec3c8f4Simarom  }
1021aec3c8f4Simarom  __pyx_L0:;
1022aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
1023aec3c8f4Simarom  #if PY_MAJOR_VERSION < 3
1024aec3c8f4Simarom  return;
1025aec3c8f4Simarom  #else
1026aec3c8f4Simarom  return __pyx_m;
1027aec3c8f4Simarom  #endif
1028aec3c8f4Simarom}
1029aec3c8f4Simarom
1030aec3c8f4Simarom/* Runtime support code */
1031aec3c8f4Simarom#if CYTHON_REFNANNY
1032aec3c8f4Simaromstatic __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
1033aec3c8f4Simarom    PyObject *m = NULL, *p = NULL;
1034aec3c8f4Simarom    void *r = NULL;
1035aec3c8f4Simarom    m = PyImport_ImportModule((char *)modname);
1036aec3c8f4Simarom    if (!m) goto end;
1037aec3c8f4Simarom    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
1038aec3c8f4Simarom    if (!p) goto end;
1039aec3c8f4Simarom    r = PyLong_AsVoidPtr(p);
1040aec3c8f4Simaromend:
1041aec3c8f4Simarom    Py_XDECREF(p);
1042aec3c8f4Simarom    Py_XDECREF(m);
1043aec3c8f4Simarom    return (__Pyx_RefNannyAPIStruct *)r;
1044aec3c8f4Simarom}
1045aec3c8f4Simarom#endif
1046aec3c8f4Simarom
1047aec3c8f4Simaromstatic PyObject *__Pyx_GetBuiltinName(PyObject *name) {
1048aec3c8f4Simarom    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
1049aec3c8f4Simarom    if (unlikely(!result)) {
1050aec3c8f4Simarom        PyErr_Format(PyExc_NameError,
1051aec3c8f4Simarom#if PY_MAJOR_VERSION >= 3
1052aec3c8f4Simarom            "name '%U' is not defined", name);
1053aec3c8f4Simarom#else
1054aec3c8f4Simarom            "name '%.200s' is not defined", PyString_AS_STRING(name));
1055aec3c8f4Simarom#endif
1056aec3c8f4Simarom    }
1057aec3c8f4Simarom    return result;
1058aec3c8f4Simarom}
1059aec3c8f4Simarom
1060aec3c8f4Simaromstatic CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
1061aec3c8f4Simarom    PyObject *result;
1062aec3c8f4Simarom#if CYTHON_COMPILING_IN_CPYTHON
1063aec3c8f4Simarom    result = PyDict_GetItem(__pyx_d, name);
1064aec3c8f4Simarom    if (likely(result)) {
1065aec3c8f4Simarom        Py_INCREF(result);
1066aec3c8f4Simarom    } else {
1067aec3c8f4Simarom#else
1068aec3c8f4Simarom    result = PyObject_GetItem(__pyx_d, name);
1069aec3c8f4Simarom    if (!result) {
1070aec3c8f4Simarom        PyErr_Clear();
1071aec3c8f4Simarom#endif
1072aec3c8f4Simarom        result = __Pyx_GetBuiltinName(name);
1073aec3c8f4Simarom    }
1074aec3c8f4Simarom    return result;
1075aec3c8f4Simarom}
1076aec3c8f4Simarom
1077aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1078aec3c8f4Simarom         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1079aec3c8f4Simarom         const char* encoding, const char* errors,
1080aec3c8f4Simarom         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
1081aec3c8f4Simarom    Py_ssize_t length;
1082aec3c8f4Simarom    if (unlikely((start < 0) | (stop < 0))) {
1083aec3c8f4Simarom        length = strlen(cstring);
1084aec3c8f4Simarom        if (start < 0) {
1085aec3c8f4Simarom            start += length;
1086aec3c8f4Simarom            if (start < 0)
1087aec3c8f4Simarom                start = 0;
1088aec3c8f4Simarom        }
1089aec3c8f4Simarom        if (stop < 0)
1090aec3c8f4Simarom            stop += length;
1091aec3c8f4Simarom    }
1092aec3c8f4Simarom    length = stop - start;
1093aec3c8f4Simarom    if (unlikely(length <= 0))
1094aec3c8f4Simarom        return PyUnicode_FromUnicode(NULL, 0);
1095aec3c8f4Simarom    cstring += start;
1096aec3c8f4Simarom    if (decode_func) {
1097aec3c8f4Simarom        return decode_func(cstring, length, errors);
1098aec3c8f4Simarom    } else {
1099aec3c8f4Simarom        return PyUnicode_Decode(cstring, length, encoding, errors);
1100aec3c8f4Simarom    }
1101aec3c8f4Simarom}
1102aec3c8f4Simarom
1103aec3c8f4Simaromstatic PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
1104aec3c8f4Simarom    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
1105aec3c8f4Simarom    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
1106aec3c8f4Simarom        PyErr_Format(PyExc_ImportError,
1107aec3c8f4Simarom        #if PY_MAJOR_VERSION < 3
1108aec3c8f4Simarom            "cannot import name %.230s", PyString_AS_STRING(name));
1109aec3c8f4Simarom        #else
1110aec3c8f4Simarom            "cannot import name %S", name);
1111aec3c8f4Simarom        #endif
1112aec3c8f4Simarom    }
1113aec3c8f4Simarom    return value;
1114aec3c8f4Simarom}
1115aec3c8f4Simarom
1116aec3c8f4Simaromstatic int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
1117aec3c8f4Simarom    int start = 0, mid = 0, end = count - 1;
1118aec3c8f4Simarom    if (end >= 0 && code_line > entries[end].code_line) {
1119aec3c8f4Simarom        return count;
1120aec3c8f4Simarom    }
1121aec3c8f4Simarom    while (start < end) {
1122aec3c8f4Simarom        mid = (start + end) / 2;
1123aec3c8f4Simarom        if (code_line < entries[mid].code_line) {
1124aec3c8f4Simarom            end = mid;
1125aec3c8f4Simarom        } else if (code_line > entries[mid].code_line) {
1126aec3c8f4Simarom             start = mid + 1;
1127aec3c8f4Simarom        } else {
1128aec3c8f4Simarom            return mid;
1129aec3c8f4Simarom        }
1130aec3c8f4Simarom    }
1131aec3c8f4Simarom    if (code_line <= entries[mid].code_line) {
1132aec3c8f4Simarom        return mid;
1133aec3c8f4Simarom    } else {
1134aec3c8f4Simarom        return mid + 1;
1135aec3c8f4Simarom    }
1136aec3c8f4Simarom}
1137aec3c8f4Simaromstatic PyCodeObject *__pyx_find_code_object(int code_line) {
1138aec3c8f4Simarom    PyCodeObject* code_object;
1139aec3c8f4Simarom    int pos;
1140aec3c8f4Simarom    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
1141aec3c8f4Simarom        return NULL;
1142aec3c8f4Simarom    }
1143aec3c8f4Simarom    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
1144aec3c8f4Simarom    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
1145aec3c8f4Simarom        return NULL;
1146aec3c8f4Simarom    }
1147aec3c8f4Simarom    code_object = __pyx_code_cache.entries[pos].code_object;
1148aec3c8f4Simarom    Py_INCREF(code_object);
1149aec3c8f4Simarom    return code_object;
1150aec3c8f4Simarom}
1151aec3c8f4Simaromstatic void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
1152aec3c8f4Simarom    int pos, i;
1153aec3c8f4Simarom    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
1154aec3c8f4Simarom    if (unlikely(!code_line)) {
1155aec3c8f4Simarom        return;
1156aec3c8f4Simarom    }
1157aec3c8f4Simarom    if (unlikely(!entries)) {
1158aec3c8f4Simarom        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
1159aec3c8f4Simarom        if (likely(entries)) {
1160aec3c8f4Simarom            __pyx_code_cache.entries = entries;
1161aec3c8f4Simarom            __pyx_code_cache.max_count = 64;
1162aec3c8f4Simarom            __pyx_code_cache.count = 1;
1163aec3c8f4Simarom            entries[0].code_line = code_line;
1164aec3c8f4Simarom            entries[0].code_object = code_object;
1165aec3c8f4Simarom            Py_INCREF(code_object);
1166aec3c8f4Simarom        }
1167aec3c8f4Simarom        return;
1168aec3c8f4Simarom    }
1169aec3c8f4Simarom    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
1170aec3c8f4Simarom    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
1171aec3c8f4Simarom        PyCodeObject* tmp = entries[pos].code_object;
1172aec3c8f4Simarom        entries[pos].code_object = code_object;
1173aec3c8f4Simarom        Py_DECREF(tmp);
1174aec3c8f4Simarom        return;
1175aec3c8f4Simarom    }
1176aec3c8f4Simarom    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
1177aec3c8f4Simarom        int new_max = __pyx_code_cache.max_count + 64;
1178aec3c8f4Simarom        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
1179aec3c8f4Simarom            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
1180aec3c8f4Simarom        if (unlikely(!entries)) {
1181aec3c8f4Simarom            return;
1182aec3c8f4Simarom        }
1183aec3c8f4Simarom        __pyx_code_cache.entries = entries;
1184aec3c8f4Simarom        __pyx_code_cache.max_count = new_max;
1185aec3c8f4Simarom    }
1186aec3c8f4Simarom    for (i=__pyx_code_cache.count; i>pos; i--) {
1187aec3c8f4Simarom        entries[i] = entries[i-1];
1188aec3c8f4Simarom    }
1189aec3c8f4Simarom    entries[pos].code_line = code_line;
1190aec3c8f4Simarom    entries[pos].code_object = code_object;
1191aec3c8f4Simarom    __pyx_code_cache.count++;
1192aec3c8f4Simarom    Py_INCREF(code_object);
1193aec3c8f4Simarom}
1194aec3c8f4Simarom
1195aec3c8f4Simarom#include "compile.h"
1196aec3c8f4Simarom#include "frameobject.h"
1197aec3c8f4Simarom#include "traceback.h"
1198aec3c8f4Simaromstatic PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
1199aec3c8f4Simarom            const char *funcname, int c_line,
1200aec3c8f4Simarom            int py_line, const char *filename) {
1201aec3c8f4Simarom    PyCodeObject *py_code = 0;
1202aec3c8f4Simarom    PyObject *py_srcfile = 0;
1203aec3c8f4Simarom    PyObject *py_funcname = 0;
1204aec3c8f4Simarom    #if PY_MAJOR_VERSION < 3
1205aec3c8f4Simarom    py_srcfile = PyString_FromString(filename);
1206aec3c8f4Simarom    #else
1207aec3c8f4Simarom    py_srcfile = PyUnicode_FromString(filename);
1208aec3c8f4Simarom    #endif
1209aec3c8f4Simarom    if (!py_srcfile) goto bad;
1210aec3c8f4Simarom    if (c_line) {
1211aec3c8f4Simarom        #if PY_MAJOR_VERSION < 3
1212aec3c8f4Simarom        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
1213aec3c8f4Simarom        #else
1214aec3c8f4Simarom        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
1215aec3c8f4Simarom        #endif
1216aec3c8f4Simarom    }
1217aec3c8f4Simarom    else {
1218aec3c8f4Simarom        #if PY_MAJOR_VERSION < 3
1219aec3c8f4Simarom        py_funcname = PyString_FromString(funcname);
1220aec3c8f4Simarom        #else
1221aec3c8f4Simarom        py_funcname = PyUnicode_FromString(funcname);
1222aec3c8f4Simarom        #endif
1223aec3c8f4Simarom    }
1224aec3c8f4Simarom    if (!py_funcname) goto bad;
1225aec3c8f4Simarom    py_code = __Pyx_PyCode_New(
1226aec3c8f4Simarom        0,
1227aec3c8f4Simarom        0,
1228aec3c8f4Simarom        0,
1229aec3c8f4Simarom        0,
1230aec3c8f4Simarom        0,
1231aec3c8f4Simarom        __pyx_empty_bytes, /*PyObject *code,*/
1232aec3c8f4Simarom        __pyx_empty_tuple, /*PyObject *consts,*/
1233aec3c8f4Simarom        __pyx_empty_tuple, /*PyObject *names,*/
1234aec3c8f4Simarom        __pyx_empty_tuple, /*PyObject *varnames,*/
1235aec3c8f4Simarom        __pyx_empty_tuple, /*PyObject *freevars,*/
1236aec3c8f4Simarom        __pyx_empty_tuple, /*PyObject *cellvars,*/
1237aec3c8f4Simarom        py_srcfile,   /*PyObject *filename,*/
1238aec3c8f4Simarom        py_funcname,  /*PyObject *name,*/
1239aec3c8f4Simarom        py_line,
1240aec3c8f4Simarom        __pyx_empty_bytes  /*PyObject *lnotab*/
1241aec3c8f4Simarom    );
1242aec3c8f4Simarom    Py_DECREF(py_srcfile);
1243aec3c8f4Simarom    Py_DECREF(py_funcname);
1244aec3c8f4Simarom    return py_code;
1245aec3c8f4Simarombad:
1246aec3c8f4Simarom    Py_XDECREF(py_srcfile);
1247aec3c8f4Simarom    Py_XDECREF(py_funcname);
1248aec3c8f4Simarom    return NULL;
1249aec3c8f4Simarom}
1250aec3c8f4Simaromstatic void __Pyx_AddTraceback(const char *funcname, int c_line,
1251aec3c8f4Simarom                               int py_line, const char *filename) {
1252aec3c8f4Simarom    PyCodeObject *py_code = 0;
1253aec3c8f4Simarom    PyFrameObject *py_frame = 0;
1254aec3c8f4Simarom    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
1255aec3c8f4Simarom    if (!py_code) {
1256aec3c8f4Simarom        py_code = __Pyx_CreateCodeObjectForTraceback(
1257aec3c8f4Simarom            funcname, c_line, py_line, filename);
1258aec3c8f4Simarom        if (!py_code) goto bad;
1259aec3c8f4Simarom        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
1260aec3c8f4Simarom    }
1261aec3c8f4Simarom    py_frame = PyFrame_New(
1262aec3c8f4Simarom        PyThreadState_GET(), /*PyThreadState *tstate,*/
1263aec3c8f4Simarom        py_code,             /*PyCodeObject *code,*/
1264aec3c8f4Simarom        __pyx_d,      /*PyObject *globals,*/
1265aec3c8f4Simarom        0                    /*PyObject *locals*/
1266aec3c8f4Simarom    );
1267aec3c8f4Simarom    if (!py_frame) goto bad;
1268aec3c8f4Simarom    py_frame->f_lineno = py_line;
1269aec3c8f4Simarom    PyTraceBack_Here(py_frame);
1270aec3c8f4Simarombad:
1271aec3c8f4Simarom    Py_XDECREF(py_code);
1272aec3c8f4Simarom    Py_XDECREF(py_frame);
1273aec3c8f4Simarom}
1274aec3c8f4Simarom
1275aec3c8f4Simaromstatic PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
1276aec3c8f4Simarom    PyObject *empty_list = 0;
1277aec3c8f4Simarom    PyObject *module = 0;
1278aec3c8f4Simarom    PyObject *global_dict = 0;
1279aec3c8f4Simarom    PyObject *empty_dict = 0;
1280aec3c8f4Simarom    PyObject *list;
1281aec3c8f4Simarom    #if PY_VERSION_HEX < 0x03030000
1282aec3c8f4Simarom    PyObject *py_import;
1283aec3c8f4Simarom    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
1284aec3c8f4Simarom    if (!py_import)
1285aec3c8f4Simarom        goto bad;
1286aec3c8f4Simarom    #endif
1287aec3c8f4Simarom    if (from_list)
1288aec3c8f4Simarom        list = from_list;
1289aec3c8f4Simarom    else {
1290aec3c8f4Simarom        empty_list = PyList_New(0);
1291aec3c8f4Simarom        if (!empty_list)
1292aec3c8f4Simarom            goto bad;
1293aec3c8f4Simarom        list = empty_list;
1294aec3c8f4Simarom    }
1295aec3c8f4Simarom    global_dict = PyModule_GetDict(__pyx_m);
1296aec3c8f4Simarom    if (!global_dict)
1297aec3c8f4Simarom        goto bad;
1298aec3c8f4Simarom    empty_dict = PyDict_New();
1299aec3c8f4Simarom    if (!empty_dict)
1300aec3c8f4Simarom        goto bad;
1301aec3c8f4Simarom    {
1302aec3c8f4Simarom        #if PY_MAJOR_VERSION >= 3
1303aec3c8f4Simarom        if (level == -1) {
1304aec3c8f4Simarom            if (strchr(__Pyx_MODULE_NAME, '.')) {
1305aec3c8f4Simarom                #if PY_VERSION_HEX < 0x03030000
1306aec3c8f4Simarom                PyObject *py_level = PyInt_FromLong(1);
1307aec3c8f4Simarom                if (!py_level)
1308aec3c8f4Simarom                    goto bad;
1309aec3c8f4Simarom                module = PyObject_CallFunctionObjArgs(py_import,
1310aec3c8f4Simarom                    name, global_dict, empty_dict, list, py_level, NULL);
1311aec3c8f4Simarom                Py_DECREF(py_level);
1312aec3c8f4Simarom                #else
1313aec3c8f4Simarom                module = PyImport_ImportModuleLevelObject(
1314aec3c8f4Simarom                    name, global_dict, empty_dict, list, 1);
1315aec3c8f4Simarom                #endif
1316aec3c8f4Simarom                if (!module) {
1317aec3c8f4Simarom                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
1318aec3c8f4Simarom                        goto bad;
1319aec3c8f4Simarom                    PyErr_Clear();
1320aec3c8f4Simarom                }
1321aec3c8f4Simarom            }
1322aec3c8f4Simarom            level = 0;
1323aec3c8f4Simarom        }
1324aec3c8f4Simarom        #endif
1325aec3c8f4Simarom        if (!module) {
1326aec3c8f4Simarom            #if PY_VERSION_HEX < 0x03030000
1327aec3c8f4Simarom            PyObject *py_level = PyInt_FromLong(level);
1328aec3c8f4Simarom            if (!py_level)
1329aec3c8f4Simarom                goto bad;
1330aec3c8f4Simarom            module = PyObject_CallFunctionObjArgs(py_import,
1331aec3c8f4Simarom                name, global_dict, empty_dict, list, py_level, NULL);
1332aec3c8f4Simarom            Py_DECREF(py_level);
1333aec3c8f4Simarom            #else
1334aec3c8f4Simarom            module = PyImport_ImportModuleLevelObject(
1335aec3c8f4Simarom                name, global_dict, empty_dict, list, level);
1336aec3c8f4Simarom            #endif
1337aec3c8f4Simarom        }
1338aec3c8f4Simarom    }
1339aec3c8f4Simarombad:
1340aec3c8f4Simarom    #if PY_VERSION_HEX < 0x03030000
1341aec3c8f4Simarom    Py_XDECREF(py_import);
1342aec3c8f4Simarom    #endif
1343aec3c8f4Simarom    Py_XDECREF(empty_list);
1344aec3c8f4Simarom    Py_XDECREF(empty_dict);
1345aec3c8f4Simarom    return module;
1346aec3c8f4Simarom}
1347aec3c8f4Simarom
1348aec3c8f4Simarom#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)       \
1349aec3c8f4Simarom    {                                                                     \
1350aec3c8f4Simarom        func_type value = func_value;                                     \
1351aec3c8f4Simarom        if (sizeof(target_type) < sizeof(func_type)) {                    \
1352aec3c8f4Simarom            if (unlikely(value != (func_type) (target_type) value)) {     \
1353aec3c8f4Simarom                func_type zero = 0;                                       \
1354aec3c8f4Simarom                if (is_unsigned && unlikely(value < zero))                \
1355aec3c8f4Simarom                    goto raise_neg_overflow;                              \
1356aec3c8f4Simarom                else                                                      \
1357aec3c8f4Simarom                    goto raise_overflow;                                  \
1358aec3c8f4Simarom            }                                                             \
1359aec3c8f4Simarom        }                                                                 \
1360aec3c8f4Simarom        return (target_type) value;                                       \
1361aec3c8f4Simarom    }
1362aec3c8f4Simarom
1363aec3c8f4Simarom#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
1364aec3c8f4Simarom #if CYTHON_USE_PYLONG_INTERNALS
1365aec3c8f4Simarom  #include "longintrepr.h"
1366aec3c8f4Simarom #endif
1367aec3c8f4Simarom#endif
1368aec3c8f4Simarom
1369aec3c8f4Simaromstatic CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
1370aec3c8f4Simarom    const int neg_one = (int) -1, const_zero = 0;
1371aec3c8f4Simarom    const int is_unsigned = neg_one > const_zero;
1372aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
1373aec3c8f4Simarom    if (likely(PyInt_Check(x))) {
1374aec3c8f4Simarom        if (sizeof(int) < sizeof(long)) {
1375aec3c8f4Simarom            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
1376aec3c8f4Simarom        } else {
1377aec3c8f4Simarom            long val = PyInt_AS_LONG(x);
1378aec3c8f4Simarom            if (is_unsigned && unlikely(val < 0)) {
1379aec3c8f4Simarom                goto raise_neg_overflow;
1380aec3c8f4Simarom            }
1381aec3c8f4Simarom            return (int) val;
1382aec3c8f4Simarom        }
1383aec3c8f4Simarom    } else
1384aec3c8f4Simarom#endif
1385aec3c8f4Simarom    if (likely(PyLong_Check(x))) {
1386aec3c8f4Simarom        if (is_unsigned) {
1387aec3c8f4Simarom#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
1388aec3c8f4Simarom #if CYTHON_USE_PYLONG_INTERNALS
1389aec3c8f4Simarom            switch (Py_SIZE(x)) {
1390aec3c8f4Simarom                case  0: return 0;
1391aec3c8f4Simarom                case  1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
1392aec3c8f4Simarom            }
1393aec3c8f4Simarom #endif
1394aec3c8f4Simarom#endif
1395aec3c8f4Simarom            if (unlikely(Py_SIZE(x) < 0)) {
1396aec3c8f4Simarom                goto raise_neg_overflow;
1397aec3c8f4Simarom            }
1398aec3c8f4Simarom            if (sizeof(int) <= sizeof(unsigned long)) {
1399aec3c8f4Simarom                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
1400aec3c8f4Simarom            } else if (sizeof(int) <= sizeof(unsigned long long)) {
1401aec3c8f4Simarom                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
1402aec3c8f4Simarom            }
1403aec3c8f4Simarom        } else {
1404aec3c8f4Simarom#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
1405aec3c8f4Simarom #if CYTHON_USE_PYLONG_INTERNALS
1406aec3c8f4Simarom            switch (Py_SIZE(x)) {
1407aec3c8f4Simarom                case  0: return 0;
1408aec3c8f4Simarom                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
1409aec3c8f4Simarom                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
1410aec3c8f4Simarom            }
1411aec3c8f4Simarom #endif
1412aec3c8f4Simarom#endif
1413aec3c8f4Simarom            if (sizeof(int) <= sizeof(long)) {
1414aec3c8f4Simarom                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
1415aec3c8f4Simarom            } else if (sizeof(int) <= sizeof(long long)) {
1416aec3c8f4Simarom                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
1417aec3c8f4Simarom            }
1418aec3c8f4Simarom        }
1419aec3c8f4Simarom        {
1420aec3c8f4Simarom#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
1421aec3c8f4Simarom            PyErr_SetString(PyExc_RuntimeError,
1422aec3c8f4Simarom                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
1423aec3c8f4Simarom#else
1424aec3c8f4Simarom            int val;
1425aec3c8f4Simarom            PyObject *v = __Pyx_PyNumber_Int(x);
1426aec3c8f4Simarom #if PY_MAJOR_VERSION < 3
1427aec3c8f4Simarom            if (likely(v) && !PyLong_Check(v)) {
1428aec3c8f4Simarom                PyObject *tmp = v;
1429aec3c8f4Simarom                v = PyNumber_Long(tmp);
1430aec3c8f4Simarom                Py_DECREF(tmp);
1431aec3c8f4Simarom            }
1432aec3c8f4Simarom #endif
1433aec3c8f4Simarom            if (likely(v)) {
1434aec3c8f4Simarom                int one = 1; int is_little = (int)*(unsigned char *)&one;
1435aec3c8f4Simarom                unsigned char *bytes = (unsigned char *)&val;
1436aec3c8f4Simarom                int ret = _PyLong_AsByteArray((PyLongObject *)v,
1437aec3c8f4Simarom                                              bytes, sizeof(val),
1438aec3c8f4Simarom                                              is_little, !is_unsigned);
1439aec3c8f4Simarom                Py_DECREF(v);
1440aec3c8f4Simarom                if (likely(!ret))
1441aec3c8f4Simarom                    return val;
1442aec3c8f4Simarom            }
1443aec3c8f4Simarom#endif
1444aec3c8f4Simarom            return (int) -1;
1445aec3c8f4Simarom        }
1446aec3c8f4Simarom    } else {
1447aec3c8f4Simarom        int val;
1448aec3c8f4Simarom        PyObject *tmp = __Pyx_PyNumber_Int(x);
1449aec3c8f4Simarom        if (!tmp) return (int) -1;
1450aec3c8f4Simarom        val = __Pyx_PyInt_As_int(tmp);
1451aec3c8f4Simarom        Py_DECREF(tmp);
1452aec3c8f4Simarom        return val;
1453aec3c8f4Simarom    }
1454aec3c8f4Simaromraise_overflow:
1455aec3c8f4Simarom    PyErr_SetString(PyExc_OverflowError,
1456aec3c8f4Simarom        "value too large to convert to int");
1457aec3c8f4Simarom    return (int) -1;
1458aec3c8f4Simaromraise_neg_overflow:
1459aec3c8f4Simarom    PyErr_SetString(PyExc_OverflowError,
1460aec3c8f4Simarom        "can't convert negative value to int");
1461aec3c8f4Simarom    return (int) -1;
1462aec3c8f4Simarom}
1463aec3c8f4Simarom
1464aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
1465aec3c8f4Simarom    const int neg_one = (int) -1, const_zero = 0;
1466aec3c8f4Simarom    const int is_unsigned = neg_one > const_zero;
1467aec3c8f4Simarom    if (is_unsigned) {
1468aec3c8f4Simarom        if (sizeof(int) < sizeof(long)) {
1469aec3c8f4Simarom            return PyInt_FromLong((long) value);
1470aec3c8f4Simarom        } else if (sizeof(int) <= sizeof(unsigned long)) {
1471aec3c8f4Simarom            return PyLong_FromUnsignedLong((unsigned long) value);
1472aec3c8f4Simarom        } else if (sizeof(int) <= sizeof(unsigned long long)) {
1473aec3c8f4Simarom            return PyLong_FromUnsignedLongLong((unsigned long long) value);
1474aec3c8f4Simarom        }
1475aec3c8f4Simarom    } else {
1476aec3c8f4Simarom        if (sizeof(int) <= sizeof(long)) {
1477aec3c8f4Simarom            return PyInt_FromLong((long) value);
1478aec3c8f4Simarom        } else if (sizeof(int) <= sizeof(long long)) {
1479aec3c8f4Simarom            return PyLong_FromLongLong((long long) value);
1480aec3c8f4Simarom        }
1481aec3c8f4Simarom    }
1482aec3c8f4Simarom    {
1483aec3c8f4Simarom        int one = 1; int little = (int)*(unsigned char *)&one;
1484aec3c8f4Simarom        unsigned char *bytes = (unsigned char *)&value;
1485aec3c8f4Simarom        return _PyLong_FromByteArray(bytes, sizeof(int),
1486aec3c8f4Simarom                                     little, !is_unsigned);
1487aec3c8f4Simarom    }
1488aec3c8f4Simarom}
1489aec3c8f4Simarom
1490aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
1491aec3c8f4Simarom    const long neg_one = (long) -1, const_zero = 0;
1492aec3c8f4Simarom    const int is_unsigned = neg_one > const_zero;
1493aec3c8f4Simarom    if (is_unsigned) {
1494aec3c8f4Simarom        if (sizeof(long) < sizeof(long)) {
1495aec3c8f4Simarom            return PyInt_FromLong((long) value);
1496aec3c8f4Simarom        } else if (sizeof(long) <= sizeof(unsigned long)) {
1497aec3c8f4Simarom            return PyLong_FromUnsignedLong((unsigned long) value);
1498aec3c8f4Simarom        } else if (sizeof(long) <= sizeof(unsigned long long)) {
1499aec3c8f4Simarom            return PyLong_FromUnsignedLongLong((unsigned long long) value);
1500aec3c8f4Simarom        }
1501aec3c8f4Simarom    } else {
1502aec3c8f4Simarom        if (sizeof(long) <= sizeof(long)) {
1503aec3c8f4Simarom            return PyInt_FromLong((long) value);
1504aec3c8f4Simarom        } else if (sizeof(long) <= sizeof(long long)) {
1505aec3c8f4Simarom            return PyLong_FromLongLong((long long) value);
1506aec3c8f4Simarom        }
1507aec3c8f4Simarom    }
1508aec3c8f4Simarom    {
1509aec3c8f4Simarom        int one = 1; int little = (int)*(unsigned char *)&one;
1510aec3c8f4Simarom        unsigned char *bytes = (unsigned char *)&value;
1511aec3c8f4Simarom        return _PyLong_FromByteArray(bytes, sizeof(long),
1512aec3c8f4Simarom                                     little, !is_unsigned);
1513aec3c8f4Simarom    }
1514aec3c8f4Simarom}
1515aec3c8f4Simarom
1516aec3c8f4Simaromstatic CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
1517aec3c8f4Simarom    const long neg_one = (long) -1, const_zero = 0;
1518aec3c8f4Simarom    const int is_unsigned = neg_one > const_zero;
1519aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
1520aec3c8f4Simarom    if (likely(PyInt_Check(x))) {
1521aec3c8f4Simarom        if (sizeof(long) < sizeof(long)) {
1522aec3c8f4Simarom            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
1523aec3c8f4Simarom        } else {
1524aec3c8f4Simarom            long val = PyInt_AS_LONG(x);
1525aec3c8f4Simarom            if (is_unsigned && unlikely(val < 0)) {
1526aec3c8f4Simarom                goto raise_neg_overflow;
1527aec3c8f4Simarom            }
1528aec3c8f4Simarom            return (long) val;
1529aec3c8f4Simarom        }
1530aec3c8f4Simarom    } else
1531aec3c8f4Simarom#endif
1532aec3c8f4Simarom    if (likely(PyLong_Check(x))) {
1533aec3c8f4Simarom        if (is_unsigned) {
1534aec3c8f4Simarom#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
1535aec3c8f4Simarom #if CYTHON_USE_PYLONG_INTERNALS
1536aec3c8f4Simarom            switch (Py_SIZE(x)) {
1537aec3c8f4Simarom                case  0: return 0;
1538aec3c8f4Simarom                case  1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
1539aec3c8f4Simarom            }
1540aec3c8f4Simarom #endif
1541aec3c8f4Simarom#endif
1542aec3c8f4Simarom            if (unlikely(Py_SIZE(x) < 0)) {
1543aec3c8f4Simarom                goto raise_neg_overflow;
1544aec3c8f4Simarom            }
1545aec3c8f4Simarom            if (sizeof(long) <= sizeof(unsigned long)) {
1546aec3c8f4Simarom                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
1547aec3c8f4Simarom            } else if (sizeof(long) <= sizeof(unsigned long long)) {
1548aec3c8f4Simarom                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
1549aec3c8f4Simarom            }
1550aec3c8f4Simarom        } else {
1551aec3c8f4Simarom#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
1552aec3c8f4Simarom #if CYTHON_USE_PYLONG_INTERNALS
1553aec3c8f4Simarom            switch (Py_SIZE(x)) {
1554aec3c8f4Simarom                case  0: return 0;
1555aec3c8f4Simarom                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +(((PyLongObject*)x)->ob_digit[0]));
1556aec3c8f4Simarom                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
1557aec3c8f4Simarom            }
1558aec3c8f4Simarom #endif
1559aec3c8f4Simarom#endif
1560aec3c8f4Simarom            if (sizeof(long) <= sizeof(long)) {
1561aec3c8f4Simarom                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
1562aec3c8f4Simarom            } else if (sizeof(long) <= sizeof(long long)) {
1563aec3c8f4Simarom                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
1564aec3c8f4Simarom            }
1565aec3c8f4Simarom        }
1566aec3c8f4Simarom        {
1567aec3c8f4Simarom#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
1568aec3c8f4Simarom            PyErr_SetString(PyExc_RuntimeError,
1569aec3c8f4Simarom                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
1570aec3c8f4Simarom#else
1571aec3c8f4Simarom            long val;
1572aec3c8f4Simarom            PyObject *v = __Pyx_PyNumber_Int(x);
1573aec3c8f4Simarom #if PY_MAJOR_VERSION < 3
1574aec3c8f4Simarom            if (likely(v) && !PyLong_Check(v)) {
1575aec3c8f4Simarom                PyObject *tmp = v;
1576aec3c8f4Simarom                v = PyNumber_Long(tmp);
1577aec3c8f4Simarom                Py_DECREF(tmp);
1578aec3c8f4Simarom            }
1579aec3c8f4Simarom #endif
1580aec3c8f4Simarom            if (likely(v)) {
1581aec3c8f4Simarom                int one = 1; int is_little = (int)*(unsigned char *)&one;
1582aec3c8f4Simarom                unsigned char *bytes = (unsigned char *)&val;
1583aec3c8f4Simarom                int ret = _PyLong_AsByteArray((PyLongObject *)v,
1584aec3c8f4Simarom                                              bytes, sizeof(val),
1585aec3c8f4Simarom                                              is_little, !is_unsigned);
1586aec3c8f4Simarom                Py_DECREF(v);
1587aec3c8f4Simarom                if (likely(!ret))
1588aec3c8f4Simarom                    return val;
1589aec3c8f4Simarom            }
1590aec3c8f4Simarom#endif
1591aec3c8f4Simarom            return (long) -1;
1592aec3c8f4Simarom        }
1593aec3c8f4Simarom    } else {
1594aec3c8f4Simarom        long val;
1595aec3c8f4Simarom        PyObject *tmp = __Pyx_PyNumber_Int(x);
1596aec3c8f4Simarom        if (!tmp) return (long) -1;
1597aec3c8f4Simarom        val = __Pyx_PyInt_As_long(tmp);
1598aec3c8f4Simarom        Py_DECREF(tmp);
1599aec3c8f4Simarom        return val;
1600aec3c8f4Simarom    }
1601aec3c8f4Simaromraise_overflow:
1602aec3c8f4Simarom    PyErr_SetString(PyExc_OverflowError,
1603aec3c8f4Simarom        "value too large to convert to long");
1604aec3c8f4Simarom    return (long) -1;
1605aec3c8f4Simaromraise_neg_overflow:
1606aec3c8f4Simarom    PyErr_SetString(PyExc_OverflowError,
1607aec3c8f4Simarom        "can't convert negative value to long");
1608aec3c8f4Simarom    return (long) -1;
1609aec3c8f4Simarom}
1610aec3c8f4Simarom
1611aec3c8f4Simaromstatic int __Pyx_check_binary_version(void) {
1612aec3c8f4Simarom    char ctversion[4], rtversion[4];
1613aec3c8f4Simarom    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
1614aec3c8f4Simarom    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
1615aec3c8f4Simarom    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
1616aec3c8f4Simarom        char message[200];
1617aec3c8f4Simarom        PyOS_snprintf(message, sizeof(message),
1618aec3c8f4Simarom                      "compiletime version %s of module '%.100s' "
1619aec3c8f4Simarom                      "does not match runtime version %s",
1620aec3c8f4Simarom                      ctversion, __Pyx_MODULE_NAME, rtversion);
1621aec3c8f4Simarom        return PyErr_WarnEx(NULL, message, 1);
1622aec3c8f4Simarom    }
1623aec3c8f4Simarom    return 0;
1624aec3c8f4Simarom}
1625aec3c8f4Simarom
1626aec3c8f4Simaromstatic int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
1627aec3c8f4Simarom    while (t->p) {
1628aec3c8f4Simarom        #if PY_MAJOR_VERSION < 3
1629aec3c8f4Simarom        if (t->is_unicode) {
1630aec3c8f4Simarom            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
1631aec3c8f4Simarom        } else if (t->intern) {
1632aec3c8f4Simarom            *t->p = PyString_InternFromString(t->s);
1633aec3c8f4Simarom        } else {
1634aec3c8f4Simarom            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
1635aec3c8f4Simarom        }
1636aec3c8f4Simarom        #else
1637aec3c8f4Simarom        if (t->is_unicode | t->is_str) {
1638aec3c8f4Simarom            if (t->intern) {
1639aec3c8f4Simarom                *t->p = PyUnicode_InternFromString(t->s);
1640aec3c8f4Simarom            } else if (t->encoding) {
1641aec3c8f4Simarom                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
1642aec3c8f4Simarom            } else {
1643aec3c8f4Simarom                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
1644aec3c8f4Simarom            }
1645aec3c8f4Simarom        } else {
1646aec3c8f4Simarom            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
1647aec3c8f4Simarom        }
1648aec3c8f4Simarom        #endif
1649aec3c8f4Simarom        if (!*t->p)
1650aec3c8f4Simarom            return -1;
1651aec3c8f4Simarom        ++t;
1652aec3c8f4Simarom    }
1653aec3c8f4Simarom    return 0;
1654aec3c8f4Simarom}
1655aec3c8f4Simarom
1656aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
1657aec3c8f4Simarom    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
1658aec3c8f4Simarom}
1659aec3c8f4Simaromstatic CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
1660aec3c8f4Simarom    Py_ssize_t ignore;
1661aec3c8f4Simarom    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
1662aec3c8f4Simarom}
1663aec3c8f4Simaromstatic CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
1664aec3c8f4Simarom#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1665aec3c8f4Simarom    if (
1666aec3c8f4Simarom#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1667aec3c8f4Simarom            __Pyx_sys_getdefaultencoding_not_ascii &&
1668aec3c8f4Simarom#endif
1669aec3c8f4Simarom            PyUnicode_Check(o)) {
1670aec3c8f4Simarom#if PY_VERSION_HEX < 0x03030000
1671aec3c8f4Simarom        char* defenc_c;
1672aec3c8f4Simarom        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
1673aec3c8f4Simarom        if (!defenc) return NULL;
1674aec3c8f4Simarom        defenc_c = PyBytes_AS_STRING(defenc);
1675aec3c8f4Simarom#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1676aec3c8f4Simarom        {
1677aec3c8f4Simarom            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
1678aec3c8f4Simarom            char* c;
1679aec3c8f4Simarom            for (c = defenc_c; c < end; c++) {
1680aec3c8f4Simarom                if ((unsigned char) (*c) >= 128) {
1681aec3c8f4Simarom                    PyUnicode_AsASCIIString(o);
1682aec3c8f4Simarom                    return NULL;
1683aec3c8f4Simarom                }
1684aec3c8f4Simarom            }
1685aec3c8f4Simarom        }
1686aec3c8f4Simarom#endif
1687aec3c8f4Simarom        *length = PyBytes_GET_SIZE(defenc);
1688aec3c8f4Simarom        return defenc_c;
1689aec3c8f4Simarom#else
1690aec3c8f4Simarom        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
1691aec3c8f4Simarom#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1692aec3c8f4Simarom        if (PyUnicode_IS_ASCII(o)) {
1693aec3c8f4Simarom            *length = PyUnicode_GET_LENGTH(o);
1694aec3c8f4Simarom            return PyUnicode_AsUTF8(o);
1695aec3c8f4Simarom        } else {
1696aec3c8f4Simarom            PyUnicode_AsASCIIString(o);
1697aec3c8f4Simarom            return NULL;
1698aec3c8f4Simarom        }
1699aec3c8f4Simarom#else
1700aec3c8f4Simarom        return PyUnicode_AsUTF8AndSize(o, length);
1701aec3c8f4Simarom#endif
1702aec3c8f4Simarom#endif
1703aec3c8f4Simarom    } else
1704aec3c8f4Simarom#endif
1705aec3c8f4Simarom#if !CYTHON_COMPILING_IN_PYPY
1706aec3c8f4Simarom    if (PyByteArray_Check(o)) {
1707aec3c8f4Simarom        *length = PyByteArray_GET_SIZE(o);
1708aec3c8f4Simarom        return PyByteArray_AS_STRING(o);
1709aec3c8f4Simarom    } else
1710aec3c8f4Simarom#endif
1711aec3c8f4Simarom    {
1712aec3c8f4Simarom        char* result;
1713aec3c8f4Simarom        int r = PyBytes_AsStringAndSize(o, &result, length);
1714aec3c8f4Simarom        if (unlikely(r < 0)) {
1715aec3c8f4Simarom            return NULL;
1716aec3c8f4Simarom        } else {
1717aec3c8f4Simarom            return result;
1718aec3c8f4Simarom        }
1719aec3c8f4Simarom    }
1720aec3c8f4Simarom}
1721aec3c8f4Simaromstatic CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
1722aec3c8f4Simarom   int is_true = x == Py_True;
1723aec3c8f4Simarom   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
1724aec3c8f4Simarom   else return PyObject_IsTrue(x);
1725aec3c8f4Simarom}
1726aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
1727aec3c8f4Simarom  PyNumberMethods *m;
1728aec3c8f4Simarom  const char *name = NULL;
1729aec3c8f4Simarom  PyObject *res = NULL;
1730aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
1731aec3c8f4Simarom  if (PyInt_Check(x) || PyLong_Check(x))
1732aec3c8f4Simarom#else
1733aec3c8f4Simarom  if (PyLong_Check(x))
1734aec3c8f4Simarom#endif
1735aec3c8f4Simarom    return Py_INCREF(x), x;
1736aec3c8f4Simarom  m = Py_TYPE(x)->tp_as_number;
1737aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
1738aec3c8f4Simarom  if (m && m->nb_int) {
1739aec3c8f4Simarom    name = "int";
1740aec3c8f4Simarom    res = PyNumber_Int(x);
1741aec3c8f4Simarom  }
1742aec3c8f4Simarom  else if (m && m->nb_long) {
1743aec3c8f4Simarom    name = "long";
1744aec3c8f4Simarom    res = PyNumber_Long(x);
1745aec3c8f4Simarom  }
1746aec3c8f4Simarom#else
1747aec3c8f4Simarom  if (m && m->nb_int) {
1748aec3c8f4Simarom    name = "int";
1749aec3c8f4Simarom    res = PyNumber_Long(x);
1750aec3c8f4Simarom  }
1751aec3c8f4Simarom#endif
1752aec3c8f4Simarom  if (res) {
1753aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
1754aec3c8f4Simarom    if (!PyInt_Check(res) && !PyLong_Check(res)) {
1755aec3c8f4Simarom#else
1756aec3c8f4Simarom    if (!PyLong_Check(res)) {
1757aec3c8f4Simarom#endif
1758aec3c8f4Simarom      PyErr_Format(PyExc_TypeError,
1759aec3c8f4Simarom                   "__%.4s__ returned non-%.4s (type %.200s)",
1760aec3c8f4Simarom                   name, name, Py_TYPE(res)->tp_name);
1761aec3c8f4Simarom      Py_DECREF(res);
1762aec3c8f4Simarom      return NULL;
1763aec3c8f4Simarom    }
1764aec3c8f4Simarom  }
1765aec3c8f4Simarom  else if (!PyErr_Occurred()) {
1766aec3c8f4Simarom    PyErr_SetString(PyExc_TypeError,
1767aec3c8f4Simarom                    "an integer is required");
1768aec3c8f4Simarom  }
1769aec3c8f4Simarom  return res;
1770aec3c8f4Simarom}
1771aec3c8f4Simaromstatic CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
1772aec3c8f4Simarom  Py_ssize_t ival;
1773aec3c8f4Simarom  PyObject *x;
1774aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
1775aec3c8f4Simarom  if (likely(PyInt_CheckExact(b)))
1776aec3c8f4Simarom      return PyInt_AS_LONG(b);
1777aec3c8f4Simarom#endif
1778aec3c8f4Simarom  if (likely(PyLong_CheckExact(b))) {
1779aec3c8f4Simarom    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
1780aec3c8f4Simarom     #if CYTHON_USE_PYLONG_INTERNALS
1781aec3c8f4Simarom       switch (Py_SIZE(b)) {
1782aec3c8f4Simarom       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
1783aec3c8f4Simarom       case  0: return 0;
1784aec3c8f4Simarom       case  1: return ((PyLongObject*)b)->ob_digit[0];
1785aec3c8f4Simarom       }
1786aec3c8f4Simarom     #endif
1787aec3c8f4Simarom    #endif
1788aec3c8f4Simarom    return PyLong_AsSsize_t(b);
1789aec3c8f4Simarom  }
1790aec3c8f4Simarom  x = PyNumber_Index(b);
1791aec3c8f4Simarom  if (!x) return -1;
1792aec3c8f4Simarom  ival = PyInt_AsSsize_t(x);
1793aec3c8f4Simarom  Py_DECREF(x);
1794aec3c8f4Simarom  return ival;
1795aec3c8f4Simarom}
1796aec3c8f4Simaromstatic CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
1797aec3c8f4Simarom    return PyInt_FromSize_t(ival);
1798aec3c8f4Simarom}
1799aec3c8f4Simarom
1800aec3c8f4Simarom
1801aec3c8f4Simarom#endif /* Py_PYTHON_H */
1802