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___version
235aec3c8f4Simarom#define __PYX_HAVE_API__zmq__backend__cython___version
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/_version.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
487aec3c8f4Simaromtypedef struct {
488aec3c8f4Simarom    int code_line;
489aec3c8f4Simarom    PyCodeObject* code_object;
490aec3c8f4Simarom} __Pyx_CodeObjectCacheEntry;
491aec3c8f4Simaromstruct __Pyx_CodeObjectCache {
492aec3c8f4Simarom    int count;
493aec3c8f4Simarom    int max_count;
494aec3c8f4Simarom    __Pyx_CodeObjectCacheEntry* entries;
495aec3c8f4Simarom};
496aec3c8f4Simaromstatic struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
497aec3c8f4Simaromstatic int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
498aec3c8f4Simaromstatic PyCodeObject *__pyx_find_code_object(int code_line);
499aec3c8f4Simaromstatic void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
500aec3c8f4Simarom
501aec3c8f4Simaromstatic void __Pyx_AddTraceback(const char *funcname, int c_line,
502aec3c8f4Simarom                               int py_line, const char *filename);
503aec3c8f4Simarom
504aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
505aec3c8f4Simarom
506aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
507aec3c8f4Simarom
508aec3c8f4Simaromstatic CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
509aec3c8f4Simarom
510aec3c8f4Simaromstatic CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
511aec3c8f4Simarom
512aec3c8f4Simaromstatic int __Pyx_check_binary_version(void);
513aec3c8f4Simarom
514aec3c8f4Simaromstatic int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
515aec3c8f4Simarom
516aec3c8f4Simarom
517aec3c8f4Simarom/* Module declarations from 'zmq.backend.cython.libzmq' */
518aec3c8f4Simarom
519aec3c8f4Simarom/* Module declarations from 'zmq.backend.cython._version' */
520aec3c8f4Simarom#define __Pyx_MODULE_NAME "zmq.backend.cython._version"
521aec3c8f4Simaromint __pyx_module_is_main_zmq__backend__cython___version = 0;
522aec3c8f4Simarom
523aec3c8f4Simarom/* Implementation of 'zmq.backend.cython._version' */
524aec3c8f4Simaromstatic PyObject *__pyx_pf_3zmq_7backend_6cython_8_version_zmq_version_info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
525aec3c8f4Simaromstatic char __pyx_k_all[] = "__all__";
526aec3c8f4Simaromstatic char __pyx_k_main[] = "__main__";
527aec3c8f4Simaromstatic char __pyx_k_test[] = "__test__";
528aec3c8f4Simaromstatic char __pyx_k_major[] = "major";
529aec3c8f4Simaromstatic char __pyx_k_minor[] = "minor";
530aec3c8f4Simaromstatic char __pyx_k_patch[] = "patch";
531aec3c8f4Simaromstatic char __pyx_k_zmq_version_info[] = "zmq_version_info";
532aec3c8f4Simaromstatic char __pyx_k_zmq_backend_cython__version[] = "zmq.backend.cython._version";
533aec3c8f4Simaromstatic char __pyx_k_PyZMQ_and_0MQ_version_functions[] = "PyZMQ and 0MQ version functions.";
534aec3c8f4Simaromstatic char __pyx_k_private_tmp_pyzmq_release_zmq_b[] = "/private/tmp/pyzmq-release/zmq/backend/cython/_version.pyx";
535aec3c8f4Simaromstatic PyObject *__pyx_n_s_all;
536aec3c8f4Simaromstatic PyObject *__pyx_n_s_main;
537aec3c8f4Simaromstatic PyObject *__pyx_n_s_major;
538aec3c8f4Simaromstatic PyObject *__pyx_n_s_minor;
539aec3c8f4Simaromstatic PyObject *__pyx_n_s_patch;
540aec3c8f4Simaromstatic PyObject *__pyx_kp_s_private_tmp_pyzmq_release_zmq_b;
541aec3c8f4Simaromstatic PyObject *__pyx_n_s_test;
542aec3c8f4Simaromstatic PyObject *__pyx_n_s_zmq_backend_cython__version;
543aec3c8f4Simaromstatic PyObject *__pyx_n_s_zmq_version_info;
544aec3c8f4Simaromstatic PyObject *__pyx_tuple_;
545aec3c8f4Simaromstatic PyObject *__pyx_codeobj__2;
546aec3c8f4Simarom
547aec3c8f4Simarom/* "zmq/backend/cython/_version.pyx":32
548aec3c8f4Simarom * #-----------------------------------------------------------------------------
549aec3c8f4Simarom *
550aec3c8f4Simarom * def zmq_version_info():             # <<<<<<<<<<<<<<
551aec3c8f4Simarom *     """zmq_version_info()
552aec3c8f4Simarom *
553aec3c8f4Simarom */
554aec3c8f4Simarom
555aec3c8f4Simarom/* Python wrapper */
556aec3c8f4Simaromstatic PyObject *__pyx_pw_3zmq_7backend_6cython_8_version_1zmq_version_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
557aec3c8f4Simaromstatic char __pyx_doc_3zmq_7backend_6cython_8_version_zmq_version_info[] = "zmq_version_info()\n\n    Return the version of ZeroMQ itself as a 3-tuple of ints.\n    ";
558aec3c8f4Simaromstatic PyMethodDef __pyx_mdef_3zmq_7backend_6cython_8_version_1zmq_version_info = {"zmq_version_info", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_8_version_1zmq_version_info, METH_NOARGS, __pyx_doc_3zmq_7backend_6cython_8_version_zmq_version_info};
559aec3c8f4Simaromstatic PyObject *__pyx_pw_3zmq_7backend_6cython_8_version_1zmq_version_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
560aec3c8f4Simarom  PyObject *__pyx_r = 0;
561aec3c8f4Simarom  __Pyx_RefNannyDeclarations
562aec3c8f4Simarom  __Pyx_RefNannySetupContext("zmq_version_info (wrapper)", 0);
563aec3c8f4Simarom  __pyx_r = __pyx_pf_3zmq_7backend_6cython_8_version_zmq_version_info(__pyx_self);
564aec3c8f4Simarom
565aec3c8f4Simarom  /* function exit code */
566aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
567aec3c8f4Simarom  return __pyx_r;
568aec3c8f4Simarom}
569aec3c8f4Simarom
570aec3c8f4Simaromstatic PyObject *__pyx_pf_3zmq_7backend_6cython_8_version_zmq_version_info(CYTHON_UNUSED PyObject *__pyx_self) {
571aec3c8f4Simarom  int __pyx_v_major;
572aec3c8f4Simarom  int __pyx_v_minor;
573aec3c8f4Simarom  int __pyx_v_patch;
574aec3c8f4Simarom  PyObject *__pyx_r = NULL;
575aec3c8f4Simarom  __Pyx_RefNannyDeclarations
576aec3c8f4Simarom  PyObject *__pyx_t_1 = NULL;
577aec3c8f4Simarom  PyObject *__pyx_t_2 = NULL;
578aec3c8f4Simarom  PyObject *__pyx_t_3 = NULL;
579aec3c8f4Simarom  PyObject *__pyx_t_4 = NULL;
580aec3c8f4Simarom  int __pyx_lineno = 0;
581aec3c8f4Simarom  const char *__pyx_filename = NULL;
582aec3c8f4Simarom  int __pyx_clineno = 0;
583aec3c8f4Simarom  __Pyx_RefNannySetupContext("zmq_version_info", 0);
584aec3c8f4Simarom
585aec3c8f4Simarom  /* "zmq/backend/cython/_version.pyx":38
586aec3c8f4Simarom *     """
587aec3c8f4Simarom *     cdef int major, minor, patch
588aec3c8f4Simarom *     _zmq_version(&major, &minor, &patch)             # <<<<<<<<<<<<<<
589aec3c8f4Simarom *     return (major, minor, patch)
590aec3c8f4Simarom *
591aec3c8f4Simarom */
592aec3c8f4Simarom  zmq_version((&__pyx_v_major), (&__pyx_v_minor), (&__pyx_v_patch));
593aec3c8f4Simarom
594aec3c8f4Simarom  /* "zmq/backend/cython/_version.pyx":39
595aec3c8f4Simarom *     cdef int major, minor, patch
596aec3c8f4Simarom *     _zmq_version(&major, &minor, &patch)
597aec3c8f4Simarom *     return (major, minor, patch)             # <<<<<<<<<<<<<<
598aec3c8f4Simarom *
599aec3c8f4Simarom *
600aec3c8f4Simarom */
601aec3c8f4Simarom  __Pyx_XDECREF(__pyx_r);
602aec3c8f4Simarom  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_major); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
603aec3c8f4Simarom  __Pyx_GOTREF(__pyx_t_1);
604aec3c8f4Simarom  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_minor); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
605aec3c8f4Simarom  __Pyx_GOTREF(__pyx_t_2);
606aec3c8f4Simarom  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_patch); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
607aec3c8f4Simarom  __Pyx_GOTREF(__pyx_t_3);
608aec3c8f4Simarom  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
609aec3c8f4Simarom  __Pyx_GOTREF(__pyx_t_4);
610aec3c8f4Simarom  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
611aec3c8f4Simarom  __Pyx_GIVEREF(__pyx_t_1);
612aec3c8f4Simarom  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
613aec3c8f4Simarom  __Pyx_GIVEREF(__pyx_t_2);
614aec3c8f4Simarom  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
615aec3c8f4Simarom  __Pyx_GIVEREF(__pyx_t_3);
616aec3c8f4Simarom  __pyx_t_1 = 0;
617aec3c8f4Simarom  __pyx_t_2 = 0;
618aec3c8f4Simarom  __pyx_t_3 = 0;
619aec3c8f4Simarom  __pyx_r = __pyx_t_4;
620aec3c8f4Simarom  __pyx_t_4 = 0;
621aec3c8f4Simarom  goto __pyx_L0;
622aec3c8f4Simarom
623aec3c8f4Simarom  /* "zmq/backend/cython/_version.pyx":32
624aec3c8f4Simarom * #-----------------------------------------------------------------------------
625aec3c8f4Simarom *
626aec3c8f4Simarom * def zmq_version_info():             # <<<<<<<<<<<<<<
627aec3c8f4Simarom *     """zmq_version_info()
628aec3c8f4Simarom *
629aec3c8f4Simarom */
630aec3c8f4Simarom
631aec3c8f4Simarom  /* function exit code */
632aec3c8f4Simarom  __pyx_L1_error:;
633aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_1);
634aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_2);
635aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_3);
636aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_4);
637aec3c8f4Simarom  __Pyx_AddTraceback("zmq.backend.cython._version.zmq_version_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
638aec3c8f4Simarom  __pyx_r = NULL;
639aec3c8f4Simarom  __pyx_L0:;
640aec3c8f4Simarom  __Pyx_XGIVEREF(__pyx_r);
641aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
642aec3c8f4Simarom  return __pyx_r;
643aec3c8f4Simarom}
644aec3c8f4Simarom
645aec3c8f4Simaromstatic PyMethodDef __pyx_methods[] = {
646aec3c8f4Simarom  {0, 0, 0, 0}
647aec3c8f4Simarom};
648aec3c8f4Simarom
649aec3c8f4Simarom#if PY_MAJOR_VERSION >= 3
650aec3c8f4Simaromstatic struct PyModuleDef __pyx_moduledef = {
651aec3c8f4Simarom  #if PY_VERSION_HEX < 0x03020000
652aec3c8f4Simarom    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
653aec3c8f4Simarom  #else
654aec3c8f4Simarom    PyModuleDef_HEAD_INIT,
655aec3c8f4Simarom  #endif
656aec3c8f4Simarom    "_version",
657aec3c8f4Simarom    __pyx_k_PyZMQ_and_0MQ_version_functions, /* m_doc */
658aec3c8f4Simarom    -1, /* m_size */
659aec3c8f4Simarom    __pyx_methods /* m_methods */,
660aec3c8f4Simarom    NULL, /* m_reload */
661aec3c8f4Simarom    NULL, /* m_traverse */
662aec3c8f4Simarom    NULL, /* m_clear */
663aec3c8f4Simarom    NULL /* m_free */
664aec3c8f4Simarom};
665aec3c8f4Simarom#endif
666aec3c8f4Simarom
667aec3c8f4Simaromstatic __Pyx_StringTabEntry __pyx_string_tab[] = {
668aec3c8f4Simarom  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
669aec3c8f4Simarom  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
670aec3c8f4Simarom  {&__pyx_n_s_major, __pyx_k_major, sizeof(__pyx_k_major), 0, 0, 1, 1},
671aec3c8f4Simarom  {&__pyx_n_s_minor, __pyx_k_minor, sizeof(__pyx_k_minor), 0, 0, 1, 1},
672aec3c8f4Simarom  {&__pyx_n_s_patch, __pyx_k_patch, sizeof(__pyx_k_patch), 0, 0, 1, 1},
673aec3c8f4Simarom  {&__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},
674aec3c8f4Simarom  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
675aec3c8f4Simarom  {&__pyx_n_s_zmq_backend_cython__version, __pyx_k_zmq_backend_cython__version, sizeof(__pyx_k_zmq_backend_cython__version), 0, 0, 1, 1},
676aec3c8f4Simarom  {&__pyx_n_s_zmq_version_info, __pyx_k_zmq_version_info, sizeof(__pyx_k_zmq_version_info), 0, 0, 1, 1},
677aec3c8f4Simarom  {0, 0, 0, 0, 0, 0, 0}
678aec3c8f4Simarom};
679aec3c8f4Simaromstatic int __Pyx_InitCachedBuiltins(void) {
680aec3c8f4Simarom  return 0;
681aec3c8f4Simarom}
682aec3c8f4Simarom
683aec3c8f4Simaromstatic int __Pyx_InitCachedConstants(void) {
684aec3c8f4Simarom  __Pyx_RefNannyDeclarations
685aec3c8f4Simarom  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
686aec3c8f4Simarom
687aec3c8f4Simarom  /* "zmq/backend/cython/_version.pyx":32
688aec3c8f4Simarom * #-----------------------------------------------------------------------------
689aec3c8f4Simarom *
690aec3c8f4Simarom * def zmq_version_info():             # <<<<<<<<<<<<<<
691aec3c8f4Simarom *     """zmq_version_info()
692aec3c8f4Simarom *
693aec3c8f4Simarom */
694aec3c8f4Simarom  __pyx_tuple_ = PyTuple_Pack(3, __pyx_n_s_major, __pyx_n_s_minor, __pyx_n_s_patch); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
695aec3c8f4Simarom  __Pyx_GOTREF(__pyx_tuple_);
696aec3c8f4Simarom  __Pyx_GIVEREF(__pyx_tuple_);
697aec3c8f4Simarom  __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(0, 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_zmq_version_info, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
698aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
699aec3c8f4Simarom  return 0;
700aec3c8f4Simarom  __pyx_L1_error:;
701aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
702aec3c8f4Simarom  return -1;
703aec3c8f4Simarom}
704aec3c8f4Simarom
705aec3c8f4Simaromstatic int __Pyx_InitGlobals(void) {
706aec3c8f4Simarom  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
707aec3c8f4Simarom  return 0;
708aec3c8f4Simarom  __pyx_L1_error:;
709aec3c8f4Simarom  return -1;
710aec3c8f4Simarom}
711aec3c8f4Simarom
712aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
713aec3c8f4SimaromPyMODINIT_FUNC init_version(void); /*proto*/
714aec3c8f4SimaromPyMODINIT_FUNC init_version(void)
715aec3c8f4Simarom#else
716aec3c8f4SimaromPyMODINIT_FUNC PyInit__version(void); /*proto*/
717aec3c8f4SimaromPyMODINIT_FUNC PyInit__version(void)
718aec3c8f4Simarom#endif
719aec3c8f4Simarom{
720aec3c8f4Simarom  PyObject *__pyx_t_1 = NULL;
721aec3c8f4Simarom  int __pyx_lineno = 0;
722aec3c8f4Simarom  const char *__pyx_filename = NULL;
723aec3c8f4Simarom  int __pyx_clineno = 0;
724aec3c8f4Simarom  __Pyx_RefNannyDeclarations
725aec3c8f4Simarom  #if CYTHON_REFNANNY
726aec3c8f4Simarom  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
727aec3c8f4Simarom  if (!__Pyx_RefNanny) {
728aec3c8f4Simarom      PyErr_Clear();
729aec3c8f4Simarom      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
730aec3c8f4Simarom      if (!__Pyx_RefNanny)
731aec3c8f4Simarom          Py_FatalError("failed to import 'refnanny' module");
732aec3c8f4Simarom  }
733aec3c8f4Simarom  #endif
734aec3c8f4Simarom  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__version(void)", 0);
735aec3c8f4Simarom  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
736aec3c8f4Simarom  __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;}
737aec3c8f4Simarom  __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;}
738aec3c8f4Simarom  #ifdef __Pyx_CyFunction_USED
739aec3c8f4Simarom  if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
740aec3c8f4Simarom  #endif
741aec3c8f4Simarom  #ifdef __Pyx_FusedFunction_USED
742aec3c8f4Simarom  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
743aec3c8f4Simarom  #endif
744aec3c8f4Simarom  #ifdef __Pyx_Generator_USED
745aec3c8f4Simarom  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
746aec3c8f4Simarom  #endif
747aec3c8f4Simarom  /*--- Library function declarations ---*/
748aec3c8f4Simarom  /*--- Threads initialization code ---*/
749aec3c8f4Simarom  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
750aec3c8f4Simarom  #ifdef WITH_THREAD /* Python build with threading support? */
751aec3c8f4Simarom  PyEval_InitThreads();
752aec3c8f4Simarom  #endif
753aec3c8f4Simarom  #endif
754aec3c8f4Simarom  /*--- Module creation code ---*/
755aec3c8f4Simarom  #if PY_MAJOR_VERSION < 3
756aec3c8f4Simarom  __pyx_m = Py_InitModule4("_version", __pyx_methods, __pyx_k_PyZMQ_and_0MQ_version_functions, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
757aec3c8f4Simarom  #else
758aec3c8f4Simarom  __pyx_m = PyModule_Create(&__pyx_moduledef);
759aec3c8f4Simarom  #endif
760aec3c8f4Simarom  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
761aec3c8f4Simarom  __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;}
762aec3c8f4Simarom  Py_INCREF(__pyx_d);
763aec3c8f4Simarom  __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;}
764aec3c8f4Simarom  #if CYTHON_COMPILING_IN_PYPY
765aec3c8f4Simarom  Py_INCREF(__pyx_b);
766aec3c8f4Simarom  #endif
767aec3c8f4Simarom  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
768aec3c8f4Simarom  /*--- Initialize various global constants etc. ---*/
769aec3c8f4Simarom  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
770aec3c8f4Simarom  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
771aec3c8f4Simarom  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
772aec3c8f4Simarom  #endif
773aec3c8f4Simarom  if (__pyx_module_is_main_zmq__backend__cython___version) {
774aec3c8f4Simarom    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;};
775aec3c8f4Simarom  }
776aec3c8f4Simarom  #if PY_MAJOR_VERSION >= 3
777aec3c8f4Simarom  {
778aec3c8f4Simarom    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
779aec3c8f4Simarom    if (!PyDict_GetItemString(modules, "zmq.backend.cython._version")) {
780aec3c8f4Simarom      if (unlikely(PyDict_SetItemString(modules, "zmq.backend.cython._version", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
781aec3c8f4Simarom    }
782aec3c8f4Simarom  }
783aec3c8f4Simarom  #endif
784aec3c8f4Simarom  /*--- Builtin init code ---*/
785aec3c8f4Simarom  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
786aec3c8f4Simarom  /*--- Constants init code ---*/
787aec3c8f4Simarom  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
788aec3c8f4Simarom  /*--- Global init code ---*/
789aec3c8f4Simarom  /*--- Variable export code ---*/
790aec3c8f4Simarom  /*--- Function export code ---*/
791aec3c8f4Simarom  /*--- Type init code ---*/
792aec3c8f4Simarom  /*--- Type import code ---*/
793aec3c8f4Simarom  /*--- Variable import code ---*/
794aec3c8f4Simarom  /*--- Function import code ---*/
795aec3c8f4Simarom  /*--- Execution code ---*/
796aec3c8f4Simarom
797aec3c8f4Simarom  /* "zmq/backend/cython/_version.pyx":32
798aec3c8f4Simarom * #-----------------------------------------------------------------------------
799aec3c8f4Simarom *
800aec3c8f4Simarom * def zmq_version_info():             # <<<<<<<<<<<<<<
801aec3c8f4Simarom *     """zmq_version_info()
802aec3c8f4Simarom *
803aec3c8f4Simarom */
804aec3c8f4Simarom  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3zmq_7backend_6cython_8_version_1zmq_version_info, NULL, __pyx_n_s_zmq_backend_cython__version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
805aec3c8f4Simarom  __Pyx_GOTREF(__pyx_t_1);
806aec3c8f4Simarom  if (PyDict_SetItem(__pyx_d, __pyx_n_s_zmq_version_info, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
807aec3c8f4Simarom  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
808aec3c8f4Simarom
809aec3c8f4Simarom  /* "zmq/backend/cython/_version.pyx":42
810aec3c8f4Simarom *
811aec3c8f4Simarom *
812aec3c8f4Simarom * __all__ = ['zmq_version_info']             # <<<<<<<<<<<<<<
813aec3c8f4Simarom *
814aec3c8f4Simarom */
815aec3c8f4Simarom  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
816aec3c8f4Simarom  __Pyx_GOTREF(__pyx_t_1);
817aec3c8f4Simarom  __Pyx_INCREF(__pyx_n_s_zmq_version_info);
818aec3c8f4Simarom  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_zmq_version_info);
819aec3c8f4Simarom  __Pyx_GIVEREF(__pyx_n_s_zmq_version_info);
820aec3c8f4Simarom  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
821aec3c8f4Simarom  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
822aec3c8f4Simarom
823aec3c8f4Simarom  /* "zmq/backend/cython/_version.pyx":1
824aec3c8f4Simarom * """PyZMQ and 0MQ version functions."""             # <<<<<<<<<<<<<<
825aec3c8f4Simarom *
826aec3c8f4Simarom * #
827aec3c8f4Simarom */
828aec3c8f4Simarom  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
829aec3c8f4Simarom  __Pyx_GOTREF(__pyx_t_1);
830aec3c8f4Simarom  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
831aec3c8f4Simarom  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
832aec3c8f4Simarom
833aec3c8f4Simarom  /*--- Wrapped vars code ---*/
834aec3c8f4Simarom
835aec3c8f4Simarom  goto __pyx_L0;
836aec3c8f4Simarom  __pyx_L1_error:;
837aec3c8f4Simarom  __Pyx_XDECREF(__pyx_t_1);
838aec3c8f4Simarom  if (__pyx_m) {
839aec3c8f4Simarom    if (__pyx_d) {
840aec3c8f4Simarom      __Pyx_AddTraceback("init zmq.backend.cython._version", __pyx_clineno, __pyx_lineno, __pyx_filename);
841aec3c8f4Simarom    }
842aec3c8f4Simarom    Py_DECREF(__pyx_m); __pyx_m = 0;
843aec3c8f4Simarom  } else if (!PyErr_Occurred()) {
844aec3c8f4Simarom    PyErr_SetString(PyExc_ImportError, "init zmq.backend.cython._version");
845aec3c8f4Simarom  }
846aec3c8f4Simarom  __pyx_L0:;
847aec3c8f4Simarom  __Pyx_RefNannyFinishContext();
848aec3c8f4Simarom  #if PY_MAJOR_VERSION < 3
849aec3c8f4Simarom  return;
850aec3c8f4Simarom  #else
851aec3c8f4Simarom  return __pyx_m;
852aec3c8f4Simarom  #endif
853aec3c8f4Simarom}
854aec3c8f4Simarom
855aec3c8f4Simarom/* Runtime support code */
856aec3c8f4Simarom#if CYTHON_REFNANNY
857aec3c8f4Simaromstatic __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
858aec3c8f4Simarom    PyObject *m = NULL, *p = NULL;
859aec3c8f4Simarom    void *r = NULL;
860aec3c8f4Simarom    m = PyImport_ImportModule((char *)modname);
861aec3c8f4Simarom    if (!m) goto end;
862aec3c8f4Simarom    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
863aec3c8f4Simarom    if (!p) goto end;
864aec3c8f4Simarom    r = PyLong_AsVoidPtr(p);
865aec3c8f4Simaromend:
866aec3c8f4Simarom    Py_XDECREF(p);
867aec3c8f4Simarom    Py_XDECREF(m);
868aec3c8f4Simarom    return (__Pyx_RefNannyAPIStruct *)r;
869aec3c8f4Simarom}
870aec3c8f4Simarom#endif
871aec3c8f4Simarom
872aec3c8f4Simaromstatic int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
873aec3c8f4Simarom    int start = 0, mid = 0, end = count - 1;
874aec3c8f4Simarom    if (end >= 0 && code_line > entries[end].code_line) {
875aec3c8f4Simarom        return count;
876aec3c8f4Simarom    }
877aec3c8f4Simarom    while (start < end) {
878aec3c8f4Simarom        mid = (start + end) / 2;
879aec3c8f4Simarom        if (code_line < entries[mid].code_line) {
880aec3c8f4Simarom            end = mid;
881aec3c8f4Simarom        } else if (code_line > entries[mid].code_line) {
882aec3c8f4Simarom             start = mid + 1;
883aec3c8f4Simarom        } else {
884aec3c8f4Simarom            return mid;
885aec3c8f4Simarom        }
886aec3c8f4Simarom    }
887aec3c8f4Simarom    if (code_line <= entries[mid].code_line) {
888aec3c8f4Simarom        return mid;
889aec3c8f4Simarom    } else {
890aec3c8f4Simarom        return mid + 1;
891aec3c8f4Simarom    }
892aec3c8f4Simarom}
893aec3c8f4Simaromstatic PyCodeObject *__pyx_find_code_object(int code_line) {
894aec3c8f4Simarom    PyCodeObject* code_object;
895aec3c8f4Simarom    int pos;
896aec3c8f4Simarom    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
897aec3c8f4Simarom        return NULL;
898aec3c8f4Simarom    }
899aec3c8f4Simarom    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
900aec3c8f4Simarom    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
901aec3c8f4Simarom        return NULL;
902aec3c8f4Simarom    }
903aec3c8f4Simarom    code_object = __pyx_code_cache.entries[pos].code_object;
904aec3c8f4Simarom    Py_INCREF(code_object);
905aec3c8f4Simarom    return code_object;
906aec3c8f4Simarom}
907aec3c8f4Simaromstatic void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
908aec3c8f4Simarom    int pos, i;
909aec3c8f4Simarom    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
910aec3c8f4Simarom    if (unlikely(!code_line)) {
911aec3c8f4Simarom        return;
912aec3c8f4Simarom    }
913aec3c8f4Simarom    if (unlikely(!entries)) {
914aec3c8f4Simarom        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
915aec3c8f4Simarom        if (likely(entries)) {
916aec3c8f4Simarom            __pyx_code_cache.entries = entries;
917aec3c8f4Simarom            __pyx_code_cache.max_count = 64;
918aec3c8f4Simarom            __pyx_code_cache.count = 1;
919aec3c8f4Simarom            entries[0].code_line = code_line;
920aec3c8f4Simarom            entries[0].code_object = code_object;
921aec3c8f4Simarom            Py_INCREF(code_object);
922aec3c8f4Simarom        }
923aec3c8f4Simarom        return;
924aec3c8f4Simarom    }
925aec3c8f4Simarom    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
926aec3c8f4Simarom    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
927aec3c8f4Simarom        PyCodeObject* tmp = entries[pos].code_object;
928aec3c8f4Simarom        entries[pos].code_object = code_object;
929aec3c8f4Simarom        Py_DECREF(tmp);
930aec3c8f4Simarom        return;
931aec3c8f4Simarom    }
932aec3c8f4Simarom    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
933aec3c8f4Simarom        int new_max = __pyx_code_cache.max_count + 64;
934aec3c8f4Simarom        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
935aec3c8f4Simarom            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
936aec3c8f4Simarom        if (unlikely(!entries)) {
937aec3c8f4Simarom            return;
938aec3c8f4Simarom        }
939aec3c8f4Simarom        __pyx_code_cache.entries = entries;
940aec3c8f4Simarom        __pyx_code_cache.max_count = new_max;
941aec3c8f4Simarom    }
942aec3c8f4Simarom    for (i=__pyx_code_cache.count; i>pos; i--) {
943aec3c8f4Simarom        entries[i] = entries[i-1];
944aec3c8f4Simarom    }
945aec3c8f4Simarom    entries[pos].code_line = code_line;
946aec3c8f4Simarom    entries[pos].code_object = code_object;
947aec3c8f4Simarom    __pyx_code_cache.count++;
948aec3c8f4Simarom    Py_INCREF(code_object);
949aec3c8f4Simarom}
950aec3c8f4Simarom
951aec3c8f4Simarom#include "compile.h"
952aec3c8f4Simarom#include "frameobject.h"
953aec3c8f4Simarom#include "traceback.h"
954aec3c8f4Simaromstatic PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
955aec3c8f4Simarom            const char *funcname, int c_line,
956aec3c8f4Simarom            int py_line, const char *filename) {
957aec3c8f4Simarom    PyCodeObject *py_code = 0;
958aec3c8f4Simarom    PyObject *py_srcfile = 0;
959aec3c8f4Simarom    PyObject *py_funcname = 0;
960aec3c8f4Simarom    #if PY_MAJOR_VERSION < 3
961aec3c8f4Simarom    py_srcfile = PyString_FromString(filename);
962aec3c8f4Simarom    #else
963aec3c8f4Simarom    py_srcfile = PyUnicode_FromString(filename);
964aec3c8f4Simarom    #endif
965aec3c8f4Simarom    if (!py_srcfile) goto bad;
966aec3c8f4Simarom    if (c_line) {
967aec3c8f4Simarom        #if PY_MAJOR_VERSION < 3
968aec3c8f4Simarom        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
969aec3c8f4Simarom        #else
970aec3c8f4Simarom        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
971aec3c8f4Simarom        #endif
972aec3c8f4Simarom    }
973aec3c8f4Simarom    else {
974aec3c8f4Simarom        #if PY_MAJOR_VERSION < 3
975aec3c8f4Simarom        py_funcname = PyString_FromString(funcname);
976aec3c8f4Simarom        #else
977aec3c8f4Simarom        py_funcname = PyUnicode_FromString(funcname);
978aec3c8f4Simarom        #endif
979aec3c8f4Simarom    }
980aec3c8f4Simarom    if (!py_funcname) goto bad;
981aec3c8f4Simarom    py_code = __Pyx_PyCode_New(
982aec3c8f4Simarom        0,
983aec3c8f4Simarom        0,
984aec3c8f4Simarom        0,
985aec3c8f4Simarom        0,
986aec3c8f4Simarom        0,
987aec3c8f4Simarom        __pyx_empty_bytes, /*PyObject *code,*/
988aec3c8f4Simarom        __pyx_empty_tuple, /*PyObject *consts,*/
989aec3c8f4Simarom        __pyx_empty_tuple, /*PyObject *names,*/
990aec3c8f4Simarom        __pyx_empty_tuple, /*PyObject *varnames,*/
991aec3c8f4Simarom        __pyx_empty_tuple, /*PyObject *freevars,*/
992aec3c8f4Simarom        __pyx_empty_tuple, /*PyObject *cellvars,*/
993aec3c8f4Simarom        py_srcfile,   /*PyObject *filename,*/
994aec3c8f4Simarom        py_funcname,  /*PyObject *name,*/
995aec3c8f4Simarom        py_line,
996aec3c8f4Simarom        __pyx_empty_bytes  /*PyObject *lnotab*/
997aec3c8f4Simarom    );
998aec3c8f4Simarom    Py_DECREF(py_srcfile);
999aec3c8f4Simarom    Py_DECREF(py_funcname);
1000aec3c8f4Simarom    return py_code;
1001aec3c8f4Simarombad:
1002aec3c8f4Simarom    Py_XDECREF(py_srcfile);
1003aec3c8f4Simarom    Py_XDECREF(py_funcname);
1004aec3c8f4Simarom    return NULL;
1005aec3c8f4Simarom}
1006aec3c8f4Simaromstatic void __Pyx_AddTraceback(const char *funcname, int c_line,
1007aec3c8f4Simarom                               int py_line, const char *filename) {
1008aec3c8f4Simarom    PyCodeObject *py_code = 0;
1009aec3c8f4Simarom    PyFrameObject *py_frame = 0;
1010aec3c8f4Simarom    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
1011aec3c8f4Simarom    if (!py_code) {
1012aec3c8f4Simarom        py_code = __Pyx_CreateCodeObjectForTraceback(
1013aec3c8f4Simarom            funcname, c_line, py_line, filename);
1014aec3c8f4Simarom        if (!py_code) goto bad;
1015aec3c8f4Simarom        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
1016aec3c8f4Simarom    }
1017aec3c8f4Simarom    py_frame = PyFrame_New(
1018aec3c8f4Simarom        PyThreadState_GET(), /*PyThreadState *tstate,*/
1019aec3c8f4Simarom        py_code,             /*PyCodeObject *code,*/
1020aec3c8f4Simarom        __pyx_d,      /*PyObject *globals,*/
1021aec3c8f4Simarom        0                    /*PyObject *locals*/
1022aec3c8f4Simarom    );
1023aec3c8f4Simarom    if (!py_frame) goto bad;
1024aec3c8f4Simarom    py_frame->f_lineno = py_line;
1025aec3c8f4Simarom    PyTraceBack_Here(py_frame);
1026aec3c8f4Simarombad:
1027aec3c8f4Simarom    Py_XDECREF(py_code);
1028aec3c8f4Simarom    Py_XDECREF(py_frame);
1029aec3c8f4Simarom}
1030aec3c8f4Simarom
1031aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
1032aec3c8f4Simarom    const int neg_one = (int) -1, const_zero = 0;
1033aec3c8f4Simarom    const int is_unsigned = neg_one > const_zero;
1034aec3c8f4Simarom    if (is_unsigned) {
1035aec3c8f4Simarom        if (sizeof(int) < sizeof(long)) {
1036aec3c8f4Simarom            return PyInt_FromLong((long) value);
1037aec3c8f4Simarom        } else if (sizeof(int) <= sizeof(unsigned long)) {
1038aec3c8f4Simarom            return PyLong_FromUnsignedLong((unsigned long) value);
1039aec3c8f4Simarom        } else if (sizeof(int) <= sizeof(unsigned long long)) {
1040aec3c8f4Simarom            return PyLong_FromUnsignedLongLong((unsigned long long) value);
1041aec3c8f4Simarom        }
1042aec3c8f4Simarom    } else {
1043aec3c8f4Simarom        if (sizeof(int) <= sizeof(long)) {
1044aec3c8f4Simarom            return PyInt_FromLong((long) value);
1045aec3c8f4Simarom        } else if (sizeof(int) <= sizeof(long long)) {
1046aec3c8f4Simarom            return PyLong_FromLongLong((long long) value);
1047aec3c8f4Simarom        }
1048aec3c8f4Simarom    }
1049aec3c8f4Simarom    {
1050aec3c8f4Simarom        int one = 1; int little = (int)*(unsigned char *)&one;
1051aec3c8f4Simarom        unsigned char *bytes = (unsigned char *)&value;
1052aec3c8f4Simarom        return _PyLong_FromByteArray(bytes, sizeof(int),
1053aec3c8f4Simarom                                     little, !is_unsigned);
1054aec3c8f4Simarom    }
1055aec3c8f4Simarom}
1056aec3c8f4Simarom
1057aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
1058aec3c8f4Simarom    const long neg_one = (long) -1, const_zero = 0;
1059aec3c8f4Simarom    const int is_unsigned = neg_one > const_zero;
1060aec3c8f4Simarom    if (is_unsigned) {
1061aec3c8f4Simarom        if (sizeof(long) < sizeof(long)) {
1062aec3c8f4Simarom            return PyInt_FromLong((long) value);
1063aec3c8f4Simarom        } else if (sizeof(long) <= sizeof(unsigned long)) {
1064aec3c8f4Simarom            return PyLong_FromUnsignedLong((unsigned long) value);
1065aec3c8f4Simarom        } else if (sizeof(long) <= sizeof(unsigned long long)) {
1066aec3c8f4Simarom            return PyLong_FromUnsignedLongLong((unsigned long long) value);
1067aec3c8f4Simarom        }
1068aec3c8f4Simarom    } else {
1069aec3c8f4Simarom        if (sizeof(long) <= sizeof(long)) {
1070aec3c8f4Simarom            return PyInt_FromLong((long) value);
1071aec3c8f4Simarom        } else if (sizeof(long) <= sizeof(long long)) {
1072aec3c8f4Simarom            return PyLong_FromLongLong((long long) value);
1073aec3c8f4Simarom        }
1074aec3c8f4Simarom    }
1075aec3c8f4Simarom    {
1076aec3c8f4Simarom        int one = 1; int little = (int)*(unsigned char *)&one;
1077aec3c8f4Simarom        unsigned char *bytes = (unsigned char *)&value;
1078aec3c8f4Simarom        return _PyLong_FromByteArray(bytes, sizeof(long),
1079aec3c8f4Simarom                                     little, !is_unsigned);
1080aec3c8f4Simarom    }
1081aec3c8f4Simarom}
1082aec3c8f4Simarom
1083aec3c8f4Simarom#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)       \
1084aec3c8f4Simarom    {                                                                     \
1085aec3c8f4Simarom        func_type value = func_value;                                     \
1086aec3c8f4Simarom        if (sizeof(target_type) < sizeof(func_type)) {                    \
1087aec3c8f4Simarom            if (unlikely(value != (func_type) (target_type) value)) {     \
1088aec3c8f4Simarom                func_type zero = 0;                                       \
1089aec3c8f4Simarom                if (is_unsigned && unlikely(value < zero))                \
1090aec3c8f4Simarom                    goto raise_neg_overflow;                              \
1091aec3c8f4Simarom                else                                                      \
1092aec3c8f4Simarom                    goto raise_overflow;                                  \
1093aec3c8f4Simarom            }                                                             \
1094aec3c8f4Simarom        }                                                                 \
1095aec3c8f4Simarom        return (target_type) value;                                       \
1096aec3c8f4Simarom    }
1097aec3c8f4Simarom
1098aec3c8f4Simarom#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
1099aec3c8f4Simarom #if CYTHON_USE_PYLONG_INTERNALS
1100aec3c8f4Simarom  #include "longintrepr.h"
1101aec3c8f4Simarom #endif
1102aec3c8f4Simarom#endif
1103aec3c8f4Simarom
1104aec3c8f4Simaromstatic CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
1105aec3c8f4Simarom    const long neg_one = (long) -1, const_zero = 0;
1106aec3c8f4Simarom    const int is_unsigned = neg_one > const_zero;
1107aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
1108aec3c8f4Simarom    if (likely(PyInt_Check(x))) {
1109aec3c8f4Simarom        if (sizeof(long) < sizeof(long)) {
1110aec3c8f4Simarom            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
1111aec3c8f4Simarom        } else {
1112aec3c8f4Simarom            long val = PyInt_AS_LONG(x);
1113aec3c8f4Simarom            if (is_unsigned && unlikely(val < 0)) {
1114aec3c8f4Simarom                goto raise_neg_overflow;
1115aec3c8f4Simarom            }
1116aec3c8f4Simarom            return (long) val;
1117aec3c8f4Simarom        }
1118aec3c8f4Simarom    } else
1119aec3c8f4Simarom#endif
1120aec3c8f4Simarom    if (likely(PyLong_Check(x))) {
1121aec3c8f4Simarom        if (is_unsigned) {
1122aec3c8f4Simarom#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
1123aec3c8f4Simarom #if CYTHON_USE_PYLONG_INTERNALS
1124aec3c8f4Simarom            switch (Py_SIZE(x)) {
1125aec3c8f4Simarom                case  0: return 0;
1126aec3c8f4Simarom                case  1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
1127aec3c8f4Simarom            }
1128aec3c8f4Simarom #endif
1129aec3c8f4Simarom#endif
1130aec3c8f4Simarom            if (unlikely(Py_SIZE(x) < 0)) {
1131aec3c8f4Simarom                goto raise_neg_overflow;
1132aec3c8f4Simarom            }
1133aec3c8f4Simarom            if (sizeof(long) <= sizeof(unsigned long)) {
1134aec3c8f4Simarom                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
1135aec3c8f4Simarom            } else if (sizeof(long) <= sizeof(unsigned long long)) {
1136aec3c8f4Simarom                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
1137aec3c8f4Simarom            }
1138aec3c8f4Simarom        } else {
1139aec3c8f4Simarom#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
1140aec3c8f4Simarom #if CYTHON_USE_PYLONG_INTERNALS
1141aec3c8f4Simarom            switch (Py_SIZE(x)) {
1142aec3c8f4Simarom                case  0: return 0;
1143aec3c8f4Simarom                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +(((PyLongObject*)x)->ob_digit[0]));
1144aec3c8f4Simarom                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
1145aec3c8f4Simarom            }
1146aec3c8f4Simarom #endif
1147aec3c8f4Simarom#endif
1148aec3c8f4Simarom            if (sizeof(long) <= sizeof(long)) {
1149aec3c8f4Simarom                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
1150aec3c8f4Simarom            } else if (sizeof(long) <= sizeof(long long)) {
1151aec3c8f4Simarom                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
1152aec3c8f4Simarom            }
1153aec3c8f4Simarom        }
1154aec3c8f4Simarom        {
1155aec3c8f4Simarom#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
1156aec3c8f4Simarom            PyErr_SetString(PyExc_RuntimeError,
1157aec3c8f4Simarom                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
1158aec3c8f4Simarom#else
1159aec3c8f4Simarom            long val;
1160aec3c8f4Simarom            PyObject *v = __Pyx_PyNumber_Int(x);
1161aec3c8f4Simarom #if PY_MAJOR_VERSION < 3
1162aec3c8f4Simarom            if (likely(v) && !PyLong_Check(v)) {
1163aec3c8f4Simarom                PyObject *tmp = v;
1164aec3c8f4Simarom                v = PyNumber_Long(tmp);
1165aec3c8f4Simarom                Py_DECREF(tmp);
1166aec3c8f4Simarom            }
1167aec3c8f4Simarom #endif
1168aec3c8f4Simarom            if (likely(v)) {
1169aec3c8f4Simarom                int one = 1; int is_little = (int)*(unsigned char *)&one;
1170aec3c8f4Simarom                unsigned char *bytes = (unsigned char *)&val;
1171aec3c8f4Simarom                int ret = _PyLong_AsByteArray((PyLongObject *)v,
1172aec3c8f4Simarom                                              bytes, sizeof(val),
1173aec3c8f4Simarom                                              is_little, !is_unsigned);
1174aec3c8f4Simarom                Py_DECREF(v);
1175aec3c8f4Simarom                if (likely(!ret))
1176aec3c8f4Simarom                    return val;
1177aec3c8f4Simarom            }
1178aec3c8f4Simarom#endif
1179aec3c8f4Simarom            return (long) -1;
1180aec3c8f4Simarom        }
1181aec3c8f4Simarom    } else {
1182aec3c8f4Simarom        long val;
1183aec3c8f4Simarom        PyObject *tmp = __Pyx_PyNumber_Int(x);
1184aec3c8f4Simarom        if (!tmp) return (long) -1;
1185aec3c8f4Simarom        val = __Pyx_PyInt_As_long(tmp);
1186aec3c8f4Simarom        Py_DECREF(tmp);
1187aec3c8f4Simarom        return val;
1188aec3c8f4Simarom    }
1189aec3c8f4Simaromraise_overflow:
1190aec3c8f4Simarom    PyErr_SetString(PyExc_OverflowError,
1191aec3c8f4Simarom        "value too large to convert to long");
1192aec3c8f4Simarom    return (long) -1;
1193aec3c8f4Simaromraise_neg_overflow:
1194aec3c8f4Simarom    PyErr_SetString(PyExc_OverflowError,
1195aec3c8f4Simarom        "can't convert negative value to long");
1196aec3c8f4Simarom    return (long) -1;
1197aec3c8f4Simarom}
1198aec3c8f4Simarom
1199aec3c8f4Simaromstatic CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
1200aec3c8f4Simarom    const int neg_one = (int) -1, const_zero = 0;
1201aec3c8f4Simarom    const int is_unsigned = neg_one > const_zero;
1202aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
1203aec3c8f4Simarom    if (likely(PyInt_Check(x))) {
1204aec3c8f4Simarom        if (sizeof(int) < sizeof(long)) {
1205aec3c8f4Simarom            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
1206aec3c8f4Simarom        } else {
1207aec3c8f4Simarom            long val = PyInt_AS_LONG(x);
1208aec3c8f4Simarom            if (is_unsigned && unlikely(val < 0)) {
1209aec3c8f4Simarom                goto raise_neg_overflow;
1210aec3c8f4Simarom            }
1211aec3c8f4Simarom            return (int) val;
1212aec3c8f4Simarom        }
1213aec3c8f4Simarom    } else
1214aec3c8f4Simarom#endif
1215aec3c8f4Simarom    if (likely(PyLong_Check(x))) {
1216aec3c8f4Simarom        if (is_unsigned) {
1217aec3c8f4Simarom#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
1218aec3c8f4Simarom #if CYTHON_USE_PYLONG_INTERNALS
1219aec3c8f4Simarom            switch (Py_SIZE(x)) {
1220aec3c8f4Simarom                case  0: return 0;
1221aec3c8f4Simarom                case  1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
1222aec3c8f4Simarom            }
1223aec3c8f4Simarom #endif
1224aec3c8f4Simarom#endif
1225aec3c8f4Simarom            if (unlikely(Py_SIZE(x) < 0)) {
1226aec3c8f4Simarom                goto raise_neg_overflow;
1227aec3c8f4Simarom            }
1228aec3c8f4Simarom            if (sizeof(int) <= sizeof(unsigned long)) {
1229aec3c8f4Simarom                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
1230aec3c8f4Simarom            } else if (sizeof(int) <= sizeof(unsigned long long)) {
1231aec3c8f4Simarom                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
1232aec3c8f4Simarom            }
1233aec3c8f4Simarom        } else {
1234aec3c8f4Simarom#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
1235aec3c8f4Simarom #if CYTHON_USE_PYLONG_INTERNALS
1236aec3c8f4Simarom            switch (Py_SIZE(x)) {
1237aec3c8f4Simarom                case  0: return 0;
1238aec3c8f4Simarom                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
1239aec3c8f4Simarom                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
1240aec3c8f4Simarom            }
1241aec3c8f4Simarom #endif
1242aec3c8f4Simarom#endif
1243aec3c8f4Simarom            if (sizeof(int) <= sizeof(long)) {
1244aec3c8f4Simarom                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
1245aec3c8f4Simarom            } else if (sizeof(int) <= sizeof(long long)) {
1246aec3c8f4Simarom                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
1247aec3c8f4Simarom            }
1248aec3c8f4Simarom        }
1249aec3c8f4Simarom        {
1250aec3c8f4Simarom#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
1251aec3c8f4Simarom            PyErr_SetString(PyExc_RuntimeError,
1252aec3c8f4Simarom                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
1253aec3c8f4Simarom#else
1254aec3c8f4Simarom            int val;
1255aec3c8f4Simarom            PyObject *v = __Pyx_PyNumber_Int(x);
1256aec3c8f4Simarom #if PY_MAJOR_VERSION < 3
1257aec3c8f4Simarom            if (likely(v) && !PyLong_Check(v)) {
1258aec3c8f4Simarom                PyObject *tmp = v;
1259aec3c8f4Simarom                v = PyNumber_Long(tmp);
1260aec3c8f4Simarom                Py_DECREF(tmp);
1261aec3c8f4Simarom            }
1262aec3c8f4Simarom #endif
1263aec3c8f4Simarom            if (likely(v)) {
1264aec3c8f4Simarom                int one = 1; int is_little = (int)*(unsigned char *)&one;
1265aec3c8f4Simarom                unsigned char *bytes = (unsigned char *)&val;
1266aec3c8f4Simarom                int ret = _PyLong_AsByteArray((PyLongObject *)v,
1267aec3c8f4Simarom                                              bytes, sizeof(val),
1268aec3c8f4Simarom                                              is_little, !is_unsigned);
1269aec3c8f4Simarom                Py_DECREF(v);
1270aec3c8f4Simarom                if (likely(!ret))
1271aec3c8f4Simarom                    return val;
1272aec3c8f4Simarom            }
1273aec3c8f4Simarom#endif
1274aec3c8f4Simarom            return (int) -1;
1275aec3c8f4Simarom        }
1276aec3c8f4Simarom    } else {
1277aec3c8f4Simarom        int val;
1278aec3c8f4Simarom        PyObject *tmp = __Pyx_PyNumber_Int(x);
1279aec3c8f4Simarom        if (!tmp) return (int) -1;
1280aec3c8f4Simarom        val = __Pyx_PyInt_As_int(tmp);
1281aec3c8f4Simarom        Py_DECREF(tmp);
1282aec3c8f4Simarom        return val;
1283aec3c8f4Simarom    }
1284aec3c8f4Simaromraise_overflow:
1285aec3c8f4Simarom    PyErr_SetString(PyExc_OverflowError,
1286aec3c8f4Simarom        "value too large to convert to int");
1287aec3c8f4Simarom    return (int) -1;
1288aec3c8f4Simaromraise_neg_overflow:
1289aec3c8f4Simarom    PyErr_SetString(PyExc_OverflowError,
1290aec3c8f4Simarom        "can't convert negative value to int");
1291aec3c8f4Simarom    return (int) -1;
1292aec3c8f4Simarom}
1293aec3c8f4Simarom
1294aec3c8f4Simaromstatic int __Pyx_check_binary_version(void) {
1295aec3c8f4Simarom    char ctversion[4], rtversion[4];
1296aec3c8f4Simarom    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
1297aec3c8f4Simarom    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
1298aec3c8f4Simarom    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
1299aec3c8f4Simarom        char message[200];
1300aec3c8f4Simarom        PyOS_snprintf(message, sizeof(message),
1301aec3c8f4Simarom                      "compiletime version %s of module '%.100s' "
1302aec3c8f4Simarom                      "does not match runtime version %s",
1303aec3c8f4Simarom                      ctversion, __Pyx_MODULE_NAME, rtversion);
1304aec3c8f4Simarom        return PyErr_WarnEx(NULL, message, 1);
1305aec3c8f4Simarom    }
1306aec3c8f4Simarom    return 0;
1307aec3c8f4Simarom}
1308aec3c8f4Simarom
1309aec3c8f4Simaromstatic int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
1310aec3c8f4Simarom    while (t->p) {
1311aec3c8f4Simarom        #if PY_MAJOR_VERSION < 3
1312aec3c8f4Simarom        if (t->is_unicode) {
1313aec3c8f4Simarom            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
1314aec3c8f4Simarom        } else if (t->intern) {
1315aec3c8f4Simarom            *t->p = PyString_InternFromString(t->s);
1316aec3c8f4Simarom        } else {
1317aec3c8f4Simarom            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
1318aec3c8f4Simarom        }
1319aec3c8f4Simarom        #else
1320aec3c8f4Simarom        if (t->is_unicode | t->is_str) {
1321aec3c8f4Simarom            if (t->intern) {
1322aec3c8f4Simarom                *t->p = PyUnicode_InternFromString(t->s);
1323aec3c8f4Simarom            } else if (t->encoding) {
1324aec3c8f4Simarom                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
1325aec3c8f4Simarom            } else {
1326aec3c8f4Simarom                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
1327aec3c8f4Simarom            }
1328aec3c8f4Simarom        } else {
1329aec3c8f4Simarom            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
1330aec3c8f4Simarom        }
1331aec3c8f4Simarom        #endif
1332aec3c8f4Simarom        if (!*t->p)
1333aec3c8f4Simarom            return -1;
1334aec3c8f4Simarom        ++t;
1335aec3c8f4Simarom    }
1336aec3c8f4Simarom    return 0;
1337aec3c8f4Simarom}
1338aec3c8f4Simarom
1339aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
1340aec3c8f4Simarom    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
1341aec3c8f4Simarom}
1342aec3c8f4Simaromstatic CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
1343aec3c8f4Simarom    Py_ssize_t ignore;
1344aec3c8f4Simarom    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
1345aec3c8f4Simarom}
1346aec3c8f4Simaromstatic CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
1347aec3c8f4Simarom#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1348aec3c8f4Simarom    if (
1349aec3c8f4Simarom#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1350aec3c8f4Simarom            __Pyx_sys_getdefaultencoding_not_ascii &&
1351aec3c8f4Simarom#endif
1352aec3c8f4Simarom            PyUnicode_Check(o)) {
1353aec3c8f4Simarom#if PY_VERSION_HEX < 0x03030000
1354aec3c8f4Simarom        char* defenc_c;
1355aec3c8f4Simarom        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
1356aec3c8f4Simarom        if (!defenc) return NULL;
1357aec3c8f4Simarom        defenc_c = PyBytes_AS_STRING(defenc);
1358aec3c8f4Simarom#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1359aec3c8f4Simarom        {
1360aec3c8f4Simarom            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
1361aec3c8f4Simarom            char* c;
1362aec3c8f4Simarom            for (c = defenc_c; c < end; c++) {
1363aec3c8f4Simarom                if ((unsigned char) (*c) >= 128) {
1364aec3c8f4Simarom                    PyUnicode_AsASCIIString(o);
1365aec3c8f4Simarom                    return NULL;
1366aec3c8f4Simarom                }
1367aec3c8f4Simarom            }
1368aec3c8f4Simarom        }
1369aec3c8f4Simarom#endif
1370aec3c8f4Simarom        *length = PyBytes_GET_SIZE(defenc);
1371aec3c8f4Simarom        return defenc_c;
1372aec3c8f4Simarom#else
1373aec3c8f4Simarom        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
1374aec3c8f4Simarom#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1375aec3c8f4Simarom        if (PyUnicode_IS_ASCII(o)) {
1376aec3c8f4Simarom            *length = PyUnicode_GET_LENGTH(o);
1377aec3c8f4Simarom            return PyUnicode_AsUTF8(o);
1378aec3c8f4Simarom        } else {
1379aec3c8f4Simarom            PyUnicode_AsASCIIString(o);
1380aec3c8f4Simarom            return NULL;
1381aec3c8f4Simarom        }
1382aec3c8f4Simarom#else
1383aec3c8f4Simarom        return PyUnicode_AsUTF8AndSize(o, length);
1384aec3c8f4Simarom#endif
1385aec3c8f4Simarom#endif
1386aec3c8f4Simarom    } else
1387aec3c8f4Simarom#endif
1388aec3c8f4Simarom#if !CYTHON_COMPILING_IN_PYPY
1389aec3c8f4Simarom    if (PyByteArray_Check(o)) {
1390aec3c8f4Simarom        *length = PyByteArray_GET_SIZE(o);
1391aec3c8f4Simarom        return PyByteArray_AS_STRING(o);
1392aec3c8f4Simarom    } else
1393aec3c8f4Simarom#endif
1394aec3c8f4Simarom    {
1395aec3c8f4Simarom        char* result;
1396aec3c8f4Simarom        int r = PyBytes_AsStringAndSize(o, &result, length);
1397aec3c8f4Simarom        if (unlikely(r < 0)) {
1398aec3c8f4Simarom            return NULL;
1399aec3c8f4Simarom        } else {
1400aec3c8f4Simarom            return result;
1401aec3c8f4Simarom        }
1402aec3c8f4Simarom    }
1403aec3c8f4Simarom}
1404aec3c8f4Simaromstatic CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
1405aec3c8f4Simarom   int is_true = x == Py_True;
1406aec3c8f4Simarom   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
1407aec3c8f4Simarom   else return PyObject_IsTrue(x);
1408aec3c8f4Simarom}
1409aec3c8f4Simaromstatic CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
1410aec3c8f4Simarom  PyNumberMethods *m;
1411aec3c8f4Simarom  const char *name = NULL;
1412aec3c8f4Simarom  PyObject *res = NULL;
1413aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
1414aec3c8f4Simarom  if (PyInt_Check(x) || PyLong_Check(x))
1415aec3c8f4Simarom#else
1416aec3c8f4Simarom  if (PyLong_Check(x))
1417aec3c8f4Simarom#endif
1418aec3c8f4Simarom    return Py_INCREF(x), x;
1419aec3c8f4Simarom  m = Py_TYPE(x)->tp_as_number;
1420aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
1421aec3c8f4Simarom  if (m && m->nb_int) {
1422aec3c8f4Simarom    name = "int";
1423aec3c8f4Simarom    res = PyNumber_Int(x);
1424aec3c8f4Simarom  }
1425aec3c8f4Simarom  else if (m && m->nb_long) {
1426aec3c8f4Simarom    name = "long";
1427aec3c8f4Simarom    res = PyNumber_Long(x);
1428aec3c8f4Simarom  }
1429aec3c8f4Simarom#else
1430aec3c8f4Simarom  if (m && m->nb_int) {
1431aec3c8f4Simarom    name = "int";
1432aec3c8f4Simarom    res = PyNumber_Long(x);
1433aec3c8f4Simarom  }
1434aec3c8f4Simarom#endif
1435aec3c8f4Simarom  if (res) {
1436aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
1437aec3c8f4Simarom    if (!PyInt_Check(res) && !PyLong_Check(res)) {
1438aec3c8f4Simarom#else
1439aec3c8f4Simarom    if (!PyLong_Check(res)) {
1440aec3c8f4Simarom#endif
1441aec3c8f4Simarom      PyErr_Format(PyExc_TypeError,
1442aec3c8f4Simarom                   "__%.4s__ returned non-%.4s (type %.200s)",
1443aec3c8f4Simarom                   name, name, Py_TYPE(res)->tp_name);
1444aec3c8f4Simarom      Py_DECREF(res);
1445aec3c8f4Simarom      return NULL;
1446aec3c8f4Simarom    }
1447aec3c8f4Simarom  }
1448aec3c8f4Simarom  else if (!PyErr_Occurred()) {
1449aec3c8f4Simarom    PyErr_SetString(PyExc_TypeError,
1450aec3c8f4Simarom                    "an integer is required");
1451aec3c8f4Simarom  }
1452aec3c8f4Simarom  return res;
1453aec3c8f4Simarom}
1454aec3c8f4Simaromstatic CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
1455aec3c8f4Simarom  Py_ssize_t ival;
1456aec3c8f4Simarom  PyObject *x;
1457aec3c8f4Simarom#if PY_MAJOR_VERSION < 3
1458aec3c8f4Simarom  if (likely(PyInt_CheckExact(b)))
1459aec3c8f4Simarom      return PyInt_AS_LONG(b);
1460aec3c8f4Simarom#endif
1461aec3c8f4Simarom  if (likely(PyLong_CheckExact(b))) {
1462aec3c8f4Simarom    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
1463aec3c8f4Simarom     #if CYTHON_USE_PYLONG_INTERNALS
1464aec3c8f4Simarom       switch (Py_SIZE(b)) {
1465aec3c8f4Simarom       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
1466aec3c8f4Simarom       case  0: return 0;
1467aec3c8f4Simarom       case  1: return ((PyLongObject*)b)->ob_digit[0];
1468aec3c8f4Simarom       }
1469aec3c8f4Simarom     #endif
1470aec3c8f4Simarom    #endif
1471aec3c8f4Simarom    return PyLong_AsSsize_t(b);
1472aec3c8f4Simarom  }
1473aec3c8f4Simarom  x = PyNumber_Index(b);
1474aec3c8f4Simarom  if (!x) return -1;
1475aec3c8f4Simarom  ival = PyInt_AsSsize_t(x);
1476aec3c8f4Simarom  Py_DECREF(x);
1477aec3c8f4Simarom  return ival;
1478aec3c8f4Simarom}
1479aec3c8f4Simaromstatic CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
1480aec3c8f4Simarom    return PyInt_FromSize_t(ival);
1481aec3c8f4Simarom}
1482aec3c8f4Simarom
1483aec3c8f4Simarom
1484aec3c8f4Simarom#endif /* Py_PYTHON_H */
1485