1/* Generated by Cython 0.21.2 */
2
3#define PY_SSIZE_T_CLEAN
4#ifndef CYTHON_USE_PYLONG_INTERNALS
5#ifdef PYLONG_BITS_IN_DIGIT
6#define CYTHON_USE_PYLONG_INTERNALS 0
7#else
8#include "pyconfig.h"
9#ifdef PYLONG_BITS_IN_DIGIT
10#define CYTHON_USE_PYLONG_INTERNALS 1
11#else
12#define CYTHON_USE_PYLONG_INTERNALS 0
13#endif
14#endif
15#endif
16#include "Python.h"
17#ifndef Py_PYTHON_H
18    #error Python headers needed to compile C extensions, please install development version of Python.
19#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
20    #error Cython requires Python 2.6+ or Python 3.2+.
21#else
22#define CYTHON_ABI "0_21_2"
23#include <stddef.h>
24#ifndef offsetof
25#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
26#endif
27#if !defined(WIN32) && !defined(MS_WINDOWS)
28  #ifndef __stdcall
29    #define __stdcall
30  #endif
31  #ifndef __cdecl
32    #define __cdecl
33  #endif
34  #ifndef __fastcall
35    #define __fastcall
36  #endif
37#endif
38#ifndef DL_IMPORT
39  #define DL_IMPORT(t) t
40#endif
41#ifndef DL_EXPORT
42  #define DL_EXPORT(t) t
43#endif
44#ifndef PY_LONG_LONG
45  #define PY_LONG_LONG LONG_LONG
46#endif
47#ifndef Py_HUGE_VAL
48  #define Py_HUGE_VAL HUGE_VAL
49#endif
50#ifdef PYPY_VERSION
51#define CYTHON_COMPILING_IN_PYPY 1
52#define CYTHON_COMPILING_IN_CPYTHON 0
53#else
54#define CYTHON_COMPILING_IN_PYPY 0
55#define CYTHON_COMPILING_IN_CPYTHON 1
56#endif
57#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
58#define Py_OptimizeFlag 0
59#endif
60#define __PYX_BUILD_PY_SSIZE_T "n"
61#define CYTHON_FORMAT_SSIZE_T "z"
62#if PY_MAJOR_VERSION < 3
63  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
64  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
65          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
66  #define __Pyx_DefaultClassType PyClass_Type
67#else
68  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
69  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
70          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
71  #define __Pyx_DefaultClassType PyType_Type
72#endif
73#if PY_MAJOR_VERSION >= 3
74  #define Py_TPFLAGS_CHECKTYPES 0
75  #define Py_TPFLAGS_HAVE_INDEX 0
76  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
77#endif
78#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
79  #define Py_TPFLAGS_HAVE_FINALIZE 0
80#endif
81#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
82  #define CYTHON_PEP393_ENABLED 1
83  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
84                                              0 : _PyUnicode_Ready((PyObject *)(op)))
85  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
86  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
87  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
88  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
89  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
90#else
91  #define CYTHON_PEP393_ENABLED 0
92  #define __Pyx_PyUnicode_READY(op)       (0)
93  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
94  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
95  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
96  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
97  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
98#endif
99#if CYTHON_COMPILING_IN_PYPY
100  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
101  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
102  #define __Pyx_PyFrozenSet_Size(s)         PyObject_Size(s)
103#else
104  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
105  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
106      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
107  #define __Pyx_PyFrozenSet_Size(s)         PySet_Size(s)
108#endif
109#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
110#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
111#if PY_MAJOR_VERSION >= 3
112  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
113#else
114  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
115#endif
116#if PY_MAJOR_VERSION >= 3
117  #define PyBaseString_Type            PyUnicode_Type
118  #define PyStringObject               PyUnicodeObject
119  #define PyString_Type                PyUnicode_Type
120  #define PyString_Check               PyUnicode_Check
121  #define PyString_CheckExact          PyUnicode_CheckExact
122#endif
123#if PY_MAJOR_VERSION >= 3
124  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
125  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
126#else
127  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
128  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
129#endif
130#ifndef PySet_CheckExact
131  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
132#endif
133#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
134#if PY_MAJOR_VERSION >= 3
135  #define PyIntObject                  PyLongObject
136  #define PyInt_Type                   PyLong_Type
137  #define PyInt_Check(op)              PyLong_Check(op)
138  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
139  #define PyInt_FromString             PyLong_FromString
140  #define PyInt_FromUnicode            PyLong_FromUnicode
141  #define PyInt_FromLong               PyLong_FromLong
142  #define PyInt_FromSize_t             PyLong_FromSize_t
143  #define PyInt_FromSsize_t            PyLong_FromSsize_t
144  #define PyInt_AsLong                 PyLong_AsLong
145  #define PyInt_AS_LONG                PyLong_AS_LONG
146  #define PyInt_AsSsize_t              PyLong_AsSsize_t
147  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
148  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
149  #define PyNumber_Int                 PyNumber_Long
150#endif
151#if PY_MAJOR_VERSION >= 3
152  #define PyBoolObject                 PyLongObject
153#endif
154#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
155  #ifndef PyUnicode_InternFromString
156    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
157  #endif
158#endif
159#if PY_VERSION_HEX < 0x030200A4
160  typedef long Py_hash_t;
161  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
162  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
163#else
164  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
165  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
166#endif
167#if PY_MAJOR_VERSION >= 3
168  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
169#else
170  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
171#endif
172#ifndef CYTHON_INLINE
173  #if defined(__GNUC__)
174    #define CYTHON_INLINE __inline__
175  #elif defined(_MSC_VER)
176    #define CYTHON_INLINE __inline
177  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
178    #define CYTHON_INLINE inline
179  #else
180    #define CYTHON_INLINE
181  #endif
182#endif
183#ifndef CYTHON_RESTRICT
184  #if defined(__GNUC__)
185    #define CYTHON_RESTRICT __restrict__
186  #elif defined(_MSC_VER) && _MSC_VER >= 1400
187    #define CYTHON_RESTRICT __restrict
188  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
189    #define CYTHON_RESTRICT restrict
190  #else
191    #define CYTHON_RESTRICT
192  #endif
193#endif
194#ifdef NAN
195#define __PYX_NAN() ((float) NAN)
196#else
197static CYTHON_INLINE float __PYX_NAN() {
198  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
199   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
200   a quiet NaN. */
201  float value;
202  memset(&value, 0xFF, sizeof(value));
203  return value;
204}
205#endif
206#ifdef __cplusplus
207template<typename T>
208void __Pyx_call_destructor(T* x) {
209    x->~T();
210}
211#endif
212
213
214#if PY_MAJOR_VERSION >= 3
215  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
216  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
217#else
218  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
219  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
220#endif
221
222#ifndef __PYX_EXTERN_C
223  #ifdef __cplusplus
224    #define __PYX_EXTERN_C extern "C"
225  #else
226    #define __PYX_EXTERN_C extern
227  #endif
228#endif
229
230#if defined(WIN32) || defined(MS_WINDOWS)
231#define _USE_MATH_DEFINES
232#endif
233#include <math.h>
234#define __PYX_HAVE__zmq__backend__cython___version
235#define __PYX_HAVE_API__zmq__backend__cython___version
236#include "zmq_compat.h"
237#include "zmq.h"
238#include "zmq_utils.h"
239#ifdef _OPENMP
240#include <omp.h>
241#endif /* _OPENMP */
242
243#ifdef PYREX_WITHOUT_ASSERTIONS
244#define CYTHON_WITHOUT_ASSERTIONS
245#endif
246
247#ifndef CYTHON_UNUSED
248# if defined(__GNUC__)
249#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
250#     define CYTHON_UNUSED __attribute__ ((__unused__))
251#   else
252#     define CYTHON_UNUSED
253#   endif
254# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
255#   define CYTHON_UNUSED __attribute__ ((__unused__))
256# else
257#   define CYTHON_UNUSED
258# endif
259#endif
260typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
261                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
262
263#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
264#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
265#define __PYX_DEFAULT_STRING_ENCODING ""
266#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
267#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
268#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (    \
269    (sizeof(type) < sizeof(Py_ssize_t))  ||             \
270    (sizeof(type) > sizeof(Py_ssize_t) &&               \
271          likely(v < (type)PY_SSIZE_T_MAX ||            \
272                 v == (type)PY_SSIZE_T_MAX)  &&         \
273          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||       \
274                                v == (type)PY_SSIZE_T_MIN)))  ||  \
275    (sizeof(type) == sizeof(Py_ssize_t) &&              \
276          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||        \
277                               v == (type)PY_SSIZE_T_MAX)))  )
278static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
279static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
280#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
281#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
282#define __Pyx_PyBytes_FromString        PyBytes_FromString
283#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
284static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
285#if PY_MAJOR_VERSION < 3
286    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
287    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
288#else
289    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
290    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
291#endif
292#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
293#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
294#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((const char*)s)
295#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((const char*)s)
296#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((const char*)s)
297#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((const char*)s)
298#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
299#if PY_MAJOR_VERSION < 3
300static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
301{
302    const Py_UNICODE *u_end = u;
303    while (*u_end++) ;
304    return (size_t)(u_end - u - 1);
305}
306#else
307#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
308#endif
309#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
310#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
311#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
312#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
313#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
314static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
315static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
316static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
317static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
318#if CYTHON_COMPILING_IN_CPYTHON
319#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
320#else
321#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
322#endif
323#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
324#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
325static int __Pyx_sys_getdefaultencoding_not_ascii;
326static int __Pyx_init_sys_getdefaultencoding_params(void) {
327    PyObject* sys;
328    PyObject* default_encoding = NULL;
329    PyObject* ascii_chars_u = NULL;
330    PyObject* ascii_chars_b = NULL;
331    const char* default_encoding_c;
332    sys = PyImport_ImportModule("sys");
333    if (!sys) goto bad;
334    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
335    Py_DECREF(sys);
336    if (!default_encoding) goto bad;
337    default_encoding_c = PyBytes_AsString(default_encoding);
338    if (!default_encoding_c) goto bad;
339    if (strcmp(default_encoding_c, "ascii") == 0) {
340        __Pyx_sys_getdefaultencoding_not_ascii = 0;
341    } else {
342        char ascii_chars[128];
343        int c;
344        for (c = 0; c < 128; c++) {
345            ascii_chars[c] = c;
346        }
347        __Pyx_sys_getdefaultencoding_not_ascii = 1;
348        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
349        if (!ascii_chars_u) goto bad;
350        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
351        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
352            PyErr_Format(
353                PyExc_ValueError,
354                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
355                default_encoding_c);
356            goto bad;
357        }
358        Py_DECREF(ascii_chars_u);
359        Py_DECREF(ascii_chars_b);
360    }
361    Py_DECREF(default_encoding);
362    return 0;
363bad:
364    Py_XDECREF(default_encoding);
365    Py_XDECREF(ascii_chars_u);
366    Py_XDECREF(ascii_chars_b);
367    return -1;
368}
369#endif
370#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
371#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
372#else
373#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
374#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
375static char* __PYX_DEFAULT_STRING_ENCODING;
376static int __Pyx_init_sys_getdefaultencoding_params(void) {
377    PyObject* sys;
378    PyObject* default_encoding = NULL;
379    char* default_encoding_c;
380    sys = PyImport_ImportModule("sys");
381    if (!sys) goto bad;
382    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
383    Py_DECREF(sys);
384    if (!default_encoding) goto bad;
385    default_encoding_c = PyBytes_AsString(default_encoding);
386    if (!default_encoding_c) goto bad;
387    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
388    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
389    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
390    Py_DECREF(default_encoding);
391    return 0;
392bad:
393    Py_XDECREF(default_encoding);
394    return -1;
395}
396#endif
397#endif
398
399
400/* Test for GCC > 2.95 */
401#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
402  #define likely(x)   __builtin_expect(!!(x), 1)
403  #define unlikely(x) __builtin_expect(!!(x), 0)
404#else /* !__GNUC__ or GCC < 2.95 */
405  #define likely(x)   (x)
406  #define unlikely(x) (x)
407#endif /* __GNUC__ */
408
409static PyObject *__pyx_m;
410static PyObject *__pyx_d;
411static PyObject *__pyx_b;
412static PyObject *__pyx_empty_tuple;
413static PyObject *__pyx_empty_bytes;
414static int __pyx_lineno;
415static int __pyx_clineno = 0;
416static const char * __pyx_cfilenm= __FILE__;
417static const char *__pyx_filename;
418
419
420static const char *__pyx_f[] = {
421  "zmq/backend/cython/_version.pyx",
422};
423
424/*--- Type declarations ---*/
425#ifndef CYTHON_REFNANNY
426  #define CYTHON_REFNANNY 0
427#endif
428#if CYTHON_REFNANNY
429  typedef struct {
430    void (*INCREF)(void*, PyObject*, int);
431    void (*DECREF)(void*, PyObject*, int);
432    void (*GOTREF)(void*, PyObject*, int);
433    void (*GIVEREF)(void*, PyObject*, int);
434    void* (*SetupContext)(const char*, int, const char*);
435    void (*FinishContext)(void**);
436  } __Pyx_RefNannyAPIStruct;
437  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
438  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
439  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
440#ifdef WITH_THREAD
441  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
442          if (acquire_gil) { \
443              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
444              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
445              PyGILState_Release(__pyx_gilstate_save); \
446          } else { \
447              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
448          }
449#else
450  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
451          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
452#endif
453  #define __Pyx_RefNannyFinishContext() \
454          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
455  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
456  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
457  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
458  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
459  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
460  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
461  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
462  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
463#else
464  #define __Pyx_RefNannyDeclarations
465  #define __Pyx_RefNannySetupContext(name, acquire_gil)
466  #define __Pyx_RefNannyFinishContext()
467  #define __Pyx_INCREF(r) Py_INCREF(r)
468  #define __Pyx_DECREF(r) Py_DECREF(r)
469  #define __Pyx_GOTREF(r)
470  #define __Pyx_GIVEREF(r)
471  #define __Pyx_XINCREF(r) Py_XINCREF(r)
472  #define __Pyx_XDECREF(r) Py_XDECREF(r)
473  #define __Pyx_XGOTREF(r)
474  #define __Pyx_XGIVEREF(r)
475#endif
476#define __Pyx_XDECREF_SET(r, v) do {                            \
477        PyObject *tmp = (PyObject *) r;                         \
478        r = v; __Pyx_XDECREF(tmp);                              \
479    } while (0)
480#define __Pyx_DECREF_SET(r, v) do {                             \
481        PyObject *tmp = (PyObject *) r;                         \
482        r = v; __Pyx_DECREF(tmp);                               \
483    } while (0)
484#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
485#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
486
487typedef struct {
488    int code_line;
489    PyCodeObject* code_object;
490} __Pyx_CodeObjectCacheEntry;
491struct __Pyx_CodeObjectCache {
492    int count;
493    int max_count;
494    __Pyx_CodeObjectCacheEntry* entries;
495};
496static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
497static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
498static PyCodeObject *__pyx_find_code_object(int code_line);
499static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
500
501static void __Pyx_AddTraceback(const char *funcname, int c_line,
502                               int py_line, const char *filename);
503
504static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
505
506static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
507
508static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
509
510static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
511
512static int __Pyx_check_binary_version(void);
513
514static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
515
516
517/* Module declarations from 'zmq.backend.cython.libzmq' */
518
519/* Module declarations from 'zmq.backend.cython._version' */
520#define __Pyx_MODULE_NAME "zmq.backend.cython._version"
521int __pyx_module_is_main_zmq__backend__cython___version = 0;
522
523/* Implementation of 'zmq.backend.cython._version' */
524static PyObject *__pyx_pf_3zmq_7backend_6cython_8_version_zmq_version_info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
525static char __pyx_k_all[] = "__all__";
526static char __pyx_k_main[] = "__main__";
527static char __pyx_k_test[] = "__test__";
528static char __pyx_k_major[] = "major";
529static char __pyx_k_minor[] = "minor";
530static char __pyx_k_patch[] = "patch";
531static char __pyx_k_zmq_version_info[] = "zmq_version_info";
532static char __pyx_k_zmq_backend_cython__version[] = "zmq.backend.cython._version";
533static char __pyx_k_PyZMQ_and_0MQ_version_functions[] = "PyZMQ and 0MQ version functions.";
534static char __pyx_k_private_tmp_pyzmq_release_zmq_b[] = "/private/tmp/pyzmq-release/zmq/backend/cython/_version.pyx";
535static PyObject *__pyx_n_s_all;
536static PyObject *__pyx_n_s_main;
537static PyObject *__pyx_n_s_major;
538static PyObject *__pyx_n_s_minor;
539static PyObject *__pyx_n_s_patch;
540static PyObject *__pyx_kp_s_private_tmp_pyzmq_release_zmq_b;
541static PyObject *__pyx_n_s_test;
542static PyObject *__pyx_n_s_zmq_backend_cython__version;
543static PyObject *__pyx_n_s_zmq_version_info;
544static PyObject *__pyx_tuple_;
545static PyObject *__pyx_codeobj__2;
546
547/* "zmq/backend/cython/_version.pyx":32
548 * #-----------------------------------------------------------------------------
549 *
550 * def zmq_version_info():             # <<<<<<<<<<<<<<
551 *     """zmq_version_info()
552 *
553 */
554
555/* Python wrapper */
556static PyObject *__pyx_pw_3zmq_7backend_6cython_8_version_1zmq_version_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
557static 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    ";
558static 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};
559static PyObject *__pyx_pw_3zmq_7backend_6cython_8_version_1zmq_version_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
560  PyObject *__pyx_r = 0;
561  __Pyx_RefNannyDeclarations
562  __Pyx_RefNannySetupContext("zmq_version_info (wrapper)", 0);
563  __pyx_r = __pyx_pf_3zmq_7backend_6cython_8_version_zmq_version_info(__pyx_self);
564
565  /* function exit code */
566  __Pyx_RefNannyFinishContext();
567  return __pyx_r;
568}
569
570static PyObject *__pyx_pf_3zmq_7backend_6cython_8_version_zmq_version_info(CYTHON_UNUSED PyObject *__pyx_self) {
571  int __pyx_v_major;
572  int __pyx_v_minor;
573  int __pyx_v_patch;
574  PyObject *__pyx_r = NULL;
575  __Pyx_RefNannyDeclarations
576  PyObject *__pyx_t_1 = NULL;
577  PyObject *__pyx_t_2 = NULL;
578  PyObject *__pyx_t_3 = NULL;
579  PyObject *__pyx_t_4 = NULL;
580  int __pyx_lineno = 0;
581  const char *__pyx_filename = NULL;
582  int __pyx_clineno = 0;
583  __Pyx_RefNannySetupContext("zmq_version_info", 0);
584
585  /* "zmq/backend/cython/_version.pyx":38
586 *     """
587 *     cdef int major, minor, patch
588 *     _zmq_version(&major, &minor, &patch)             # <<<<<<<<<<<<<<
589 *     return (major, minor, patch)
590 *
591 */
592  zmq_version((&__pyx_v_major), (&__pyx_v_minor), (&__pyx_v_patch));
593
594  /* "zmq/backend/cython/_version.pyx":39
595 *     cdef int major, minor, patch
596 *     _zmq_version(&major, &minor, &patch)
597 *     return (major, minor, patch)             # <<<<<<<<<<<<<<
598 *
599 *
600 */
601  __Pyx_XDECREF(__pyx_r);
602  __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;}
603  __Pyx_GOTREF(__pyx_t_1);
604  __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;}
605  __Pyx_GOTREF(__pyx_t_2);
606  __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;}
607  __Pyx_GOTREF(__pyx_t_3);
608  __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;}
609  __Pyx_GOTREF(__pyx_t_4);
610  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
611  __Pyx_GIVEREF(__pyx_t_1);
612  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
613  __Pyx_GIVEREF(__pyx_t_2);
614  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
615  __Pyx_GIVEREF(__pyx_t_3);
616  __pyx_t_1 = 0;
617  __pyx_t_2 = 0;
618  __pyx_t_3 = 0;
619  __pyx_r = __pyx_t_4;
620  __pyx_t_4 = 0;
621  goto __pyx_L0;
622
623  /* "zmq/backend/cython/_version.pyx":32
624 * #-----------------------------------------------------------------------------
625 *
626 * def zmq_version_info():             # <<<<<<<<<<<<<<
627 *     """zmq_version_info()
628 *
629 */
630
631  /* function exit code */
632  __pyx_L1_error:;
633  __Pyx_XDECREF(__pyx_t_1);
634  __Pyx_XDECREF(__pyx_t_2);
635  __Pyx_XDECREF(__pyx_t_3);
636  __Pyx_XDECREF(__pyx_t_4);
637  __Pyx_AddTraceback("zmq.backend.cython._version.zmq_version_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
638  __pyx_r = NULL;
639  __pyx_L0:;
640  __Pyx_XGIVEREF(__pyx_r);
641  __Pyx_RefNannyFinishContext();
642  return __pyx_r;
643}
644
645static PyMethodDef __pyx_methods[] = {
646  {0, 0, 0, 0}
647};
648
649#if PY_MAJOR_VERSION >= 3
650static struct PyModuleDef __pyx_moduledef = {
651  #if PY_VERSION_HEX < 0x03020000
652    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
653  #else
654    PyModuleDef_HEAD_INIT,
655  #endif
656    "_version",
657    __pyx_k_PyZMQ_and_0MQ_version_functions, /* m_doc */
658    -1, /* m_size */
659    __pyx_methods /* m_methods */,
660    NULL, /* m_reload */
661    NULL, /* m_traverse */
662    NULL, /* m_clear */
663    NULL /* m_free */
664};
665#endif
666
667static __Pyx_StringTabEntry __pyx_string_tab[] = {
668  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
669  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
670  {&__pyx_n_s_major, __pyx_k_major, sizeof(__pyx_k_major), 0, 0, 1, 1},
671  {&__pyx_n_s_minor, __pyx_k_minor, sizeof(__pyx_k_minor), 0, 0, 1, 1},
672  {&__pyx_n_s_patch, __pyx_k_patch, sizeof(__pyx_k_patch), 0, 0, 1, 1},
673  {&__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},
674  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
675  {&__pyx_n_s_zmq_backend_cython__version, __pyx_k_zmq_backend_cython__version, sizeof(__pyx_k_zmq_backend_cython__version), 0, 0, 1, 1},
676  {&__pyx_n_s_zmq_version_info, __pyx_k_zmq_version_info, sizeof(__pyx_k_zmq_version_info), 0, 0, 1, 1},
677  {0, 0, 0, 0, 0, 0, 0}
678};
679static int __Pyx_InitCachedBuiltins(void) {
680  return 0;
681}
682
683static int __Pyx_InitCachedConstants(void) {
684  __Pyx_RefNannyDeclarations
685  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
686
687  /* "zmq/backend/cython/_version.pyx":32
688 * #-----------------------------------------------------------------------------
689 *
690 * def zmq_version_info():             # <<<<<<<<<<<<<<
691 *     """zmq_version_info()
692 *
693 */
694  __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;}
695  __Pyx_GOTREF(__pyx_tuple_);
696  __Pyx_GIVEREF(__pyx_tuple_);
697  __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;}
698  __Pyx_RefNannyFinishContext();
699  return 0;
700  __pyx_L1_error:;
701  __Pyx_RefNannyFinishContext();
702  return -1;
703}
704
705static int __Pyx_InitGlobals(void) {
706  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
707  return 0;
708  __pyx_L1_error:;
709  return -1;
710}
711
712#if PY_MAJOR_VERSION < 3
713PyMODINIT_FUNC init_version(void); /*proto*/
714PyMODINIT_FUNC init_version(void)
715#else
716PyMODINIT_FUNC PyInit__version(void); /*proto*/
717PyMODINIT_FUNC PyInit__version(void)
718#endif
719{
720  PyObject *__pyx_t_1 = NULL;
721  int __pyx_lineno = 0;
722  const char *__pyx_filename = NULL;
723  int __pyx_clineno = 0;
724  __Pyx_RefNannyDeclarations
725  #if CYTHON_REFNANNY
726  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
727  if (!__Pyx_RefNanny) {
728      PyErr_Clear();
729      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
730      if (!__Pyx_RefNanny)
731          Py_FatalError("failed to import 'refnanny' module");
732  }
733  #endif
734  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__version(void)", 0);
735  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
736  __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;}
737  __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;}
738  #ifdef __Pyx_CyFunction_USED
739  if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
740  #endif
741  #ifdef __Pyx_FusedFunction_USED
742  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
743  #endif
744  #ifdef __Pyx_Generator_USED
745  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
746  #endif
747  /*--- Library function declarations ---*/
748  /*--- Threads initialization code ---*/
749  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
750  #ifdef WITH_THREAD /* Python build with threading support? */
751  PyEval_InitThreads();
752  #endif
753  #endif
754  /*--- Module creation code ---*/
755  #if PY_MAJOR_VERSION < 3
756  __pyx_m = Py_InitModule4("_version", __pyx_methods, __pyx_k_PyZMQ_and_0MQ_version_functions, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
757  #else
758  __pyx_m = PyModule_Create(&__pyx_moduledef);
759  #endif
760  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
761  __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;}
762  Py_INCREF(__pyx_d);
763  __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;}
764  #if CYTHON_COMPILING_IN_PYPY
765  Py_INCREF(__pyx_b);
766  #endif
767  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
768  /*--- Initialize various global constants etc. ---*/
769  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
770  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
771  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
772  #endif
773  if (__pyx_module_is_main_zmq__backend__cython___version) {
774    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;};
775  }
776  #if PY_MAJOR_VERSION >= 3
777  {
778    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
779    if (!PyDict_GetItemString(modules, "zmq.backend.cython._version")) {
780      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;}
781    }
782  }
783  #endif
784  /*--- Builtin init code ---*/
785  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
786  /*--- Constants init code ---*/
787  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
788  /*--- Global init code ---*/
789  /*--- Variable export code ---*/
790  /*--- Function export code ---*/
791  /*--- Type init code ---*/
792  /*--- Type import code ---*/
793  /*--- Variable import code ---*/
794  /*--- Function import code ---*/
795  /*--- Execution code ---*/
796
797  /* "zmq/backend/cython/_version.pyx":32
798 * #-----------------------------------------------------------------------------
799 *
800 * def zmq_version_info():             # <<<<<<<<<<<<<<
801 *     """zmq_version_info()
802 *
803 */
804  __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;}
805  __Pyx_GOTREF(__pyx_t_1);
806  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;}
807  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
808
809  /* "zmq/backend/cython/_version.pyx":42
810 *
811 *
812 * __all__ = ['zmq_version_info']             # <<<<<<<<<<<<<<
813 *
814 */
815  __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;}
816  __Pyx_GOTREF(__pyx_t_1);
817  __Pyx_INCREF(__pyx_n_s_zmq_version_info);
818  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_zmq_version_info);
819  __Pyx_GIVEREF(__pyx_n_s_zmq_version_info);
820  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;}
821  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
822
823  /* "zmq/backend/cython/_version.pyx":1
824 * """PyZMQ and 0MQ version functions."""             # <<<<<<<<<<<<<<
825 *
826 * #
827 */
828  __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;}
829  __Pyx_GOTREF(__pyx_t_1);
830  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;}
831  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
832
833  /*--- Wrapped vars code ---*/
834
835  goto __pyx_L0;
836  __pyx_L1_error:;
837  __Pyx_XDECREF(__pyx_t_1);
838  if (__pyx_m) {
839    if (__pyx_d) {
840      __Pyx_AddTraceback("init zmq.backend.cython._version", __pyx_clineno, __pyx_lineno, __pyx_filename);
841    }
842    Py_DECREF(__pyx_m); __pyx_m = 0;
843  } else if (!PyErr_Occurred()) {
844    PyErr_SetString(PyExc_ImportError, "init zmq.backend.cython._version");
845  }
846  __pyx_L0:;
847  __Pyx_RefNannyFinishContext();
848  #if PY_MAJOR_VERSION < 3
849  return;
850  #else
851  return __pyx_m;
852  #endif
853}
854
855/* Runtime support code */
856#if CYTHON_REFNANNY
857static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
858    PyObject *m = NULL, *p = NULL;
859    void *r = NULL;
860    m = PyImport_ImportModule((char *)modname);
861    if (!m) goto end;
862    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
863    if (!p) goto end;
864    r = PyLong_AsVoidPtr(p);
865end:
866    Py_XDECREF(p);
867    Py_XDECREF(m);
868    return (__Pyx_RefNannyAPIStruct *)r;
869}
870#endif
871
872static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
873    int start = 0, mid = 0, end = count - 1;
874    if (end >= 0 && code_line > entries[end].code_line) {
875        return count;
876    }
877    while (start < end) {
878        mid = (start + end) / 2;
879        if (code_line < entries[mid].code_line) {
880            end = mid;
881        } else if (code_line > entries[mid].code_line) {
882             start = mid + 1;
883        } else {
884            return mid;
885        }
886    }
887    if (code_line <= entries[mid].code_line) {
888        return mid;
889    } else {
890        return mid + 1;
891    }
892}
893static PyCodeObject *__pyx_find_code_object(int code_line) {
894    PyCodeObject* code_object;
895    int pos;
896    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
897        return NULL;
898    }
899    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
900    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
901        return NULL;
902    }
903    code_object = __pyx_code_cache.entries[pos].code_object;
904    Py_INCREF(code_object);
905    return code_object;
906}
907static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
908    int pos, i;
909    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
910    if (unlikely(!code_line)) {
911        return;
912    }
913    if (unlikely(!entries)) {
914        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
915        if (likely(entries)) {
916            __pyx_code_cache.entries = entries;
917            __pyx_code_cache.max_count = 64;
918            __pyx_code_cache.count = 1;
919            entries[0].code_line = code_line;
920            entries[0].code_object = code_object;
921            Py_INCREF(code_object);
922        }
923        return;
924    }
925    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
926    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
927        PyCodeObject* tmp = entries[pos].code_object;
928        entries[pos].code_object = code_object;
929        Py_DECREF(tmp);
930        return;
931    }
932    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
933        int new_max = __pyx_code_cache.max_count + 64;
934        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
935            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
936        if (unlikely(!entries)) {
937            return;
938        }
939        __pyx_code_cache.entries = entries;
940        __pyx_code_cache.max_count = new_max;
941    }
942    for (i=__pyx_code_cache.count; i>pos; i--) {
943        entries[i] = entries[i-1];
944    }
945    entries[pos].code_line = code_line;
946    entries[pos].code_object = code_object;
947    __pyx_code_cache.count++;
948    Py_INCREF(code_object);
949}
950
951#include "compile.h"
952#include "frameobject.h"
953#include "traceback.h"
954static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
955            const char *funcname, int c_line,
956            int py_line, const char *filename) {
957    PyCodeObject *py_code = 0;
958    PyObject *py_srcfile = 0;
959    PyObject *py_funcname = 0;
960    #if PY_MAJOR_VERSION < 3
961    py_srcfile = PyString_FromString(filename);
962    #else
963    py_srcfile = PyUnicode_FromString(filename);
964    #endif
965    if (!py_srcfile) goto bad;
966    if (c_line) {
967        #if PY_MAJOR_VERSION < 3
968        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
969        #else
970        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
971        #endif
972    }
973    else {
974        #if PY_MAJOR_VERSION < 3
975        py_funcname = PyString_FromString(funcname);
976        #else
977        py_funcname = PyUnicode_FromString(funcname);
978        #endif
979    }
980    if (!py_funcname) goto bad;
981    py_code = __Pyx_PyCode_New(
982        0,
983        0,
984        0,
985        0,
986        0,
987        __pyx_empty_bytes, /*PyObject *code,*/
988        __pyx_empty_tuple, /*PyObject *consts,*/
989        __pyx_empty_tuple, /*PyObject *names,*/
990        __pyx_empty_tuple, /*PyObject *varnames,*/
991        __pyx_empty_tuple, /*PyObject *freevars,*/
992        __pyx_empty_tuple, /*PyObject *cellvars,*/
993        py_srcfile,   /*PyObject *filename,*/
994        py_funcname,  /*PyObject *name,*/
995        py_line,
996        __pyx_empty_bytes  /*PyObject *lnotab*/
997    );
998    Py_DECREF(py_srcfile);
999    Py_DECREF(py_funcname);
1000    return py_code;
1001bad:
1002    Py_XDECREF(py_srcfile);
1003    Py_XDECREF(py_funcname);
1004    return NULL;
1005}
1006static void __Pyx_AddTraceback(const char *funcname, int c_line,
1007                               int py_line, const char *filename) {
1008    PyCodeObject *py_code = 0;
1009    PyFrameObject *py_frame = 0;
1010    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
1011    if (!py_code) {
1012        py_code = __Pyx_CreateCodeObjectForTraceback(
1013            funcname, c_line, py_line, filename);
1014        if (!py_code) goto bad;
1015        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
1016    }
1017    py_frame = PyFrame_New(
1018        PyThreadState_GET(), /*PyThreadState *tstate,*/
1019        py_code,             /*PyCodeObject *code,*/
1020        __pyx_d,      /*PyObject *globals,*/
1021        0                    /*PyObject *locals*/
1022    );
1023    if (!py_frame) goto bad;
1024    py_frame->f_lineno = py_line;
1025    PyTraceBack_Here(py_frame);
1026bad:
1027    Py_XDECREF(py_code);
1028    Py_XDECREF(py_frame);
1029}
1030
1031static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
1032    const int neg_one = (int) -1, const_zero = 0;
1033    const int is_unsigned = neg_one > const_zero;
1034    if (is_unsigned) {
1035        if (sizeof(int) < sizeof(long)) {
1036            return PyInt_FromLong((long) value);
1037        } else if (sizeof(int) <= sizeof(unsigned long)) {
1038            return PyLong_FromUnsignedLong((unsigned long) value);
1039        } else if (sizeof(int) <= sizeof(unsigned long long)) {
1040            return PyLong_FromUnsignedLongLong((unsigned long long) value);
1041        }
1042    } else {
1043        if (sizeof(int) <= sizeof(long)) {
1044            return PyInt_FromLong((long) value);
1045        } else if (sizeof(int) <= sizeof(long long)) {
1046            return PyLong_FromLongLong((long long) value);
1047        }
1048    }
1049    {
1050        int one = 1; int little = (int)*(unsigned char *)&one;
1051        unsigned char *bytes = (unsigned char *)&value;
1052        return _PyLong_FromByteArray(bytes, sizeof(int),
1053                                     little, !is_unsigned);
1054    }
1055}
1056
1057static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
1058    const long neg_one = (long) -1, const_zero = 0;
1059    const int is_unsigned = neg_one > const_zero;
1060    if (is_unsigned) {
1061        if (sizeof(long) < sizeof(long)) {
1062            return PyInt_FromLong((long) value);
1063        } else if (sizeof(long) <= sizeof(unsigned long)) {
1064            return PyLong_FromUnsignedLong((unsigned long) value);
1065        } else if (sizeof(long) <= sizeof(unsigned long long)) {
1066            return PyLong_FromUnsignedLongLong((unsigned long long) value);
1067        }
1068    } else {
1069        if (sizeof(long) <= sizeof(long)) {
1070            return PyInt_FromLong((long) value);
1071        } else if (sizeof(long) <= sizeof(long long)) {
1072            return PyLong_FromLongLong((long long) value);
1073        }
1074    }
1075    {
1076        int one = 1; int little = (int)*(unsigned char *)&one;
1077        unsigned char *bytes = (unsigned char *)&value;
1078        return _PyLong_FromByteArray(bytes, sizeof(long),
1079                                     little, !is_unsigned);
1080    }
1081}
1082
1083#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)       \
1084    {                                                                     \
1085        func_type value = func_value;                                     \
1086        if (sizeof(target_type) < sizeof(func_type)) {                    \
1087            if (unlikely(value != (func_type) (target_type) value)) {     \
1088                func_type zero = 0;                                       \
1089                if (is_unsigned && unlikely(value < zero))                \
1090                    goto raise_neg_overflow;                              \
1091                else                                                      \
1092                    goto raise_overflow;                                  \
1093            }                                                             \
1094        }                                                                 \
1095        return (target_type) value;                                       \
1096    }
1097
1098#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
1099 #if CYTHON_USE_PYLONG_INTERNALS
1100  #include "longintrepr.h"
1101 #endif
1102#endif
1103
1104static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
1105    const long neg_one = (long) -1, const_zero = 0;
1106    const int is_unsigned = neg_one > const_zero;
1107#if PY_MAJOR_VERSION < 3
1108    if (likely(PyInt_Check(x))) {
1109        if (sizeof(long) < sizeof(long)) {
1110            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
1111        } else {
1112            long val = PyInt_AS_LONG(x);
1113            if (is_unsigned && unlikely(val < 0)) {
1114                goto raise_neg_overflow;
1115            }
1116            return (long) val;
1117        }
1118    } else
1119#endif
1120    if (likely(PyLong_Check(x))) {
1121        if (is_unsigned) {
1122#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
1123 #if CYTHON_USE_PYLONG_INTERNALS
1124            switch (Py_SIZE(x)) {
1125                case  0: return 0;
1126                case  1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
1127            }
1128 #endif
1129#endif
1130            if (unlikely(Py_SIZE(x) < 0)) {
1131                goto raise_neg_overflow;
1132            }
1133            if (sizeof(long) <= sizeof(unsigned long)) {
1134                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
1135            } else if (sizeof(long) <= sizeof(unsigned long long)) {
1136                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
1137            }
1138        } else {
1139#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
1140 #if CYTHON_USE_PYLONG_INTERNALS
1141            switch (Py_SIZE(x)) {
1142                case  0: return 0;
1143                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +(((PyLongObject*)x)->ob_digit[0]));
1144                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
1145            }
1146 #endif
1147#endif
1148            if (sizeof(long) <= sizeof(long)) {
1149                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
1150            } else if (sizeof(long) <= sizeof(long long)) {
1151                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
1152            }
1153        }
1154        {
1155#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
1156            PyErr_SetString(PyExc_RuntimeError,
1157                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
1158#else
1159            long val;
1160            PyObject *v = __Pyx_PyNumber_Int(x);
1161 #if PY_MAJOR_VERSION < 3
1162            if (likely(v) && !PyLong_Check(v)) {
1163                PyObject *tmp = v;
1164                v = PyNumber_Long(tmp);
1165                Py_DECREF(tmp);
1166            }
1167 #endif
1168            if (likely(v)) {
1169                int one = 1; int is_little = (int)*(unsigned char *)&one;
1170                unsigned char *bytes = (unsigned char *)&val;
1171                int ret = _PyLong_AsByteArray((PyLongObject *)v,
1172                                              bytes, sizeof(val),
1173                                              is_little, !is_unsigned);
1174                Py_DECREF(v);
1175                if (likely(!ret))
1176                    return val;
1177            }
1178#endif
1179            return (long) -1;
1180        }
1181    } else {
1182        long val;
1183        PyObject *tmp = __Pyx_PyNumber_Int(x);
1184        if (!tmp) return (long) -1;
1185        val = __Pyx_PyInt_As_long(tmp);
1186        Py_DECREF(tmp);
1187        return val;
1188    }
1189raise_overflow:
1190    PyErr_SetString(PyExc_OverflowError,
1191        "value too large to convert to long");
1192    return (long) -1;
1193raise_neg_overflow:
1194    PyErr_SetString(PyExc_OverflowError,
1195        "can't convert negative value to long");
1196    return (long) -1;
1197}
1198
1199static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
1200    const int neg_one = (int) -1, const_zero = 0;
1201    const int is_unsigned = neg_one > const_zero;
1202#if PY_MAJOR_VERSION < 3
1203    if (likely(PyInt_Check(x))) {
1204        if (sizeof(int) < sizeof(long)) {
1205            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
1206        } else {
1207            long val = PyInt_AS_LONG(x);
1208            if (is_unsigned && unlikely(val < 0)) {
1209                goto raise_neg_overflow;
1210            }
1211            return (int) val;
1212        }
1213    } else
1214#endif
1215    if (likely(PyLong_Check(x))) {
1216        if (is_unsigned) {
1217#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
1218 #if CYTHON_USE_PYLONG_INTERNALS
1219            switch (Py_SIZE(x)) {
1220                case  0: return 0;
1221                case  1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
1222            }
1223 #endif
1224#endif
1225            if (unlikely(Py_SIZE(x) < 0)) {
1226                goto raise_neg_overflow;
1227            }
1228            if (sizeof(int) <= sizeof(unsigned long)) {
1229                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
1230            } else if (sizeof(int) <= sizeof(unsigned long long)) {
1231                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
1232            }
1233        } else {
1234#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
1235 #if CYTHON_USE_PYLONG_INTERNALS
1236            switch (Py_SIZE(x)) {
1237                case  0: return 0;
1238                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
1239                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
1240            }
1241 #endif
1242#endif
1243            if (sizeof(int) <= sizeof(long)) {
1244                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
1245            } else if (sizeof(int) <= sizeof(long long)) {
1246                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
1247            }
1248        }
1249        {
1250#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
1251            PyErr_SetString(PyExc_RuntimeError,
1252                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
1253#else
1254            int val;
1255            PyObject *v = __Pyx_PyNumber_Int(x);
1256 #if PY_MAJOR_VERSION < 3
1257            if (likely(v) && !PyLong_Check(v)) {
1258                PyObject *tmp = v;
1259                v = PyNumber_Long(tmp);
1260                Py_DECREF(tmp);
1261            }
1262 #endif
1263            if (likely(v)) {
1264                int one = 1; int is_little = (int)*(unsigned char *)&one;
1265                unsigned char *bytes = (unsigned char *)&val;
1266                int ret = _PyLong_AsByteArray((PyLongObject *)v,
1267                                              bytes, sizeof(val),
1268                                              is_little, !is_unsigned);
1269                Py_DECREF(v);
1270                if (likely(!ret))
1271                    return val;
1272            }
1273#endif
1274            return (int) -1;
1275        }
1276    } else {
1277        int val;
1278        PyObject *tmp = __Pyx_PyNumber_Int(x);
1279        if (!tmp) return (int) -1;
1280        val = __Pyx_PyInt_As_int(tmp);
1281        Py_DECREF(tmp);
1282        return val;
1283    }
1284raise_overflow:
1285    PyErr_SetString(PyExc_OverflowError,
1286        "value too large to convert to int");
1287    return (int) -1;
1288raise_neg_overflow:
1289    PyErr_SetString(PyExc_OverflowError,
1290        "can't convert negative value to int");
1291    return (int) -1;
1292}
1293
1294static int __Pyx_check_binary_version(void) {
1295    char ctversion[4], rtversion[4];
1296    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
1297    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
1298    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
1299        char message[200];
1300        PyOS_snprintf(message, sizeof(message),
1301                      "compiletime version %s of module '%.100s' "
1302                      "does not match runtime version %s",
1303                      ctversion, __Pyx_MODULE_NAME, rtversion);
1304        return PyErr_WarnEx(NULL, message, 1);
1305    }
1306    return 0;
1307}
1308
1309static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
1310    while (t->p) {
1311        #if PY_MAJOR_VERSION < 3
1312        if (t->is_unicode) {
1313            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
1314        } else if (t->intern) {
1315            *t->p = PyString_InternFromString(t->s);
1316        } else {
1317            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
1318        }
1319        #else
1320        if (t->is_unicode | t->is_str) {
1321            if (t->intern) {
1322                *t->p = PyUnicode_InternFromString(t->s);
1323            } else if (t->encoding) {
1324                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
1325            } else {
1326                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
1327            }
1328        } else {
1329            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
1330        }
1331        #endif
1332        if (!*t->p)
1333            return -1;
1334        ++t;
1335    }
1336    return 0;
1337}
1338
1339static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
1340    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
1341}
1342static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
1343    Py_ssize_t ignore;
1344    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
1345}
1346static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
1347#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1348    if (
1349#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1350            __Pyx_sys_getdefaultencoding_not_ascii &&
1351#endif
1352            PyUnicode_Check(o)) {
1353#if PY_VERSION_HEX < 0x03030000
1354        char* defenc_c;
1355        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
1356        if (!defenc) return NULL;
1357        defenc_c = PyBytes_AS_STRING(defenc);
1358#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1359        {
1360            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
1361            char* c;
1362            for (c = defenc_c; c < end; c++) {
1363                if ((unsigned char) (*c) >= 128) {
1364                    PyUnicode_AsASCIIString(o);
1365                    return NULL;
1366                }
1367            }
1368        }
1369#endif
1370        *length = PyBytes_GET_SIZE(defenc);
1371        return defenc_c;
1372#else
1373        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
1374#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1375        if (PyUnicode_IS_ASCII(o)) {
1376            *length = PyUnicode_GET_LENGTH(o);
1377            return PyUnicode_AsUTF8(o);
1378        } else {
1379            PyUnicode_AsASCIIString(o);
1380            return NULL;
1381        }
1382#else
1383        return PyUnicode_AsUTF8AndSize(o, length);
1384#endif
1385#endif
1386    } else
1387#endif
1388#if !CYTHON_COMPILING_IN_PYPY
1389    if (PyByteArray_Check(o)) {
1390        *length = PyByteArray_GET_SIZE(o);
1391        return PyByteArray_AS_STRING(o);
1392    } else
1393#endif
1394    {
1395        char* result;
1396        int r = PyBytes_AsStringAndSize(o, &result, length);
1397        if (unlikely(r < 0)) {
1398            return NULL;
1399        } else {
1400            return result;
1401        }
1402    }
1403}
1404static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
1405   int is_true = x == Py_True;
1406   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
1407   else return PyObject_IsTrue(x);
1408}
1409static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
1410  PyNumberMethods *m;
1411  const char *name = NULL;
1412  PyObject *res = NULL;
1413#if PY_MAJOR_VERSION < 3
1414  if (PyInt_Check(x) || PyLong_Check(x))
1415#else
1416  if (PyLong_Check(x))
1417#endif
1418    return Py_INCREF(x), x;
1419  m = Py_TYPE(x)->tp_as_number;
1420#if PY_MAJOR_VERSION < 3
1421  if (m && m->nb_int) {
1422    name = "int";
1423    res = PyNumber_Int(x);
1424  }
1425  else if (m && m->nb_long) {
1426    name = "long";
1427    res = PyNumber_Long(x);
1428  }
1429#else
1430  if (m && m->nb_int) {
1431    name = "int";
1432    res = PyNumber_Long(x);
1433  }
1434#endif
1435  if (res) {
1436#if PY_MAJOR_VERSION < 3
1437    if (!PyInt_Check(res) && !PyLong_Check(res)) {
1438#else
1439    if (!PyLong_Check(res)) {
1440#endif
1441      PyErr_Format(PyExc_TypeError,
1442                   "__%.4s__ returned non-%.4s (type %.200s)",
1443                   name, name, Py_TYPE(res)->tp_name);
1444      Py_DECREF(res);
1445      return NULL;
1446    }
1447  }
1448  else if (!PyErr_Occurred()) {
1449    PyErr_SetString(PyExc_TypeError,
1450                    "an integer is required");
1451  }
1452  return res;
1453}
1454static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
1455  Py_ssize_t ival;
1456  PyObject *x;
1457#if PY_MAJOR_VERSION < 3
1458  if (likely(PyInt_CheckExact(b)))
1459      return PyInt_AS_LONG(b);
1460#endif
1461  if (likely(PyLong_CheckExact(b))) {
1462    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
1463     #if CYTHON_USE_PYLONG_INTERNALS
1464       switch (Py_SIZE(b)) {
1465       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
1466       case  0: return 0;
1467       case  1: return ((PyLongObject*)b)->ob_digit[0];
1468       }
1469     #endif
1470    #endif
1471    return PyLong_AsSsize_t(b);
1472  }
1473  x = PyNumber_Index(b);
1474  if (!x) return -1;
1475  ival = PyInt_AsSsize_t(x);
1476  Py_DECREF(x);
1477  return ival;
1478}
1479static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
1480    return PyInt_FromSize_t(ival);
1481}
1482
1483
1484#endif /* Py_PYTHON_H */
1485