~ubuntu-branches/ubuntu/raring/pyzmq/raring

« back to all changes in this revision

Viewing changes to zmq/core/version.c

  • Committer: Package Import Robot
  • Author(s): Debian Python Modules Team
  • Date: 2011-11-22 14:54:20 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20111122145420-k4siu00r9im6jg9g
Tags: 2.1.10-1
* New upstream version
* Build-depend on zeromq 2.1.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Generated by Cython 0.15.1 on Thu Oct 13 16:33:54 2011 */
 
2
 
 
3
#define PY_SSIZE_T_CLEAN
 
4
#include "Python.h"
 
5
#ifndef Py_PYTHON_H
 
6
    #error Python headers needed to compile C extensions, please install development version of Python.
 
7
#else
 
8
 
 
9
#include <stddef.h> /* For offsetof */
 
10
#ifndef offsetof
 
11
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
 
12
#endif
 
13
 
 
14
#if !defined(WIN32) && !defined(MS_WINDOWS)
 
15
  #ifndef __stdcall
 
16
    #define __stdcall
 
17
  #endif
 
18
  #ifndef __cdecl
 
19
    #define __cdecl
 
20
  #endif
 
21
  #ifndef __fastcall
 
22
    #define __fastcall
 
23
  #endif
 
24
#endif
 
25
 
 
26
#ifndef DL_IMPORT
 
27
  #define DL_IMPORT(t) t
 
28
#endif
 
29
#ifndef DL_EXPORT
 
30
  #define DL_EXPORT(t) t
 
31
#endif
 
32
 
 
33
#ifndef PY_LONG_LONG
 
34
  #define PY_LONG_LONG LONG_LONG
 
35
#endif
 
36
 
 
37
#if PY_VERSION_HEX < 0x02040000
 
38
  #define METH_COEXIST 0
 
39
  #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
 
40
  #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
 
41
#endif
 
42
 
 
43
#if PY_VERSION_HEX < 0x02050000
 
44
  typedef int Py_ssize_t;
 
45
  #define PY_SSIZE_T_MAX INT_MAX
 
46
  #define PY_SSIZE_T_MIN INT_MIN
 
47
  #define PY_FORMAT_SIZE_T ""
 
48
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
 
49
  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
 
50
  #define PyNumber_Index(o)    PyNumber_Int(o)
 
51
  #define PyIndex_Check(o)     PyNumber_Check(o)
 
52
  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
 
53
#endif
 
54
 
 
55
#if PY_VERSION_HEX < 0x02060000
 
56
  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
 
57
  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
 
58
  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
 
59
  #define PyVarObject_HEAD_INIT(type, size) \
 
60
          PyObject_HEAD_INIT(type) size,
 
61
  #define PyType_Modified(t)
 
62
 
 
63
  typedef struct {
 
64
     void *buf;
 
65
     PyObject *obj;
 
66
     Py_ssize_t len;
 
67
     Py_ssize_t itemsize;
 
68
     int readonly;
 
69
     int ndim;
 
70
     char *format;
 
71
     Py_ssize_t *shape;
 
72
     Py_ssize_t *strides;
 
73
     Py_ssize_t *suboffsets;
 
74
     void *internal;
 
75
  } Py_buffer;
 
76
 
 
77
  #define PyBUF_SIMPLE 0
 
78
  #define PyBUF_WRITABLE 0x0001
 
79
  #define PyBUF_FORMAT 0x0004
 
80
  #define PyBUF_ND 0x0008
 
81
  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
 
82
  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
 
83
  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
 
84
  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
 
85
  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
 
86
 
 
87
#endif
 
88
 
 
89
#if PY_MAJOR_VERSION < 3
 
90
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
 
91
#else
 
92
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
 
93
#endif
 
94
 
 
95
#if PY_MAJOR_VERSION >= 3
 
96
  #define Py_TPFLAGS_CHECKTYPES 0
 
97
  #define Py_TPFLAGS_HAVE_INDEX 0
 
98
#endif
 
99
 
 
100
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
 
101
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
 
102
#endif
 
103
 
 
104
#if PY_MAJOR_VERSION >= 3
 
105
  #define PyBaseString_Type            PyUnicode_Type
 
106
  #define PyStringObject               PyUnicodeObject
 
107
  #define PyString_Type                PyUnicode_Type
 
108
  #define PyString_Check               PyUnicode_Check
 
109
  #define PyString_CheckExact          PyUnicode_CheckExact
 
110
#endif
 
111
 
 
112
#if PY_VERSION_HEX < 0x02060000
 
113
  #define PyBytesObject                PyStringObject
 
114
  #define PyBytes_Type                 PyString_Type
 
115
  #define PyBytes_Check                PyString_Check
 
116
  #define PyBytes_CheckExact           PyString_CheckExact
 
117
  #define PyBytes_FromString           PyString_FromString
 
118
  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
 
119
  #define PyBytes_FromFormat           PyString_FromFormat
 
120
  #define PyBytes_DecodeEscape         PyString_DecodeEscape
 
121
  #define PyBytes_AsString             PyString_AsString
 
122
  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
 
123
  #define PyBytes_Size                 PyString_Size
 
124
  #define PyBytes_AS_STRING            PyString_AS_STRING
 
125
  #define PyBytes_GET_SIZE             PyString_GET_SIZE
 
126
  #define PyBytes_Repr                 PyString_Repr
 
127
  #define PyBytes_Concat               PyString_Concat
 
128
  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
 
129
#endif
 
130
 
 
131
#if PY_VERSION_HEX < 0x02060000
 
132
  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
 
133
  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
 
134
#endif
 
135
#ifndef PySet_CheckExact
 
136
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
 
137
#endif
 
138
 
 
139
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
 
140
 
 
141
#if PY_MAJOR_VERSION >= 3
 
142
  #define PyIntObject                  PyLongObject
 
143
  #define PyInt_Type                   PyLong_Type
 
144
  #define PyInt_Check(op)              PyLong_Check(op)
 
145
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
 
146
  #define PyInt_FromString             PyLong_FromString
 
147
  #define PyInt_FromUnicode            PyLong_FromUnicode
 
148
  #define PyInt_FromLong               PyLong_FromLong
 
149
  #define PyInt_FromSize_t             PyLong_FromSize_t
 
150
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
 
151
  #define PyInt_AsLong                 PyLong_AsLong
 
152
  #define PyInt_AS_LONG                PyLong_AS_LONG
 
153
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
 
154
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
 
155
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
 
156
#endif
 
157
 
 
158
#if PY_MAJOR_VERSION >= 3
 
159
  #define PyBoolObject                 PyLongObject
 
160
#endif
 
161
 
 
162
#if PY_VERSION_HEX < 0x03020000
 
163
  typedef long Py_hash_t;
 
164
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
 
165
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
 
166
#else
 
167
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
 
168
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
 
169
#endif
 
170
 
 
171
 
 
172
#if PY_MAJOR_VERSION >= 3
 
173
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
 
174
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
 
175
#else
 
176
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
 
177
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
 
178
#endif
 
179
 
 
180
#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
 
181
  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
 
182
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
 
183
  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
 
184
#else
 
185
  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
 
186
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
 
187
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
 
188
            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
 
189
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
 
190
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
 
191
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
 
192
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
 
193
  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
 
194
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
 
195
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
 
196
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
 
197
#endif
 
198
 
 
199
#if PY_MAJOR_VERSION >= 3
 
200
  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
 
201
#endif
 
202
 
 
203
#if PY_VERSION_HEX < 0x02050000
 
204
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
 
205
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
 
206
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
 
207
#else
 
208
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
 
209
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
 
210
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
 
211
#endif
 
212
 
 
213
#if PY_VERSION_HEX < 0x02050000
 
214
  #define __Pyx_NAMESTR(n) ((char *)(n))
 
215
  #define __Pyx_DOCSTR(n)  ((char *)(n))
 
216
#else
 
217
  #define __Pyx_NAMESTR(n) (n)
 
218
  #define __Pyx_DOCSTR(n)  (n)
 
219
#endif
 
220
 
 
221
#ifndef __PYX_EXTERN_C
 
222
  #ifdef __cplusplus
 
223
    #define __PYX_EXTERN_C extern "C"
 
224
  #else
 
225
    #define __PYX_EXTERN_C extern
 
226
  #endif
 
227
#endif
 
228
 
 
229
#if defined(WIN32) || defined(MS_WINDOWS)
 
230
#define _USE_MATH_DEFINES
 
231
#endif
 
232
#include <math.h>
 
233
#define __PYX_HAVE__zmq__core__version
 
234
#define __PYX_HAVE_API__zmq__core__version
 
235
#include "allocate.h"
 
236
#include "errno.h"
 
237
#include "string.h"
 
238
#include "zmq_compat.h"
 
239
#include "zmq.h"
 
240
#include "zmq_utils.h"
 
241
#ifdef _OPENMP
 
242
#include <omp.h>
 
243
#endif /* _OPENMP */
 
244
 
 
245
#ifdef PYREX_WITHOUT_ASSERTIONS
 
246
#define CYTHON_WITHOUT_ASSERTIONS
 
247
#endif
 
248
 
 
249
 
 
250
/* inline attribute */
 
251
#ifndef CYTHON_INLINE
 
252
  #if defined(__GNUC__)
 
253
    #define CYTHON_INLINE __inline__
 
254
  #elif defined(_MSC_VER)
 
255
    #define CYTHON_INLINE __inline
 
256
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 
257
    #define CYTHON_INLINE inline
 
258
  #else
 
259
    #define CYTHON_INLINE
 
260
  #endif
 
261
#endif
 
262
 
 
263
/* unused attribute */
 
264
#ifndef CYTHON_UNUSED
 
265
# if defined(__GNUC__)
 
266
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
 
267
#     define CYTHON_UNUSED __attribute__ ((__unused__))
 
268
#   else
 
269
#     define CYTHON_UNUSED
 
270
#   endif
 
271
# elif defined(__ICC) || defined(__INTEL_COMPILER)
 
272
#   define CYTHON_UNUSED __attribute__ ((__unused__))
 
273
# else
 
274
#   define CYTHON_UNUSED
 
275
# endif
 
276
#endif
 
277
 
 
278
typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
 
279
 
 
280
 
 
281
/* Type Conversion Predeclarations */
 
282
 
 
283
#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
 
284
#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))
 
285
 
 
286
#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
 
287
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
 
288
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
 
289
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
 
290
 
 
291
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
 
292
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
 
293
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
 
294
 
 
295
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
 
296
 
 
297
 
 
298
#ifdef __GNUC__
 
299
  /* Test for GCC > 2.95 */
 
300
  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
 
301
    #define likely(x)   __builtin_expect(!!(x), 1)
 
302
    #define unlikely(x) __builtin_expect(!!(x), 0)
 
303
  #else /* __GNUC__ > 2 ... */
 
304
    #define likely(x)   (x)
 
305
    #define unlikely(x) (x)
 
306
  #endif /* __GNUC__ > 2 ... */
 
307
#else /* __GNUC__ */
 
308
  #define likely(x)   (x)
 
309
  #define unlikely(x) (x)
 
310
#endif /* __GNUC__ */
 
311
    
 
312
static PyObject *__pyx_m;
 
313
static PyObject *__pyx_b;
 
314
static PyObject *__pyx_empty_tuple;
 
315
static PyObject *__pyx_empty_bytes;
 
316
static int __pyx_lineno;
 
317
static int __pyx_clineno = 0;
 
318
static const char * __pyx_cfilenm= __FILE__;
 
319
static const char *__pyx_filename;
 
320
 
 
321
 
 
322
static const char *__pyx_f[] = {
 
323
  "version.pyx",
 
324
};
 
325
 
 
326
/*--- Type declarations ---*/
 
327
 
 
328
#ifndef CYTHON_REFNANNY
 
329
  #define CYTHON_REFNANNY 0
 
330
#endif
 
331
 
 
332
#if CYTHON_REFNANNY
 
333
  typedef struct {
 
334
    void (*INCREF)(void*, PyObject*, int);
 
335
    void (*DECREF)(void*, PyObject*, int);
 
336
    void (*GOTREF)(void*, PyObject*, int);
 
337
    void (*GIVEREF)(void*, PyObject*, int);
 
338
    void* (*SetupContext)(const char*, int, const char*);
 
339
    void (*FinishContext)(void**);
 
340
  } __Pyx_RefNannyAPIStruct;
 
341
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
 
342
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
 
343
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
 
344
  #define __Pyx_RefNannySetupContext(name)           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
 
345
  #define __Pyx_RefNannyFinishContext()           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
 
346
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
 
347
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
 
348
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
 
349
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
 
350
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
 
351
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
 
352
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
 
353
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
 
354
#else
 
355
  #define __Pyx_RefNannyDeclarations
 
356
  #define __Pyx_RefNannySetupContext(name)
 
357
  #define __Pyx_RefNannyFinishContext()
 
358
  #define __Pyx_INCREF(r) Py_INCREF(r)
 
359
  #define __Pyx_DECREF(r) Py_DECREF(r)
 
360
  #define __Pyx_GOTREF(r)
 
361
  #define __Pyx_GIVEREF(r)
 
362
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
 
363
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
 
364
  #define __Pyx_XGOTREF(r)
 
365
  #define __Pyx_XGIVEREF(r)
 
366
#endif /* CYTHON_REFNANNY */
 
367
 
 
368
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
 
369
 
 
370
static CYTHON_INLINE int __Pyx_NegateNonNeg(int b) { 
 
371
    return unlikely(b < 0) ? b : !b; 
 
372
}
 
373
static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) {
 
374
    return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b);
 
375
}
 
376
 
 
377
static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
 
378
    if (likely(PyList_CheckExact(L))) {
 
379
        if (PyList_Append(L, x) < 0) return NULL;
 
380
        Py_INCREF(Py_None);
 
381
        return Py_None; /* this is just to have an accurate signature */
 
382
    }
 
383
    else {
 
384
        PyObject *r, *m;
 
385
        m = __Pyx_GetAttrString(L, "append");
 
386
        if (!m) return NULL;
 
387
        r = PyObject_CallFunctionObjArgs(m, x, NULL);
 
388
        Py_DECREF(m);
 
389
        return r;
 
390
    }
 
391
}
 
392
 
 
393
static double __Pyx__PyObject_AsDouble(PyObject* obj); /* proto */
 
394
 
 
395
#define __Pyx_PyObject_AsDouble(obj) \
 
396
    ((likely(PyFloat_CheckExact(obj))) ? \
 
397
     PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
 
398
 
 
399
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); /*proto*/
 
400
 
 
401
#ifndef __PYX_FORCE_INIT_THREADS
 
402
  #if PY_VERSION_HEX < 0x02040200
 
403
    #define __PYX_FORCE_INIT_THREADS 1
 
404
  #else
 
405
    #define __PYX_FORCE_INIT_THREADS 0
 
406
  #endif
 
407
#endif
 
408
 
 
409
static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
 
410
 
 
411
static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
 
412
 
 
413
static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
 
414
 
 
415
static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
 
416
 
 
417
static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
 
418
 
 
419
static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
 
420
 
 
421
static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
 
422
 
 
423
static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
 
424
 
 
425
static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
 
426
 
 
427
static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
 
428
 
 
429
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
 
430
 
 
431
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
 
432
 
 
433
static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
 
434
 
 
435
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
 
436
 
 
437
static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
 
438
 
 
439
static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
 
440
 
 
441
static int __Pyx_check_binary_version(void);
 
442
 
 
443
static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno,
 
444
                               int __pyx_lineno, const char *__pyx_filename); /*proto*/
 
445
 
 
446
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
 
447
 
 
448
/* Module declarations from 'zmq.core.libzmq' */
 
449
 
 
450
/* Module declarations from 'zmq.core.version' */
 
451
#define __Pyx_MODULE_NAME "zmq.core.version"
 
452
int __pyx_module_is_main_zmq__core__version = 0;
 
453
 
 
454
/* Implementation of 'zmq.core.version' */
 
455
static char __pyx_k_1[] = "@";
 
456
static char __pyx_k_2[] = "[0-9]+";
 
457
static char __pyx_k_3[] = "%i.%i.%i";
 
458
static char __pyx_k_4[] = "PyZMQ and 0MQ version functions.";
 
459
static char __pyx_k_5[] = "2.1.10";
 
460
static char __pyx_k_6[] = "";
 
461
static char __pyx_k_7[] = "zmq.core.version";
 
462
static char __pyx_k__re[] = "re";
 
463
static char __pyx_k__dev[] = "dev";
 
464
static char __pyx_k__inf[] = "inf";
 
465
static char __pyx_k__join[] = "join";
 
466
static char __pyx_k____all__[] = "__all__";
 
467
static char __pyx_k__findall[] = "findall";
 
468
static char __pyx_k____main__[] = "__main__";
 
469
static char __pyx_k____test__[] = "__test__";
 
470
static char __pyx_k____version__[] = "__version__";
 
471
static char __pyx_k__zmq_version[] = "zmq_version";
 
472
static char __pyx_k____revision__[] = "__revision__";
 
473
static char __pyx_k__pyzmq_version[] = "pyzmq_version";
 
474
static char __pyx_k__zmq_version_info[] = "zmq_version_info";
 
475
static char __pyx_k__pyzmq_version_info[] = "pyzmq_version_info";
 
476
static PyObject *__pyx_kp_s_1;
 
477
static PyObject *__pyx_kp_s_2;
 
478
static PyObject *__pyx_kp_s_3;
 
479
static PyObject *__pyx_kp_s_5;
 
480
static PyObject *__pyx_kp_s_6;
 
481
static PyObject *__pyx_n_s_7;
 
482
static PyObject *__pyx_n_s____all__;
 
483
static PyObject *__pyx_n_s____main__;
 
484
static PyObject *__pyx_n_s____revision__;
 
485
static PyObject *__pyx_n_s____test__;
 
486
static PyObject *__pyx_n_s____version__;
 
487
static PyObject *__pyx_n_s__dev;
 
488
static PyObject *__pyx_n_s__findall;
 
489
static PyObject *__pyx_n_s__inf;
 
490
static PyObject *__pyx_n_s__join;
 
491
static PyObject *__pyx_n_s__pyzmq_version;
 
492
static PyObject *__pyx_n_s__pyzmq_version_info;
 
493
static PyObject *__pyx_n_s__re;
 
494
static PyObject *__pyx_n_s__zmq_version;
 
495
static PyObject *__pyx_n_s__zmq_version_info;
 
496
 
 
497
/* "zmq/core/version.pyx":35
 
498
 * __revision__ = ''
 
499
 * 
 
500
 * def pyzmq_version():             # <<<<<<<<<<<<<<
 
501
 *     """pyzmq_version()
 
502
 * 
 
503
 */
 
504
 
 
505
static PyObject *__pyx_pf_3zmq_4core_7version_pyzmq_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 
506
static char __pyx_doc_3zmq_4core_7version_pyzmq_version[] = "pyzmq_version()\n\n    Return the version of pyzmq as a string.\n    ";
 
507
static PyMethodDef __pyx_mdef_3zmq_4core_7version_pyzmq_version = {__Pyx_NAMESTR("pyzmq_version"), (PyCFunction)__pyx_pf_3zmq_4core_7version_pyzmq_version, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3zmq_4core_7version_pyzmq_version)};
 
508
static PyObject *__pyx_pf_3zmq_4core_7version_pyzmq_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
 
509
  PyObject *__pyx_r = NULL;
 
510
  __Pyx_RefNannyDeclarations
 
511
  PyObject *__pyx_t_1 = NULL;
 
512
  int __pyx_t_2;
 
513
  PyObject *__pyx_t_3 = NULL;
 
514
  PyObject *__pyx_t_4 = NULL;
 
515
  PyObject *__pyx_t_5 = NULL;
 
516
  int __pyx_lineno = 0;
 
517
  const char *__pyx_filename = NULL;
 
518
  int __pyx_clineno = 0;
 
519
  __Pyx_RefNannySetupContext("pyzmq_version");
 
520
  __pyx_self = __pyx_self;
 
521
 
 
522
  /* "zmq/core/version.pyx":40
 
523
 *     Return the version of pyzmq as a string.
 
524
 *     """
 
525
 *     if __revision__:             # <<<<<<<<<<<<<<
 
526
 *         return '@'.join([__version__,__revision__[:6]])
 
527
 *     else:
 
528
 */
 
529
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s____revision__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
530
  __Pyx_GOTREF(__pyx_t_1);
 
531
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
532
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
533
  if (__pyx_t_2) {
 
534
 
 
535
    /* "zmq/core/version.pyx":41
 
536
 *     """
 
537
 *     if __revision__:
 
538
 *         return '@'.join([__version__,__revision__[:6]])             # <<<<<<<<<<<<<<
 
539
 *     else:
 
540
 *         return __version__
 
541
 */
 
542
    __Pyx_XDECREF(__pyx_r);
 
543
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_1), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
544
    __Pyx_GOTREF(__pyx_t_1);
 
545
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s____version__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
546
    __Pyx_GOTREF(__pyx_t_3);
 
547
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s____revision__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
548
    __Pyx_GOTREF(__pyx_t_4);
 
549
    __pyx_t_5 = __Pyx_PySequence_GetSlice(__pyx_t_4, 0, 6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
550
    __Pyx_GOTREF(__pyx_t_5);
 
551
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
552
    __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
553
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
 
554
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
 
555
    __Pyx_GIVEREF(__pyx_t_3);
 
556
    PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
 
557
    __Pyx_GIVEREF(__pyx_t_5);
 
558
    __pyx_t_3 = 0;
 
559
    __pyx_t_5 = 0;
 
560
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
561
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
 
562
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
 
563
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
 
564
    __pyx_t_4 = 0;
 
565
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
566
    __Pyx_GOTREF(__pyx_t_4);
 
567
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
568
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
 
569
    __pyx_r = __pyx_t_4;
 
570
    __pyx_t_4 = 0;
 
571
    goto __pyx_L0;
 
572
    goto __pyx_L5;
 
573
  }
 
574
  /*else*/ {
 
575
 
 
576
    /* "zmq/core/version.pyx":43
 
577
 *         return '@'.join([__version__,__revision__[:6]])
 
578
 *     else:
 
579
 *         return __version__             # <<<<<<<<<<<<<<
 
580
 * 
 
581
 * def pyzmq_version_info():
 
582
 */
 
583
    __Pyx_XDECREF(__pyx_r);
 
584
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s____version__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
585
    __Pyx_GOTREF(__pyx_t_4);
 
586
    __pyx_r = __pyx_t_4;
 
587
    __pyx_t_4 = 0;
 
588
    goto __pyx_L0;
 
589
  }
 
590
  __pyx_L5:;
 
591
 
 
592
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
593
  goto __pyx_L0;
 
594
  __pyx_L1_error:;
 
595
  __Pyx_XDECREF(__pyx_t_1);
 
596
  __Pyx_XDECREF(__pyx_t_3);
 
597
  __Pyx_XDECREF(__pyx_t_4);
 
598
  __Pyx_XDECREF(__pyx_t_5);
 
599
  __Pyx_AddTraceback("zmq.core.version.pyzmq_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
 
600
  __pyx_r = NULL;
 
601
  __pyx_L0:;
 
602
  __Pyx_XGIVEREF(__pyx_r);
 
603
  __Pyx_RefNannyFinishContext();
 
604
  return __pyx_r;
 
605
}
 
606
 
 
607
/* "zmq/core/version.pyx":45
 
608
 *         return __version__
 
609
 * 
 
610
 * def pyzmq_version_info():             # <<<<<<<<<<<<<<
 
611
 *     """pyzmq_version_info()
 
612
 * 
 
613
 */
 
614
 
 
615
static PyObject *__pyx_pf_3zmq_4core_7version_1pyzmq_version_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 
616
static char __pyx_doc_3zmq_4core_7version_1pyzmq_version_info[] = "pyzmq_version_info()\n    \n    Return the pyzmq version as a 3-tuple of numbers\n    \n    If pyzmq is a dev version, the patch-version will be `inf`.\n    \n    This helps comparison of version tuples in Python 3, where str-int\n    comparison is no longer legal for some reason.\n    ";
 
617
static PyMethodDef __pyx_mdef_3zmq_4core_7version_1pyzmq_version_info = {__Pyx_NAMESTR("pyzmq_version_info"), (PyCFunction)__pyx_pf_3zmq_4core_7version_1pyzmq_version_info, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3zmq_4core_7version_1pyzmq_version_info)};
 
618
static PyObject *__pyx_pf_3zmq_4core_7version_1pyzmq_version_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
 
619
  PyObject *__pyx_v_re = NULL;
 
620
  PyObject *__pyx_v_parts = NULL;
 
621
  PyObject *__pyx_v_p = NULL;
 
622
  PyObject *__pyx_r = NULL;
 
623
  __Pyx_RefNannyDeclarations
 
624
  PyObject *__pyx_t_1 = NULL;
 
625
  PyObject *__pyx_t_2 = NULL;
 
626
  PyObject *__pyx_t_3 = NULL;
 
627
  Py_ssize_t __pyx_t_4;
 
628
  PyObject *(*__pyx_t_5)(PyObject *);
 
629
  PyObject *__pyx_t_6 = NULL;
 
630
  int __pyx_t_7;
 
631
  double __pyx_t_8;
 
632
  int __pyx_lineno = 0;
 
633
  const char *__pyx_filename = NULL;
 
634
  int __pyx_clineno = 0;
 
635
  __Pyx_RefNannySetupContext("pyzmq_version_info");
 
636
  __pyx_self = __pyx_self;
 
637
 
 
638
  /* "zmq/core/version.pyx":55
 
639
 *     comparison is no longer legal for some reason.
 
640
 *     """
 
641
 *     import re             # <<<<<<<<<<<<<<
 
642
 *     parts = re.findall('[0-9]+', __version__)
 
643
 *     parts = [ int(p) for p in parts ]
 
644
 */
 
645
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__re), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
646
  __Pyx_GOTREF(__pyx_t_1);
 
647
  __pyx_v_re = __pyx_t_1;
 
648
  __pyx_t_1 = 0;
 
649
 
 
650
  /* "zmq/core/version.pyx":56
 
651
 *     """
 
652
 *     import re
 
653
 *     parts = re.findall('[0-9]+', __version__)             # <<<<<<<<<<<<<<
 
654
 *     parts = [ int(p) for p in parts ]
 
655
 *     if 'dev' in __version__:
 
656
 */
 
657
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_re, __pyx_n_s__findall); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
658
  __Pyx_GOTREF(__pyx_t_1);
 
659
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s____version__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
660
  __Pyx_GOTREF(__pyx_t_2);
 
661
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
662
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
 
663
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
 
664
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_2));
 
665
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
 
666
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
 
667
  __Pyx_GIVEREF(__pyx_t_2);
 
668
  __pyx_t_2 = 0;
 
669
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
670
  __Pyx_GOTREF(__pyx_t_2);
 
671
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
672
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
 
673
  __pyx_v_parts = __pyx_t_2;
 
674
  __pyx_t_2 = 0;
 
675
 
 
676
  /* "zmq/core/version.pyx":57
 
677
 *     import re
 
678
 *     parts = re.findall('[0-9]+', __version__)
 
679
 *     parts = [ int(p) for p in parts ]             # <<<<<<<<<<<<<<
 
680
 *     if 'dev' in __version__:
 
681
 *         parts.append(float('inf'))
 
682
 */
 
683
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
684
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
 
685
  if (PyList_CheckExact(__pyx_v_parts) || PyTuple_CheckExact(__pyx_v_parts)) {
 
686
    __pyx_t_3 = __pyx_v_parts; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
 
687
    __pyx_t_5 = NULL;
 
688
  } else {
 
689
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_parts); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
690
    __Pyx_GOTREF(__pyx_t_3);
 
691
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
 
692
  }
 
693
  for (;;) {
 
694
    if (PyList_CheckExact(__pyx_t_3)) {
 
695
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
 
696
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
 
697
    } else if (PyTuple_CheckExact(__pyx_t_3)) {
 
698
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
 
699
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
 
700
    } else {
 
701
      __pyx_t_1 = __pyx_t_5(__pyx_t_3);
 
702
      if (unlikely(!__pyx_t_1)) {
 
703
        if (PyErr_Occurred()) {
 
704
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
 
705
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
706
        }
 
707
        break;
 
708
      }
 
709
      __Pyx_GOTREF(__pyx_t_1);
 
710
    }
 
711
    __Pyx_XDECREF(__pyx_v_p);
 
712
    __pyx_v_p = __pyx_t_1;
 
713
    __pyx_t_1 = 0;
 
714
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
715
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
716
    __Pyx_INCREF(__pyx_v_p);
 
717
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_p);
 
718
    __Pyx_GIVEREF(__pyx_v_p);
 
719
    __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
720
    __Pyx_GOTREF(__pyx_t_6);
 
721
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
 
722
    if (unlikely(PyList_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
723
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
724
  }
 
725
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
726
  __Pyx_INCREF(((PyObject *)__pyx_t_2));
 
727
  __Pyx_DECREF(__pyx_v_parts);
 
728
  __pyx_v_parts = ((PyObject *)__pyx_t_2);
 
729
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
 
730
 
 
731
  /* "zmq/core/version.pyx":58
 
732
 *     parts = re.findall('[0-9]+', __version__)
 
733
 *     parts = [ int(p) for p in parts ]
 
734
 *     if 'dev' in __version__:             # <<<<<<<<<<<<<<
 
735
 *         parts.append(float('inf'))
 
736
 *     return tuple(parts)
 
737
 */
 
738
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s____version__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
739
  __Pyx_GOTREF(__pyx_t_2);
 
740
  __pyx_t_7 = ((PySequence_Contains(__pyx_t_2, ((PyObject *)__pyx_n_s__dev)))); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
741
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
742
  if (__pyx_t_7) {
 
743
 
 
744
    /* "zmq/core/version.pyx":59
 
745
 *     parts = [ int(p) for p in parts ]
 
746
 *     if 'dev' in __version__:
 
747
 *         parts.append(float('inf'))             # <<<<<<<<<<<<<<
 
748
 *     return tuple(parts)
 
749
 * 
 
750
 */
 
751
    __pyx_t_8 = __Pyx_PyObject_AsDouble(((PyObject *)__pyx_n_s__inf)); if (unlikely(__pyx_t_8 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
752
    __pyx_t_2 = PyFloat_FromDouble(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
753
    __Pyx_GOTREF(__pyx_t_2);
 
754
    __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_parts, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
755
    __Pyx_GOTREF(__pyx_t_3);
 
756
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
757
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
758
    goto __pyx_L7;
 
759
  }
 
760
  __pyx_L7:;
 
761
 
 
762
  /* "zmq/core/version.pyx":60
 
763
 *     if 'dev' in __version__:
 
764
 *         parts.append(float('inf'))
 
765
 *     return tuple(parts)             # <<<<<<<<<<<<<<
 
766
 * 
 
767
 * 
 
768
 */
 
769
  __Pyx_XDECREF(__pyx_r);
 
770
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
771
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
 
772
  __Pyx_INCREF(__pyx_v_parts);
 
773
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_parts);
 
774
  __Pyx_GIVEREF(__pyx_v_parts);
 
775
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
776
  __Pyx_GOTREF(__pyx_t_2);
 
777
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
 
778
  __pyx_r = __pyx_t_2;
 
779
  __pyx_t_2 = 0;
 
780
  goto __pyx_L0;
 
781
 
 
782
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
783
  goto __pyx_L0;
 
784
  __pyx_L1_error:;
 
785
  __Pyx_XDECREF(__pyx_t_1);
 
786
  __Pyx_XDECREF(__pyx_t_2);
 
787
  __Pyx_XDECREF(__pyx_t_3);
 
788
  __Pyx_XDECREF(__pyx_t_6);
 
789
  __Pyx_AddTraceback("zmq.core.version.pyzmq_version_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
 
790
  __pyx_r = NULL;
 
791
  __pyx_L0:;
 
792
  __Pyx_XDECREF(__pyx_v_re);
 
793
  __Pyx_XDECREF(__pyx_v_parts);
 
794
  __Pyx_XDECREF(__pyx_v_p);
 
795
  __Pyx_XGIVEREF(__pyx_r);
 
796
  __Pyx_RefNannyFinishContext();
 
797
  return __pyx_r;
 
798
}
 
799
 
 
800
/* "zmq/core/version.pyx":63
 
801
 * 
 
802
 * 
 
803
 * def zmq_version():             # <<<<<<<<<<<<<<
 
804
 *     """zmq_version()
 
805
 * 
 
806
 */
 
807
 
 
808
static PyObject *__pyx_pf_3zmq_4core_7version_2zmq_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 
809
static char __pyx_doc_3zmq_4core_7version_2zmq_version[] = "zmq_version()\n\n    Return the version of ZeroMQ itself as a string.\n    ";
 
810
static PyMethodDef __pyx_mdef_3zmq_4core_7version_2zmq_version = {__Pyx_NAMESTR("zmq_version"), (PyCFunction)__pyx_pf_3zmq_4core_7version_2zmq_version, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3zmq_4core_7version_2zmq_version)};
 
811
static PyObject *__pyx_pf_3zmq_4core_7version_2zmq_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
 
812
  PyObject *__pyx_r = NULL;
 
813
  __Pyx_RefNannyDeclarations
 
814
  PyObject *__pyx_t_1 = NULL;
 
815
  PyObject *__pyx_t_2 = NULL;
 
816
  int __pyx_lineno = 0;
 
817
  const char *__pyx_filename = NULL;
 
818
  int __pyx_clineno = 0;
 
819
  __Pyx_RefNannySetupContext("zmq_version");
 
820
  __pyx_self = __pyx_self;
 
821
 
 
822
  /* "zmq/core/version.pyx":68
 
823
 *     Return the version of ZeroMQ itself as a string.
 
824
 *     """
 
825
 *     return "%i.%i.%i" % zmq_version_info()             # <<<<<<<<<<<<<<
 
826
 * 
 
827
 * def zmq_version_info():
 
828
 */
 
829
  __Pyx_XDECREF(__pyx_r);
 
830
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__zmq_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
831
  __Pyx_GOTREF(__pyx_t_1);
 
832
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
833
  __Pyx_GOTREF(__pyx_t_2);
 
834
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
835
  __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
836
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
837
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
838
  __pyx_r = ((PyObject *)__pyx_t_1);
 
839
  __pyx_t_1 = 0;
 
840
  goto __pyx_L0;
 
841
 
 
842
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
843
  goto __pyx_L0;
 
844
  __pyx_L1_error:;
 
845
  __Pyx_XDECREF(__pyx_t_1);
 
846
  __Pyx_XDECREF(__pyx_t_2);
 
847
  __Pyx_AddTraceback("zmq.core.version.zmq_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
 
848
  __pyx_r = NULL;
 
849
  __pyx_L0:;
 
850
  __Pyx_XGIVEREF(__pyx_r);
 
851
  __Pyx_RefNannyFinishContext();
 
852
  return __pyx_r;
 
853
}
 
854
 
 
855
/* "zmq/core/version.pyx":70
 
856
 *     return "%i.%i.%i" % zmq_version_info()
 
857
 * 
 
858
 * def zmq_version_info():             # <<<<<<<<<<<<<<
 
859
 *     """zmq_version()
 
860
 * 
 
861
 */
 
862
 
 
863
static PyObject *__pyx_pf_3zmq_4core_7version_3zmq_version_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 
864
static char __pyx_doc_3zmq_4core_7version_3zmq_version_info[] = "zmq_version()\n\n    Return the version of ZeroMQ itself as a 3-tuple of ints.\n    ";
 
865
static PyMethodDef __pyx_mdef_3zmq_4core_7version_3zmq_version_info = {__Pyx_NAMESTR("zmq_version_info"), (PyCFunction)__pyx_pf_3zmq_4core_7version_3zmq_version_info, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3zmq_4core_7version_3zmq_version_info)};
 
866
static PyObject *__pyx_pf_3zmq_4core_7version_3zmq_version_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
 
867
  int __pyx_v_major;
 
868
  int __pyx_v_minor;
 
869
  int __pyx_v_patch;
 
870
  PyObject *__pyx_r = NULL;
 
871
  __Pyx_RefNannyDeclarations
 
872
  PyObject *__pyx_t_1 = NULL;
 
873
  PyObject *__pyx_t_2 = NULL;
 
874
  PyObject *__pyx_t_3 = NULL;
 
875
  PyObject *__pyx_t_4 = NULL;
 
876
  int __pyx_lineno = 0;
 
877
  const char *__pyx_filename = NULL;
 
878
  int __pyx_clineno = 0;
 
879
  __Pyx_RefNannySetupContext("zmq_version_info");
 
880
  __pyx_self = __pyx_self;
 
881
 
 
882
  /* "zmq/core/version.pyx":76
 
883
 *     """
 
884
 *     cdef int major, minor, patch
 
885
 *     with nogil:             # <<<<<<<<<<<<<<
 
886
 *         _zmq_version(&major, &minor, &patch)
 
887
 *     return (major, minor, patch)
 
888
 */
 
889
  {
 
890
      #ifdef WITH_THREAD
 
891
      PyThreadState *_save = NULL;
 
892
      #endif
 
893
      Py_UNBLOCK_THREADS
 
894
      /*try:*/ {
 
895
 
 
896
        /* "zmq/core/version.pyx":77
 
897
 *     cdef int major, minor, patch
 
898
 *     with nogil:
 
899
 *         _zmq_version(&major, &minor, &patch)             # <<<<<<<<<<<<<<
 
900
 *     return (major, minor, patch)
 
901
 * 
 
902
 */
 
903
        zmq_version((&__pyx_v_major), (&__pyx_v_minor), (&__pyx_v_patch));
 
904
      }
 
905
 
 
906
      /* "zmq/core/version.pyx":76
 
907
 *     """
 
908
 *     cdef int major, minor, patch
 
909
 *     with nogil:             # <<<<<<<<<<<<<<
 
910
 *         _zmq_version(&major, &minor, &patch)
 
911
 *     return (major, minor, patch)
 
912
 */
 
913
      /*finally:*/ {
 
914
        Py_BLOCK_THREADS
 
915
      }
 
916
  }
 
917
 
 
918
  /* "zmq/core/version.pyx":78
 
919
 *     with nogil:
 
920
 *         _zmq_version(&major, &minor, &patch)
 
921
 *     return (major, minor, patch)             # <<<<<<<<<<<<<<
 
922
 * 
 
923
 * 
 
924
 */
 
925
  __Pyx_XDECREF(__pyx_r);
 
926
  __pyx_t_1 = PyInt_FromLong(__pyx_v_major); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
927
  __Pyx_GOTREF(__pyx_t_1);
 
928
  __pyx_t_2 = PyInt_FromLong(__pyx_v_minor); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
929
  __Pyx_GOTREF(__pyx_t_2);
 
930
  __pyx_t_3 = PyInt_FromLong(__pyx_v_patch); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
931
  __Pyx_GOTREF(__pyx_t_3);
 
932
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
933
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
 
934
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
 
935
  __Pyx_GIVEREF(__pyx_t_1);
 
936
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
 
937
  __Pyx_GIVEREF(__pyx_t_2);
 
938
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
 
939
  __Pyx_GIVEREF(__pyx_t_3);
 
940
  __pyx_t_1 = 0;
 
941
  __pyx_t_2 = 0;
 
942
  __pyx_t_3 = 0;
 
943
  __pyx_r = ((PyObject *)__pyx_t_4);
 
944
  __pyx_t_4 = 0;
 
945
  goto __pyx_L0;
 
946
 
 
947
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
948
  goto __pyx_L0;
 
949
  __pyx_L1_error:;
 
950
  __Pyx_XDECREF(__pyx_t_1);
 
951
  __Pyx_XDECREF(__pyx_t_2);
 
952
  __Pyx_XDECREF(__pyx_t_3);
 
953
  __Pyx_XDECREF(__pyx_t_4);
 
954
  __Pyx_AddTraceback("zmq.core.version.zmq_version_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
 
955
  __pyx_r = NULL;
 
956
  __pyx_L0:;
 
957
  __Pyx_XGIVEREF(__pyx_r);
 
958
  __Pyx_RefNannyFinishContext();
 
959
  return __pyx_r;
 
960
}
 
961
 
 
962
static PyMethodDef __pyx_methods[] = {
 
963
  {0, 0, 0, 0}
 
964
};
 
965
 
 
966
#if PY_MAJOR_VERSION >= 3
 
967
static struct PyModuleDef __pyx_moduledef = {
 
968
    PyModuleDef_HEAD_INIT,
 
969
    __Pyx_NAMESTR("version"),
 
970
    __Pyx_DOCSTR(__pyx_k_4), /* m_doc */
 
971
    -1, /* m_size */
 
972
    __pyx_methods /* m_methods */,
 
973
    NULL, /* m_reload */
 
974
    NULL, /* m_traverse */
 
975
    NULL, /* m_clear */
 
976
    NULL /* m_free */
 
977
};
 
978
#endif
 
979
 
 
980
static __Pyx_StringTabEntry __pyx_string_tab[] = {
 
981
  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
 
982
  {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
 
983
  {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
 
984
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
 
985
  {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
 
986
  {&__pyx_n_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 1},
 
987
  {&__pyx_n_s____all__, __pyx_k____all__, sizeof(__pyx_k____all__), 0, 0, 1, 1},
 
988
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
 
989
  {&__pyx_n_s____revision__, __pyx_k____revision__, sizeof(__pyx_k____revision__), 0, 0, 1, 1},
 
990
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
 
991
  {&__pyx_n_s____version__, __pyx_k____version__, sizeof(__pyx_k____version__), 0, 0, 1, 1},
 
992
  {&__pyx_n_s__dev, __pyx_k__dev, sizeof(__pyx_k__dev), 0, 0, 1, 1},
 
993
  {&__pyx_n_s__findall, __pyx_k__findall, sizeof(__pyx_k__findall), 0, 0, 1, 1},
 
994
  {&__pyx_n_s__inf, __pyx_k__inf, sizeof(__pyx_k__inf), 0, 0, 1, 1},
 
995
  {&__pyx_n_s__join, __pyx_k__join, sizeof(__pyx_k__join), 0, 0, 1, 1},
 
996
  {&__pyx_n_s__pyzmq_version, __pyx_k__pyzmq_version, sizeof(__pyx_k__pyzmq_version), 0, 0, 1, 1},
 
997
  {&__pyx_n_s__pyzmq_version_info, __pyx_k__pyzmq_version_info, sizeof(__pyx_k__pyzmq_version_info), 0, 0, 1, 1},
 
998
  {&__pyx_n_s__re, __pyx_k__re, sizeof(__pyx_k__re), 0, 0, 1, 1},
 
999
  {&__pyx_n_s__zmq_version, __pyx_k__zmq_version, sizeof(__pyx_k__zmq_version), 0, 0, 1, 1},
 
1000
  {&__pyx_n_s__zmq_version_info, __pyx_k__zmq_version_info, sizeof(__pyx_k__zmq_version_info), 0, 0, 1, 1},
 
1001
  {0, 0, 0, 0, 0, 0, 0}
 
1002
};
 
1003
static int __Pyx_InitCachedBuiltins(void) {
 
1004
  return 0;
 
1005
}
 
1006
 
 
1007
static int __Pyx_InitCachedConstants(void) {
 
1008
  __Pyx_RefNannyDeclarations
 
1009
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants");
 
1010
  __Pyx_RefNannyFinishContext();
 
1011
  return 0;
 
1012
}
 
1013
 
 
1014
static int __Pyx_InitGlobals(void) {
 
1015
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
 
1016
  return 0;
 
1017
  __pyx_L1_error:;
 
1018
  return -1;
 
1019
}
 
1020
 
 
1021
#if PY_MAJOR_VERSION < 3
 
1022
PyMODINIT_FUNC initversion(void); /*proto*/
 
1023
PyMODINIT_FUNC initversion(void)
 
1024
#else
 
1025
PyMODINIT_FUNC PyInit_version(void); /*proto*/
 
1026
PyMODINIT_FUNC PyInit_version(void)
 
1027
#endif
 
1028
{
 
1029
  PyObject *__pyx_t_1 = NULL;
 
1030
  __Pyx_RefNannyDeclarations
 
1031
  #if CYTHON_REFNANNY
 
1032
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
 
1033
  if (!__Pyx_RefNanny) {
 
1034
      PyErr_Clear();
 
1035
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
 
1036
      if (!__Pyx_RefNanny)
 
1037
          Py_FatalError("failed to import 'refnanny' module");
 
1038
  }
 
1039
  #endif
 
1040
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_version(void)");
 
1041
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1042
  __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;}
 
1043
  __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;}
 
1044
  #ifdef __pyx_binding_PyCFunctionType_USED
 
1045
  if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1046
  #endif
 
1047
  /*--- Library function declarations ---*/
 
1048
  /*--- Threads initialization code ---*/
 
1049
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
 
1050
  #ifdef WITH_THREAD /* Python build with threading support? */
 
1051
  PyEval_InitThreads();
 
1052
  #endif
 
1053
  #endif
 
1054
  /*--- Module creation code ---*/
 
1055
  #if PY_MAJOR_VERSION < 3
 
1056
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("version"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_4), 0, PYTHON_API_VERSION);
 
1057
  #else
 
1058
  __pyx_m = PyModule_Create(&__pyx_moduledef);
 
1059
  #endif
 
1060
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
 
1061
  #if PY_MAJOR_VERSION < 3
 
1062
  Py_INCREF(__pyx_m);
 
1063
  #endif
 
1064
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
 
1065
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
 
1066
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
 
1067
  /*--- Initialize various global constants etc. ---*/
 
1068
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1069
  if (__pyx_module_is_main_zmq__core__version) {
 
1070
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
 
1071
  }
 
1072
  /*--- Builtin init code ---*/
 
1073
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1074
  /*--- Constants init code ---*/
 
1075
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1076
  /*--- Global init code ---*/
 
1077
  /*--- Variable export code ---*/
 
1078
  /*--- Function export code ---*/
 
1079
  /*--- Type init code ---*/
 
1080
  /*--- Type import code ---*/
 
1081
  /*--- Variable import code ---*/
 
1082
  /*--- Function import code ---*/
 
1083
  /*--- Execution code ---*/
 
1084
 
 
1085
  /* "zmq/core/version.pyx":32
 
1086
 * #-----------------------------------------------------------------------------
 
1087
 * 
 
1088
 * __version__ = '2.1.10'             # <<<<<<<<<<<<<<
 
1089
 * __revision__ = ''
 
1090
 * 
 
1091
 */
 
1092
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____version__, ((PyObject *)__pyx_kp_s_5)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1093
 
 
1094
  /* "zmq/core/version.pyx":33
 
1095
 * 
 
1096
 * __version__ = '2.1.10'
 
1097
 * __revision__ = ''             # <<<<<<<<<<<<<<
 
1098
 * 
 
1099
 * def pyzmq_version():
 
1100
 */
 
1101
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____revision__, ((PyObject *)__pyx_kp_s_6)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1102
 
 
1103
  /* "zmq/core/version.pyx":35
 
1104
 * __revision__ = ''
 
1105
 * 
 
1106
 * def pyzmq_version():             # <<<<<<<<<<<<<<
 
1107
 *     """pyzmq_version()
 
1108
 * 
 
1109
 */
 
1110
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3zmq_4core_7version_pyzmq_version, NULL, __pyx_n_s_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1111
  __Pyx_GOTREF(__pyx_t_1);
 
1112
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__pyzmq_version, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1113
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
1114
 
 
1115
  /* "zmq/core/version.pyx":45
 
1116
 *         return __version__
 
1117
 * 
 
1118
 * def pyzmq_version_info():             # <<<<<<<<<<<<<<
 
1119
 *     """pyzmq_version_info()
 
1120
 * 
 
1121
 */
 
1122
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3zmq_4core_7version_1pyzmq_version_info, NULL, __pyx_n_s_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1123
  __Pyx_GOTREF(__pyx_t_1);
 
1124
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__pyzmq_version_info, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1125
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
1126
 
 
1127
  /* "zmq/core/version.pyx":63
 
1128
 * 
 
1129
 * 
 
1130
 * def zmq_version():             # <<<<<<<<<<<<<<
 
1131
 *     """zmq_version()
 
1132
 * 
 
1133
 */
 
1134
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3zmq_4core_7version_2zmq_version, NULL, __pyx_n_s_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1135
  __Pyx_GOTREF(__pyx_t_1);
 
1136
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__zmq_version, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1137
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
1138
 
 
1139
  /* "zmq/core/version.pyx":70
 
1140
 *     return "%i.%i.%i" % zmq_version_info()
 
1141
 * 
 
1142
 * def zmq_version_info():             # <<<<<<<<<<<<<<
 
1143
 *     """zmq_version()
 
1144
 * 
 
1145
 */
 
1146
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3zmq_4core_7version_3zmq_version_info, NULL, __pyx_n_s_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1147
  __Pyx_GOTREF(__pyx_t_1);
 
1148
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__zmq_version_info, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1149
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
1150
 
 
1151
  /* "zmq/core/version.pyx":81
 
1152
 * 
 
1153
 * 
 
1154
 * __all__ = ['zmq_version', 'zmq_version_info',             # <<<<<<<<<<<<<<
 
1155
 *            'pyzmq_version','pyzmq_version_info',
 
1156
 *            '__version__', '__revision__'
 
1157
 */
 
1158
  __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1159
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
1160
  __Pyx_INCREF(((PyObject *)__pyx_n_s__zmq_version));
 
1161
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__zmq_version));
 
1162
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__zmq_version));
 
1163
  __Pyx_INCREF(((PyObject *)__pyx_n_s__zmq_version_info));
 
1164
  PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__zmq_version_info));
 
1165
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__zmq_version_info));
 
1166
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pyzmq_version));
 
1167
  PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_n_s__pyzmq_version));
 
1168
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pyzmq_version));
 
1169
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pyzmq_version_info));
 
1170
  PyList_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_n_s__pyzmq_version_info));
 
1171
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pyzmq_version_info));
 
1172
  __Pyx_INCREF(((PyObject *)__pyx_n_s____version__));
 
1173
  PyList_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_n_s____version__));
 
1174
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s____version__));
 
1175
  __Pyx_INCREF(((PyObject *)__pyx_n_s____revision__));
 
1176
  PyList_SET_ITEM(__pyx_t_1, 5, ((PyObject *)__pyx_n_s____revision__));
 
1177
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s____revision__));
 
1178
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____all__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1179
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
 
1180
 
 
1181
  /* "zmq/core/version.pyx":1
 
1182
 * """PyZMQ and 0MQ version functions."""             # <<<<<<<<<<<<<<
 
1183
 * 
 
1184
 * #
 
1185
 */
 
1186
  __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;}
 
1187
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
1188
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1189
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
 
1190
  goto __pyx_L0;
 
1191
  __pyx_L1_error:;
 
1192
  __Pyx_XDECREF(__pyx_t_1);
 
1193
  if (__pyx_m) {
 
1194
    __Pyx_AddTraceback("init zmq.core.version", __pyx_clineno, __pyx_lineno, __pyx_filename);
 
1195
    Py_DECREF(__pyx_m); __pyx_m = 0;
 
1196
  } else if (!PyErr_Occurred()) {
 
1197
    PyErr_SetString(PyExc_ImportError, "init zmq.core.version");
 
1198
  }
 
1199
  __pyx_L0:;
 
1200
  __Pyx_RefNannyFinishContext();
 
1201
  #if PY_MAJOR_VERSION < 3
 
1202
  return;
 
1203
  #else
 
1204
  return __pyx_m;
 
1205
  #endif
 
1206
}
 
1207
 
 
1208
/* Runtime support code */
 
1209
 
 
1210
#if CYTHON_REFNANNY
 
1211
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
 
1212
    PyObject *m = NULL, *p = NULL;
 
1213
    void *r = NULL;
 
1214
    m = PyImport_ImportModule((char *)modname);
 
1215
    if (!m) goto end;
 
1216
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
 
1217
    if (!p) goto end;
 
1218
    r = PyLong_AsVoidPtr(p);
 
1219
end:
 
1220
    Py_XDECREF(p);
 
1221
    Py_XDECREF(m);
 
1222
    return (__Pyx_RefNannyAPIStruct *)r;
 
1223
}
 
1224
#endif /* CYTHON_REFNANNY */
 
1225
 
 
1226
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
 
1227
    PyObject *result;
 
1228
    result = PyObject_GetAttr(dict, name);
 
1229
    if (!result) {
 
1230
        if (dict != __pyx_b) {
 
1231
            PyErr_Clear();
 
1232
            result = PyObject_GetAttr(__pyx_b, name);
 
1233
        }
 
1234
        if (!result) {
 
1235
            PyErr_SetObject(PyExc_NameError, name);
 
1236
        }
 
1237
    }
 
1238
    return result;
 
1239
}
 
1240
 
 
1241
static double __Pyx__PyObject_AsDouble(PyObject* obj) {
 
1242
    PyObject* float_value;
 
1243
    if (Py_TYPE(obj)->tp_as_number && Py_TYPE(obj)->tp_as_number->nb_float) {
 
1244
        return PyFloat_AsDouble(obj);
 
1245
    } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
 
1246
#if PY_MAJOR_VERSION >= 3
 
1247
        float_value = PyFloat_FromString(obj);
 
1248
#else
 
1249
        float_value = PyFloat_FromString(obj, 0);
 
1250
#endif
 
1251
    } else {
 
1252
        PyObject* args = PyTuple_New(1);
 
1253
        if (unlikely(!args)) goto bad;
 
1254
        PyTuple_SET_ITEM(args, 0, obj);
 
1255
        float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
 
1256
        PyTuple_SET_ITEM(args, 0, 0);
 
1257
        Py_DECREF(args);
 
1258
    }
 
1259
    if (likely(float_value)) {
 
1260
        double value = PyFloat_AS_DOUBLE(float_value);
 
1261
        Py_DECREF(float_value);
 
1262
        return value;
 
1263
    }
 
1264
bad:
 
1265
    return (double)-1;
 
1266
}
 
1267
 
 
1268
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) {
 
1269
    PyObject *py_import = 0;
 
1270
    PyObject *empty_list = 0;
 
1271
    PyObject *module = 0;
 
1272
    PyObject *global_dict = 0;
 
1273
    PyObject *empty_dict = 0;
 
1274
    PyObject *list;
 
1275
    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
 
1276
    if (!py_import)
 
1277
        goto bad;
 
1278
    if (from_list)
 
1279
        list = from_list;
 
1280
    else {
 
1281
        empty_list = PyList_New(0);
 
1282
        if (!empty_list)
 
1283
            goto bad;
 
1284
        list = empty_list;
 
1285
    }
 
1286
    global_dict = PyModule_GetDict(__pyx_m);
 
1287
    if (!global_dict)
 
1288
        goto bad;
 
1289
    empty_dict = PyDict_New();
 
1290
    if (!empty_dict)
 
1291
        goto bad;
 
1292
    #if PY_VERSION_HEX >= 0x02050000
 
1293
    {
 
1294
        PyObject *py_level = PyInt_FromLong(level);
 
1295
        if (!py_level)
 
1296
            goto bad;
 
1297
        module = PyObject_CallFunctionObjArgs(py_import,
 
1298
            name, global_dict, empty_dict, list, py_level, NULL);
 
1299
        Py_DECREF(py_level);
 
1300
    }
 
1301
    #else
 
1302
    if (level>0) {
 
1303
        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
 
1304
        goto bad;
 
1305
    }
 
1306
    module = PyObject_CallFunctionObjArgs(py_import,
 
1307
        name, global_dict, empty_dict, list, NULL);
 
1308
    #endif
 
1309
bad:
 
1310
    Py_XDECREF(empty_list);
 
1311
    Py_XDECREF(py_import);
 
1312
    Py_XDECREF(empty_dict);
 
1313
    return module;
 
1314
}
 
1315
 
 
1316
static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
 
1317
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
 
1318
    const int is_unsigned = neg_one > const_zero;
 
1319
    if (sizeof(unsigned char) < sizeof(long)) {
 
1320
        long val = __Pyx_PyInt_AsLong(x);
 
1321
        if (unlikely(val != (long)(unsigned char)val)) {
 
1322
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
1323
                PyErr_SetString(PyExc_OverflowError,
 
1324
                    (is_unsigned && unlikely(val < 0)) ?
 
1325
                    "can't convert negative value to unsigned char" :
 
1326
                    "value too large to convert to unsigned char");
 
1327
            }
 
1328
            return (unsigned char)-1;
 
1329
        }
 
1330
        return (unsigned char)val;
 
1331
    }
 
1332
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
 
1333
}
 
1334
 
 
1335
static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
 
1336
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
 
1337
    const int is_unsigned = neg_one > const_zero;
 
1338
    if (sizeof(unsigned short) < sizeof(long)) {
 
1339
        long val = __Pyx_PyInt_AsLong(x);
 
1340
        if (unlikely(val != (long)(unsigned short)val)) {
 
1341
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
1342
                PyErr_SetString(PyExc_OverflowError,
 
1343
                    (is_unsigned && unlikely(val < 0)) ?
 
1344
                    "can't convert negative value to unsigned short" :
 
1345
                    "value too large to convert to unsigned short");
 
1346
            }
 
1347
            return (unsigned short)-1;
 
1348
        }
 
1349
        return (unsigned short)val;
 
1350
    }
 
1351
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
 
1352
}
 
1353
 
 
1354
static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
 
1355
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
 
1356
    const int is_unsigned = neg_one > const_zero;
 
1357
    if (sizeof(unsigned int) < sizeof(long)) {
 
1358
        long val = __Pyx_PyInt_AsLong(x);
 
1359
        if (unlikely(val != (long)(unsigned int)val)) {
 
1360
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
1361
                PyErr_SetString(PyExc_OverflowError,
 
1362
                    (is_unsigned && unlikely(val < 0)) ?
 
1363
                    "can't convert negative value to unsigned int" :
 
1364
                    "value too large to convert to unsigned int");
 
1365
            }
 
1366
            return (unsigned int)-1;
 
1367
        }
 
1368
        return (unsigned int)val;
 
1369
    }
 
1370
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
 
1371
}
 
1372
 
 
1373
static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
 
1374
    const char neg_one = (char)-1, const_zero = 0;
 
1375
    const int is_unsigned = neg_one > const_zero;
 
1376
    if (sizeof(char) < sizeof(long)) {
 
1377
        long val = __Pyx_PyInt_AsLong(x);
 
1378
        if (unlikely(val != (long)(char)val)) {
 
1379
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
1380
                PyErr_SetString(PyExc_OverflowError,
 
1381
                    (is_unsigned && unlikely(val < 0)) ?
 
1382
                    "can't convert negative value to char" :
 
1383
                    "value too large to convert to char");
 
1384
            }
 
1385
            return (char)-1;
 
1386
        }
 
1387
        return (char)val;
 
1388
    }
 
1389
    return (char)__Pyx_PyInt_AsLong(x);
 
1390
}
 
1391
 
 
1392
static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
 
1393
    const short neg_one = (short)-1, const_zero = 0;
 
1394
    const int is_unsigned = neg_one > const_zero;
 
1395
    if (sizeof(short) < sizeof(long)) {
 
1396
        long val = __Pyx_PyInt_AsLong(x);
 
1397
        if (unlikely(val != (long)(short)val)) {
 
1398
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
1399
                PyErr_SetString(PyExc_OverflowError,
 
1400
                    (is_unsigned && unlikely(val < 0)) ?
 
1401
                    "can't convert negative value to short" :
 
1402
                    "value too large to convert to short");
 
1403
            }
 
1404
            return (short)-1;
 
1405
        }
 
1406
        return (short)val;
 
1407
    }
 
1408
    return (short)__Pyx_PyInt_AsLong(x);
 
1409
}
 
1410
 
 
1411
static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
 
1412
    const int neg_one = (int)-1, const_zero = 0;
 
1413
    const int is_unsigned = neg_one > const_zero;
 
1414
    if (sizeof(int) < sizeof(long)) {
 
1415
        long val = __Pyx_PyInt_AsLong(x);
 
1416
        if (unlikely(val != (long)(int)val)) {
 
1417
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
1418
                PyErr_SetString(PyExc_OverflowError,
 
1419
                    (is_unsigned && unlikely(val < 0)) ?
 
1420
                    "can't convert negative value to int" :
 
1421
                    "value too large to convert to int");
 
1422
            }
 
1423
            return (int)-1;
 
1424
        }
 
1425
        return (int)val;
 
1426
    }
 
1427
    return (int)__Pyx_PyInt_AsLong(x);
 
1428
}
 
1429
 
 
1430
static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
 
1431
    const signed char neg_one = (signed char)-1, const_zero = 0;
 
1432
    const int is_unsigned = neg_one > const_zero;
 
1433
    if (sizeof(signed char) < sizeof(long)) {
 
1434
        long val = __Pyx_PyInt_AsLong(x);
 
1435
        if (unlikely(val != (long)(signed char)val)) {
 
1436
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
1437
                PyErr_SetString(PyExc_OverflowError,
 
1438
                    (is_unsigned && unlikely(val < 0)) ?
 
1439
                    "can't convert negative value to signed char" :
 
1440
                    "value too large to convert to signed char");
 
1441
            }
 
1442
            return (signed char)-1;
 
1443
        }
 
1444
        return (signed char)val;
 
1445
    }
 
1446
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
 
1447
}
 
1448
 
 
1449
static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
 
1450
    const signed short neg_one = (signed short)-1, const_zero = 0;
 
1451
    const int is_unsigned = neg_one > const_zero;
 
1452
    if (sizeof(signed short) < sizeof(long)) {
 
1453
        long val = __Pyx_PyInt_AsLong(x);
 
1454
        if (unlikely(val != (long)(signed short)val)) {
 
1455
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
1456
                PyErr_SetString(PyExc_OverflowError,
 
1457
                    (is_unsigned && unlikely(val < 0)) ?
 
1458
                    "can't convert negative value to signed short" :
 
1459
                    "value too large to convert to signed short");
 
1460
            }
 
1461
            return (signed short)-1;
 
1462
        }
 
1463
        return (signed short)val;
 
1464
    }
 
1465
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
 
1466
}
 
1467
 
 
1468
static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
 
1469
    const signed int neg_one = (signed int)-1, const_zero = 0;
 
1470
    const int is_unsigned = neg_one > const_zero;
 
1471
    if (sizeof(signed int) < sizeof(long)) {
 
1472
        long val = __Pyx_PyInt_AsLong(x);
 
1473
        if (unlikely(val != (long)(signed int)val)) {
 
1474
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
1475
                PyErr_SetString(PyExc_OverflowError,
 
1476
                    (is_unsigned && unlikely(val < 0)) ?
 
1477
                    "can't convert negative value to signed int" :
 
1478
                    "value too large to convert to signed int");
 
1479
            }
 
1480
            return (signed int)-1;
 
1481
        }
 
1482
        return (signed int)val;
 
1483
    }
 
1484
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
 
1485
}
 
1486
 
 
1487
static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
 
1488
    const int neg_one = (int)-1, const_zero = 0;
 
1489
    const int is_unsigned = neg_one > const_zero;
 
1490
    if (sizeof(int) < sizeof(long)) {
 
1491
        long val = __Pyx_PyInt_AsLong(x);
 
1492
        if (unlikely(val != (long)(int)val)) {
 
1493
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
1494
                PyErr_SetString(PyExc_OverflowError,
 
1495
                    (is_unsigned && unlikely(val < 0)) ?
 
1496
                    "can't convert negative value to int" :
 
1497
                    "value too large to convert to int");
 
1498
            }
 
1499
            return (int)-1;
 
1500
        }
 
1501
        return (int)val;
 
1502
    }
 
1503
    return (int)__Pyx_PyInt_AsLong(x);
 
1504
}
 
1505
 
 
1506
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
 
1507
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
 
1508
    const int is_unsigned = neg_one > const_zero;
 
1509
#if PY_VERSION_HEX < 0x03000000
 
1510
    if (likely(PyInt_Check(x))) {
 
1511
        long val = PyInt_AS_LONG(x);
 
1512
        if (is_unsigned && unlikely(val < 0)) {
 
1513
            PyErr_SetString(PyExc_OverflowError,
 
1514
                            "can't convert negative value to unsigned long");
 
1515
            return (unsigned long)-1;
 
1516
        }
 
1517
        return (unsigned long)val;
 
1518
    } else
 
1519
#endif
 
1520
    if (likely(PyLong_Check(x))) {
 
1521
        if (is_unsigned) {
 
1522
            if (unlikely(Py_SIZE(x) < 0)) {
 
1523
                PyErr_SetString(PyExc_OverflowError,
 
1524
                                "can't convert negative value to unsigned long");
 
1525
                return (unsigned long)-1;
 
1526
            }
 
1527
            return (unsigned long)PyLong_AsUnsignedLong(x);
 
1528
        } else {
 
1529
            return (unsigned long)PyLong_AsLong(x);
 
1530
        }
 
1531
    } else {
 
1532
        unsigned long val;
 
1533
        PyObject *tmp = __Pyx_PyNumber_Int(x);
 
1534
        if (!tmp) return (unsigned long)-1;
 
1535
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
 
1536
        Py_DECREF(tmp);
 
1537
        return val;
 
1538
    }
 
1539
}
 
1540
 
 
1541
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
 
1542
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
 
1543
    const int is_unsigned = neg_one > const_zero;
 
1544
#if PY_VERSION_HEX < 0x03000000
 
1545
    if (likely(PyInt_Check(x))) {
 
1546
        long val = PyInt_AS_LONG(x);
 
1547
        if (is_unsigned && unlikely(val < 0)) {
 
1548
            PyErr_SetString(PyExc_OverflowError,
 
1549
                            "can't convert negative value to unsigned PY_LONG_LONG");
 
1550
            return (unsigned PY_LONG_LONG)-1;
 
1551
        }
 
1552
        return (unsigned PY_LONG_LONG)val;
 
1553
    } else
 
1554
#endif
 
1555
    if (likely(PyLong_Check(x))) {
 
1556
        if (is_unsigned) {
 
1557
            if (unlikely(Py_SIZE(x) < 0)) {
 
1558
                PyErr_SetString(PyExc_OverflowError,
 
1559
                                "can't convert negative value to unsigned PY_LONG_LONG");
 
1560
                return (unsigned PY_LONG_LONG)-1;
 
1561
            }
 
1562
            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
 
1563
        } else {
 
1564
            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
 
1565
        }
 
1566
    } else {
 
1567
        unsigned PY_LONG_LONG val;
 
1568
        PyObject *tmp = __Pyx_PyNumber_Int(x);
 
1569
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
 
1570
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
 
1571
        Py_DECREF(tmp);
 
1572
        return val;
 
1573
    }
 
1574
}
 
1575
 
 
1576
static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
 
1577
    const long neg_one = (long)-1, const_zero = 0;
 
1578
    const int is_unsigned = neg_one > const_zero;
 
1579
#if PY_VERSION_HEX < 0x03000000
 
1580
    if (likely(PyInt_Check(x))) {
 
1581
        long val = PyInt_AS_LONG(x);
 
1582
        if (is_unsigned && unlikely(val < 0)) {
 
1583
            PyErr_SetString(PyExc_OverflowError,
 
1584
                            "can't convert negative value to long");
 
1585
            return (long)-1;
 
1586
        }
 
1587
        return (long)val;
 
1588
    } else
 
1589
#endif
 
1590
    if (likely(PyLong_Check(x))) {
 
1591
        if (is_unsigned) {
 
1592
            if (unlikely(Py_SIZE(x) < 0)) {
 
1593
                PyErr_SetString(PyExc_OverflowError,
 
1594
                                "can't convert negative value to long");
 
1595
                return (long)-1;
 
1596
            }
 
1597
            return (long)PyLong_AsUnsignedLong(x);
 
1598
        } else {
 
1599
            return (long)PyLong_AsLong(x);
 
1600
        }
 
1601
    } else {
 
1602
        long val;
 
1603
        PyObject *tmp = __Pyx_PyNumber_Int(x);
 
1604
        if (!tmp) return (long)-1;
 
1605
        val = __Pyx_PyInt_AsLong(tmp);
 
1606
        Py_DECREF(tmp);
 
1607
        return val;
 
1608
    }
 
1609
}
 
1610
 
 
1611
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
 
1612
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
 
1613
    const int is_unsigned = neg_one > const_zero;
 
1614
#if PY_VERSION_HEX < 0x03000000
 
1615
    if (likely(PyInt_Check(x))) {
 
1616
        long val = PyInt_AS_LONG(x);
 
1617
        if (is_unsigned && unlikely(val < 0)) {
 
1618
            PyErr_SetString(PyExc_OverflowError,
 
1619
                            "can't convert negative value to PY_LONG_LONG");
 
1620
            return (PY_LONG_LONG)-1;
 
1621
        }
 
1622
        return (PY_LONG_LONG)val;
 
1623
    } else
 
1624
#endif
 
1625
    if (likely(PyLong_Check(x))) {
 
1626
        if (is_unsigned) {
 
1627
            if (unlikely(Py_SIZE(x) < 0)) {
 
1628
                PyErr_SetString(PyExc_OverflowError,
 
1629
                                "can't convert negative value to PY_LONG_LONG");
 
1630
                return (PY_LONG_LONG)-1;
 
1631
            }
 
1632
            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
 
1633
        } else {
 
1634
            return (PY_LONG_LONG)PyLong_AsLongLong(x);
 
1635
        }
 
1636
    } else {
 
1637
        PY_LONG_LONG val;
 
1638
        PyObject *tmp = __Pyx_PyNumber_Int(x);
 
1639
        if (!tmp) return (PY_LONG_LONG)-1;
 
1640
        val = __Pyx_PyInt_AsLongLong(tmp);
 
1641
        Py_DECREF(tmp);
 
1642
        return val;
 
1643
    }
 
1644
}
 
1645
 
 
1646
static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
 
1647
    const signed long neg_one = (signed long)-1, const_zero = 0;
 
1648
    const int is_unsigned = neg_one > const_zero;
 
1649
#if PY_VERSION_HEX < 0x03000000
 
1650
    if (likely(PyInt_Check(x))) {
 
1651
        long val = PyInt_AS_LONG(x);
 
1652
        if (is_unsigned && unlikely(val < 0)) {
 
1653
            PyErr_SetString(PyExc_OverflowError,
 
1654
                            "can't convert negative value to signed long");
 
1655
            return (signed long)-1;
 
1656
        }
 
1657
        return (signed long)val;
 
1658
    } else
 
1659
#endif
 
1660
    if (likely(PyLong_Check(x))) {
 
1661
        if (is_unsigned) {
 
1662
            if (unlikely(Py_SIZE(x) < 0)) {
 
1663
                PyErr_SetString(PyExc_OverflowError,
 
1664
                                "can't convert negative value to signed long");
 
1665
                return (signed long)-1;
 
1666
            }
 
1667
            return (signed long)PyLong_AsUnsignedLong(x);
 
1668
        } else {
 
1669
            return (signed long)PyLong_AsLong(x);
 
1670
        }
 
1671
    } else {
 
1672
        signed long val;
 
1673
        PyObject *tmp = __Pyx_PyNumber_Int(x);
 
1674
        if (!tmp) return (signed long)-1;
 
1675
        val = __Pyx_PyInt_AsSignedLong(tmp);
 
1676
        Py_DECREF(tmp);
 
1677
        return val;
 
1678
    }
 
1679
}
 
1680
 
 
1681
static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
 
1682
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
 
1683
    const int is_unsigned = neg_one > const_zero;
 
1684
#if PY_VERSION_HEX < 0x03000000
 
1685
    if (likely(PyInt_Check(x))) {
 
1686
        long val = PyInt_AS_LONG(x);
 
1687
        if (is_unsigned && unlikely(val < 0)) {
 
1688
            PyErr_SetString(PyExc_OverflowError,
 
1689
                            "can't convert negative value to signed PY_LONG_LONG");
 
1690
            return (signed PY_LONG_LONG)-1;
 
1691
        }
 
1692
        return (signed PY_LONG_LONG)val;
 
1693
    } else
 
1694
#endif
 
1695
    if (likely(PyLong_Check(x))) {
 
1696
        if (is_unsigned) {
 
1697
            if (unlikely(Py_SIZE(x) < 0)) {
 
1698
                PyErr_SetString(PyExc_OverflowError,
 
1699
                                "can't convert negative value to signed PY_LONG_LONG");
 
1700
                return (signed PY_LONG_LONG)-1;
 
1701
            }
 
1702
            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
 
1703
        } else {
 
1704
            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
 
1705
        }
 
1706
    } else {
 
1707
        signed PY_LONG_LONG val;
 
1708
        PyObject *tmp = __Pyx_PyNumber_Int(x);
 
1709
        if (!tmp) return (signed PY_LONG_LONG)-1;
 
1710
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
 
1711
        Py_DECREF(tmp);
 
1712
        return val;
 
1713
    }
 
1714
}
 
1715
 
 
1716
static int __Pyx_check_binary_version(void) {
 
1717
    char ctversion[4], rtversion[4];
 
1718
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
 
1719
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
 
1720
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
 
1721
        char message[200];
 
1722
        PyOS_snprintf(message, sizeof(message),
 
1723
                      "compiletime version %s of module '%.100s' "
 
1724
                      "does not match runtime version %s",
 
1725
                      ctversion, __Pyx_MODULE_NAME, rtversion);
 
1726
        #if PY_VERSION_HEX < 0x02050000
 
1727
        return PyErr_Warn(NULL, message);
 
1728
        #else
 
1729
        return PyErr_WarnEx(NULL, message, 1);
 
1730
        #endif
 
1731
    }
 
1732
    return 0;
 
1733
}
 
1734
 
 
1735
#include "compile.h"
 
1736
#include "frameobject.h"
 
1737
#include "traceback.h"
 
1738
 
 
1739
static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno,
 
1740
                               int __pyx_lineno, const char *__pyx_filename) {
 
1741
    PyObject *py_srcfile = 0;
 
1742
    PyObject *py_funcname = 0;
 
1743
    PyObject *py_globals = 0;
 
1744
    PyCodeObject *py_code = 0;
 
1745
    PyFrameObject *py_frame = 0;
 
1746
 
 
1747
    #if PY_MAJOR_VERSION < 3
 
1748
    py_srcfile = PyString_FromString(__pyx_filename);
 
1749
    #else
 
1750
    py_srcfile = PyUnicode_FromString(__pyx_filename);
 
1751
    #endif
 
1752
    if (!py_srcfile) goto bad;
 
1753
    if (__pyx_clineno) {
 
1754
        #if PY_MAJOR_VERSION < 3
 
1755
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
 
1756
        #else
 
1757
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
 
1758
        #endif
 
1759
    }
 
1760
    else {
 
1761
        #if PY_MAJOR_VERSION < 3
 
1762
        py_funcname = PyString_FromString(funcname);
 
1763
        #else
 
1764
        py_funcname = PyUnicode_FromString(funcname);
 
1765
        #endif
 
1766
    }
 
1767
    if (!py_funcname) goto bad;
 
1768
    py_globals = PyModule_GetDict(__pyx_m);
 
1769
    if (!py_globals) goto bad;
 
1770
    py_code = PyCode_New(
 
1771
        0,            /*int argcount,*/
 
1772
        #if PY_MAJOR_VERSION >= 3
 
1773
        0,            /*int kwonlyargcount,*/
 
1774
        #endif
 
1775
        0,            /*int nlocals,*/
 
1776
        0,            /*int stacksize,*/
 
1777
        0,            /*int flags,*/
 
1778
        __pyx_empty_bytes, /*PyObject *code,*/
 
1779
        __pyx_empty_tuple,  /*PyObject *consts,*/
 
1780
        __pyx_empty_tuple,  /*PyObject *names,*/
 
1781
        __pyx_empty_tuple,  /*PyObject *varnames,*/
 
1782
        __pyx_empty_tuple,  /*PyObject *freevars,*/
 
1783
        __pyx_empty_tuple,  /*PyObject *cellvars,*/
 
1784
        py_srcfile,   /*PyObject *filename,*/
 
1785
        py_funcname,  /*PyObject *name,*/
 
1786
        __pyx_lineno,   /*int firstlineno,*/
 
1787
        __pyx_empty_bytes  /*PyObject *lnotab*/
 
1788
    );
 
1789
    if (!py_code) goto bad;
 
1790
    py_frame = PyFrame_New(
 
1791
        PyThreadState_GET(), /*PyThreadState *tstate,*/
 
1792
        py_code,             /*PyCodeObject *code,*/
 
1793
        py_globals,          /*PyObject *globals,*/
 
1794
        0                    /*PyObject *locals*/
 
1795
    );
 
1796
    if (!py_frame) goto bad;
 
1797
    py_frame->f_lineno = __pyx_lineno;
 
1798
    PyTraceBack_Here(py_frame);
 
1799
bad:
 
1800
    Py_XDECREF(py_srcfile);
 
1801
    Py_XDECREF(py_funcname);
 
1802
    Py_XDECREF(py_code);
 
1803
    Py_XDECREF(py_frame);
 
1804
}
 
1805
 
 
1806
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
 
1807
    while (t->p) {
 
1808
        #if PY_MAJOR_VERSION < 3
 
1809
        if (t->is_unicode) {
 
1810
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
 
1811
        } else if (t->intern) {
 
1812
            *t->p = PyString_InternFromString(t->s);
 
1813
        } else {
 
1814
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
 
1815
        }
 
1816
        #else  /* Python 3+ has unicode identifiers */
 
1817
        if (t->is_unicode | t->is_str) {
 
1818
            if (t->intern) {
 
1819
                *t->p = PyUnicode_InternFromString(t->s);
 
1820
            } else if (t->encoding) {
 
1821
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
 
1822
            } else {
 
1823
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
 
1824
            }
 
1825
        } else {
 
1826
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
 
1827
        }
 
1828
        #endif
 
1829
        if (!*t->p)
 
1830
            return -1;
 
1831
        ++t;
 
1832
    }
 
1833
    return 0;
 
1834
}
 
1835
 
 
1836
/* Type Conversion Functions */
 
1837
 
 
1838
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
 
1839
   int is_true = x == Py_True;
 
1840
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
 
1841
   else return PyObject_IsTrue(x);
 
1842
}
 
1843
 
 
1844
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
 
1845
  PyNumberMethods *m;
 
1846
  const char *name = NULL;
 
1847
  PyObject *res = NULL;
 
1848
#if PY_VERSION_HEX < 0x03000000
 
1849
  if (PyInt_Check(x) || PyLong_Check(x))
 
1850
#else
 
1851
  if (PyLong_Check(x))
 
1852
#endif
 
1853
    return Py_INCREF(x), x;
 
1854
  m = Py_TYPE(x)->tp_as_number;
 
1855
#if PY_VERSION_HEX < 0x03000000
 
1856
  if (m && m->nb_int) {
 
1857
    name = "int";
 
1858
    res = PyNumber_Int(x);
 
1859
  }
 
1860
  else if (m && m->nb_long) {
 
1861
    name = "long";
 
1862
    res = PyNumber_Long(x);
 
1863
  }
 
1864
#else
 
1865
  if (m && m->nb_int) {
 
1866
    name = "int";
 
1867
    res = PyNumber_Long(x);
 
1868
  }
 
1869
#endif
 
1870
  if (res) {
 
1871
#if PY_VERSION_HEX < 0x03000000
 
1872
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
 
1873
#else
 
1874
    if (!PyLong_Check(res)) {
 
1875
#endif
 
1876
      PyErr_Format(PyExc_TypeError,
 
1877
                   "__%s__ returned non-%s (type %.200s)",
 
1878
                   name, name, Py_TYPE(res)->tp_name);
 
1879
      Py_DECREF(res);
 
1880
      return NULL;
 
1881
    }
 
1882
  }
 
1883
  else if (!PyErr_Occurred()) {
 
1884
    PyErr_SetString(PyExc_TypeError,
 
1885
                    "an integer is required");
 
1886
  }
 
1887
  return res;
 
1888
}
 
1889
 
 
1890
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
 
1891
  Py_ssize_t ival;
 
1892
  PyObject* x = PyNumber_Index(b);
 
1893
  if (!x) return -1;
 
1894
  ival = PyInt_AsSsize_t(x);
 
1895
  Py_DECREF(x);
 
1896
  return ival;
 
1897
}
 
1898
 
 
1899
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
 
1900
#if PY_VERSION_HEX < 0x02050000
 
1901
   if (ival <= LONG_MAX)
 
1902
       return PyInt_FromLong((long)ival);
 
1903
   else {
 
1904
       unsigned char *bytes = (unsigned char *) &ival;
 
1905
       int one = 1; int little = (int)*(unsigned char*)&one;
 
1906
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
 
1907
   }
 
1908
#else
 
1909
   return PyInt_FromSize_t(ival);
 
1910
#endif
 
1911
}
 
1912
 
 
1913
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
 
1914
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
 
1915
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
 
1916
       return (size_t)-1;
 
1917
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
 
1918
       PyErr_SetString(PyExc_OverflowError,
 
1919
                       "value too large to convert to size_t");
 
1920
       return (size_t)-1;
 
1921
   }
 
1922
   return (size_t)val;
 
1923
}
 
1924
 
 
1925
 
 
1926
#endif /* Py_PYTHON_H */