1
/* Generated by Cython 0.15.1 on Thu Oct 13 16:33:54 2011 */
3
#define PY_SSIZE_T_CLEAN
6
#error Python headers needed to compile C extensions, please install development version of Python.
9
#include <stddef.h> /* For offsetof */
11
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
14
#if !defined(WIN32) && !defined(MS_WINDOWS)
27
#define DL_IMPORT(t) t
30
#define DL_EXPORT(t) t
34
#define PY_LONG_LONG LONG_LONG
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)
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)
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)
73
Py_ssize_t *suboffsets;
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)
89
#if PY_MAJOR_VERSION < 3
90
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
92
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
95
#if PY_MAJOR_VERSION >= 3
96
#define Py_TPFLAGS_CHECKTYPES 0
97
#define Py_TPFLAGS_HAVE_INDEX 0
100
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
101
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
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
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
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)
135
#ifndef PySet_CheckExact
136
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
139
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
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
158
#if PY_MAJOR_VERSION >= 3
159
#define PyBoolObject PyLongObject
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
167
#define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
168
#define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
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)
176
#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
177
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
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)
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)))
199
#if PY_MAJOR_VERSION >= 3
200
#define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
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)))
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))
213
#if PY_VERSION_HEX < 0x02050000
214
#define __Pyx_NAMESTR(n) ((char *)(n))
215
#define __Pyx_DOCSTR(n) ((char *)(n))
217
#define __Pyx_NAMESTR(n) (n)
218
#define __Pyx_DOCSTR(n) (n)
221
#ifndef __PYX_EXTERN_C
223
#define __PYX_EXTERN_C extern "C"
225
#define __PYX_EXTERN_C extern
229
#if defined(WIN32) || defined(MS_WINDOWS)
230
#define _USE_MATH_DEFINES
233
#define __PYX_HAVE__zmq__core__version
234
#define __PYX_HAVE_API__zmq__core__version
235
#include "allocate.h"
238
#include "zmq_compat.h"
240
#include "zmq_utils.h"
245
#ifdef PYREX_WITHOUT_ASSERTIONS
246
#define CYTHON_WITHOUT_ASSERTIONS
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
259
#define CYTHON_INLINE
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__))
269
# define CYTHON_UNUSED
271
# elif defined(__ICC) || defined(__INTEL_COMPILER)
272
# define CYTHON_UNUSED __attribute__ ((__unused__))
274
# define CYTHON_UNUSED
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*/
281
/* Type Conversion Predeclarations */
283
#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
284
#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s))
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);
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*);
295
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
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 ... */
308
#define likely(x) (x)
309
#define unlikely(x) (x)
310
#endif /* __GNUC__ */
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;
322
static const char *__pyx_f[] = {
326
/*--- Type declarations ---*/
328
#ifndef CYTHON_REFNANNY
329
#define CYTHON_REFNANNY 0
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)
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 */
368
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
370
static CYTHON_INLINE int __Pyx_NegateNonNeg(int b) {
371
return unlikely(b < 0) ? b : !b;
373
static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) {
374
return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b);
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;
381
return Py_None; /* this is just to have an accurate signature */
385
m = __Pyx_GetAttrString(L, "append");
387
r = PyObject_CallFunctionObjArgs(m, x, NULL);
393
static double __Pyx__PyObject_AsDouble(PyObject* obj); /* proto */
395
#define __Pyx_PyObject_AsDouble(obj) \
396
((likely(PyFloat_CheckExact(obj))) ? \
397
PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
399
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); /*proto*/
401
#ifndef __PYX_FORCE_INIT_THREADS
402
#if PY_VERSION_HEX < 0x02040200
403
#define __PYX_FORCE_INIT_THREADS 1
405
#define __PYX_FORCE_INIT_THREADS 0
409
static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
411
static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
413
static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
415
static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
417
static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
419
static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
421
static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
423
static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
425
static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
427
static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
429
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
431
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
433
static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
435
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
437
static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
439
static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
441
static int __Pyx_check_binary_version(void);
443
static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno,
444
int __pyx_lineno, const char *__pyx_filename); /*proto*/
446
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
448
/* Module declarations from 'zmq.core.libzmq' */
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;
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;
497
/* "zmq/core/version.pyx":35
500
* def pyzmq_version(): # <<<<<<<<<<<<<<
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;
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;
522
/* "zmq/core/version.pyx":40
523
* Return the version of pyzmq as a string.
525
* if __revision__: # <<<<<<<<<<<<<<
526
* return '@'.join([__version__,__revision__[:6]])
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;
535
/* "zmq/core/version.pyx":41
538
* return '@'.join([__version__,__revision__[:6]]) # <<<<<<<<<<<<<<
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);
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));
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;
576
/* "zmq/core/version.pyx":43
577
* return '@'.join([__version__,__revision__[:6]])
579
* return __version__ # <<<<<<<<<<<<<<
581
* def pyzmq_version_info():
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);
592
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
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);
602
__Pyx_XGIVEREF(__pyx_r);
603
__Pyx_RefNannyFinishContext();
607
/* "zmq/core/version.pyx":45
610
* def pyzmq_version_info(): # <<<<<<<<<<<<<<
611
* """pyzmq_version_info()
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;
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;
638
/* "zmq/core/version.pyx":55
639
* comparison is no longer legal for some reason.
641
* import re # <<<<<<<<<<<<<<
642
* parts = re.findall('[0-9]+', __version__)
643
* parts = [ int(p) for p in parts ]
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;
650
/* "zmq/core/version.pyx":56
653
* parts = re.findall('[0-9]+', __version__) # <<<<<<<<<<<<<<
654
* parts = [ int(p) for p in parts ]
655
* if 'dev' in __version__:
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);
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;
676
/* "zmq/core/version.pyx":57
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'))
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;
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;
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++;
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;}
709
__Pyx_GOTREF(__pyx_t_1);
711
__Pyx_XDECREF(__pyx_v_p);
712
__pyx_v_p = __pyx_t_1;
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;
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;
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)
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;
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)
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;
762
/* "zmq/core/version.pyx":60
763
* if 'dev' in __version__:
764
* parts.append(float('inf'))
765
* return tuple(parts) # <<<<<<<<<<<<<<
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;
782
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
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);
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();
800
/* "zmq/core/version.pyx":63
803
* def zmq_version(): # <<<<<<<<<<<<<<
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;
822
/* "zmq/core/version.pyx":68
823
* Return the version of ZeroMQ itself as a string.
825
* return "%i.%i.%i" % zmq_version_info() # <<<<<<<<<<<<<<
827
* def zmq_version_info():
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);
842
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
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);
850
__Pyx_XGIVEREF(__pyx_r);
851
__Pyx_RefNannyFinishContext();
855
/* "zmq/core/version.pyx":70
856
* return "%i.%i.%i" % zmq_version_info()
858
* def zmq_version_info(): # <<<<<<<<<<<<<<
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) {
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;
882
/* "zmq/core/version.pyx":76
884
* cdef int major, minor, patch
885
* with nogil: # <<<<<<<<<<<<<<
886
* _zmq_version(&major, &minor, &patch)
887
* return (major, minor, patch)
891
PyThreadState *_save = NULL;
896
/* "zmq/core/version.pyx":77
897
* cdef int major, minor, patch
899
* _zmq_version(&major, &minor, &patch) # <<<<<<<<<<<<<<
900
* return (major, minor, patch)
903
zmq_version((&__pyx_v_major), (&__pyx_v_minor), (&__pyx_v_patch));
906
/* "zmq/core/version.pyx":76
908
* cdef int major, minor, patch
909
* with nogil: # <<<<<<<<<<<<<<
910
* _zmq_version(&major, &minor, &patch)
911
* return (major, minor, patch)
918
/* "zmq/core/version.pyx":78
920
* _zmq_version(&major, &minor, &patch)
921
* return (major, minor, patch) # <<<<<<<<<<<<<<
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);
943
__pyx_r = ((PyObject *)__pyx_t_4);
947
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
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);
957
__Pyx_XGIVEREF(__pyx_r);
958
__Pyx_RefNannyFinishContext();
962
static PyMethodDef __pyx_methods[] = {
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 */
972
__pyx_methods /* m_methods */,
974
NULL, /* m_traverse */
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}
1003
static int __Pyx_InitCachedBuiltins(void) {
1007
static int __Pyx_InitCachedConstants(void) {
1008
__Pyx_RefNannyDeclarations
1009
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants");
1010
__Pyx_RefNannyFinishContext();
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;};
1021
#if PY_MAJOR_VERSION < 3
1022
PyMODINIT_FUNC initversion(void); /*proto*/
1023
PyMODINIT_FUNC initversion(void)
1025
PyMODINIT_FUNC PyInit_version(void); /*proto*/
1026
PyMODINIT_FUNC PyInit_version(void)
1029
PyObject *__pyx_t_1 = NULL;
1030
__Pyx_RefNannyDeclarations
1032
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
1033
if (!__Pyx_RefNanny) {
1035
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
1036
if (!__Pyx_RefNanny)
1037
Py_FatalError("failed to import 'refnanny' module");
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;}
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();
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);
1058
__pyx_m = PyModule_Create(&__pyx_moduledef);
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
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;};
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 ---*/
1085
/* "zmq/core/version.pyx":32
1086
* #-----------------------------------------------------------------------------
1088
* __version__ = '2.1.10' # <<<<<<<<<<<<<<
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;}
1094
/* "zmq/core/version.pyx":33
1096
* __version__ = '2.1.10'
1097
* __revision__ = '' # <<<<<<<<<<<<<<
1099
* def pyzmq_version():
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;}
1103
/* "zmq/core/version.pyx":35
1106
* def pyzmq_version(): # <<<<<<<<<<<<<<
1107
* """pyzmq_version()
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;
1115
/* "zmq/core/version.pyx":45
1116
* return __version__
1118
* def pyzmq_version_info(): # <<<<<<<<<<<<<<
1119
* """pyzmq_version_info()
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;
1127
/* "zmq/core/version.pyx":63
1130
* def zmq_version(): # <<<<<<<<<<<<<<
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;
1139
/* "zmq/core/version.pyx":70
1140
* return "%i.%i.%i" % zmq_version_info()
1142
* def zmq_version_info(): # <<<<<<<<<<<<<<
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;
1151
/* "zmq/core/version.pyx":81
1154
* __all__ = ['zmq_version', 'zmq_version_info', # <<<<<<<<<<<<<<
1155
* 'pyzmq_version','pyzmq_version_info',
1156
* '__version__', '__revision__'
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;
1181
/* "zmq/core/version.pyx":1
1182
* """PyZMQ and 0MQ version functions.""" # <<<<<<<<<<<<<<
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;
1192
__Pyx_XDECREF(__pyx_t_1);
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");
1200
__Pyx_RefNannyFinishContext();
1201
#if PY_MAJOR_VERSION < 3
1208
/* Runtime support code */
1211
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
1212
PyObject *m = NULL, *p = NULL;
1214
m = PyImport_ImportModule((char *)modname);
1216
p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
1218
r = PyLong_AsVoidPtr(p);
1222
return (__Pyx_RefNannyAPIStruct *)r;
1224
#endif /* CYTHON_REFNANNY */
1226
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
1228
result = PyObject_GetAttr(dict, name);
1230
if (dict != __pyx_b) {
1232
result = PyObject_GetAttr(__pyx_b, name);
1235
PyErr_SetObject(PyExc_NameError, name);
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);
1249
float_value = PyFloat_FromString(obj, 0);
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);
1259
if (likely(float_value)) {
1260
double value = PyFloat_AS_DOUBLE(float_value);
1261
Py_DECREF(float_value);
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;
1275
py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
1281
empty_list = PyList_New(0);
1286
global_dict = PyModule_GetDict(__pyx_m);
1289
empty_dict = PyDict_New();
1292
#if PY_VERSION_HEX >= 0x02050000
1294
PyObject *py_level = PyInt_FromLong(level);
1297
module = PyObject_CallFunctionObjArgs(py_import,
1298
name, global_dict, empty_dict, list, py_level, NULL);
1299
Py_DECREF(py_level);
1303
PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
1306
module = PyObject_CallFunctionObjArgs(py_import,
1307
name, global_dict, empty_dict, list, NULL);
1310
Py_XDECREF(empty_list);
1311
Py_XDECREF(py_import);
1312
Py_XDECREF(empty_dict);
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");
1328
return (unsigned char)-1;
1330
return (unsigned char)val;
1332
return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
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");
1347
return (unsigned short)-1;
1349
return (unsigned short)val;
1351
return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
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");
1366
return (unsigned int)-1;
1368
return (unsigned int)val;
1370
return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
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");
1389
return (char)__Pyx_PyInt_AsLong(x);
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");
1408
return (short)__Pyx_PyInt_AsLong(x);
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");
1427
return (int)__Pyx_PyInt_AsLong(x);
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");
1442
return (signed char)-1;
1444
return (signed char)val;
1446
return (signed char)__Pyx_PyInt_AsSignedLong(x);
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");
1461
return (signed short)-1;
1463
return (signed short)val;
1465
return (signed short)__Pyx_PyInt_AsSignedLong(x);
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");
1480
return (signed int)-1;
1482
return (signed int)val;
1484
return (signed int)__Pyx_PyInt_AsSignedLong(x);
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");
1503
return (int)__Pyx_PyInt_AsLong(x);
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;
1517
return (unsigned long)val;
1520
if (likely(PyLong_Check(x))) {
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;
1527
return (unsigned long)PyLong_AsUnsignedLong(x);
1529
return (unsigned long)PyLong_AsLong(x);
1533
PyObject *tmp = __Pyx_PyNumber_Int(x);
1534
if (!tmp) return (unsigned long)-1;
1535
val = __Pyx_PyInt_AsUnsignedLong(tmp);
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;
1552
return (unsigned PY_LONG_LONG)val;
1555
if (likely(PyLong_Check(x))) {
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;
1562
return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
1564
return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
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);
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");
1590
if (likely(PyLong_Check(x))) {
1592
if (unlikely(Py_SIZE(x) < 0)) {
1593
PyErr_SetString(PyExc_OverflowError,
1594
"can't convert negative value to long");
1597
return (long)PyLong_AsUnsignedLong(x);
1599
return (long)PyLong_AsLong(x);
1603
PyObject *tmp = __Pyx_PyNumber_Int(x);
1604
if (!tmp) return (long)-1;
1605
val = __Pyx_PyInt_AsLong(tmp);
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;
1622
return (PY_LONG_LONG)val;
1625
if (likely(PyLong_Check(x))) {
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;
1632
return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
1634
return (PY_LONG_LONG)PyLong_AsLongLong(x);
1638
PyObject *tmp = __Pyx_PyNumber_Int(x);
1639
if (!tmp) return (PY_LONG_LONG)-1;
1640
val = __Pyx_PyInt_AsLongLong(tmp);
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;
1657
return (signed long)val;
1660
if (likely(PyLong_Check(x))) {
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;
1667
return (signed long)PyLong_AsUnsignedLong(x);
1669
return (signed long)PyLong_AsLong(x);
1673
PyObject *tmp = __Pyx_PyNumber_Int(x);
1674
if (!tmp) return (signed long)-1;
1675
val = __Pyx_PyInt_AsSignedLong(tmp);
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;
1692
return (signed PY_LONG_LONG)val;
1695
if (likely(PyLong_Check(x))) {
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;
1702
return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
1704
return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
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);
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]) {
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);
1729
return PyErr_WarnEx(NULL, message, 1);
1735
#include "compile.h"
1736
#include "frameobject.h"
1737
#include "traceback.h"
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;
1747
#if PY_MAJOR_VERSION < 3
1748
py_srcfile = PyString_FromString(__pyx_filename);
1750
py_srcfile = PyUnicode_FromString(__pyx_filename);
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);
1757
py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
1761
#if PY_MAJOR_VERSION < 3
1762
py_funcname = PyString_FromString(funcname);
1764
py_funcname = PyUnicode_FromString(funcname);
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,*/
1776
0, /*int stacksize,*/
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*/
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*/
1796
if (!py_frame) goto bad;
1797
py_frame->f_lineno = __pyx_lineno;
1798
PyTraceBack_Here(py_frame);
1800
Py_XDECREF(py_srcfile);
1801
Py_XDECREF(py_funcname);
1802
Py_XDECREF(py_code);
1803
Py_XDECREF(py_frame);
1806
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
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);
1814
*t->p = PyString_FromStringAndSize(t->s, t->n - 1);
1816
#else /* Python 3+ has unicode identifiers */
1817
if (t->is_unicode | t->is_str) {
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);
1823
*t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
1826
*t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
1836
/* Type Conversion Functions */
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);
1844
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
1846
const char *name = NULL;
1847
PyObject *res = NULL;
1848
#if PY_VERSION_HEX < 0x03000000
1849
if (PyInt_Check(x) || PyLong_Check(x))
1851
if (PyLong_Check(x))
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) {
1858
res = PyNumber_Int(x);
1860
else if (m && m->nb_long) {
1862
res = PyNumber_Long(x);
1865
if (m && m->nb_int) {
1867
res = PyNumber_Long(x);
1871
#if PY_VERSION_HEX < 0x03000000
1872
if (!PyInt_Check(res) && !PyLong_Check(res)) {
1874
if (!PyLong_Check(res)) {
1876
PyErr_Format(PyExc_TypeError,
1877
"__%s__ returned non-%s (type %.200s)",
1878
name, name, Py_TYPE(res)->tp_name);
1883
else if (!PyErr_Occurred()) {
1884
PyErr_SetString(PyExc_TypeError,
1885
"an integer is required");
1890
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
1892
PyObject* x = PyNumber_Index(b);
1894
ival = PyInt_AsSsize_t(x);
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);
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);
1909
return PyInt_FromSize_t(ival);
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())) {
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");
1926
#endif /* Py_PYTHON_H */