summaryrefslogtreecommitdiffstats
path: root/scripts/external_libs
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2015-12-27 06:37:18 -0500
committerimarom <imarom@cisco.com>2015-12-27 07:27:36 -0500
commitaec3c8f4a0fe4da9a964a051d86fae808f336a55 (patch)
treeb9cdd5fb06b55141a234d83c5be3f72e4a093c78 /scripts/external_libs
parent9d1cd91825d48a97ca0ea21fa7bd34900f6c7450 (diff)
provide a CEL 5.9 a way to run trex-console
Diffstat (limited to 'scripts/external_libs')
-rw-r--r--scripts/external_libs/platform/cel59/zmq/__init__.py (renamed from scripts/external_libs/zmq/__init__.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/auth/__init__.py (renamed from scripts/external_libs/zmq/auth/__init__.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/auth/base.py (renamed from scripts/external_libs/zmq/auth/base.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/auth/certs.py (renamed from scripts/external_libs/zmq/auth/certs.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/auth/ioloop.py (renamed from scripts/external_libs/zmq/auth/ioloop.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/auth/thread.py (renamed from scripts/external_libs/zmq/auth/thread.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/__init__.py (renamed from scripts/external_libs/zmq/backend/__init__.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cffi/__init__.py (renamed from scripts/external_libs/zmq/backend/cffi/__init__.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cffi/_cdefs.h (renamed from scripts/external_libs/zmq/backend/cffi/_cdefs.h)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cffi/_cffi.py (renamed from scripts/external_libs/zmq/backend/cffi/_cffi.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cffi/_poll.py (renamed from scripts/external_libs/zmq/backend/cffi/_poll.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cffi/_verify.c (renamed from scripts/external_libs/zmq/backend/cffi/_verify.c)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cffi/constants.py (renamed from scripts/external_libs/zmq/backend/cffi/constants.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cffi/context.py (renamed from scripts/external_libs/zmq/backend/cffi/context.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cffi/devices.py (renamed from scripts/external_libs/zmq/backend/cffi/devices.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cffi/error.py (renamed from scripts/external_libs/zmq/backend/cffi/error.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cffi/message.py (renamed from scripts/external_libs/zmq/backend/cffi/message.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cffi/socket.py (renamed from scripts/external_libs/zmq/backend/cffi/socket.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cffi/utils.py (renamed from scripts/external_libs/zmq/backend/cffi/utils.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/__init__.py (renamed from scripts/external_libs/zmq/backend/cython/__init__.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/_device.c3173
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/_device.pyx89
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/_poll.c4004
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/_poll.pyx137
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/_version.c1484
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/_version.pyx43
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/checkrc.pxd (renamed from scripts/external_libs/zmq/backend/cython/checkrc.pxd)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/constant_enums.pxi156
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/constants.c4189
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/constants.pxi318
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/constants.pyx32
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/context.c4754
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/context.pxd (renamed from scripts/external_libs/zmq/backend/cython/context.pxd)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/context.pyx243
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/error.c1801
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/error.pyx56
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/libzmq.pxd (renamed from scripts/external_libs/zmq/backend/cython/libzmq.pxd)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/message.c8145
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/message.pxd (renamed from scripts/external_libs/zmq/backend/cython/message.pxd)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/message.pyx381
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/rebuffer.pyx104
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/socket.c10913
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/socket.pxd (renamed from scripts/external_libs/zmq/backend/cython/socket.pxd)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/socket.pyx672
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/utils.c2943
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/utils.pxd (renamed from scripts/external_libs/zmq/backend/cython/utils.pxd)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/cython/utils.pyx119
-rw-r--r--scripts/external_libs/platform/cel59/zmq/backend/select.py (renamed from scripts/external_libs/zmq/backend/select.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/devices/__init__.py (renamed from scripts/external_libs/zmq/devices/__init__.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/devices/basedevice.py (renamed from scripts/external_libs/zmq/devices/basedevice.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/devices/monitoredqueue.c5724
-rw-r--r--scripts/external_libs/platform/cel59/zmq/devices/monitoredqueue.pxd (renamed from scripts/external_libs/zmq/devices/monitoredqueue.pxd)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/devices/monitoredqueue.py37
-rw-r--r--scripts/external_libs/platform/cel59/zmq/devices/monitoredqueue.pyx103
-rw-r--r--scripts/external_libs/platform/cel59/zmq/devices/monitoredqueuedevice.py (renamed from scripts/external_libs/zmq/devices/monitoredqueuedevice.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/devices/proxydevice.py (renamed from scripts/external_libs/zmq/devices/proxydevice.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/error.py (renamed from scripts/external_libs/zmq/error.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/eventloop/__init__.py (renamed from scripts/external_libs/zmq/eventloop/__init__.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/eventloop/ioloop.py (renamed from scripts/external_libs/zmq/eventloop/ioloop.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/__init__.py (renamed from scripts/external_libs/zmq/eventloop/minitornado/__init__.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/concurrent.py (renamed from scripts/external_libs/zmq/eventloop/minitornado/concurrent.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/ioloop.py (renamed from scripts/external_libs/zmq/eventloop/minitornado/ioloop.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/log.py (renamed from scripts/external_libs/zmq/eventloop/minitornado/log.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/platform/__init__.py (renamed from scripts/external_libs/zmq/eventloop/minitornado/platform/__init__.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/platform/auto.py (renamed from scripts/external_libs/zmq/eventloop/minitornado/platform/auto.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/platform/common.py (renamed from scripts/external_libs/zmq/eventloop/minitornado/platform/common.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/platform/interface.py (renamed from scripts/external_libs/zmq/eventloop/minitornado/platform/interface.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/platform/posix.py (renamed from scripts/external_libs/zmq/eventloop/minitornado/platform/posix.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/platform/windows.py (renamed from scripts/external_libs/zmq/eventloop/minitornado/platform/windows.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/stack_context.py (renamed from scripts/external_libs/zmq/eventloop/minitornado/stack_context.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/util.py (renamed from scripts/external_libs/zmq/eventloop/minitornado/util.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/eventloop/zmqstream.py (renamed from scripts/external_libs/zmq/eventloop/zmqstream.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/green/__init__.py (renamed from scripts/external_libs/zmq/green/__init__.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/green/core.py (renamed from scripts/external_libs/zmq/green/core.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/green/device.py (renamed from scripts/external_libs/zmq/green/device.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/green/eventloop/__init__.py (renamed from scripts/external_libs/zmq/green/eventloop/__init__.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/green/eventloop/ioloop.py (renamed from scripts/external_libs/zmq/green/eventloop/ioloop.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/green/eventloop/zmqstream.py (renamed from scripts/external_libs/zmq/green/eventloop/zmqstream.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/green/poll.py (renamed from scripts/external_libs/zmq/green/poll.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/log/__init__.py (renamed from scripts/external_libs/zmq/log/__init__.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/log/handlers.py (renamed from scripts/external_libs/zmq/log/handlers.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/ssh/__init__.py (renamed from scripts/external_libs/zmq/ssh/__init__.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/ssh/forward.py (renamed from scripts/external_libs/zmq/ssh/forward.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/ssh/tunnel.py (renamed from scripts/external_libs/zmq/ssh/tunnel.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/sugar/__init__.py (renamed from scripts/external_libs/zmq/sugar/__init__.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/sugar/attrsettr.py (renamed from scripts/external_libs/zmq/sugar/attrsettr.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/sugar/constants.py (renamed from scripts/external_libs/zmq/sugar/constants.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/sugar/context.py (renamed from scripts/external_libs/zmq/sugar/context.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/sugar/frame.py (renamed from scripts/external_libs/zmq/sugar/frame.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/sugar/poll.py (renamed from scripts/external_libs/zmq/sugar/poll.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/sugar/socket.py (renamed from scripts/external_libs/zmq/sugar/socket.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/sugar/tracker.py (renamed from scripts/external_libs/zmq/sugar/tracker.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/sugar/version.py (renamed from scripts/external_libs/zmq/sugar/version.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/__init__.py (renamed from scripts/external_libs/zmq/tests/__init__.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_auth.py (renamed from scripts/external_libs/zmq/tests/test_auth.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_cffi_backend.py (renamed from scripts/external_libs/zmq/tests/test_cffi_backend.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_constants.py (renamed from scripts/external_libs/zmq/tests/test_constants.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_context.py (renamed from scripts/external_libs/zmq/tests/test_context.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_device.py (renamed from scripts/external_libs/zmq/tests/test_device.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_error.py (renamed from scripts/external_libs/zmq/tests/test_error.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_etc.py (renamed from scripts/external_libs/zmq/tests/test_etc.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_imports.py (renamed from scripts/external_libs/zmq/tests/test_imports.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_ioloop.py (renamed from scripts/external_libs/zmq/tests/test_ioloop.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_log.py (renamed from scripts/external_libs/zmq/tests/test_log.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_message.py (renamed from scripts/external_libs/zmq/tests/test_message.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_monitor.py (renamed from scripts/external_libs/zmq/tests/test_monitor.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_monqueue.py (renamed from scripts/external_libs/zmq/tests/test_monqueue.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_multipart.py (renamed from scripts/external_libs/zmq/tests/test_multipart.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_pair.py (renamed from scripts/external_libs/zmq/tests/test_pair.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_poll.py (renamed from scripts/external_libs/zmq/tests/test_poll.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_pubsub.py (renamed from scripts/external_libs/zmq/tests/test_pubsub.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_reqrep.py (renamed from scripts/external_libs/zmq/tests/test_reqrep.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_security.py (renamed from scripts/external_libs/zmq/tests/test_security.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_socket.py (renamed from scripts/external_libs/zmq/tests/test_socket.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_stopwatch.py (renamed from scripts/external_libs/zmq/tests/test_stopwatch.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_version.py (renamed from scripts/external_libs/zmq/tests/test_version.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_win32_shim.py (renamed from scripts/external_libs/zmq/tests/test_win32_shim.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_z85.py (renamed from scripts/external_libs/zmq/tests/test_z85.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/tests/test_zmqstream.py (renamed from scripts/external_libs/zmq/tests/test_zmqstream.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/utils/__init__.py (renamed from scripts/external_libs/zmq/utils/__init__.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/utils/buffers.pxd (renamed from scripts/external_libs/zmq/utils/buffers.pxd)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/utils/compiler.json24
-rw-r--r--scripts/external_libs/platform/cel59/zmq/utils/config.json9
-rw-r--r--scripts/external_libs/platform/cel59/zmq/utils/constant_names.py (renamed from scripts/external_libs/zmq/utils/constant_names.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/utils/garbage.py (renamed from scripts/external_libs/zmq/utils/garbage.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/utils/getpid_compat.h (renamed from scripts/external_libs/zmq/utils/getpid_compat.h)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/utils/interop.py (renamed from scripts/external_libs/zmq/utils/interop.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/utils/ipcmaxlen.h (renamed from scripts/external_libs/zmq/utils/ipcmaxlen.h)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/utils/jsonapi.py (renamed from scripts/external_libs/zmq/utils/jsonapi.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/utils/monitor.py (renamed from scripts/external_libs/zmq/utils/monitor.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/utils/pyversion_compat.h (renamed from scripts/external_libs/zmq/utils/pyversion_compat.h)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/utils/sixcerpt.py (renamed from scripts/external_libs/zmq/utils/sixcerpt.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/utils/strtypes.py (renamed from scripts/external_libs/zmq/utils/strtypes.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/utils/win32.py (renamed from scripts/external_libs/zmq/utils/win32.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/utils/z85.py (renamed from scripts/external_libs/zmq/utils/z85.py)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/utils/zmq_compat.h (renamed from scripts/external_libs/zmq/utils/zmq_compat.h)0
-rw-r--r--scripts/external_libs/platform/cel59/zmq/utils/zmq_constants.h (renamed from scripts/external_libs/zmq/utils/zmq_constants.h)0
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/__init__.py64
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/auth/__init__.py10
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/auth/base.py272
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/auth/certs.py119
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/auth/ioloop.py34
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/auth/thread.py184
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/__init__.py45
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cffi/__init__.py22
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cffi/_cdefs.h68
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cffi/_cffi.py127
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cffi/_poll.py56
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cffi/_verify.c12
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cffi/constants.py15
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cffi/context.py100
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cffi/devices.py24
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cffi/error.py13
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cffi/message.py69
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cffi/socket.py244
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cffi/utils.py62
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cython/__init__.py23
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cython/_device.py (renamed from scripts/external_libs/zmq/backend/cython/_device.py)0
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cython/_poll.py (renamed from scripts/external_libs/zmq/backend/cython/_poll.py)0
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cython/_version.py (renamed from scripts/external_libs/zmq/backend/cython/_version.py)0
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cython/checkrc.pxd23
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cython/constants.py (renamed from scripts/external_libs/zmq/backend/cython/constants.py)0
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cython/context.pxd41
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cython/context.py (renamed from scripts/external_libs/zmq/backend/cython/context.py)0
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cython/error.py (renamed from scripts/external_libs/zmq/backend/cython/error.py)0
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cython/libzmq.pxd110
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cython/message.pxd63
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cython/message.py (renamed from scripts/external_libs/zmq/backend/cython/message.py)0
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cython/socket.pxd47
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cython/socket.py (renamed from scripts/external_libs/zmq/backend/cython/socket.py)0
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cython/utils.pxd29
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/cython/utils.py (renamed from scripts/external_libs/zmq/backend/cython/utils.py)0
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/backend/select.py39
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/devices/__init__.py16
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/devices/basedevice.py229
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/devices/monitoredqueue.pxd177
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/devices/monitoredqueue.py (renamed from scripts/external_libs/zmq/devices/monitoredqueue.py)0
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/devices/monitoredqueuedevice.py66
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/devices/proxydevice.py90
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/error.py164
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/eventloop/__init__.py5
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/eventloop/ioloop.py193
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/__init__.py0
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/concurrent.py11
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/ioloop.py829
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/log.py6
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/__init__.py0
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/auto.py45
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/common.py91
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/interface.py63
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/posix.py70
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/windows.py20
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/stack_context.py376
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/util.py184
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/eventloop/zmqstream.py529
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/green/__init__.py40
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/green/core.py287
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/green/device.py32
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/green/eventloop/__init__.py3
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/green/eventloop/ioloop.py33
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/green/eventloop/zmqstream.py11
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/green/poll.py95
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/libzmq.so.3 (renamed from scripts/external_libs/zmq/libzmq.so)bin3150071 -> 3150071 bytes
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/log/__init__.py0
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/log/handlers.py146
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/ssh/__init__.py1
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/ssh/forward.py91
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/ssh/tunnel.py376
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/sugar/.version.py.swpbin0 -> 12288 bytes
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/sugar/__init__.py27
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/sugar/attrsettr.py52
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/sugar/constants.py98
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/sugar/context.py192
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/sugar/frame.py19
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/sugar/poll.py161
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/sugar/socket.py495
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/sugar/tracker.py120
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/sugar/version.py48
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/__init__.py211
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_auth.py431
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_cffi_backend.py310
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_constants.py104
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_context.py257
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_device.py146
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_error.py43
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_etc.py15
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_imports.py62
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_ioloop.py113
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_log.py116
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_message.py362
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_monitor.py71
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_monqueue.py227
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_multipart.py35
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_pair.py53
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_poll.py229
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_pubsub.py41
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_reqrep.py62
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_security.py212
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_socket.py450
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_stopwatch.py42
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_version.py44
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_win32_shim.py56
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_z85.py63
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/tests/test_zmqstream.py34
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/utils/__init__.py0
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/utils/buffers.pxd313
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/utils/compiler.json (renamed from scripts/external_libs/zmq/utils/compiler.json)0
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/utils/config.json (renamed from scripts/external_libs/zmq/utils/config.json)0
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/utils/constant_names.py365
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/utils/garbage.py180
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/utils/getpid_compat.h6
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/utils/interop.py33
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/utils/ipcmaxlen.h21
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/utils/jsonapi.py59
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/utils/monitor.py68
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/utils/pyversion_compat.h25
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/utils/sixcerpt.py52
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/utils/strtypes.py45
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/utils/win32.py132
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/utils/z85.py56
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/utils/zmq_compat.h80
-rw-r--r--scripts/external_libs/platform/fedora18/zmq/utils/zmq_constants.h622
-rw-r--r--scripts/external_libs/zmq/backend/cython/_device.sobin116272 -> 0 bytes
-rw-r--r--scripts/external_libs/zmq/backend/cython/_poll.sobin164229 -> 0 bytes
-rw-r--r--scripts/external_libs/zmq/backend/cython/_version.sobin45734 -> 0 bytes
-rw-r--r--scripts/external_libs/zmq/backend/cython/constants.sobin189238 -> 0 bytes
-rw-r--r--scripts/external_libs/zmq/backend/cython/context.sobin172716 -> 0 bytes
-rw-r--r--scripts/external_libs/zmq/backend/cython/error.sobin63000 -> 0 bytes
-rw-r--r--scripts/external_libs/zmq/backend/cython/message.sobin256078 -> 0 bytes
-rw-r--r--scripts/external_libs/zmq/backend/cython/socket.sobin472585 -> 0 bytes
-rw-r--r--scripts/external_libs/zmq/backend/cython/utils.sobin106936 -> 0 bytes
-rw-r--r--scripts/external_libs/zmq/devices/monitoredqueue.sobin157950 -> 0 bytes
272 files changed, 62905 insertions, 0 deletions
diff --git a/scripts/external_libs/zmq/__init__.py b/scripts/external_libs/platform/cel59/zmq/__init__.py
index 3408b3ba..3408b3ba 100644
--- a/scripts/external_libs/zmq/__init__.py
+++ b/scripts/external_libs/platform/cel59/zmq/__init__.py
diff --git a/scripts/external_libs/zmq/auth/__init__.py b/scripts/external_libs/platform/cel59/zmq/auth/__init__.py
index 11d3ad6b..11d3ad6b 100644
--- a/scripts/external_libs/zmq/auth/__init__.py
+++ b/scripts/external_libs/platform/cel59/zmq/auth/__init__.py
diff --git a/scripts/external_libs/zmq/auth/base.py b/scripts/external_libs/platform/cel59/zmq/auth/base.py
index 9b4aaed7..9b4aaed7 100644
--- a/scripts/external_libs/zmq/auth/base.py
+++ b/scripts/external_libs/platform/cel59/zmq/auth/base.py
diff --git a/scripts/external_libs/zmq/auth/certs.py b/scripts/external_libs/platform/cel59/zmq/auth/certs.py
index 4d26ad7b..4d26ad7b 100644
--- a/scripts/external_libs/zmq/auth/certs.py
+++ b/scripts/external_libs/platform/cel59/zmq/auth/certs.py
diff --git a/scripts/external_libs/zmq/auth/ioloop.py b/scripts/external_libs/platform/cel59/zmq/auth/ioloop.py
index 1f448b47..1f448b47 100644
--- a/scripts/external_libs/zmq/auth/ioloop.py
+++ b/scripts/external_libs/platform/cel59/zmq/auth/ioloop.py
diff --git a/scripts/external_libs/zmq/auth/thread.py b/scripts/external_libs/platform/cel59/zmq/auth/thread.py
index 8c3355a9..8c3355a9 100644
--- a/scripts/external_libs/zmq/auth/thread.py
+++ b/scripts/external_libs/platform/cel59/zmq/auth/thread.py
diff --git a/scripts/external_libs/zmq/backend/__init__.py b/scripts/external_libs/platform/cel59/zmq/backend/__init__.py
index 7cac725c..7cac725c 100644
--- a/scripts/external_libs/zmq/backend/__init__.py
+++ b/scripts/external_libs/platform/cel59/zmq/backend/__init__.py
diff --git a/scripts/external_libs/zmq/backend/cffi/__init__.py b/scripts/external_libs/platform/cel59/zmq/backend/cffi/__init__.py
index ca3164d3..ca3164d3 100644
--- a/scripts/external_libs/zmq/backend/cffi/__init__.py
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cffi/__init__.py
diff --git a/scripts/external_libs/zmq/backend/cffi/_cdefs.h b/scripts/external_libs/platform/cel59/zmq/backend/cffi/_cdefs.h
index d3300575..d3300575 100644
--- a/scripts/external_libs/zmq/backend/cffi/_cdefs.h
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cffi/_cdefs.h
diff --git a/scripts/external_libs/zmq/backend/cffi/_cffi.py b/scripts/external_libs/platform/cel59/zmq/backend/cffi/_cffi.py
index c73ebf83..c73ebf83 100644
--- a/scripts/external_libs/zmq/backend/cffi/_cffi.py
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cffi/_cffi.py
diff --git a/scripts/external_libs/zmq/backend/cffi/_poll.py b/scripts/external_libs/platform/cel59/zmq/backend/cffi/_poll.py
index 9bca34ca..9bca34ca 100644
--- a/scripts/external_libs/zmq/backend/cffi/_poll.py
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cffi/_poll.py
diff --git a/scripts/external_libs/zmq/backend/cffi/_verify.c b/scripts/external_libs/platform/cel59/zmq/backend/cffi/_verify.c
index 547840eb..547840eb 100644
--- a/scripts/external_libs/zmq/backend/cffi/_verify.c
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cffi/_verify.c
diff --git a/scripts/external_libs/zmq/backend/cffi/constants.py b/scripts/external_libs/platform/cel59/zmq/backend/cffi/constants.py
index ee293e74..ee293e74 100644
--- a/scripts/external_libs/zmq/backend/cffi/constants.py
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cffi/constants.py
diff --git a/scripts/external_libs/zmq/backend/cffi/context.py b/scripts/external_libs/platform/cel59/zmq/backend/cffi/context.py
index 16a7b257..16a7b257 100644
--- a/scripts/external_libs/zmq/backend/cffi/context.py
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cffi/context.py
diff --git a/scripts/external_libs/zmq/backend/cffi/devices.py b/scripts/external_libs/platform/cel59/zmq/backend/cffi/devices.py
index c7a514a8..c7a514a8 100644
--- a/scripts/external_libs/zmq/backend/cffi/devices.py
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cffi/devices.py
diff --git a/scripts/external_libs/zmq/backend/cffi/error.py b/scripts/external_libs/platform/cel59/zmq/backend/cffi/error.py
index 3bb64de0..3bb64de0 100644
--- a/scripts/external_libs/zmq/backend/cffi/error.py
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cffi/error.py
diff --git a/scripts/external_libs/zmq/backend/cffi/message.py b/scripts/external_libs/platform/cel59/zmq/backend/cffi/message.py
index c35decb6..c35decb6 100644
--- a/scripts/external_libs/zmq/backend/cffi/message.py
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cffi/message.py
diff --git a/scripts/external_libs/zmq/backend/cffi/socket.py b/scripts/external_libs/platform/cel59/zmq/backend/cffi/socket.py
index 3c427739..3c427739 100644
--- a/scripts/external_libs/zmq/backend/cffi/socket.py
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cffi/socket.py
diff --git a/scripts/external_libs/zmq/backend/cffi/utils.py b/scripts/external_libs/platform/cel59/zmq/backend/cffi/utils.py
index fde7827b..fde7827b 100644
--- a/scripts/external_libs/zmq/backend/cffi/utils.py
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cffi/utils.py
diff --git a/scripts/external_libs/zmq/backend/cython/__init__.py b/scripts/external_libs/platform/cel59/zmq/backend/cython/__init__.py
index e5358185..e5358185 100644
--- a/scripts/external_libs/zmq/backend/cython/__init__.py
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/__init__.py
diff --git a/scripts/external_libs/platform/cel59/zmq/backend/cython/_device.c b/scripts/external_libs/platform/cel59/zmq/backend/cython/_device.c
new file mode 100644
index 00000000..9c8777ea
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/_device.c
@@ -0,0 +1,3173 @@
+/* Generated by Cython 0.21.2 */
+
+#define PY_SSIZE_T_CLEAN
+#ifndef CYTHON_USE_PYLONG_INTERNALS
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#else
+#include "pyconfig.h"
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 1
+#else
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#endif
+#endif
+#endif
+#include "Python.h"
+#ifndef Py_PYTHON_H
+ #error Python headers needed to compile C extensions, please install development version of Python.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+ #error Cython requires Python 2.6+ or Python 3.2+.
+#else
+#define CYTHON_ABI "0_21_2"
+#include <stddef.h>
+#ifndef offsetof
+#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+ #ifndef __stdcall
+ #define __stdcall
+ #endif
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
+ #ifndef __fastcall
+ #define __fastcall
+ #endif
+#endif
+#ifndef DL_IMPORT
+ #define DL_IMPORT(t) t
+#endif
+#ifndef DL_EXPORT
+ #define DL_EXPORT(t) t
+#endif
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifndef Py_HUGE_VAL
+ #define Py_HUGE_VAL HUGE_VAL
+#endif
+#ifdef PYPY_VERSION
+#define CYTHON_COMPILING_IN_PYPY 1
+#define CYTHON_COMPILING_IN_CPYTHON 0
+#else
+#define CYTHON_COMPILING_IN_PYPY 0
+#define CYTHON_COMPILING_IN_CPYTHON 1
+#endif
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
+#define Py_OptimizeFlag 0
+#endif
+#define __PYX_BUILD_PY_SSIZE_T "n"
+#define CYTHON_FORMAT_SSIZE_T "z"
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyClass_Type
+#else
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyType_Type
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define Py_TPFLAGS_CHECKTYPES 0
+ #define Py_TPFLAGS_HAVE_INDEX 0
+ #define Py_TPFLAGS_HAVE_NEWBUFFER 0
+#endif
+#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+ #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
+#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
+ #define CYTHON_PEP393_ENABLED 1
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
+ 0 : _PyUnicode_Ready((PyObject *)(op)))
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
+ #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
+ #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+#else
+ #define CYTHON_PEP393_ENABLED 0
+ #define __Pyx_PyUnicode_READY(op) (0)
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
+ #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
+ #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+ #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyFrozenSet_Size(s) PyObject_Size(s)
+#else
+ #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
+ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
+ #define __Pyx_PyFrozenSet_Size(s) PySet_Size(s)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
+#else
+ #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBaseString_Type PyUnicode_Type
+ #define PyStringObject PyUnicodeObject
+ #define PyString_Type PyUnicode_Type
+ #define PyString_Check PyUnicode_Check
+ #define PyString_CheckExact PyUnicode_CheckExact
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
+ #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
+#else
+ #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+ #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
+#endif
+#ifndef PySet_CheckExact
+ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
+#endif
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#if PY_MAJOR_VERSION >= 3
+ #define PyIntObject PyLongObject
+ #define PyInt_Type PyLong_Type
+ #define PyInt_Check(op) PyLong_Check(op)
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
+ #define PyInt_FromString PyLong_FromString
+ #define PyInt_FromUnicode PyLong_FromUnicode
+ #define PyInt_FromLong PyLong_FromLong
+ #define PyInt_FromSize_t PyLong_FromSize_t
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
+ #define PyInt_AsLong PyLong_AsLong
+ #define PyInt_AS_LONG PyLong_AS_LONG
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+ #define PyNumber_Int PyNumber_Long
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBoolObject PyLongObject
+#endif
+#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
+ #ifndef PyUnicode_InternFromString
+ #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
+ #endif
+#endif
+#if PY_VERSION_HEX < 0x030200A4
+ typedef long Py_hash_t;
+ #define __Pyx_PyInt_FromHash_t PyInt_FromLong
+ #define __Pyx_PyInt_AsHash_t PyInt_AsLong
+#else
+ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
+ #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+#else
+ #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
+#endif
+#ifndef CYTHON_INLINE
+ #if defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+#ifndef CYTHON_RESTRICT
+ #if defined(__GNUC__)
+ #define CYTHON_RESTRICT __restrict__
+ #elif defined(_MSC_VER) && _MSC_VER >= 1400
+ #define CYTHON_RESTRICT __restrict
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_RESTRICT restrict
+ #else
+ #define CYTHON_RESTRICT
+ #endif
+#endif
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
+#else
+static CYTHON_INLINE float __PYX_NAN() {
+ /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
+ a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
+ a quiet NaN. */
+ float value;
+ memset(&value, 0xFF, sizeof(value));
+ return value;
+}
+#endif
+#ifdef __cplusplus
+template<typename T>
+void __Pyx_call_destructor(T* x) {
+ x->~T();
+}
+#endif
+
+
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
+#else
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
+#endif
+
+#ifndef __PYX_EXTERN_C
+ #ifdef __cplusplus
+ #define __PYX_EXTERN_C extern "C"
+ #else
+ #define __PYX_EXTERN_C extern
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+#define _USE_MATH_DEFINES
+#endif
+#include <math.h>
+#define __PYX_HAVE__zmq__backend__cython___device
+#define __PYX_HAVE_API__zmq__backend__cython___device
+#include "zmq_compat.h"
+#include "zmq.h"
+#include "zmq_utils.h"
+#include "errno.h"
+#include "string.h"
+#include "stdio.h"
+#include "pythread.h"
+#ifdef _OPENMP
+#include <omp.h>
+#endif /* _OPENMP */
+
+#ifdef PYREX_WITHOUT_ASSERTIONS
+#define CYTHON_WITHOUT_ASSERTIONS
+#endif
+
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
+ const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \
+ (sizeof(type) < sizeof(Py_ssize_t)) || \
+ (sizeof(type) > sizeof(Py_ssize_t) && \
+ likely(v < (type)PY_SSIZE_T_MAX || \
+ v == (type)PY_SSIZE_T_MAX) && \
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \
+ v == (type)PY_SSIZE_T_MIN))) || \
+ (sizeof(type) == sizeof(Py_ssize_t) && \
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \
+ v == (type)PY_SSIZE_T_MAX))) )
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
+#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
+#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
+#define __Pyx_PyBytes_FromString PyBytes_FromString
+#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#else
+ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
+#endif
+#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
+#if PY_MAJOR_VERSION < 3
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
+{
+ const Py_UNICODE *u_end = u;
+ while (*u_end++) ;
+ return (size_t)(u_end - u - 1);
+}
+#else
+#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
+#endif
+#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
+#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
+#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
+#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
+#else
+#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
+#endif
+#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ PyObject* ascii_chars_u = NULL;
+ PyObject* ascii_chars_b = NULL;
+ const char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ if (strcmp(default_encoding_c, "ascii") == 0) {
+ __Pyx_sys_getdefaultencoding_not_ascii = 0;
+ } else {
+ char ascii_chars[128];
+ int c;
+ for (c = 0; c < 128; c++) {
+ ascii_chars[c] = c;
+ }
+ __Pyx_sys_getdefaultencoding_not_ascii = 1;
+ ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
+ if (!ascii_chars_u) goto bad;
+ ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
+ if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
+ PyErr_Format(
+ PyExc_ValueError,
+ "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
+ default_encoding_c);
+ goto bad;
+ }
+ Py_DECREF(ascii_chars_u);
+ Py_DECREF(ascii_chars_b);
+ }
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ Py_XDECREF(ascii_chars_u);
+ Py_XDECREF(ascii_chars_b);
+ return -1;
+}
+#endif
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
+#else
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+static char* __PYX_DEFAULT_STRING_ENCODING;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
+ if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
+ strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ return -1;
+}
+#endif
+#endif
+
+
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+ #define likely(x) __builtin_expect(!!(x), 1)
+ #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
+ #define likely(x) (x)
+ #define unlikely(x) (x)
+#endif /* __GNUC__ */
+
+static PyObject *__pyx_m;
+static PyObject *__pyx_d;
+static PyObject *__pyx_b;
+static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
+static int __pyx_lineno;
+static int __pyx_clineno = 0;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+
+
+static const char *__pyx_f[] = {
+ "zmq/backend/cython/_device.pyx",
+ "zmq/backend/cython/checkrc.pxd",
+ "zmq/backend/cython/context.pxd",
+ "zmq/backend/cython/socket.pxd",
+ "type.pxd",
+ "bool.pxd",
+ "complex.pxd",
+};
+
+/*--- Type declarations ---*/
+struct __pyx_obj_3zmq_7backend_6cython_7context_Context;
+struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket;
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_send;
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_recv;
+
+/* "zmq/backend/cython/socket.pxd":45
+ *
+ * # cpdef methods for direct-cython access:
+ * cpdef object send(self, object data, int flags=*, copy=*, track=*) # <<<<<<<<<<<<<<
+ * cpdef object recv(self, int flags=*, copy=*, track=*)
+ *
+ */
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_send {
+ int __pyx_n;
+ int flags;
+ PyObject *copy;
+ PyObject *track;
+};
+
+/* "zmq/backend/cython/socket.pxd":46
+ * # cpdef methods for direct-cython access:
+ * cpdef object send(self, object data, int flags=*, copy=*, track=*)
+ * cpdef object recv(self, int flags=*, copy=*, track=*) # <<<<<<<<<<<<<<
+ *
+ */
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_recv {
+ int __pyx_n;
+ int flags;
+ PyObject *copy;
+ PyObject *track;
+};
+
+/* "context.pxd":26
+ * #-----------------------------------------------------------------------------
+ *
+ * cdef class Context: # <<<<<<<<<<<<<<
+ *
+ * cdef object __weakref__ # enable weakref
+ */
+struct __pyx_obj_3zmq_7backend_6cython_7context_Context {
+ PyObject_HEAD
+ struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context *__pyx_vtab;
+ PyObject *__weakref__;
+ void *handle;
+ int _shadow;
+ void **_sockets;
+ size_t _n_sockets;
+ size_t _max_sockets;
+ int _pid;
+ int closed;
+};
+
+
+/* "zmq/backend/cython/socket.pxd":33
+ *
+ *
+ * cdef class Socket: # <<<<<<<<<<<<<<
+ *
+ * cdef object __weakref__ # enable weakref
+ */
+struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket {
+ PyObject_HEAD
+ struct __pyx_vtabstruct_3zmq_7backend_6cython_6socket_Socket *__pyx_vtab;
+ PyObject *__weakref__;
+ void *handle;
+ int _shadow;
+ struct __pyx_obj_3zmq_7backend_6cython_7context_Context *context;
+ int _closed;
+ int _pid;
+};
+
+
+
+/* "context.pxd":26
+ * #-----------------------------------------------------------------------------
+ *
+ * cdef class Context: # <<<<<<<<<<<<<<
+ *
+ * cdef object __weakref__ # enable weakref
+ */
+
+struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context {
+ int (*_term)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *);
+ void (*_add_socket)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *, void *);
+ void (*_remove_socket)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *, void *);
+};
+static struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context *__pyx_vtabptr_3zmq_7backend_6cython_7context_Context;
+
+
+/* "zmq/backend/cython/socket.pxd":33
+ *
+ *
+ * cdef class Socket: # <<<<<<<<<<<<<<
+ *
+ * cdef object __weakref__ # enable weakref
+ */
+
+struct __pyx_vtabstruct_3zmq_7backend_6cython_6socket_Socket {
+ PyObject *(*send)(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_send *__pyx_optional_args);
+ PyObject *(*recv)(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *, int __pyx_skip_dispatch, struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_recv *__pyx_optional_args);
+};
+static struct __pyx_vtabstruct_3zmq_7backend_6cython_6socket_Socket *__pyx_vtabptr_3zmq_7backend_6cython_6socket_Socket;
+#ifndef CYTHON_REFNANNY
+ #define CYTHON_REFNANNY 0
+#endif
+#if CYTHON_REFNANNY
+ typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*SetupContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+ } __Pyx_RefNannyAPIStruct;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
+ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
+#ifdef WITH_THREAD
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ if (acquire_gil) { \
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ PyGILState_Release(__pyx_gilstate_save); \
+ } else { \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ }
+#else
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+#endif
+ #define __Pyx_RefNannyFinishContext() \
+ __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
+ #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
+ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
+#else
+ #define __Pyx_RefNannyDeclarations
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)
+ #define __Pyx_RefNannyFinishContext()
+ #define __Pyx_INCREF(r) Py_INCREF(r)
+ #define __Pyx_DECREF(r) Py_DECREF(r)
+ #define __Pyx_GOTREF(r)
+ #define __Pyx_GIVEREF(r)
+ #define __Pyx_XINCREF(r) Py_XINCREF(r)
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
+ #define __Pyx_XGOTREF(r)
+ #define __Pyx_XGIVEREF(r)
+#endif
+#define __Pyx_XDECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_XDECREF(tmp); \
+ } while (0)
+#define __Pyx_DECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_DECREF(tmp); \
+ } while (0)
+#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
+#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
+
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+ Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
+
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+ const char* function_name);
+
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+ const char *name, int exact);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_getattro))
+ return tp->tp_getattro(obj, attr_name);
+#if PY_MAJOR_VERSION < 3
+ if (likely(tp->tp_getattr))
+ return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
+#endif
+ return PyObject_GetAttr(obj, attr_name);
+}
+#else
+#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
+#endif
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
+#else
+#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
+#endif
+
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
+
+static void* __Pyx_GetVtable(PyObject *dict);
+
+typedef struct {
+ int code_line;
+ PyCodeObject* code_object;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+ int count;
+ int max_count;
+ __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename);
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+#ifndef __PYX_FORCE_INIT_THREADS
+ #define __PYX_FORCE_INIT_THREADS 0
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+
+static int __Pyx_check_binary_version(void);
+
+#if !defined(__Pyx_PyIdentifier_FromString)
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
+#else
+ #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
+#endif
+#endif
+
+static PyObject *__Pyx_ImportModule(const char *name);
+
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+
+
+/* Module declarations from 'zmq.backend.cython.libzmq' */
+
+/* Module declarations from 'zmq.backend.cython.context' */
+static PyTypeObject *__pyx_ptype_3zmq_7backend_6cython_7context_Context = 0;
+
+/* Module declarations from 'zmq.backend.cython.socket' */
+static PyTypeObject *__pyx_ptype_3zmq_7backend_6cython_6socket_Socket = 0;
+
+/* Module declarations from 'libc.errno' */
+
+/* Module declarations from 'cpython.version' */
+
+/* Module declarations from 'cpython.ref' */
+
+/* Module declarations from 'cpython.exc' */
+
+/* Module declarations from 'cpython.module' */
+
+/* Module declarations from 'cpython.mem' */
+
+/* Module declarations from 'cpython.tuple' */
+
+/* Module declarations from 'cpython.list' */
+
+/* Module declarations from 'libc.string' */
+
+/* Module declarations from 'libc.stdio' */
+
+/* Module declarations from 'cpython.object' */
+
+/* Module declarations from 'cpython.sequence' */
+
+/* Module declarations from 'cpython.mapping' */
+
+/* Module declarations from 'cpython.iterator' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.type' */
+static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
+
+/* Module declarations from 'cpython.number' */
+
+/* Module declarations from 'cpython.int' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.bool' */
+static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
+
+/* Module declarations from 'cpython.long' */
+
+/* Module declarations from 'cpython.float' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.complex' */
+static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
+
+/* Module declarations from 'cpython.string' */
+
+/* Module declarations from 'cpython.unicode' */
+
+/* Module declarations from 'cpython.dict' */
+
+/* Module declarations from 'cpython.instance' */
+
+/* Module declarations from 'cpython.function' */
+
+/* Module declarations from 'cpython.method' */
+
+/* Module declarations from 'cpython.weakref' */
+
+/* Module declarations from 'cpython.getargs' */
+
+/* Module declarations from 'cpython.pythread' */
+
+/* Module declarations from 'cpython.pystate' */
+
+/* Module declarations from 'cpython.cobject' */
+
+/* Module declarations from 'cpython.oldbuffer' */
+
+/* Module declarations from 'cpython.set' */
+
+/* Module declarations from 'cpython.buffer' */
+
+/* Module declarations from 'cpython.bytes' */
+
+/* Module declarations from 'cpython.pycapsule' */
+
+/* Module declarations from 'cpython' */
+
+/* Module declarations from 'zmq.backend.cython.checkrc' */
+static CYTHON_INLINE int __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(int); /*proto*/
+
+/* Module declarations from 'zmq.backend.cython._device' */
+#define __Pyx_MODULE_NAME "zmq.backend.cython._device"
+int __pyx_module_is_main_zmq__backend__cython___device = 0;
+
+/* Implementation of 'zmq.backend.cython._device' */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7_device_device(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_device_type, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_frontend, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_backend); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7_device_2proxy(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_frontend, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_backend, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_capture); /* proto */
+static char __pyx_k_rc[] = "rc";
+static char __pyx_k_all[] = "__all__";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_Again[] = "Again";
+static char __pyx_k_proxy[] = "proxy";
+static char __pyx_k_device[] = "device";
+static char __pyx_k_import[] = "__import__";
+static char __pyx_k_backend[] = "backend";
+static char __pyx_k_capture[] = "capture";
+static char __pyx_k_ZMQError[] = "ZMQError";
+static char __pyx_k_frontend[] = "frontend";
+static char __pyx_k_zmq_error[] = "zmq.error";
+static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static char __pyx_k_device_type[] = "device_type";
+static char __pyx_k_capture_handle[] = "capture_handle";
+static char __pyx_k_ContextTerminated[] = "ContextTerminated";
+static char __pyx_k_zmq_backend_cython__device[] = "zmq.backend.cython._device";
+static char __pyx_k_private_tmp_pyzmq_release_zmq_b[] = "/private/tmp/pyzmq-release/zmq/backend/cython/_device.pyx";
+static char __pyx_k_Python_binding_for_0MQ_device_fu[] = "Python binding for 0MQ device function.";
+static PyObject *__pyx_n_s_Again;
+static PyObject *__pyx_n_s_ContextTerminated;
+static PyObject *__pyx_n_s_ZMQError;
+static PyObject *__pyx_n_s_all;
+static PyObject *__pyx_n_s_backend;
+static PyObject *__pyx_n_s_capture;
+static PyObject *__pyx_n_s_capture_handle;
+static PyObject *__pyx_n_s_device;
+static PyObject *__pyx_n_s_device_type;
+static PyObject *__pyx_n_s_frontend;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_kp_s_private_tmp_pyzmq_release_zmq_b;
+static PyObject *__pyx_n_s_proxy;
+static PyObject *__pyx_n_s_pyx_vtable;
+static PyObject *__pyx_n_s_rc;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_n_s_zmq_backend_cython__device;
+static PyObject *__pyx_n_s_zmq_error;
+static PyObject *__pyx_tuple_;
+static PyObject *__pyx_tuple__3;
+static PyObject *__pyx_codeobj__2;
+static PyObject *__pyx_codeobj__4;
+
+/* "zmq/backend/cython/_device.pyx":34
+ * #-----------------------------------------------------------------------------
+ *
+ * def device(int device_type, cSocket frontend, cSocket backend=None): # <<<<<<<<<<<<<<
+ * """device(device_type, frontend, backend)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7_device_1device(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_7_device_device[] = "device(device_type, frontend, backend)\n\n Start a zeromq device.\n \n .. deprecated:: libzmq-3.2\n Use zmq.proxy\n\n Parameters\n ----------\n device_type : (QUEUE, FORWARDER, STREAMER)\n The type of device to start.\n frontend : Socket\n The Socket instance for the incoming traffic.\n backend : Socket\n The Socket instance for the outbound traffic.\n ";
+static PyMethodDef __pyx_mdef_3zmq_7backend_6cython_7_device_1device = {"device", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_7_device_1device, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3zmq_7backend_6cython_7_device_device};
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7_device_1device(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ int __pyx_v_device_type;
+ struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_frontend = 0;
+ struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_backend = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("device (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_device_type,&__pyx_n_s_frontend,&__pyx_n_s_backend,0};
+ PyObject* values[3] = {0,0,0};
+ values[2] = (PyObject *)((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)Py_None);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_device_type)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_frontend)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("device", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_backend);
+ if (value) { values[2] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "device") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_device_type = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_device_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_frontend = ((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)values[1]);
+ __pyx_v_backend = ((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)values[2]);
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("device", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("zmq.backend.cython._device.device", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_frontend), __pyx_ptype_3zmq_7backend_6cython_6socket_Socket, 1, "frontend", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_backend), __pyx_ptype_3zmq_7backend_6cython_6socket_Socket, 1, "backend", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7_device_device(__pyx_self, __pyx_v_device_type, __pyx_v_frontend, __pyx_v_backend);
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7_device_device(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_device_type, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_frontend, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_backend) {
+ int __pyx_v_rc;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ Py_ssize_t __pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_t_7;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("device", 0);
+
+ /* "zmq/backend/cython/_device.pyx":51
+ * The Socket instance for the outbound traffic.
+ * """
+ * if ZMQ_VERSION_MAJOR >= 3: # <<<<<<<<<<<<<<
+ * return proxy(frontend, backend)
+ *
+ */
+ __pyx_t_1 = ((ZMQ_VERSION_MAJOR >= 3) != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/_device.pyx":52
+ * """
+ * if ZMQ_VERSION_MAJOR >= 3:
+ * return proxy(frontend, backend) # <<<<<<<<<<<<<<
+ *
+ * cdef int rc = 0
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_proxy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = NULL;
+ __pyx_t_5 = 0;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ __pyx_t_5 = 1;
+ }
+ }
+ __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ if (__pyx_t_4) {
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+ }
+ __Pyx_INCREF(((PyObject *)__pyx_v_frontend));
+ PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_frontend));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_frontend));
+ __Pyx_INCREF(((PyObject *)__pyx_v_backend));
+ PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_backend));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_backend));
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/backend/cython/_device.pyx":54
+ * return proxy(frontend, backend)
+ *
+ * cdef int rc = 0 # <<<<<<<<<<<<<<
+ * with nogil:
+ * rc = zmq_device(device_type, frontend.handle, backend.handle)
+ */
+ __pyx_v_rc = 0;
+
+ /* "zmq/backend/cython/_device.pyx":55
+ *
+ * cdef int rc = 0
+ * with nogil: # <<<<<<<<<<<<<<
+ * rc = zmq_device(device_type, frontend.handle, backend.handle)
+ * _check_rc(rc)
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ #endif
+ /*try:*/ {
+
+ /* "zmq/backend/cython/_device.pyx":56
+ * cdef int rc = 0
+ * with nogil:
+ * rc = zmq_device(device_type, frontend.handle, backend.handle) # <<<<<<<<<<<<<<
+ * _check_rc(rc)
+ * return rc
+ */
+ __pyx_v_rc = zmq_device(__pyx_v_device_type, __pyx_v_frontend->handle, __pyx_v_backend->handle);
+ }
+
+ /* "zmq/backend/cython/_device.pyx":55
+ *
+ * cdef int rc = 0
+ * with nogil: # <<<<<<<<<<<<<<
+ * rc = zmq_device(device_type, frontend.handle, backend.handle)
+ * _check_rc(rc)
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+ }
+ }
+
+ /* "zmq/backend/cython/_device.pyx":57
+ * with nogil:
+ * rc = zmq_device(device_type, frontend.handle, backend.handle)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ * return rc
+ *
+ */
+ __pyx_t_7 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/_device.pyx":58
+ * rc = zmq_device(device_type, frontend.handle, backend.handle)
+ * _check_rc(rc)
+ * return rc # <<<<<<<<<<<<<<
+ *
+ * def proxy(cSocket frontend, cSocket backend, cSocket capture=None):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/_device.pyx":34
+ * #-----------------------------------------------------------------------------
+ *
+ * def device(int device_type, cSocket frontend, cSocket backend=None): # <<<<<<<<<<<<<<
+ * """device(device_type, frontend, backend)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("zmq.backend.cython._device.device", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/_device.pyx":60
+ * return rc
+ *
+ * def proxy(cSocket frontend, cSocket backend, cSocket capture=None): # <<<<<<<<<<<<<<
+ * """proxy(frontend, backend, capture)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7_device_3proxy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_7_device_2proxy[] = "proxy(frontend, backend, capture)\n \n Start a zeromq proxy (replacement for device).\n \n .. versionadded:: libzmq-3.2\n .. versionadded:: 13.0\n \n Parameters\n ----------\n frontend : Socket\n The Socket instance for the incoming traffic.\n backend : Socket\n The Socket instance for the outbound traffic.\n capture : Socket (optional)\n The Socket instance for capturing traffic.\n ";
+static PyMethodDef __pyx_mdef_3zmq_7backend_6cython_7_device_3proxy = {"proxy", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_7_device_3proxy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3zmq_7backend_6cython_7_device_2proxy};
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7_device_3proxy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_frontend = 0;
+ struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_backend = 0;
+ struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_capture = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("proxy (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frontend,&__pyx_n_s_backend,&__pyx_n_s_capture,0};
+ PyObject* values[3] = {0,0,0};
+ values[2] = (PyObject *)((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)Py_None);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_frontend)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_backend)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("proxy", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_capture);
+ if (value) { values[2] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "proxy") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_frontend = ((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)values[0]);
+ __pyx_v_backend = ((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)values[1]);
+ __pyx_v_capture = ((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)values[2]);
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("proxy", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("zmq.backend.cython._device.proxy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_frontend), __pyx_ptype_3zmq_7backend_6cython_6socket_Socket, 1, "frontend", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_backend), __pyx_ptype_3zmq_7backend_6cython_6socket_Socket, 1, "backend", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_capture), __pyx_ptype_3zmq_7backend_6cython_6socket_Socket, 1, "capture", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7_device_2proxy(__pyx_self, __pyx_v_frontend, __pyx_v_backend, __pyx_v_capture);
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7_device_2proxy(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_frontend, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_backend, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_capture) {
+ int __pyx_v_rc;
+ void *__pyx_v_capture_handle;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ void *__pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("proxy", 0);
+
+ /* "zmq/backend/cython/_device.pyx":77
+ * The Socket instance for capturing traffic.
+ * """
+ * cdef int rc = 0 # <<<<<<<<<<<<<<
+ * cdef void* capture_handle
+ * if isinstance(capture, cSocket):
+ */
+ __pyx_v_rc = 0;
+
+ /* "zmq/backend/cython/_device.pyx":79
+ * cdef int rc = 0
+ * cdef void* capture_handle
+ * if isinstance(capture, cSocket): # <<<<<<<<<<<<<<
+ * capture_handle = capture.handle
+ * else:
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_capture), ((PyObject*)__pyx_ptype_3zmq_7backend_6cython_6socket_Socket));
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/_device.pyx":80
+ * cdef void* capture_handle
+ * if isinstance(capture, cSocket):
+ * capture_handle = capture.handle # <<<<<<<<<<<<<<
+ * else:
+ * capture_handle = NULL
+ */
+ __pyx_t_3 = __pyx_v_capture->handle;
+ __pyx_v_capture_handle = __pyx_t_3;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "zmq/backend/cython/_device.pyx":82
+ * capture_handle = capture.handle
+ * else:
+ * capture_handle = NULL # <<<<<<<<<<<<<<
+ * with nogil:
+ * rc = zmq_proxy(frontend.handle, backend.handle, capture_handle)
+ */
+ __pyx_v_capture_handle = NULL;
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/_device.pyx":83
+ * else:
+ * capture_handle = NULL
+ * with nogil: # <<<<<<<<<<<<<<
+ * rc = zmq_proxy(frontend.handle, backend.handle, capture_handle)
+ * _check_rc(rc)
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ #endif
+ /*try:*/ {
+
+ /* "zmq/backend/cython/_device.pyx":84
+ * capture_handle = NULL
+ * with nogil:
+ * rc = zmq_proxy(frontend.handle, backend.handle, capture_handle) # <<<<<<<<<<<<<<
+ * _check_rc(rc)
+ * return rc
+ */
+ __pyx_v_rc = zmq_proxy(__pyx_v_frontend->handle, __pyx_v_backend->handle, __pyx_v_capture_handle);
+ }
+
+ /* "zmq/backend/cython/_device.pyx":83
+ * else:
+ * capture_handle = NULL
+ * with nogil: # <<<<<<<<<<<<<<
+ * rc = zmq_proxy(frontend.handle, backend.handle, capture_handle)
+ * _check_rc(rc)
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+ }
+ }
+
+ /* "zmq/backend/cython/_device.pyx":85
+ * with nogil:
+ * rc = zmq_proxy(frontend.handle, backend.handle, capture_handle)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ * return rc
+ *
+ */
+ __pyx_t_4 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/_device.pyx":86
+ * rc = zmq_proxy(frontend.handle, backend.handle, capture_handle)
+ * _check_rc(rc)
+ * return rc # <<<<<<<<<<<<<<
+ *
+ * __all__ = ['device', 'proxy']
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 0;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/_device.pyx":60
+ * return rc
+ *
+ * def proxy(cSocket frontend, cSocket backend, cSocket capture=None): # <<<<<<<<<<<<<<
+ * """proxy(frontend, backend, capture)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("zmq.backend.cython._device.proxy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/checkrc.pxd":5
+ * from libzmq cimport zmq_errno, ZMQ_ETERM
+ *
+ * cdef inline int _check_rc(int rc) except -1: # <<<<<<<<<<<<<<
+ * """internal utility for checking zmq return condition
+ *
+ */
+
+static CYTHON_INLINE int __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(int __pyx_v_rc) {
+ int __pyx_v_errno;
+ PyObject *__pyx_v_Again = NULL;
+ PyObject *__pyx_v_ContextTerminated = NULL;
+ PyObject *__pyx_v_ZMQError = NULL;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_check_rc", 0);
+
+ /* "zmq/backend/cython/checkrc.pxd":10
+ * and raising the appropriate Exception class
+ * """
+ * cdef int errno = zmq_errno() # <<<<<<<<<<<<<<
+ * PyErr_CheckSignals()
+ * if rc < 0:
+ */
+ __pyx_v_errno = zmq_errno();
+
+ /* "zmq/backend/cython/checkrc.pxd":11
+ * """
+ * cdef int errno = zmq_errno()
+ * PyErr_CheckSignals() # <<<<<<<<<<<<<<
+ * if rc < 0:
+ * if errno == EAGAIN:
+ */
+ __pyx_t_1 = PyErr_CheckSignals(); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/checkrc.pxd":12
+ * cdef int errno = zmq_errno()
+ * PyErr_CheckSignals()
+ * if rc < 0: # <<<<<<<<<<<<<<
+ * if errno == EAGAIN:
+ * from zmq.error import Again
+ */
+ __pyx_t_2 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/checkrc.pxd":16
+ * from zmq.error import Again
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM: # <<<<<<<<<<<<<<
+ * from zmq.error import ContextTerminated
+ * raise ContextTerminated(errno)
+ */
+ switch (__pyx_v_errno) {
+
+ /* "zmq/backend/cython/checkrc.pxd":13
+ * PyErr_CheckSignals()
+ * if rc < 0:
+ * if errno == EAGAIN: # <<<<<<<<<<<<<<
+ * from zmq.error import Again
+ * raise Again(errno)
+ */
+ case EAGAIN:
+
+ /* "zmq/backend/cython/checkrc.pxd":14
+ * if rc < 0:
+ * if errno == EAGAIN:
+ * from zmq.error import Again # <<<<<<<<<<<<<<
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM:
+ */
+ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_n_s_Again);
+ PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Again);
+ __Pyx_GIVEREF(__pyx_n_s_Again);
+ __pyx_t_4 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Again); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_Again = __pyx_t_3;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "zmq/backend/cython/checkrc.pxd":15
+ * if errno == EAGAIN:
+ * from zmq.error import Again
+ * raise Again(errno) # <<<<<<<<<<<<<<
+ * elif errno == ZMQ_ETERM:
+ * from zmq.error import ContextTerminated
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_Again);
+ __pyx_t_5 = __pyx_v_Again; __pyx_t_6 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ }
+ }
+ if (!__pyx_t_6) {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ } else {
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ break;
+
+ /* "zmq/backend/cython/checkrc.pxd":16
+ * from zmq.error import Again
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM: # <<<<<<<<<<<<<<
+ * from zmq.error import ContextTerminated
+ * raise ContextTerminated(errno)
+ */
+ case ETERM:
+
+ /* "zmq/backend/cython/checkrc.pxd":17
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM:
+ * from zmq.error import ContextTerminated # <<<<<<<<<<<<<<
+ * raise ContextTerminated(errno)
+ * else:
+ */
+ __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_n_s_ContextTerminated);
+ PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_ContextTerminated);
+ __Pyx_GIVEREF(__pyx_n_s_ContextTerminated);
+ __pyx_t_5 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_ContextTerminated); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_4);
+ __pyx_v_ContextTerminated = __pyx_t_4;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+ /* "zmq/backend/cython/checkrc.pxd":18
+ * elif errno == ZMQ_ETERM:
+ * from zmq.error import ContextTerminated
+ * raise ContextTerminated(errno) # <<<<<<<<<<<<<<
+ * else:
+ * from zmq.error import ZMQError
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_v_ContextTerminated);
+ __pyx_t_7 = __pyx_v_ContextTerminated; __pyx_t_3 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
+ if (likely(__pyx_t_3)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_7, function);
+ }
+ }
+ if (!__pyx_t_3) {
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ } else {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ break;
+ default:
+
+ /* "zmq/backend/cython/checkrc.pxd":20
+ * raise ContextTerminated(errno)
+ * else:
+ * from zmq.error import ZMQError # <<<<<<<<<<<<<<
+ * raise ZMQError(errno)
+ * # return -1
+ */
+ __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_n_s_ZMQError);
+ PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_ZMQError);
+ __Pyx_GIVEREF(__pyx_n_s_ZMQError);
+ __pyx_t_7 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_5, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_ZMQError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_5);
+ __pyx_v_ZMQError = __pyx_t_5;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "zmq/backend/cython/checkrc.pxd":21
+ * else:
+ * from zmq.error import ZMQError
+ * raise ZMQError(errno) # <<<<<<<<<<<<<<
+ * # return -1
+ * return 0
+ */
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_v_ZMQError);
+ __pyx_t_6 = __pyx_v_ZMQError; __pyx_t_4 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
+ }
+ }
+ if (!__pyx_t_4) {
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ } else {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_Raise(__pyx_t_7, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ break;
+ }
+ }
+
+ /* "zmq/backend/cython/checkrc.pxd":23
+ * raise ZMQError(errno)
+ * # return -1
+ * return 0 # <<<<<<<<<<<<<<
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/checkrc.pxd":5
+ * from libzmq cimport zmq_errno, ZMQ_ETERM
+ *
+ * cdef inline int _check_rc(int rc) except -1: # <<<<<<<<<<<<<<
+ * """internal utility for checking zmq return condition
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_AddTraceback("zmq.backend.cython.checkrc._check_rc", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_Again);
+ __Pyx_XDECREF(__pyx_v_ContextTerminated);
+ __Pyx_XDECREF(__pyx_v_ZMQError);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyMethodDef __pyx_methods[] = {
+ {0, 0, 0, 0}
+};
+
+#if PY_MAJOR_VERSION >= 3
+static struct PyModuleDef __pyx_moduledef = {
+ #if PY_VERSION_HEX < 0x03020000
+ { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
+ #else
+ PyModuleDef_HEAD_INIT,
+ #endif
+ "_device",
+ __pyx_k_Python_binding_for_0MQ_device_fu, /* m_doc */
+ -1, /* m_size */
+ __pyx_methods /* m_methods */,
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL /* m_free */
+};
+#endif
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+ {&__pyx_n_s_Again, __pyx_k_Again, sizeof(__pyx_k_Again), 0, 0, 1, 1},
+ {&__pyx_n_s_ContextTerminated, __pyx_k_ContextTerminated, sizeof(__pyx_k_ContextTerminated), 0, 0, 1, 1},
+ {&__pyx_n_s_ZMQError, __pyx_k_ZMQError, sizeof(__pyx_k_ZMQError), 0, 0, 1, 1},
+ {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
+ {&__pyx_n_s_backend, __pyx_k_backend, sizeof(__pyx_k_backend), 0, 0, 1, 1},
+ {&__pyx_n_s_capture, __pyx_k_capture, sizeof(__pyx_k_capture), 0, 0, 1, 1},
+ {&__pyx_n_s_capture_handle, __pyx_k_capture_handle, sizeof(__pyx_k_capture_handle), 0, 0, 1, 1},
+ {&__pyx_n_s_device, __pyx_k_device, sizeof(__pyx_k_device), 0, 0, 1, 1},
+ {&__pyx_n_s_device_type, __pyx_k_device_type, sizeof(__pyx_k_device_type), 0, 0, 1, 1},
+ {&__pyx_n_s_frontend, __pyx_k_frontend, sizeof(__pyx_k_frontend), 0, 0, 1, 1},
+ {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+ {&__pyx_kp_s_private_tmp_pyzmq_release_zmq_b, __pyx_k_private_tmp_pyzmq_release_zmq_b, sizeof(__pyx_k_private_tmp_pyzmq_release_zmq_b), 0, 0, 1, 0},
+ {&__pyx_n_s_proxy, __pyx_k_proxy, sizeof(__pyx_k_proxy), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
+ {&__pyx_n_s_rc, __pyx_k_rc, sizeof(__pyx_k_rc), 0, 0, 1, 1},
+ {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq_backend_cython__device, __pyx_k_zmq_backend_cython__device, sizeof(__pyx_k_zmq_backend_cython__device), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq_error, __pyx_k_zmq_error, sizeof(__pyx_k_zmq_error), 0, 0, 1, 1},
+ {0, 0, 0, 0, 0, 0, 0}
+};
+static int __Pyx_InitCachedBuiltins(void) {
+ return 0;
+}
+
+static int __Pyx_InitCachedConstants(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
+
+ /* "zmq/backend/cython/_device.pyx":34
+ * #-----------------------------------------------------------------------------
+ *
+ * def device(int device_type, cSocket frontend, cSocket backend=None): # <<<<<<<<<<<<<<
+ * """device(device_type, frontend, backend)
+ *
+ */
+ __pyx_tuple_ = PyTuple_Pack(4, __pyx_n_s_device_type, __pyx_n_s_frontend, __pyx_n_s_backend, __pyx_n_s_rc); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple_);
+ __Pyx_GIVEREF(__pyx_tuple_);
+ __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_pyzmq_release_zmq_b, __pyx_n_s_device, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/_device.pyx":60
+ * return rc
+ *
+ * def proxy(cSocket frontend, cSocket backend, cSocket capture=None): # <<<<<<<<<<<<<<
+ * """proxy(frontend, backend, capture)
+ *
+ */
+ __pyx_tuple__3 = PyTuple_Pack(5, __pyx_n_s_frontend, __pyx_n_s_backend, __pyx_n_s_capture, __pyx_n_s_rc, __pyx_n_s_capture_handle); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__3);
+ __Pyx_GIVEREF(__pyx_tuple__3);
+ __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_pyzmq_release_zmq_b, __pyx_n_s_proxy, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static int __Pyx_InitGlobals(void) {
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+#if PY_MAJOR_VERSION < 3
+PyMODINIT_FUNC init_device(void); /*proto*/
+PyMODINIT_FUNC init_device(void)
+#else
+PyMODINIT_FUNC PyInit__device(void); /*proto*/
+PyMODINIT_FUNC PyInit__device(void)
+#endif
+{
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ #if CYTHON_REFNANNY
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
+ if (!__Pyx_RefNanny) {
+ PyErr_Clear();
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
+ if (!__Pyx_RefNanny)
+ Py_FatalError("failed to import 'refnanny' module");
+ }
+ #endif
+ __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__device(void)", 0);
+ if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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;}
+ __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;}
+ #ifdef __Pyx_CyFunction_USED
+ if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_FusedFunction_USED
+ if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_Generator_USED
+ if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ /*--- Library function declarations ---*/
+ /*--- Threads initialization code ---*/
+ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
+ #ifdef WITH_THREAD /* Python build with threading support? */
+ PyEval_InitThreads();
+ #endif
+ #endif
+ /*--- Module creation code ---*/
+ #if PY_MAJOR_VERSION < 3
+ __pyx_m = Py_InitModule4("_device", __pyx_methods, __pyx_k_Python_binding_for_0MQ_device_fu, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+ #else
+ __pyx_m = PyModule_Create(&__pyx_moduledef);
+ #endif
+ if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_INCREF(__pyx_d);
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_COMPILING_IN_PYPY
+ Py_INCREF(__pyx_b);
+ #endif
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ /*--- Initialize various global constants etc. ---*/
+ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ if (__pyx_module_is_main_zmq__backend__cython___device) {
+ if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ }
+ #if PY_MAJOR_VERSION >= 3
+ {
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!PyDict_GetItemString(modules, "zmq.backend.cython._device")) {
+ if (unlikely(PyDict_SetItemString(modules, "zmq.backend.cython._device", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+ /*--- Builtin init code ---*/
+ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Constants init code ---*/
+ if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Global init code ---*/
+ /*--- Variable export code ---*/
+ /*--- Function export code ---*/
+ /*--- Type init code ---*/
+ /*--- Type import code ---*/
+ __pyx_ptype_3zmq_7backend_6cython_7context_Context = __Pyx_ImportType("zmq.backend.cython.context", "Context", sizeof(struct __pyx_obj_3zmq_7backend_6cython_7context_Context), 1); if (unlikely(!__pyx_ptype_3zmq_7backend_6cython_7context_Context)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_vtabptr_3zmq_7backend_6cython_7context_Context = (struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context*)__Pyx_GetVtable(__pyx_ptype_3zmq_7backend_6cython_7context_Context->tp_dict); if (unlikely(!__pyx_vtabptr_3zmq_7backend_6cython_7context_Context)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_3zmq_7backend_6cython_6socket_Socket = __Pyx_ImportType("zmq.backend.cython.socket", "Socket", sizeof(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket), 1); if (unlikely(!__pyx_ptype_3zmq_7backend_6cython_6socket_Socket)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_vtabptr_3zmq_7backend_6cython_6socket_Socket = (struct __pyx_vtabstruct_3zmq_7backend_6cython_6socket_Socket*)__Pyx_GetVtable(__pyx_ptype_3zmq_7backend_6cython_6socket_Socket->tp_dict); if (unlikely(!__pyx_vtabptr_3zmq_7backend_6cython_6socket_Socket)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
+ #if CYTHON_COMPILING_IN_PYPY
+ sizeof(PyTypeObject),
+ #else
+ sizeof(PyHeapTypeObject),
+ #endif
+ 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Variable import code ---*/
+ /*--- Function import code ---*/
+ /*--- Execution code ---*/
+
+ /* "zmq/backend/cython/_device.pyx":34
+ * #-----------------------------------------------------------------------------
+ *
+ * def device(int device_type, cSocket frontend, cSocket backend=None): # <<<<<<<<<<<<<<
+ * """device(device_type, frontend, backend)
+ *
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3zmq_7backend_6cython_7_device_1device, NULL, __pyx_n_s_zmq_backend_cython__device); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_device, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/_device.pyx":60
+ * return rc
+ *
+ * def proxy(cSocket frontend, cSocket backend, cSocket capture=None): # <<<<<<<<<<<<<<
+ * """proxy(frontend, backend, capture)
+ *
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3zmq_7backend_6cython_7_device_3proxy, NULL, __pyx_n_s_zmq_backend_cython__device); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_proxy, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/_device.pyx":88
+ * return rc
+ *
+ * __all__ = ['device', 'proxy'] # <<<<<<<<<<<<<<
+ *
+ */
+ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_s_device);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_device);
+ __Pyx_GIVEREF(__pyx_n_s_device);
+ __Pyx_INCREF(__pyx_n_s_proxy);
+ PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_proxy);
+ __Pyx_GIVEREF(__pyx_n_s_proxy);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/_device.pyx":1
+ * """Python binding for 0MQ device function.""" # <<<<<<<<<<<<<<
+ *
+ * #
+ */
+ __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;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/checkrc.pxd":5
+ * from libzmq cimport zmq_errno, ZMQ_ETERM
+ *
+ * cdef inline int _check_rc(int rc) except -1: # <<<<<<<<<<<<<<
+ * """internal utility for checking zmq return condition
+ *
+ */
+
+ /*--- Wrapped vars code ---*/
+
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ if (__pyx_m) {
+ if (__pyx_d) {
+ __Pyx_AddTraceback("init zmq.backend.cython._device", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ }
+ Py_DECREF(__pyx_m); __pyx_m = 0;
+ } else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ImportError, "init zmq.backend.cython._device");
+ }
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ #if PY_MAJOR_VERSION < 3
+ return;
+ #else
+ return __pyx_m;
+ #endif
+}
+
+/* Runtime support code */
+#if CYTHON_REFNANNY
+static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
+ PyObject *m = NULL, *p = NULL;
+ void *r = NULL;
+ m = PyImport_ImportModule((char *)modname);
+ if (!m) goto end;
+ p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
+ if (!p) goto end;
+ r = PyLong_AsVoidPtr(p);
+end:
+ Py_XDECREF(p);
+ Py_XDECREF(m);
+ return (__Pyx_RefNannyAPIStruct *)r;
+}
+#endif
+
+static void __Pyx_RaiseArgtupleInvalid(
+ const char* func_name,
+ int exact,
+ Py_ssize_t num_min,
+ Py_ssize_t num_max,
+ Py_ssize_t num_found)
+{
+ Py_ssize_t num_expected;
+ const char *more_or_less;
+ if (num_found < num_min) {
+ num_expected = num_min;
+ more_or_less = "at least";
+ } else {
+ num_expected = num_max;
+ more_or_less = "at most";
+ }
+ if (exact) {
+ more_or_less = "exactly";
+ }
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+ func_name, more_or_less, num_expected,
+ (num_expected == 1) ? "" : "s", num_found);
+}
+
+static void __Pyx_RaiseDoubleKeywordsError(
+ const char* func_name,
+ PyObject* kw_name)
+{
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION >= 3
+ "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
+ #else
+ "%s() got multiple values for keyword argument '%s'", func_name,
+ PyString_AsString(kw_name));
+ #endif
+}
+
+static int __Pyx_ParseOptionalKeywords(
+ PyObject *kwds,
+ PyObject **argnames[],
+ PyObject *kwds2,
+ PyObject *values[],
+ Py_ssize_t num_pos_args,
+ const char* function_name)
+{
+ PyObject *key = 0, *value = 0;
+ Py_ssize_t pos = 0;
+ PyObject*** name;
+ PyObject*** first_kw_arg = argnames + num_pos_args;
+ while (PyDict_Next(kwds, &pos, &key, &value)) {
+ name = first_kw_arg;
+ while (*name && (**name != key)) name++;
+ if (*name) {
+ values[name-argnames] = value;
+ continue;
+ }
+ name = first_kw_arg;
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
+ while (*name) {
+ if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**name, key)) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ if ((**argname == key) || (
+ (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**argname, key))) {
+ goto arg_passed_twice;
+ }
+ argname++;
+ }
+ }
+ } else
+ #endif
+ if (likely(PyUnicode_Check(key))) {
+ while (*name) {
+ int cmp = (**name == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**name, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ int cmp = (**argname == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**argname, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) goto arg_passed_twice;
+ argname++;
+ }
+ }
+ } else
+ goto invalid_keyword_type;
+ if (kwds2) {
+ if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
+ } else {
+ goto invalid_keyword;
+ }
+ }
+ return 0;
+arg_passed_twice:
+ __Pyx_RaiseDoubleKeywordsError(function_name, key);
+ goto bad;
+invalid_keyword_type:
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() keywords must be strings", function_name);
+ goto bad;
+invalid_keyword:
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION < 3
+ "%.200s() got an unexpected keyword argument '%.200s'",
+ function_name, PyString_AsString(key));
+ #else
+ "%s() got an unexpected keyword argument '%U'",
+ function_name, key);
+ #endif
+bad:
+ return -1;
+}
+
+static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
+ PyErr_Format(PyExc_TypeError,
+ "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
+ name, type->tp_name, Py_TYPE(obj)->tp_name);
+}
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+ const char *name, int exact)
+{
+ if (unlikely(!type)) {
+ PyErr_SetString(PyExc_SystemError, "Missing type object");
+ return 0;
+ }
+ if (none_allowed && obj == Py_None) return 1;
+ else if (exact) {
+ if (likely(Py_TYPE(obj) == type)) return 1;
+ #if PY_MAJOR_VERSION == 2
+ else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
+ #endif
+ }
+ else {
+ if (likely(PyObject_TypeCheck(obj, type))) return 1;
+ }
+ __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
+ return 0;
+}
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
+ PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
+ if (unlikely(!result)) {
+ PyErr_Format(PyExc_NameError,
+#if PY_MAJOR_VERSION >= 3
+ "name '%U' is not defined", name);
+#else
+ "name '%.200s' is not defined", PyString_AS_STRING(name));
+#endif
+ }
+ return result;
+}
+
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
+ PyObject *result;
+#if CYTHON_COMPILING_IN_CPYTHON
+ result = PyDict_GetItem(__pyx_d, name);
+ if (likely(result)) {
+ Py_INCREF(result);
+ } else {
+#else
+ result = PyObject_GetItem(__pyx_d, name);
+ if (!result) {
+ PyErr_Clear();
+#endif
+ result = __Pyx_GetBuiltinName(name);
+ }
+ return result;
+}
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+ PyObject *result;
+ ternaryfunc call = func->ob_type->tp_call;
+ if (unlikely(!call))
+ return PyObject_Call(func, arg, kw);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = (*call)(func, arg, kw);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
+ PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
+ if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Format(PyExc_ImportError,
+ #if PY_MAJOR_VERSION < 3
+ "cannot import name %.230s", PyString_AS_STRING(name));
+ #else
+ "cannot import name %S", name);
+ #endif
+ }
+ return value;
+}
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
+ PyObject *self, *result;
+ PyCFunction cfunc;
+ cfunc = PyCFunction_GET_FUNCTION(func);
+ self = PyCFunction_GET_SELF(func);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = cfunc(self, arg);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject *result;
+ PyObject *args = PyTuple_New(1);
+ if (unlikely(!args)) return NULL;
+ Py_INCREF(arg);
+ PyTuple_SET_ITEM(args, 0, arg);
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#ifdef __Pyx_CyFunction_USED
+ if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+ if (likely(PyCFunction_Check(func))) {
+#endif
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
+ return __Pyx_PyObject_CallMethO(func, arg);
+ }
+ }
+ return __Pyx__PyObject_CallOneArg(func, arg);
+}
+#else
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject* args = PyTuple_Pack(1, arg);
+ return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+}
+#endif
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyThreadState *tstate = PyThreadState_GET();
+ tmp_type = tstate->curexc_type;
+ tmp_value = tstate->curexc_value;
+ tmp_tb = tstate->curexc_traceback;
+ tstate->curexc_type = type;
+ tstate->curexc_value = value;
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_Restore(type, value, tb);
+#endif
+}
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ *type = tstate->curexc_type;
+ *value = tstate->curexc_value;
+ *tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(type, value, tb);
+#endif
+}
+
+#if PY_MAJOR_VERSION < 3
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
+ CYTHON_UNUSED PyObject *cause) {
+ Py_XINCREF(type);
+ if (!value || value == Py_None)
+ value = NULL;
+ else
+ Py_INCREF(value);
+ if (!tb || tb == Py_None)
+ tb = NULL;
+ else {
+ Py_INCREF(tb);
+ if (!PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto raise_error;
+ }
+ }
+ if (PyType_Check(type)) {
+#if CYTHON_COMPILING_IN_PYPY
+ if (!value) {
+ Py_INCREF(Py_None);
+ value = Py_None;
+ }
+#endif
+ PyErr_NormalizeException(&type, &value, &tb);
+ } else {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto raise_error;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(type);
+ Py_INCREF(type);
+ if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto raise_error;
+ }
+ }
+ __Pyx_ErrRestore(type, value, tb);
+ return;
+raise_error:
+ Py_XDECREF(value);
+ Py_XDECREF(type);
+ Py_XDECREF(tb);
+ return;
+}
+#else
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
+ PyObject* owned_instance = NULL;
+ if (tb == Py_None) {
+ tb = 0;
+ } else if (tb && !PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto bad;
+ }
+ if (value == Py_None)
+ value = 0;
+ if (PyExceptionInstance_Check(type)) {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto bad;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(value);
+ } else if (PyExceptionClass_Check(type)) {
+ PyObject *instance_class = NULL;
+ if (value && PyExceptionInstance_Check(value)) {
+ instance_class = (PyObject*) Py_TYPE(value);
+ if (instance_class != type) {
+ if (PyObject_IsSubclass(instance_class, type)) {
+ type = instance_class;
+ } else {
+ instance_class = NULL;
+ }
+ }
+ }
+ if (!instance_class) {
+ PyObject *args;
+ if (!value)
+ args = PyTuple_New(0);
+ else if (PyTuple_Check(value)) {
+ Py_INCREF(value);
+ args = value;
+ } else
+ args = PyTuple_Pack(1, value);
+ if (!args)
+ goto bad;
+ owned_instance = PyObject_Call(type, args, NULL);
+ Py_DECREF(args);
+ if (!owned_instance)
+ goto bad;
+ value = owned_instance;
+ if (!PyExceptionInstance_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "calling %R should have returned an instance of "
+ "BaseException, not %R",
+ type, Py_TYPE(value));
+ goto bad;
+ }
+ }
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto bad;
+ }
+#if PY_VERSION_HEX >= 0x03030000
+ if (cause) {
+#else
+ if (cause && cause != Py_None) {
+#endif
+ PyObject *fixed_cause;
+ if (cause == Py_None) {
+ fixed_cause = NULL;
+ } else if (PyExceptionClass_Check(cause)) {
+ fixed_cause = PyObject_CallObject(cause, NULL);
+ if (fixed_cause == NULL)
+ goto bad;
+ } else if (PyExceptionInstance_Check(cause)) {
+ fixed_cause = cause;
+ Py_INCREF(fixed_cause);
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "exception causes must derive from "
+ "BaseException");
+ goto bad;
+ }
+ PyException_SetCause(value, fixed_cause);
+ }
+ PyErr_SetObject(type, value);
+ if (tb) {
+#if CYTHON_COMPILING_IN_PYPY
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyErr_Fetch(tmp_type, tmp_value, tmp_tb);
+ Py_INCREF(tb);
+ PyErr_Restore(tmp_type, tmp_value, tb);
+ Py_XDECREF(tmp_tb);
+#else
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject* tmp_tb = tstate->curexc_traceback;
+ if (tb != tmp_tb) {
+ Py_INCREF(tb);
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_tb);
+ }
+#endif
+ }
+bad:
+ Py_XDECREF(owned_instance);
+ return;
+}
+#endif
+
+static void* __Pyx_GetVtable(PyObject *dict) {
+ void* ptr;
+ PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
+ if (!ob)
+ goto bad;
+#if PY_VERSION_HEX >= 0x02070000
+ ptr = PyCapsule_GetPointer(ob, 0);
+#else
+ ptr = PyCObject_AsVoidPtr(ob);
+#endif
+ if (!ptr && !PyErr_Occurred())
+ PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
+ Py_DECREF(ob);
+ return ptr;
+bad:
+ Py_XDECREF(ob);
+ return NULL;
+}
+
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+ int start = 0, mid = 0, end = count - 1;
+ if (end >= 0 && code_line > entries[end].code_line) {
+ return count;
+ }
+ while (start < end) {
+ mid = (start + end) / 2;
+ if (code_line < entries[mid].code_line) {
+ end = mid;
+ } else if (code_line > entries[mid].code_line) {
+ start = mid + 1;
+ } else {
+ return mid;
+ }
+ }
+ if (code_line <= entries[mid].code_line) {
+ return mid;
+ } else {
+ return mid + 1;
+ }
+}
+static PyCodeObject *__pyx_find_code_object(int code_line) {
+ PyCodeObject* code_object;
+ int pos;
+ if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
+ return NULL;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
+ return NULL;
+ }
+ code_object = __pyx_code_cache.entries[pos].code_object;
+ Py_INCREF(code_object);
+ return code_object;
+}
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
+ int pos, i;
+ __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
+ if (unlikely(!code_line)) {
+ return;
+ }
+ if (unlikely(!entries)) {
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (likely(entries)) {
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = 64;
+ __pyx_code_cache.count = 1;
+ entries[0].code_line = code_line;
+ entries[0].code_object = code_object;
+ Py_INCREF(code_object);
+ }
+ return;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
+ PyCodeObject* tmp = entries[pos].code_object;
+ entries[pos].code_object = code_object;
+ Py_DECREF(tmp);
+ return;
+ }
+ if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
+ int new_max = __pyx_code_cache.max_count + 64;
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
+ __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (unlikely(!entries)) {
+ return;
+ }
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = new_max;
+ }
+ for (i=__pyx_code_cache.count; i>pos; i--) {
+ entries[i] = entries[i-1];
+ }
+ entries[pos].code_line = code_line;
+ entries[pos].code_object = code_object;
+ __pyx_code_cache.count++;
+ Py_INCREF(code_object);
+}
+
+#include "compile.h"
+#include "frameobject.h"
+#include "traceback.h"
+static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
+ const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyObject *py_srcfile = 0;
+ PyObject *py_funcname = 0;
+ #if PY_MAJOR_VERSION < 3
+ py_srcfile = PyString_FromString(filename);
+ #else
+ py_srcfile = PyUnicode_FromString(filename);
+ #endif
+ if (!py_srcfile) goto bad;
+ if (c_line) {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #else
+ py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #endif
+ }
+ else {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromString(funcname);
+ #else
+ py_funcname = PyUnicode_FromString(funcname);
+ #endif
+ }
+ if (!py_funcname) goto bad;
+ py_code = __Pyx_PyCode_New(
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ __pyx_empty_bytes, /*PyObject *code,*/
+ __pyx_empty_tuple, /*PyObject *consts,*/
+ __pyx_empty_tuple, /*PyObject *names,*/
+ __pyx_empty_tuple, /*PyObject *varnames,*/
+ __pyx_empty_tuple, /*PyObject *freevars,*/
+ __pyx_empty_tuple, /*PyObject *cellvars,*/
+ py_srcfile, /*PyObject *filename,*/
+ py_funcname, /*PyObject *name,*/
+ py_line,
+ __pyx_empty_bytes /*PyObject *lnotab*/
+ );
+ Py_DECREF(py_srcfile);
+ Py_DECREF(py_funcname);
+ return py_code;
+bad:
+ Py_XDECREF(py_srcfile);
+ Py_XDECREF(py_funcname);
+ return NULL;
+}
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyFrameObject *py_frame = 0;
+ py_code = __pyx_find_code_object(c_line ? c_line : py_line);
+ if (!py_code) {
+ py_code = __Pyx_CreateCodeObjectForTraceback(
+ funcname, c_line, py_line, filename);
+ if (!py_code) goto bad;
+ __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
+ }
+ py_frame = PyFrame_New(
+ PyThreadState_GET(), /*PyThreadState *tstate,*/
+ py_code, /*PyCodeObject *code,*/
+ __pyx_d, /*PyObject *globals,*/
+ 0 /*PyObject *locals*/
+ );
+ if (!py_frame) goto bad;
+ py_frame->f_lineno = py_line;
+ PyTraceBack_Here(py_frame);
+bad:
+ Py_XDECREF(py_code);
+ Py_XDECREF(py_frame);
+}
+
+#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value) \
+ { \
+ func_type value = func_value; \
+ if (sizeof(target_type) < sizeof(func_type)) { \
+ if (unlikely(value != (func_type) (target_type) value)) { \
+ func_type zero = 0; \
+ if (is_unsigned && unlikely(value < zero)) \
+ goto raise_neg_overflow; \
+ else \
+ goto raise_overflow; \
+ } \
+ } \
+ return (target_type) value; \
+ }
+
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ #include "longintrepr.h"
+ #endif
+#endif
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+ const int neg_one = (int) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(int) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (int) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(int) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
+ } else if (sizeof(int) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ int val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (int) -1;
+ }
+ } else {
+ int val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (int) -1;
+ val = __Pyx_PyInt_As_int(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to int");
+ return (int) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to int");
+ return (int) -1;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+ const int neg_one = (int) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(int) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(int) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(int),
+ little, !is_unsigned);
+ }
+}
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
+ goto bad;
+ #endif
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ {
+ #if PY_MAJOR_VERSION >= 3
+ if (level == -1) {
+ if (strchr(__Pyx_MODULE_NAME, '.')) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(1);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, 1);
+ #endif
+ if (!module) {
+ if (!PyErr_ExceptionMatches(PyExc_ImportError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ level = 0;
+ }
+ #endif
+ if (!module) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(level);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, level);
+ #endif
+ }
+ }
+bad:
+ #if PY_VERSION_HEX < 0x03030000
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+ const long neg_one = (long) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(long) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(long) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(long),
+ little, !is_unsigned);
+ }
+}
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+ const long neg_one = (long) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(long) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (long) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(long) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(long) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(long) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
+ } else if (sizeof(long) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ long val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (long) -1;
+ }
+ } else {
+ long val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (long) -1;
+ val = __Pyx_PyInt_As_long(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to long");
+ return (long) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to long");
+ return (long) -1;
+}
+
+static int __Pyx_check_binary_version(void) {
+ char ctversion[4], rtversion[4];
+ PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
+ if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
+ char message[200];
+ PyOS_snprintf(message, sizeof(message),
+ "compiletime version %s of module '%.100s' "
+ "does not match runtime version %s",
+ ctversion, __Pyx_MODULE_NAME, rtversion);
+ return PyErr_WarnEx(NULL, message, 1);
+ }
+ return 0;
+}
+
+#ifndef __PYX_HAVE_RT_ImportModule
+#define __PYX_HAVE_RT_ImportModule
+static PyObject *__Pyx_ImportModule(const char *name) {
+ PyObject *py_name = 0;
+ PyObject *py_module = 0;
+ py_name = __Pyx_PyIdentifier_FromString(name);
+ if (!py_name)
+ goto bad;
+ py_module = PyImport_Import(py_name);
+ Py_DECREF(py_name);
+ return py_module;
+bad:
+ Py_XDECREF(py_name);
+ return 0;
+}
+#endif
+
+#ifndef __PYX_HAVE_RT_ImportType
+#define __PYX_HAVE_RT_ImportType
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
+ size_t size, int strict)
+{
+ PyObject *py_module = 0;
+ PyObject *result = 0;
+ PyObject *py_name = 0;
+ char warning[200];
+ Py_ssize_t basicsize;
+#ifdef Py_LIMITED_API
+ PyObject *py_basicsize;
+#endif
+ py_module = __Pyx_ImportModule(module_name);
+ if (!py_module)
+ goto bad;
+ py_name = __Pyx_PyIdentifier_FromString(class_name);
+ if (!py_name)
+ goto bad;
+ result = PyObject_GetAttr(py_module, py_name);
+ Py_DECREF(py_name);
+ py_name = 0;
+ Py_DECREF(py_module);
+ py_module = 0;
+ if (!result)
+ goto bad;
+ if (!PyType_Check(result)) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s.%.200s is not a type object",
+ module_name, class_name);
+ goto bad;
+ }
+#ifndef Py_LIMITED_API
+ basicsize = ((PyTypeObject *)result)->tp_basicsize;
+#else
+ py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
+ if (!py_basicsize)
+ goto bad;
+ basicsize = PyLong_AsSsize_t(py_basicsize);
+ Py_DECREF(py_basicsize);
+ py_basicsize = 0;
+ if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
+ goto bad;
+#endif
+ if (!strict && (size_t)basicsize > size) {
+ PyOS_snprintf(warning, sizeof(warning),
+ "%s.%s size changed, may indicate binary incompatibility",
+ module_name, class_name);
+ if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
+ }
+ else if ((size_t)basicsize != size) {
+ PyErr_Format(PyExc_ValueError,
+ "%.200s.%.200s has the wrong size, try recompiling",
+ module_name, class_name);
+ goto bad;
+ }
+ return (PyTypeObject *)result;
+bad:
+ Py_XDECREF(py_module);
+ Py_XDECREF(result);
+ return NULL;
+}
+#endif
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+ while (t->p) {
+ #if PY_MAJOR_VERSION < 3
+ if (t->is_unicode) {
+ *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
+ } else if (t->intern) {
+ *t->p = PyString_InternFromString(t->s);
+ } else {
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+ }
+ #else
+ if (t->is_unicode | t->is_str) {
+ if (t->intern) {
+ *t->p = PyUnicode_InternFromString(t->s);
+ } else if (t->encoding) {
+ *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
+ } else {
+ *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+ }
+ } else {
+ *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
+ }
+ #endif
+ if (!*t->p)
+ return -1;
+ ++t;
+ }
+ return 0;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
+ return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
+ Py_ssize_t ignore;
+ return __Pyx_PyObject_AsStringAndSize(o, &ignore);
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+ if (
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ __Pyx_sys_getdefaultencoding_not_ascii &&
+#endif
+ PyUnicode_Check(o)) {
+#if PY_VERSION_HEX < 0x03030000
+ char* defenc_c;
+ PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
+ if (!defenc) return NULL;
+ defenc_c = PyBytes_AS_STRING(defenc);
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ {
+ char* end = defenc_c + PyBytes_GET_SIZE(defenc);
+ char* c;
+ for (c = defenc_c; c < end; c++) {
+ if ((unsigned char) (*c) >= 128) {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+ }
+ }
+#endif
+ *length = PyBytes_GET_SIZE(defenc);
+ return defenc_c;
+#else
+ if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ if (PyUnicode_IS_ASCII(o)) {
+ *length = PyUnicode_GET_LENGTH(o);
+ return PyUnicode_AsUTF8(o);
+ } else {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+#else
+ return PyUnicode_AsUTF8AndSize(o, length);
+#endif
+#endif
+ } else
+#endif
+#if !CYTHON_COMPILING_IN_PYPY
+ if (PyByteArray_Check(o)) {
+ *length = PyByteArray_GET_SIZE(o);
+ return PyByteArray_AS_STRING(o);
+ } else
+#endif
+ {
+ char* result;
+ int r = PyBytes_AsStringAndSize(o, &result, length);
+ if (unlikely(r < 0)) {
+ return NULL;
+ } else {
+ return result;
+ }
+ }
+}
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
+ int is_true = x == Py_True;
+ if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
+ else return PyObject_IsTrue(x);
+}
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
+ PyNumberMethods *m;
+ const char *name = NULL;
+ PyObject *res = NULL;
+#if PY_MAJOR_VERSION < 3
+ if (PyInt_Check(x) || PyLong_Check(x))
+#else
+ if (PyLong_Check(x))
+#endif
+ return Py_INCREF(x), x;
+ m = Py_TYPE(x)->tp_as_number;
+#if PY_MAJOR_VERSION < 3
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Int(x);
+ }
+ else if (m && m->nb_long) {
+ name = "long";
+ res = PyNumber_Long(x);
+ }
+#else
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Long(x);
+ }
+#endif
+ if (res) {
+#if PY_MAJOR_VERSION < 3
+ if (!PyInt_Check(res) && !PyLong_Check(res)) {
+#else
+ if (!PyLong_Check(res)) {
+#endif
+ PyErr_Format(PyExc_TypeError,
+ "__%.4s__ returned non-%.4s (type %.200s)",
+ name, name, Py_TYPE(res)->tp_name);
+ Py_DECREF(res);
+ return NULL;
+ }
+ }
+ else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "an integer is required");
+ }
+ return res;
+}
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+ Py_ssize_t ival;
+ PyObject *x;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(b)))
+ return PyInt_AS_LONG(b);
+#endif
+ if (likely(PyLong_CheckExact(b))) {
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(b)) {
+ case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
+ case 0: return 0;
+ case 1: return ((PyLongObject*)b)->ob_digit[0];
+ }
+ #endif
+ #endif
+ return PyLong_AsSsize_t(b);
+ }
+ x = PyNumber_Index(b);
+ if (!x) return -1;
+ ival = PyInt_AsSsize_t(x);
+ Py_DECREF(x);
+ return ival;
+}
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
+ return PyInt_FromSize_t(ival);
+}
+
+
+#endif /* Py_PYTHON_H */
diff --git a/scripts/external_libs/platform/cel59/zmq/backend/cython/_device.pyx b/scripts/external_libs/platform/cel59/zmq/backend/cython/_device.pyx
new file mode 100644
index 00000000..eea0a006
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/_device.pyx
@@ -0,0 +1,89 @@
+"""Python binding for 0MQ device function."""
+
+#
+# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
+#
+# This file is part of pyzmq.
+#
+# pyzmq is free software; you can redistribute it and/or modify it under
+# the terms of the Lesser GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# pyzmq is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# Lesser GNU General Public License for more details.
+#
+# You should have received a copy of the Lesser GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+#-----------------------------------------------------------------------------
+# Imports
+#-----------------------------------------------------------------------------
+
+from libzmq cimport zmq_device, zmq_proxy, ZMQ_VERSION_MAJOR
+from zmq.backend.cython.socket cimport Socket as cSocket
+from zmq.backend.cython.checkrc cimport _check_rc
+
+#-----------------------------------------------------------------------------
+# Basic device API
+#-----------------------------------------------------------------------------
+
+def device(int device_type, cSocket frontend, cSocket backend=None):
+ """device(device_type, frontend, backend)
+
+ Start a zeromq device.
+
+ .. deprecated:: libzmq-3.2
+ Use zmq.proxy
+
+ Parameters
+ ----------
+ device_type : (QUEUE, FORWARDER, STREAMER)
+ The type of device to start.
+ frontend : Socket
+ The Socket instance for the incoming traffic.
+ backend : Socket
+ The Socket instance for the outbound traffic.
+ """
+ if ZMQ_VERSION_MAJOR >= 3:
+ return proxy(frontend, backend)
+
+ cdef int rc = 0
+ with nogil:
+ rc = zmq_device(device_type, frontend.handle, backend.handle)
+ _check_rc(rc)
+ return rc
+
+def proxy(cSocket frontend, cSocket backend, cSocket capture=None):
+ """proxy(frontend, backend, capture)
+
+ Start a zeromq proxy (replacement for device).
+
+ .. versionadded:: libzmq-3.2
+ .. versionadded:: 13.0
+
+ Parameters
+ ----------
+ frontend : Socket
+ The Socket instance for the incoming traffic.
+ backend : Socket
+ The Socket instance for the outbound traffic.
+ capture : Socket (optional)
+ The Socket instance for capturing traffic.
+ """
+ cdef int rc = 0
+ cdef void* capture_handle
+ if isinstance(capture, cSocket):
+ capture_handle = capture.handle
+ else:
+ capture_handle = NULL
+ with nogil:
+ rc = zmq_proxy(frontend.handle, backend.handle, capture_handle)
+ _check_rc(rc)
+ return rc
+
+__all__ = ['device', 'proxy']
+
diff --git a/scripts/external_libs/platform/cel59/zmq/backend/cython/_poll.c b/scripts/external_libs/platform/cel59/zmq/backend/cython/_poll.c
new file mode 100644
index 00000000..b54c94eb
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/_poll.c
@@ -0,0 +1,4004 @@
+/* Generated by Cython 0.21.2 */
+
+#define PY_SSIZE_T_CLEAN
+#ifndef CYTHON_USE_PYLONG_INTERNALS
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#else
+#include "pyconfig.h"
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 1
+#else
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#endif
+#endif
+#endif
+#include "Python.h"
+#ifndef Py_PYTHON_H
+ #error Python headers needed to compile C extensions, please install development version of Python.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+ #error Cython requires Python 2.6+ or Python 3.2+.
+#else
+#define CYTHON_ABI "0_21_2"
+#include <stddef.h>
+#ifndef offsetof
+#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+ #ifndef __stdcall
+ #define __stdcall
+ #endif
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
+ #ifndef __fastcall
+ #define __fastcall
+ #endif
+#endif
+#ifndef DL_IMPORT
+ #define DL_IMPORT(t) t
+#endif
+#ifndef DL_EXPORT
+ #define DL_EXPORT(t) t
+#endif
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifndef Py_HUGE_VAL
+ #define Py_HUGE_VAL HUGE_VAL
+#endif
+#ifdef PYPY_VERSION
+#define CYTHON_COMPILING_IN_PYPY 1
+#define CYTHON_COMPILING_IN_CPYTHON 0
+#else
+#define CYTHON_COMPILING_IN_PYPY 0
+#define CYTHON_COMPILING_IN_CPYTHON 1
+#endif
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
+#define Py_OptimizeFlag 0
+#endif
+#define __PYX_BUILD_PY_SSIZE_T "n"
+#define CYTHON_FORMAT_SSIZE_T "z"
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyClass_Type
+#else
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyType_Type
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define Py_TPFLAGS_CHECKTYPES 0
+ #define Py_TPFLAGS_HAVE_INDEX 0
+ #define Py_TPFLAGS_HAVE_NEWBUFFER 0
+#endif
+#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+ #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
+#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
+ #define CYTHON_PEP393_ENABLED 1
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
+ 0 : _PyUnicode_Ready((PyObject *)(op)))
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
+ #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
+ #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+#else
+ #define CYTHON_PEP393_ENABLED 0
+ #define __Pyx_PyUnicode_READY(op) (0)
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
+ #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
+ #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+ #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyFrozenSet_Size(s) PyObject_Size(s)
+#else
+ #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
+ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
+ #define __Pyx_PyFrozenSet_Size(s) PySet_Size(s)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
+#else
+ #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBaseString_Type PyUnicode_Type
+ #define PyStringObject PyUnicodeObject
+ #define PyString_Type PyUnicode_Type
+ #define PyString_Check PyUnicode_Check
+ #define PyString_CheckExact PyUnicode_CheckExact
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
+ #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
+#else
+ #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+ #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
+#endif
+#ifndef PySet_CheckExact
+ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
+#endif
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#if PY_MAJOR_VERSION >= 3
+ #define PyIntObject PyLongObject
+ #define PyInt_Type PyLong_Type
+ #define PyInt_Check(op) PyLong_Check(op)
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
+ #define PyInt_FromString PyLong_FromString
+ #define PyInt_FromUnicode PyLong_FromUnicode
+ #define PyInt_FromLong PyLong_FromLong
+ #define PyInt_FromSize_t PyLong_FromSize_t
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
+ #define PyInt_AsLong PyLong_AsLong
+ #define PyInt_AS_LONG PyLong_AS_LONG
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+ #define PyNumber_Int PyNumber_Long
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBoolObject PyLongObject
+#endif
+#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
+ #ifndef PyUnicode_InternFromString
+ #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
+ #endif
+#endif
+#if PY_VERSION_HEX < 0x030200A4
+ typedef long Py_hash_t;
+ #define __Pyx_PyInt_FromHash_t PyInt_FromLong
+ #define __Pyx_PyInt_AsHash_t PyInt_AsLong
+#else
+ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
+ #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+#else
+ #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
+#endif
+#ifndef CYTHON_INLINE
+ #if defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+#ifndef CYTHON_RESTRICT
+ #if defined(__GNUC__)
+ #define CYTHON_RESTRICT __restrict__
+ #elif defined(_MSC_VER) && _MSC_VER >= 1400
+ #define CYTHON_RESTRICT __restrict
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_RESTRICT restrict
+ #else
+ #define CYTHON_RESTRICT
+ #endif
+#endif
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
+#else
+static CYTHON_INLINE float __PYX_NAN() {
+ /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
+ a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
+ a quiet NaN. */
+ float value;
+ memset(&value, 0xFF, sizeof(value));
+ return value;
+}
+#endif
+#ifdef __cplusplus
+template<typename T>
+void __Pyx_call_destructor(T* x) {
+ x->~T();
+}
+#endif
+
+
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
+#else
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
+#endif
+
+#ifndef __PYX_EXTERN_C
+ #ifdef __cplusplus
+ #define __PYX_EXTERN_C extern "C"
+ #else
+ #define __PYX_EXTERN_C extern
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+#define _USE_MATH_DEFINES
+#endif
+#include <math.h>
+#define __PYX_HAVE__zmq__backend__cython___poll
+#define __PYX_HAVE_API__zmq__backend__cython___poll
+#include "string.h"
+#include "stdlib.h"
+#include "zmq_compat.h"
+#include "zmq.h"
+#include "zmq_utils.h"
+#include "errno.h"
+#include "stdio.h"
+#include "pythread.h"
+#ifdef _OPENMP
+#include <omp.h>
+#endif /* _OPENMP */
+
+#ifdef PYREX_WITHOUT_ASSERTIONS
+#define CYTHON_WITHOUT_ASSERTIONS
+#endif
+
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
+ const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \
+ (sizeof(type) < sizeof(Py_ssize_t)) || \
+ (sizeof(type) > sizeof(Py_ssize_t) && \
+ likely(v < (type)PY_SSIZE_T_MAX || \
+ v == (type)PY_SSIZE_T_MAX) && \
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \
+ v == (type)PY_SSIZE_T_MIN))) || \
+ (sizeof(type) == sizeof(Py_ssize_t) && \
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \
+ v == (type)PY_SSIZE_T_MAX))) )
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
+#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
+#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
+#define __Pyx_PyBytes_FromString PyBytes_FromString
+#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#else
+ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
+#endif
+#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
+#if PY_MAJOR_VERSION < 3
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
+{
+ const Py_UNICODE *u_end = u;
+ while (*u_end++) ;
+ return (size_t)(u_end - u - 1);
+}
+#else
+#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
+#endif
+#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
+#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
+#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
+#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
+#else
+#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
+#endif
+#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ PyObject* ascii_chars_u = NULL;
+ PyObject* ascii_chars_b = NULL;
+ const char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ if (strcmp(default_encoding_c, "ascii") == 0) {
+ __Pyx_sys_getdefaultencoding_not_ascii = 0;
+ } else {
+ char ascii_chars[128];
+ int c;
+ for (c = 0; c < 128; c++) {
+ ascii_chars[c] = c;
+ }
+ __Pyx_sys_getdefaultencoding_not_ascii = 1;
+ ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
+ if (!ascii_chars_u) goto bad;
+ ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
+ if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
+ PyErr_Format(
+ PyExc_ValueError,
+ "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
+ default_encoding_c);
+ goto bad;
+ }
+ Py_DECREF(ascii_chars_u);
+ Py_DECREF(ascii_chars_b);
+ }
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ Py_XDECREF(ascii_chars_u);
+ Py_XDECREF(ascii_chars_b);
+ return -1;
+}
+#endif
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
+#else
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+static char* __PYX_DEFAULT_STRING_ENCODING;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
+ if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
+ strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ return -1;
+}
+#endif
+#endif
+
+
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+ #define likely(x) __builtin_expect(!!(x), 1)
+ #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
+ #define likely(x) (x)
+ #define unlikely(x) (x)
+#endif /* __GNUC__ */
+
+static PyObject *__pyx_m;
+static PyObject *__pyx_d;
+static PyObject *__pyx_b;
+static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
+static int __pyx_lineno;
+static int __pyx_clineno = 0;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+
+
+static const char *__pyx_f[] = {
+ "zmq/backend/cython/_poll.pyx",
+ "zmq/backend/cython/checkrc.pxd",
+ "zmq/backend/cython/context.pxd",
+ "zmq/backend/cython/socket.pxd",
+ "type.pxd",
+ "bool.pxd",
+ "complex.pxd",
+};
+
+/*--- Type declarations ---*/
+struct __pyx_obj_3zmq_7backend_6cython_7context_Context;
+struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket;
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_send;
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_recv;
+
+/* "socket.pxd":45
+ *
+ * # cpdef methods for direct-cython access:
+ * cpdef object send(self, object data, int flags=*, copy=*, track=*) # <<<<<<<<<<<<<<
+ * cpdef object recv(self, int flags=*, copy=*, track=*)
+ *
+ */
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_send {
+ int __pyx_n;
+ int flags;
+ PyObject *copy;
+ PyObject *track;
+};
+
+/* "socket.pxd":46
+ * # cpdef methods for direct-cython access:
+ * cpdef object send(self, object data, int flags=*, copy=*, track=*)
+ * cpdef object recv(self, int flags=*, copy=*, track=*) # <<<<<<<<<<<<<<
+ *
+ */
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_recv {
+ int __pyx_n;
+ int flags;
+ PyObject *copy;
+ PyObject *track;
+};
+
+/* "context.pxd":26
+ * #-----------------------------------------------------------------------------
+ *
+ * cdef class Context: # <<<<<<<<<<<<<<
+ *
+ * cdef object __weakref__ # enable weakref
+ */
+struct __pyx_obj_3zmq_7backend_6cython_7context_Context {
+ PyObject_HEAD
+ struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context *__pyx_vtab;
+ PyObject *__weakref__;
+ void *handle;
+ int _shadow;
+ void **_sockets;
+ size_t _n_sockets;
+ size_t _max_sockets;
+ int _pid;
+ int closed;
+};
+
+
+/* "socket.pxd":33
+ *
+ *
+ * cdef class Socket: # <<<<<<<<<<<<<<
+ *
+ * cdef object __weakref__ # enable weakref
+ */
+struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket {
+ PyObject_HEAD
+ struct __pyx_vtabstruct_3zmq_7backend_6cython_6socket_Socket *__pyx_vtab;
+ PyObject *__weakref__;
+ void *handle;
+ int _shadow;
+ struct __pyx_obj_3zmq_7backend_6cython_7context_Context *context;
+ int _closed;
+ int _pid;
+};
+
+
+
+/* "context.pxd":26
+ * #-----------------------------------------------------------------------------
+ *
+ * cdef class Context: # <<<<<<<<<<<<<<
+ *
+ * cdef object __weakref__ # enable weakref
+ */
+
+struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context {
+ int (*_term)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *);
+ void (*_add_socket)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *, void *);
+ void (*_remove_socket)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *, void *);
+};
+static struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context *__pyx_vtabptr_3zmq_7backend_6cython_7context_Context;
+
+
+/* "socket.pxd":33
+ *
+ *
+ * cdef class Socket: # <<<<<<<<<<<<<<
+ *
+ * cdef object __weakref__ # enable weakref
+ */
+
+struct __pyx_vtabstruct_3zmq_7backend_6cython_6socket_Socket {
+ PyObject *(*send)(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_send *__pyx_optional_args);
+ PyObject *(*recv)(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *, int __pyx_skip_dispatch, struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_recv *__pyx_optional_args);
+};
+static struct __pyx_vtabstruct_3zmq_7backend_6cython_6socket_Socket *__pyx_vtabptr_3zmq_7backend_6cython_6socket_Socket;
+#ifndef CYTHON_REFNANNY
+ #define CYTHON_REFNANNY 0
+#endif
+#if CYTHON_REFNANNY
+ typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*SetupContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+ } __Pyx_RefNannyAPIStruct;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
+ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
+#ifdef WITH_THREAD
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ if (acquire_gil) { \
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ PyGILState_Release(__pyx_gilstate_save); \
+ } else { \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ }
+#else
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+#endif
+ #define __Pyx_RefNannyFinishContext() \
+ __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
+ #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
+ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
+#else
+ #define __Pyx_RefNannyDeclarations
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)
+ #define __Pyx_RefNannyFinishContext()
+ #define __Pyx_INCREF(r) Py_INCREF(r)
+ #define __Pyx_DECREF(r) Py_DECREF(r)
+ #define __Pyx_GOTREF(r)
+ #define __Pyx_GIVEREF(r)
+ #define __Pyx_XINCREF(r) Py_XINCREF(r)
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
+ #define __Pyx_XGOTREF(r)
+ #define __Pyx_XGIVEREF(r)
+#endif
+#define __Pyx_XDECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_XDECREF(tmp); \
+ } while (0)
+#define __Pyx_DECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_DECREF(tmp); \
+ } while (0)
+#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
+#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_getattro))
+ return tp->tp_getattro(obj, attr_name);
+#if PY_MAJOR_VERSION < 3
+ if (likely(tp->tp_getattr))
+ return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
+#endif
+ return PyObject_GetAttr(obj, attr_name);
+}
+#else
+#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
+#endif
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
+
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+ const char* function_name);
+
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+ Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
+#else
+#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
+#endif
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
+
+#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
+ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
+ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \
+ __Pyx_GetItemInt_Generic(o, to_py_func(i))))
+#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
+ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
+ int wraparound, int boundscheck);
+#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
+ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
+ int wraparound, int boundscheck);
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
+ int is_list, int wraparound, int boundscheck);
+
+static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
+
+static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+
+static CYTHON_INLINE int __Pyx_IterFinish(void);
+
+static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
+
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
+#else
+#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
+#endif
+
+static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
+static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);
+
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
+ PyListObject* L = (PyListObject*) list;
+ Py_ssize_t len = Py_SIZE(list);
+ if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
+ Py_INCREF(x);
+ PyList_SET_ITEM(list, len, x);
+ Py_SIZE(list) = len+1;
+ return 0;
+ }
+ return PyList_Append(list, x);
+}
+#else
+#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
+#endif
+
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
+
+static void* __Pyx_GetVtable(PyObject *dict);
+
+typedef struct {
+ int code_line;
+ PyCodeObject* code_object;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+ int count;
+ int max_count;
+ __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename);
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+static CYTHON_INLINE short __Pyx_PyInt_As_short(PyObject *);
+
+#ifndef __PYX_FORCE_INIT_THREADS
+ #define __PYX_FORCE_INIT_THREADS 0
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_short(short value);
+
+static int __Pyx_check_binary_version(void);
+
+#if !defined(__Pyx_PyIdentifier_FromString)
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
+#else
+ #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
+#endif
+#endif
+
+static PyObject *__Pyx_ImportModule(const char *name);
+
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+
+
+/* Module declarations from 'libc.string' */
+
+/* Module declarations from 'libc.stdlib' */
+
+/* Module declarations from 'zmq.backend.cython.libzmq' */
+
+/* Module declarations from 'zmq.backend.cython.context' */
+static PyTypeObject *__pyx_ptype_3zmq_7backend_6cython_7context_Context = 0;
+
+/* Module declarations from 'zmq.backend.cython.socket' */
+static PyTypeObject *__pyx_ptype_3zmq_7backend_6cython_6socket_Socket = 0;
+
+/* Module declarations from 'libc.errno' */
+
+/* Module declarations from 'cpython.version' */
+
+/* Module declarations from 'cpython.ref' */
+
+/* Module declarations from 'cpython.exc' */
+
+/* Module declarations from 'cpython.module' */
+
+/* Module declarations from 'cpython.mem' */
+
+/* Module declarations from 'cpython.tuple' */
+
+/* Module declarations from 'cpython.list' */
+
+/* Module declarations from 'libc.stdio' */
+
+/* Module declarations from 'cpython.object' */
+
+/* Module declarations from 'cpython.sequence' */
+
+/* Module declarations from 'cpython.mapping' */
+
+/* Module declarations from 'cpython.iterator' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.type' */
+static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
+
+/* Module declarations from 'cpython.number' */
+
+/* Module declarations from 'cpython.int' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.bool' */
+static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
+
+/* Module declarations from 'cpython.long' */
+
+/* Module declarations from 'cpython.float' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.complex' */
+static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
+
+/* Module declarations from 'cpython.string' */
+
+/* Module declarations from 'cpython.unicode' */
+
+/* Module declarations from 'cpython.dict' */
+
+/* Module declarations from 'cpython.instance' */
+
+/* Module declarations from 'cpython.function' */
+
+/* Module declarations from 'cpython.method' */
+
+/* Module declarations from 'cpython.weakref' */
+
+/* Module declarations from 'cpython.getargs' */
+
+/* Module declarations from 'cpython.pythread' */
+
+/* Module declarations from 'cpython.pystate' */
+
+/* Module declarations from 'cpython.cobject' */
+
+/* Module declarations from 'cpython.oldbuffer' */
+
+/* Module declarations from 'cpython.set' */
+
+/* Module declarations from 'cpython.buffer' */
+
+/* Module declarations from 'cpython.bytes' */
+
+/* Module declarations from 'cpython.pycapsule' */
+
+/* Module declarations from 'cpython' */
+
+/* Module declarations from 'zmq.backend.cython.checkrc' */
+static CYTHON_INLINE int __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(int); /*proto*/
+
+/* Module declarations from 'zmq.backend.cython._poll' */
+#define __Pyx_MODULE_NAME "zmq.backend.cython._poll"
+int __pyx_module_is_main_zmq__backend__cython___poll = 0;
+
+/* Implementation of 'zmq.backend.cython._poll' */
+static PyObject *__pyx_builtin_MemoryError;
+static PyObject *__pyx_builtin_range;
+static PyObject *__pyx_builtin_ValueError;
+static PyObject *__pyx_builtin_TypeError;
+static PyObject *__pyx_pf_3zmq_7backend_6cython_5_poll_zmq_poll(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sockets, long __pyx_v_timeout); /* proto */
+static char __pyx_k_i[] = "i";
+static char __pyx_k_s[] = "s";
+static char __pyx_k_rc[] = "rc";
+static char __pyx_k_all[] = "__all__";
+static char __pyx_k_sys[] = "sys";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_Again[] = "Again";
+static char __pyx_k_int_t[] = "int_t";
+static char __pyx_k_range[] = "range";
+static char __pyx_k_events[] = "events";
+static char __pyx_k_fileno[] = "fileno";
+static char __pyx_k_import[] = "__import__";
+static char __pyx_k_results[] = "results";
+static char __pyx_k_revents[] = "revents";
+static char __pyx_k_sockets[] = "sockets";
+static char __pyx_k_timeout[] = "timeout";
+static char __pyx_k_ZMQError[] = "ZMQError";
+static char __pyx_k_nsockets[] = "nsockets";
+static char __pyx_k_zmq_poll[] = "zmq_poll";
+static char __pyx_k_TypeError[] = "TypeError";
+static char __pyx_k_pollitems[] = "pollitems";
+static char __pyx_k_zmq_error[] = "zmq.error";
+static char __pyx_k_ValueError[] = "ValueError";
+static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static char __pyx_k_MemoryError[] = "MemoryError";
+static char __pyx_k_version_info[] = "version_info";
+static char __pyx_k_current_socket[] = "current_socket";
+static char __pyx_k_ContextTerminated[] = "ContextTerminated";
+static char __pyx_k_zmq_backend_cython__poll[] = "zmq.backend.cython._poll";
+static char __pyx_k_Could_not_allocate_poll_items[] = "Could not allocate poll items";
+static char __pyx_k_private_tmp_pyzmq_release_zmq_b[] = "/private/tmp/pyzmq-release/zmq/backend/cython/_poll.pyx";
+static char __pyx_k_0MQ_polling_related_functions_an[] = "0MQ polling related functions and classes.";
+static char __pyx_k_Socket_must_be_a_0MQ_socket_an_i[] = "Socket must be a 0MQ socket, an integer fd or have a fileno() method: %r";
+static char __pyx_k_fileno_must_return_a_valid_integ[] = "fileno() must return a valid integer fd";
+static PyObject *__pyx_n_s_Again;
+static PyObject *__pyx_n_s_ContextTerminated;
+static PyObject *__pyx_kp_s_Could_not_allocate_poll_items;
+static PyObject *__pyx_n_s_MemoryError;
+static PyObject *__pyx_kp_s_Socket_must_be_a_0MQ_socket_an_i;
+static PyObject *__pyx_n_s_TypeError;
+static PyObject *__pyx_n_s_ValueError;
+static PyObject *__pyx_n_s_ZMQError;
+static PyObject *__pyx_n_s_all;
+static PyObject *__pyx_n_s_current_socket;
+static PyObject *__pyx_n_s_events;
+static PyObject *__pyx_n_s_fileno;
+static PyObject *__pyx_kp_s_fileno_must_return_a_valid_integ;
+static PyObject *__pyx_n_s_i;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_s_int_t;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_nsockets;
+static PyObject *__pyx_n_s_pollitems;
+static PyObject *__pyx_kp_s_private_tmp_pyzmq_release_zmq_b;
+static PyObject *__pyx_n_s_pyx_vtable;
+static PyObject *__pyx_n_s_range;
+static PyObject *__pyx_n_s_rc;
+static PyObject *__pyx_n_s_results;
+static PyObject *__pyx_n_s_revents;
+static PyObject *__pyx_n_s_s;
+static PyObject *__pyx_n_s_sockets;
+static PyObject *__pyx_n_s_sys;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_n_s_timeout;
+static PyObject *__pyx_n_s_version_info;
+static PyObject *__pyx_n_s_zmq_backend_cython__poll;
+static PyObject *__pyx_n_s_zmq_error;
+static PyObject *__pyx_n_s_zmq_poll;
+static PyObject *__pyx_int_3;
+static PyObject *__pyx_tuple_;
+static PyObject *__pyx_tuple__2;
+static PyObject *__pyx_tuple__3;
+static PyObject *__pyx_codeobj__4;
+
+/* "zmq/backend/cython/_poll.pyx":47
+ *
+ *
+ * def zmq_poll(sockets, long timeout=-1): # <<<<<<<<<<<<<<
+ * """zmq_poll(sockets, timeout=-1)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_5_poll_1zmq_poll(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_5_poll_zmq_poll[] = "zmq_poll(sockets, timeout=-1)\n\n Poll a set of 0MQ sockets, native file descs. or sockets.\n\n Parameters\n ----------\n sockets : list of tuples of (socket, flags)\n Each element of this list is a two-tuple containing a socket\n and a flags. The socket may be a 0MQ socket or any object with\n a ``fileno()`` method. The flags can be zmq.POLLIN (for detecting\n for incoming messages), zmq.POLLOUT (for detecting that send is OK)\n or zmq.POLLIN|zmq.POLLOUT for detecting both.\n timeout : int\n The number of milliseconds to poll for. Negative means no timeout.\n ";
+static PyMethodDef __pyx_mdef_3zmq_7backend_6cython_5_poll_1zmq_poll = {"zmq_poll", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_5_poll_1zmq_poll, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3zmq_7backend_6cython_5_poll_zmq_poll};
+static PyObject *__pyx_pw_3zmq_7backend_6cython_5_poll_1zmq_poll(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_sockets = 0;
+ long __pyx_v_timeout;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("zmq_poll (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sockets,&__pyx_n_s_timeout,0};
+ PyObject* values[2] = {0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sockets)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeout);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zmq_poll") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_sockets = values[0];
+ if (values[1]) {
+ __pyx_v_timeout = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_timeout == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ } else {
+ __pyx_v_timeout = ((long)-1);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("zmq_poll", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("zmq.backend.cython._poll.zmq_poll", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_5_poll_zmq_poll(__pyx_self, __pyx_v_sockets, __pyx_v_timeout);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_5_poll_zmq_poll(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sockets, long __pyx_v_timeout) {
+ int __pyx_v_rc;
+ int __pyx_v_i;
+ zmq_pollitem_t *__pyx_v_pollitems;
+ int __pyx_v_nsockets;
+ PyObject *__pyx_v_s = NULL;
+ PyObject *__pyx_v_events = NULL;
+ PyObject *__pyx_v_fileno = NULL;
+ PyObject *__pyx_v_results = NULL;
+ short __pyx_v_revents;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *(*__pyx_t_9)(PyObject *);
+ int __pyx_t_10;
+ void *__pyx_t_11;
+ short __pyx_t_12;
+ int __pyx_t_13;
+ PyObject *__pyx_t_14 = NULL;
+ PyObject *__pyx_t_15 = NULL;
+ PyObject *__pyx_t_16 = NULL;
+ int __pyx_t_17;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("zmq_poll", 0);
+
+ /* "zmq/backend/cython/_poll.pyx":64
+ * """
+ * cdef int rc, i
+ * cdef zmq_pollitem_t *pollitems = NULL # <<<<<<<<<<<<<<
+ * cdef int nsockets = <int>len(sockets)
+ * cdef Socket current_socket
+ */
+ __pyx_v_pollitems = NULL;
+
+ /* "zmq/backend/cython/_poll.pyx":65
+ * cdef int rc, i
+ * cdef zmq_pollitem_t *pollitems = NULL
+ * cdef int nsockets = <int>len(sockets) # <<<<<<<<<<<<<<
+ * cdef Socket current_socket
+ *
+ */
+ __pyx_t_1 = PyObject_Length(__pyx_v_sockets); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_nsockets = ((int)__pyx_t_1);
+
+ /* "zmq/backend/cython/_poll.pyx":68
+ * cdef Socket current_socket
+ *
+ * if nsockets == 0: # <<<<<<<<<<<<<<
+ * return []
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_nsockets == 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/_poll.pyx":69
+ *
+ * if nsockets == 0:
+ * return [] # <<<<<<<<<<<<<<
+ *
+ * pollitems = <zmq_pollitem_t *>malloc(nsockets*sizeof(zmq_pollitem_t))
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/backend/cython/_poll.pyx":71
+ * return []
+ *
+ * pollitems = <zmq_pollitem_t *>malloc(nsockets*sizeof(zmq_pollitem_t)) # <<<<<<<<<<<<<<
+ * if pollitems == NULL:
+ * raise MemoryError("Could not allocate poll items")
+ */
+ __pyx_v_pollitems = ((zmq_pollitem_t *)malloc((__pyx_v_nsockets * (sizeof(zmq_pollitem_t)))));
+
+ /* "zmq/backend/cython/_poll.pyx":72
+ *
+ * pollitems = <zmq_pollitem_t *>malloc(nsockets*sizeof(zmq_pollitem_t))
+ * if pollitems == NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError("Could not allocate poll items")
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_pollitems == NULL) != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/_poll.pyx":73
+ * pollitems = <zmq_pollitem_t *>malloc(nsockets*sizeof(zmq_pollitem_t))
+ * if pollitems == NULL:
+ * raise MemoryError("Could not allocate poll items") # <<<<<<<<<<<<<<
+ *
+ * if ZMQ_VERSION_MAJOR < 3:
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/_poll.pyx":75
+ * raise MemoryError("Could not allocate poll items")
+ *
+ * if ZMQ_VERSION_MAJOR < 3: # <<<<<<<<<<<<<<
+ * # timeout is us in 2.x, ms in 3.x
+ * # expected input is ms (matches 3.x)
+ */
+ __pyx_t_2 = ((ZMQ_VERSION_MAJOR < 3) != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/_poll.pyx":78
+ * # timeout is us in 2.x, ms in 3.x
+ * # expected input is ms (matches 3.x)
+ * timeout = 1000*timeout # <<<<<<<<<<<<<<
+ *
+ * for i in range(nsockets):
+ */
+ __pyx_v_timeout = (1000 * __pyx_v_timeout);
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+
+ /* "zmq/backend/cython/_poll.pyx":80
+ * timeout = 1000*timeout
+ *
+ * for i in range(nsockets): # <<<<<<<<<<<<<<
+ * s, events = sockets[i]
+ * if isinstance(s, Socket):
+ */
+ __pyx_t_4 = __pyx_v_nsockets;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "zmq/backend/cython/_poll.pyx":81
+ *
+ * for i in range(nsockets):
+ * s, events = sockets[i] # <<<<<<<<<<<<<<
+ * if isinstance(s, Socket):
+ * pollitems[i].socket = (<Socket>s).handle
+ */
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_sockets, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_3);
+ if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
+ PyObject* sequence = __pyx_t_3;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ Py_ssize_t size = Py_SIZE(sequence);
+ #else
+ Py_ssize_t size = PySequence_Size(sequence);
+ #endif
+ if (unlikely(size != 2)) {
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ #if CYTHON_COMPILING_IN_CPYTHON
+ if (likely(PyTuple_CheckExact(sequence))) {
+ __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
+ } else {
+ __pyx_t_6 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
+ }
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_7);
+ #else
+ __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ #endif
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else {
+ Py_ssize_t index = -1;
+ __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
+ index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_6);
+ index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_7);
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = NULL;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ goto __pyx_L9_unpacking_done;
+ __pyx_L8_unpacking_failed:;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_9 = NULL;
+ if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_L9_unpacking_done:;
+ }
+ __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_events, __pyx_t_7);
+ __pyx_t_7 = 0;
+
+ /* "zmq/backend/cython/_poll.pyx":82
+ * for i in range(nsockets):
+ * s, events = sockets[i]
+ * if isinstance(s, Socket): # <<<<<<<<<<<<<<
+ * pollitems[i].socket = (<Socket>s).handle
+ * pollitems[i].events = events
+ */
+ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_s, ((PyObject*)__pyx_ptype_3zmq_7backend_6cython_6socket_Socket));
+ __pyx_t_10 = (__pyx_t_2 != 0);
+ if (__pyx_t_10) {
+
+ /* "zmq/backend/cython/_poll.pyx":83
+ * s, events = sockets[i]
+ * if isinstance(s, Socket):
+ * pollitems[i].socket = (<Socket>s).handle # <<<<<<<<<<<<<<
+ * pollitems[i].events = events
+ * pollitems[i].revents = 0
+ */
+ __pyx_t_11 = ((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)__pyx_v_s)->handle;
+ (__pyx_v_pollitems[__pyx_v_i]).socket = __pyx_t_11;
+
+ /* "zmq/backend/cython/_poll.pyx":84
+ * if isinstance(s, Socket):
+ * pollitems[i].socket = (<Socket>s).handle
+ * pollitems[i].events = events # <<<<<<<<<<<<<<
+ * pollitems[i].revents = 0
+ * elif isinstance(s, int_t):
+ */
+ __pyx_t_12 = __Pyx_PyInt_As_short(__pyx_v_events); if (unlikely((__pyx_t_12 == (short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ (__pyx_v_pollitems[__pyx_v_i]).events = __pyx_t_12;
+
+ /* "zmq/backend/cython/_poll.pyx":85
+ * pollitems[i].socket = (<Socket>s).handle
+ * pollitems[i].events = events
+ * pollitems[i].revents = 0 # <<<<<<<<<<<<<<
+ * elif isinstance(s, int_t):
+ * pollitems[i].socket = NULL
+ */
+ (__pyx_v_pollitems[__pyx_v_i]).revents = 0;
+ goto __pyx_L10;
+ }
+
+ /* "zmq/backend/cython/_poll.pyx":86
+ * pollitems[i].events = events
+ * pollitems[i].revents = 0
+ * elif isinstance(s, int_t): # <<<<<<<<<<<<<<
+ * pollitems[i].socket = NULL
+ * pollitems[i].fd = s
+ */
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_int_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_10 = PyObject_IsInstance(__pyx_v_s, __pyx_t_3); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = (__pyx_t_10 != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/_poll.pyx":87
+ * pollitems[i].revents = 0
+ * elif isinstance(s, int_t):
+ * pollitems[i].socket = NULL # <<<<<<<<<<<<<<
+ * pollitems[i].fd = s
+ * pollitems[i].events = events
+ */
+ (__pyx_v_pollitems[__pyx_v_i]).socket = NULL;
+
+ /* "zmq/backend/cython/_poll.pyx":88
+ * elif isinstance(s, int_t):
+ * pollitems[i].socket = NULL
+ * pollitems[i].fd = s # <<<<<<<<<<<<<<
+ * pollitems[i].events = events
+ * pollitems[i].revents = 0
+ */
+ __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_s); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ (__pyx_v_pollitems[__pyx_v_i]).fd = __pyx_t_13;
+
+ /* "zmq/backend/cython/_poll.pyx":89
+ * pollitems[i].socket = NULL
+ * pollitems[i].fd = s
+ * pollitems[i].events = events # <<<<<<<<<<<<<<
+ * pollitems[i].revents = 0
+ * elif hasattr(s, 'fileno'):
+ */
+ __pyx_t_12 = __Pyx_PyInt_As_short(__pyx_v_events); if (unlikely((__pyx_t_12 == (short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ (__pyx_v_pollitems[__pyx_v_i]).events = __pyx_t_12;
+
+ /* "zmq/backend/cython/_poll.pyx":90
+ * pollitems[i].fd = s
+ * pollitems[i].events = events
+ * pollitems[i].revents = 0 # <<<<<<<<<<<<<<
+ * elif hasattr(s, 'fileno'):
+ * try:
+ */
+ (__pyx_v_pollitems[__pyx_v_i]).revents = 0;
+ goto __pyx_L10;
+ }
+
+ /* "zmq/backend/cython/_poll.pyx":91
+ * pollitems[i].events = events
+ * pollitems[i].revents = 0
+ * elif hasattr(s, 'fileno'): # <<<<<<<<<<<<<<
+ * try:
+ * fileno = int(s.fileno())
+ */
+ __pyx_t_2 = PyObject_HasAttr(__pyx_v_s, __pyx_n_s_fileno); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = (__pyx_t_2 != 0);
+ if (__pyx_t_10) {
+
+ /* "zmq/backend/cython/_poll.pyx":92
+ * pollitems[i].revents = 0
+ * elif hasattr(s, 'fileno'):
+ * try: # <<<<<<<<<<<<<<
+ * fileno = int(s.fileno())
+ * except:
+ */
+ {
+ __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
+ __Pyx_XGOTREF(__pyx_t_14);
+ __Pyx_XGOTREF(__pyx_t_15);
+ __Pyx_XGOTREF(__pyx_t_16);
+ /*try:*/ {
+
+ /* "zmq/backend/cython/_poll.pyx":93
+ * elif hasattr(s, 'fileno'):
+ * try:
+ * fileno = int(s.fileno()) # <<<<<<<<<<<<<<
+ * except:
+ * free(pollitems)
+ */
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_fileno); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_6 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_7, function);
+ }
+ }
+ if (__pyx_t_6) {
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else {
+ __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_7 = PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_fileno, __pyx_t_7);
+ __pyx_t_7 = 0;
+ }
+ /*else:*/ {
+
+ /* "zmq/backend/cython/_poll.pyx":98
+ * raise ValueError('fileno() must return a valid integer fd')
+ * else:
+ * pollitems[i].socket = NULL # <<<<<<<<<<<<<<
+ * pollitems[i].fd = fileno
+ * pollitems[i].events = events
+ */
+ (__pyx_v_pollitems[__pyx_v_i]).socket = NULL;
+
+ /* "zmq/backend/cython/_poll.pyx":99
+ * else:
+ * pollitems[i].socket = NULL
+ * pollitems[i].fd = fileno # <<<<<<<<<<<<<<
+ * pollitems[i].events = events
+ * pollitems[i].revents = 0
+ */
+ __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_fileno); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
+ (__pyx_v_pollitems[__pyx_v_i]).fd = __pyx_t_13;
+
+ /* "zmq/backend/cython/_poll.pyx":100
+ * pollitems[i].socket = NULL
+ * pollitems[i].fd = fileno
+ * pollitems[i].events = events # <<<<<<<<<<<<<<
+ * pollitems[i].revents = 0
+ * else:
+ */
+ __pyx_t_12 = __Pyx_PyInt_As_short(__pyx_v_events); if (unlikely((__pyx_t_12 == (short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
+ (__pyx_v_pollitems[__pyx_v_i]).events = __pyx_t_12;
+
+ /* "zmq/backend/cython/_poll.pyx":101
+ * pollitems[i].fd = fileno
+ * pollitems[i].events = events
+ * pollitems[i].revents = 0 # <<<<<<<<<<<<<<
+ * else:
+ * free(pollitems)
+ */
+ (__pyx_v_pollitems[__pyx_v_i]).revents = 0;
+ }
+ __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
+ goto __pyx_L18_try_end;
+ __pyx_L11_error:;
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "zmq/backend/cython/_poll.pyx":94
+ * try:
+ * fileno = int(s.fileno())
+ * except: # <<<<<<<<<<<<<<
+ * free(pollitems)
+ * raise ValueError('fileno() must return a valid integer fd')
+ */
+ /*except:*/ {
+ __Pyx_AddTraceback("zmq.backend.cython._poll.zmq_poll", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_3, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GOTREF(__pyx_t_6);
+
+ /* "zmq/backend/cython/_poll.pyx":95
+ * fileno = int(s.fileno())
+ * except:
+ * free(pollitems) # <<<<<<<<<<<<<<
+ * raise ValueError('fileno() must return a valid integer fd')
+ * else:
+ */
+ free(__pyx_v_pollitems);
+
+ /* "zmq/backend/cython/_poll.pyx":96
+ * except:
+ * free(pollitems)
+ * raise ValueError('fileno() must return a valid integer fd') # <<<<<<<<<<<<<<
+ * else:
+ * pollitems[i].socket = NULL
+ */
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
+ }
+ __pyx_L13_except_error:;
+ __Pyx_XGIVEREF(__pyx_t_14);
+ __Pyx_XGIVEREF(__pyx_t_15);
+ __Pyx_XGIVEREF(__pyx_t_16);
+ __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
+ goto __pyx_L1_error;
+ __pyx_L18_try_end:;
+ }
+ goto __pyx_L10;
+ }
+ /*else*/ {
+
+ /* "zmq/backend/cython/_poll.pyx":103
+ * pollitems[i].revents = 0
+ * else:
+ * free(pollitems) # <<<<<<<<<<<<<<
+ * raise TypeError(
+ * "Socket must be a 0MQ socket, an integer fd or have "
+ */
+ free(__pyx_v_pollitems);
+
+ /* "zmq/backend/cython/_poll.pyx":106
+ * raise TypeError(
+ * "Socket must be a 0MQ socket, an integer fd or have "
+ * "a fileno() method: %r" % s # <<<<<<<<<<<<<<
+ * )
+ *
+ */
+ __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Socket_must_be_a_0MQ_socket_an_i, __pyx_v_s); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+
+ /* "zmq/backend/cython/_poll.pyx":104
+ * else:
+ * free(pollitems)
+ * raise TypeError( # <<<<<<<<<<<<<<
+ * "Socket must be a 0MQ socket, an integer fd or have "
+ * "a fileno() method: %r" % s
+ */
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_L10:;
+ }
+
+ /* "zmq/backend/cython/_poll.pyx":110
+ *
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * rc = zmq_poll_c(pollitems, nsockets, timeout)
+ *
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ #endif
+ /*try:*/ {
+
+ /* "zmq/backend/cython/_poll.pyx":111
+ *
+ * with nogil:
+ * rc = zmq_poll_c(pollitems, nsockets, timeout) # <<<<<<<<<<<<<<
+ *
+ * if rc < 0:
+ */
+ __pyx_v_rc = zmq_poll(__pyx_v_pollitems, __pyx_v_nsockets, __pyx_v_timeout);
+ }
+
+ /* "zmq/backend/cython/_poll.pyx":110
+ *
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * rc = zmq_poll_c(pollitems, nsockets, timeout)
+ *
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L23;
+ }
+ __pyx_L23:;
+ }
+ }
+
+ /* "zmq/backend/cython/_poll.pyx":113
+ * rc = zmq_poll_c(pollitems, nsockets, timeout)
+ *
+ * if rc < 0: # <<<<<<<<<<<<<<
+ * free(pollitems)
+ * _check_rc(rc)
+ */
+ __pyx_t_10 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_10) {
+
+ /* "zmq/backend/cython/_poll.pyx":114
+ *
+ * if rc < 0:
+ * free(pollitems) # <<<<<<<<<<<<<<
+ * _check_rc(rc)
+ *
+ */
+ free(__pyx_v_pollitems);
+
+ /* "zmq/backend/cython/_poll.pyx":115
+ * if rc < 0:
+ * free(pollitems)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ *
+ * results = []
+ */
+ __pyx_t_4 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L24;
+ }
+ __pyx_L24:;
+
+ /* "zmq/backend/cython/_poll.pyx":117
+ * _check_rc(rc)
+ *
+ * results = [] # <<<<<<<<<<<<<<
+ * for i in range(nsockets):
+ * revents = pollitems[i].revents
+ */
+ __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_v_results = ((PyObject*)__pyx_t_6);
+ __pyx_t_6 = 0;
+
+ /* "zmq/backend/cython/_poll.pyx":118
+ *
+ * results = []
+ * for i in range(nsockets): # <<<<<<<<<<<<<<
+ * revents = pollitems[i].revents
+ * # for compatibility with select.poll:
+ */
+ __pyx_t_4 = __pyx_v_nsockets;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "zmq/backend/cython/_poll.pyx":119
+ * results = []
+ * for i in range(nsockets):
+ * revents = pollitems[i].revents # <<<<<<<<<<<<<<
+ * # for compatibility with select.poll:
+ * # - only return sockets with non-zero status
+ */
+ __pyx_t_12 = (__pyx_v_pollitems[__pyx_v_i]).revents;
+ __pyx_v_revents = __pyx_t_12;
+
+ /* "zmq/backend/cython/_poll.pyx":123
+ * # - only return sockets with non-zero status
+ * # - return the fd for plain sockets
+ * if revents > 0: # <<<<<<<<<<<<<<
+ * if pollitems[i].socket != NULL:
+ * s = sockets[i][0]
+ */
+ __pyx_t_10 = ((__pyx_v_revents > 0) != 0);
+ if (__pyx_t_10) {
+
+ /* "zmq/backend/cython/_poll.pyx":124
+ * # - return the fd for plain sockets
+ * if revents > 0:
+ * if pollitems[i].socket != NULL: # <<<<<<<<<<<<<<
+ * s = sockets[i][0]
+ * else:
+ */
+ __pyx_t_10 = (((__pyx_v_pollitems[__pyx_v_i]).socket != NULL) != 0);
+ if (__pyx_t_10) {
+
+ /* "zmq/backend/cython/_poll.pyx":125
+ * if revents > 0:
+ * if pollitems[i].socket != NULL:
+ * s = sockets[i][0] # <<<<<<<<<<<<<<
+ * else:
+ * s = pollitems[i].fd
+ */
+ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_sockets, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_3);
+ __pyx_t_3 = 0;
+ goto __pyx_L28;
+ }
+ /*else*/ {
+
+ /* "zmq/backend/cython/_poll.pyx":127
+ * s = sockets[i][0]
+ * else:
+ * s = pollitems[i].fd # <<<<<<<<<<<<<<
+ * results.append((s, revents))
+ *
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_pollitems[__pyx_v_i]).fd); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_3);
+ __pyx_t_3 = 0;
+ }
+ __pyx_L28:;
+
+ /* "zmq/backend/cython/_poll.pyx":128
+ * else:
+ * s = pollitems[i].fd
+ * results.append((s, revents)) # <<<<<<<<<<<<<<
+ *
+ * free(pollitems)
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_short(__pyx_v_revents); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_INCREF(__pyx_v_s);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_s);
+ __Pyx_GIVEREF(__pyx_v_s);
+ PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_results, __pyx_t_6); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ goto __pyx_L27;
+ }
+ __pyx_L27:;
+ }
+
+ /* "zmq/backend/cython/_poll.pyx":130
+ * results.append((s, revents))
+ *
+ * free(pollitems) # <<<<<<<<<<<<<<
+ * return results
+ *
+ */
+ free(__pyx_v_pollitems);
+
+ /* "zmq/backend/cython/_poll.pyx":131
+ *
+ * free(pollitems)
+ * return results # <<<<<<<<<<<<<<
+ *
+ * #-----------------------------------------------------------------------------
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_results);
+ __pyx_r = __pyx_v_results;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/_poll.pyx":47
+ *
+ *
+ * def zmq_poll(sockets, long timeout=-1): # <<<<<<<<<<<<<<
+ * """zmq_poll(sockets, timeout=-1)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("zmq.backend.cython._poll.zmq_poll", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_s);
+ __Pyx_XDECREF(__pyx_v_events);
+ __Pyx_XDECREF(__pyx_v_fileno);
+ __Pyx_XDECREF(__pyx_v_results);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/checkrc.pxd":5
+ * from libzmq cimport zmq_errno, ZMQ_ETERM
+ *
+ * cdef inline int _check_rc(int rc) except -1: # <<<<<<<<<<<<<<
+ * """internal utility for checking zmq return condition
+ *
+ */
+
+static CYTHON_INLINE int __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(int __pyx_v_rc) {
+ int __pyx_v_errno;
+ PyObject *__pyx_v_Again = NULL;
+ PyObject *__pyx_v_ContextTerminated = NULL;
+ PyObject *__pyx_v_ZMQError = NULL;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_check_rc", 0);
+
+ /* "zmq/backend/cython/checkrc.pxd":10
+ * and raising the appropriate Exception class
+ * """
+ * cdef int errno = zmq_errno() # <<<<<<<<<<<<<<
+ * PyErr_CheckSignals()
+ * if rc < 0:
+ */
+ __pyx_v_errno = zmq_errno();
+
+ /* "zmq/backend/cython/checkrc.pxd":11
+ * """
+ * cdef int errno = zmq_errno()
+ * PyErr_CheckSignals() # <<<<<<<<<<<<<<
+ * if rc < 0:
+ * if errno == EAGAIN:
+ */
+ __pyx_t_1 = PyErr_CheckSignals(); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/checkrc.pxd":12
+ * cdef int errno = zmq_errno()
+ * PyErr_CheckSignals()
+ * if rc < 0: # <<<<<<<<<<<<<<
+ * if errno == EAGAIN:
+ * from zmq.error import Again
+ */
+ __pyx_t_2 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/checkrc.pxd":16
+ * from zmq.error import Again
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM: # <<<<<<<<<<<<<<
+ * from zmq.error import ContextTerminated
+ * raise ContextTerminated(errno)
+ */
+ switch (__pyx_v_errno) {
+
+ /* "zmq/backend/cython/checkrc.pxd":13
+ * PyErr_CheckSignals()
+ * if rc < 0:
+ * if errno == EAGAIN: # <<<<<<<<<<<<<<
+ * from zmq.error import Again
+ * raise Again(errno)
+ */
+ case EAGAIN:
+
+ /* "zmq/backend/cython/checkrc.pxd":14
+ * if rc < 0:
+ * if errno == EAGAIN:
+ * from zmq.error import Again # <<<<<<<<<<<<<<
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM:
+ */
+ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_n_s_Again);
+ PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Again);
+ __Pyx_GIVEREF(__pyx_n_s_Again);
+ __pyx_t_4 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Again); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_Again = __pyx_t_3;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "zmq/backend/cython/checkrc.pxd":15
+ * if errno == EAGAIN:
+ * from zmq.error import Again
+ * raise Again(errno) # <<<<<<<<<<<<<<
+ * elif errno == ZMQ_ETERM:
+ * from zmq.error import ContextTerminated
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_Again);
+ __pyx_t_5 = __pyx_v_Again; __pyx_t_6 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ }
+ }
+ if (!__pyx_t_6) {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ } else {
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ break;
+
+ /* "zmq/backend/cython/checkrc.pxd":16
+ * from zmq.error import Again
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM: # <<<<<<<<<<<<<<
+ * from zmq.error import ContextTerminated
+ * raise ContextTerminated(errno)
+ */
+ case ETERM:
+
+ /* "zmq/backend/cython/checkrc.pxd":17
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM:
+ * from zmq.error import ContextTerminated # <<<<<<<<<<<<<<
+ * raise ContextTerminated(errno)
+ * else:
+ */
+ __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_n_s_ContextTerminated);
+ PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_ContextTerminated);
+ __Pyx_GIVEREF(__pyx_n_s_ContextTerminated);
+ __pyx_t_5 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_ContextTerminated); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_4);
+ __pyx_v_ContextTerminated = __pyx_t_4;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+ /* "zmq/backend/cython/checkrc.pxd":18
+ * elif errno == ZMQ_ETERM:
+ * from zmq.error import ContextTerminated
+ * raise ContextTerminated(errno) # <<<<<<<<<<<<<<
+ * else:
+ * from zmq.error import ZMQError
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_v_ContextTerminated);
+ __pyx_t_7 = __pyx_v_ContextTerminated; __pyx_t_3 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
+ if (likely(__pyx_t_3)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_7, function);
+ }
+ }
+ if (!__pyx_t_3) {
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ } else {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ break;
+ default:
+
+ /* "zmq/backend/cython/checkrc.pxd":20
+ * raise ContextTerminated(errno)
+ * else:
+ * from zmq.error import ZMQError # <<<<<<<<<<<<<<
+ * raise ZMQError(errno)
+ * # return -1
+ */
+ __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_n_s_ZMQError);
+ PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_ZMQError);
+ __Pyx_GIVEREF(__pyx_n_s_ZMQError);
+ __pyx_t_7 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_5, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_ZMQError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_5);
+ __pyx_v_ZMQError = __pyx_t_5;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "zmq/backend/cython/checkrc.pxd":21
+ * else:
+ * from zmq.error import ZMQError
+ * raise ZMQError(errno) # <<<<<<<<<<<<<<
+ * # return -1
+ * return 0
+ */
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_v_ZMQError);
+ __pyx_t_6 = __pyx_v_ZMQError; __pyx_t_4 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
+ }
+ }
+ if (!__pyx_t_4) {
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ } else {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_Raise(__pyx_t_7, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ break;
+ }
+ }
+
+ /* "zmq/backend/cython/checkrc.pxd":23
+ * raise ZMQError(errno)
+ * # return -1
+ * return 0 # <<<<<<<<<<<<<<
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/checkrc.pxd":5
+ * from libzmq cimport zmq_errno, ZMQ_ETERM
+ *
+ * cdef inline int _check_rc(int rc) except -1: # <<<<<<<<<<<<<<
+ * """internal utility for checking zmq return condition
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_AddTraceback("zmq.backend.cython.checkrc._check_rc", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_Again);
+ __Pyx_XDECREF(__pyx_v_ContextTerminated);
+ __Pyx_XDECREF(__pyx_v_ZMQError);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyMethodDef __pyx_methods[] = {
+ {0, 0, 0, 0}
+};
+
+#if PY_MAJOR_VERSION >= 3
+static struct PyModuleDef __pyx_moduledef = {
+ #if PY_VERSION_HEX < 0x03020000
+ { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
+ #else
+ PyModuleDef_HEAD_INIT,
+ #endif
+ "_poll",
+ __pyx_k_0MQ_polling_related_functions_an, /* m_doc */
+ -1, /* m_size */
+ __pyx_methods /* m_methods */,
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL /* m_free */
+};
+#endif
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+ {&__pyx_n_s_Again, __pyx_k_Again, sizeof(__pyx_k_Again), 0, 0, 1, 1},
+ {&__pyx_n_s_ContextTerminated, __pyx_k_ContextTerminated, sizeof(__pyx_k_ContextTerminated), 0, 0, 1, 1},
+ {&__pyx_kp_s_Could_not_allocate_poll_items, __pyx_k_Could_not_allocate_poll_items, sizeof(__pyx_k_Could_not_allocate_poll_items), 0, 0, 1, 0},
+ {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
+ {&__pyx_kp_s_Socket_must_be_a_0MQ_socket_an_i, __pyx_k_Socket_must_be_a_0MQ_socket_an_i, sizeof(__pyx_k_Socket_must_be_a_0MQ_socket_an_i), 0, 0, 1, 0},
+ {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
+ {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
+ {&__pyx_n_s_ZMQError, __pyx_k_ZMQError, sizeof(__pyx_k_ZMQError), 0, 0, 1, 1},
+ {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
+ {&__pyx_n_s_current_socket, __pyx_k_current_socket, sizeof(__pyx_k_current_socket), 0, 0, 1, 1},
+ {&__pyx_n_s_events, __pyx_k_events, sizeof(__pyx_k_events), 0, 0, 1, 1},
+ {&__pyx_n_s_fileno, __pyx_k_fileno, sizeof(__pyx_k_fileno), 0, 0, 1, 1},
+ {&__pyx_kp_s_fileno_must_return_a_valid_integ, __pyx_k_fileno_must_return_a_valid_integ, sizeof(__pyx_k_fileno_must_return_a_valid_integ), 0, 0, 1, 0},
+ {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
+ {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+ {&__pyx_n_s_int_t, __pyx_k_int_t, sizeof(__pyx_k_int_t), 0, 0, 1, 1},
+ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+ {&__pyx_n_s_nsockets, __pyx_k_nsockets, sizeof(__pyx_k_nsockets), 0, 0, 1, 1},
+ {&__pyx_n_s_pollitems, __pyx_k_pollitems, sizeof(__pyx_k_pollitems), 0, 0, 1, 1},
+ {&__pyx_kp_s_private_tmp_pyzmq_release_zmq_b, __pyx_k_private_tmp_pyzmq_release_zmq_b, sizeof(__pyx_k_private_tmp_pyzmq_release_zmq_b), 0, 0, 1, 0},
+ {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
+ {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
+ {&__pyx_n_s_rc, __pyx_k_rc, sizeof(__pyx_k_rc), 0, 0, 1, 1},
+ {&__pyx_n_s_results, __pyx_k_results, sizeof(__pyx_k_results), 0, 0, 1, 1},
+ {&__pyx_n_s_revents, __pyx_k_revents, sizeof(__pyx_k_revents), 0, 0, 1, 1},
+ {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
+ {&__pyx_n_s_sockets, __pyx_k_sockets, sizeof(__pyx_k_sockets), 0, 0, 1, 1},
+ {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
+ {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+ {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1},
+ {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq_backend_cython__poll, __pyx_k_zmq_backend_cython__poll, sizeof(__pyx_k_zmq_backend_cython__poll), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq_error, __pyx_k_zmq_error, sizeof(__pyx_k_zmq_error), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq_poll, __pyx_k_zmq_poll, sizeof(__pyx_k_zmq_poll), 0, 0, 1, 1},
+ {0, 0, 0, 0, 0, 0, 0}
+};
+static int __Pyx_InitCachedBuiltins(void) {
+ __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+static int __Pyx_InitCachedConstants(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
+
+ /* "zmq/backend/cython/_poll.pyx":73
+ * pollitems = <zmq_pollitem_t *>malloc(nsockets*sizeof(zmq_pollitem_t))
+ * if pollitems == NULL:
+ * raise MemoryError("Could not allocate poll items") # <<<<<<<<<<<<<<
+ *
+ * if ZMQ_VERSION_MAJOR < 3:
+ */
+ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Could_not_allocate_poll_items); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple_);
+ __Pyx_GIVEREF(__pyx_tuple_);
+
+ /* "zmq/backend/cython/_poll.pyx":96
+ * except:
+ * free(pollitems)
+ * raise ValueError('fileno() must return a valid integer fd') # <<<<<<<<<<<<<<
+ * else:
+ * pollitems[i].socket = NULL
+ */
+ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_fileno_must_return_a_valid_integ); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__2);
+ __Pyx_GIVEREF(__pyx_tuple__2);
+
+ /* "zmq/backend/cython/_poll.pyx":47
+ *
+ *
+ * def zmq_poll(sockets, long timeout=-1): # <<<<<<<<<<<<<<
+ * """zmq_poll(sockets, timeout=-1)
+ *
+ */
+ __pyx_tuple__3 = PyTuple_Pack(12, __pyx_n_s_sockets, __pyx_n_s_timeout, __pyx_n_s_rc, __pyx_n_s_i, __pyx_n_s_pollitems, __pyx_n_s_nsockets, __pyx_n_s_current_socket, __pyx_n_s_s, __pyx_n_s_events, __pyx_n_s_fileno, __pyx_n_s_results, __pyx_n_s_revents); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__3);
+ __Pyx_GIVEREF(__pyx_tuple__3);
+ __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_pyzmq_release_zmq_b, __pyx_n_s_zmq_poll, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static int __Pyx_InitGlobals(void) {
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+#if PY_MAJOR_VERSION < 3
+PyMODINIT_FUNC init_poll(void); /*proto*/
+PyMODINIT_FUNC init_poll(void)
+#else
+PyMODINIT_FUNC PyInit__poll(void); /*proto*/
+PyMODINIT_FUNC PyInit__poll(void)
+#endif
+{
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ #if CYTHON_REFNANNY
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
+ if (!__Pyx_RefNanny) {
+ PyErr_Clear();
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
+ if (!__Pyx_RefNanny)
+ Py_FatalError("failed to import 'refnanny' module");
+ }
+ #endif
+ __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__poll(void)", 0);
+ if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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;}
+ __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;}
+ #ifdef __Pyx_CyFunction_USED
+ if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_FusedFunction_USED
+ if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_Generator_USED
+ if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ /*--- Library function declarations ---*/
+ /*--- Threads initialization code ---*/
+ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
+ #ifdef WITH_THREAD /* Python build with threading support? */
+ PyEval_InitThreads();
+ #endif
+ #endif
+ /*--- Module creation code ---*/
+ #if PY_MAJOR_VERSION < 3
+ __pyx_m = Py_InitModule4("_poll", __pyx_methods, __pyx_k_0MQ_polling_related_functions_an, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+ #else
+ __pyx_m = PyModule_Create(&__pyx_moduledef);
+ #endif
+ if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_INCREF(__pyx_d);
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_COMPILING_IN_PYPY
+ Py_INCREF(__pyx_b);
+ #endif
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ /*--- Initialize various global constants etc. ---*/
+ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ if (__pyx_module_is_main_zmq__backend__cython___poll) {
+ if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ }
+ #if PY_MAJOR_VERSION >= 3
+ {
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!PyDict_GetItemString(modules, "zmq.backend.cython._poll")) {
+ if (unlikely(PyDict_SetItemString(modules, "zmq.backend.cython._poll", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+ /*--- Builtin init code ---*/
+ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Constants init code ---*/
+ if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Global init code ---*/
+ /*--- Variable export code ---*/
+ /*--- Function export code ---*/
+ /*--- Type init code ---*/
+ /*--- Type import code ---*/
+ __pyx_ptype_3zmq_7backend_6cython_7context_Context = __Pyx_ImportType("zmq.backend.cython.context", "Context", sizeof(struct __pyx_obj_3zmq_7backend_6cython_7context_Context), 1); if (unlikely(!__pyx_ptype_3zmq_7backend_6cython_7context_Context)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_vtabptr_3zmq_7backend_6cython_7context_Context = (struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context*)__Pyx_GetVtable(__pyx_ptype_3zmq_7backend_6cython_7context_Context->tp_dict); if (unlikely(!__pyx_vtabptr_3zmq_7backend_6cython_7context_Context)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_3zmq_7backend_6cython_6socket_Socket = __Pyx_ImportType("zmq.backend.cython.socket", "Socket", sizeof(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket), 1); if (unlikely(!__pyx_ptype_3zmq_7backend_6cython_6socket_Socket)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_vtabptr_3zmq_7backend_6cython_6socket_Socket = (struct __pyx_vtabstruct_3zmq_7backend_6cython_6socket_Socket*)__Pyx_GetVtable(__pyx_ptype_3zmq_7backend_6cython_6socket_Socket->tp_dict); if (unlikely(!__pyx_vtabptr_3zmq_7backend_6cython_6socket_Socket)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
+ #if CYTHON_COMPILING_IN_PYPY
+ sizeof(PyTypeObject),
+ #else
+ sizeof(PyHeapTypeObject),
+ #endif
+ 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Variable import code ---*/
+ /*--- Function import code ---*/
+ /*--- Execution code ---*/
+
+ /* "zmq/backend/cython/_poll.pyx":32
+ * from socket cimport Socket
+ *
+ * import sys # <<<<<<<<<<<<<<
+ *
+ * from zmq.backend.cython.checkrc cimport _check_rc
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/_poll.pyx":41
+ *
+ * # version-independent typecheck for int/long
+ * if sys.version_info[0] >= 3: # <<<<<<<<<<<<<<
+ * int_t = int
+ * else:
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (__pyx_t_3) {
+
+ /* "zmq/backend/cython/_poll.pyx":42
+ * # version-independent typecheck for int/long
+ * if sys.version_info[0] >= 3:
+ * int_t = int # <<<<<<<<<<<<<<
+ * else:
+ * int_t = (int,long)
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_int_t, ((PyObject *)((PyObject*)(&PyInt_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L2;
+ }
+ /*else*/ {
+
+ /* "zmq/backend/cython/_poll.pyx":44
+ * int_t = int
+ * else:
+ * int_t = (int,long) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyInt_Type))));
+ __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
+ __Pyx_INCREF(((PyObject *)((PyObject*)(&PyLong_Type))));
+ PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyLong_Type))));
+ __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyLong_Type))));
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_int_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ }
+ __pyx_L2:;
+
+ /* "zmq/backend/cython/_poll.pyx":47
+ *
+ *
+ * def zmq_poll(sockets, long timeout=-1): # <<<<<<<<<<<<<<
+ * """zmq_poll(sockets, timeout=-1)
+ *
+ */
+ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3zmq_7backend_6cython_5_poll_1zmq_poll, NULL, __pyx_n_s_zmq_backend_cython__poll); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_zmq_poll, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/_poll.pyx":137
+ * #-----------------------------------------------------------------------------
+ *
+ * __all__ = [ 'zmq_poll' ] # <<<<<<<<<<<<<<
+ */
+ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_n_s_zmq_poll);
+ PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_zmq_poll);
+ __Pyx_GIVEREF(__pyx_n_s_zmq_poll);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/_poll.pyx":1
+ * """0MQ polling related functions and classes.""" # <<<<<<<<<<<<<<
+ *
+ * #
+ */
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/checkrc.pxd":5
+ * from libzmq cimport zmq_errno, ZMQ_ETERM
+ *
+ * cdef inline int _check_rc(int rc) except -1: # <<<<<<<<<<<<<<
+ * """internal utility for checking zmq return condition
+ *
+ */
+
+ /*--- Wrapped vars code ---*/
+
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ if (__pyx_m) {
+ if (__pyx_d) {
+ __Pyx_AddTraceback("init zmq.backend.cython._poll", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ }
+ Py_DECREF(__pyx_m); __pyx_m = 0;
+ } else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ImportError, "init zmq.backend.cython._poll");
+ }
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ #if PY_MAJOR_VERSION < 3
+ return;
+ #else
+ return __pyx_m;
+ #endif
+}
+
+/* Runtime support code */
+#if CYTHON_REFNANNY
+static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
+ PyObject *m = NULL, *p = NULL;
+ void *r = NULL;
+ m = PyImport_ImportModule((char *)modname);
+ if (!m) goto end;
+ p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
+ if (!p) goto end;
+ r = PyLong_AsVoidPtr(p);
+end:
+ Py_XDECREF(p);
+ Py_XDECREF(m);
+ return (__Pyx_RefNannyAPIStruct *)r;
+}
+#endif
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
+ PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
+ if (unlikely(!result)) {
+ PyErr_Format(PyExc_NameError,
+#if PY_MAJOR_VERSION >= 3
+ "name '%U' is not defined", name);
+#else
+ "name '%.200s' is not defined", PyString_AS_STRING(name));
+#endif
+ }
+ return result;
+}
+
+static void __Pyx_RaiseDoubleKeywordsError(
+ const char* func_name,
+ PyObject* kw_name)
+{
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION >= 3
+ "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
+ #else
+ "%s() got multiple values for keyword argument '%s'", func_name,
+ PyString_AsString(kw_name));
+ #endif
+}
+
+static int __Pyx_ParseOptionalKeywords(
+ PyObject *kwds,
+ PyObject **argnames[],
+ PyObject *kwds2,
+ PyObject *values[],
+ Py_ssize_t num_pos_args,
+ const char* function_name)
+{
+ PyObject *key = 0, *value = 0;
+ Py_ssize_t pos = 0;
+ PyObject*** name;
+ PyObject*** first_kw_arg = argnames + num_pos_args;
+ while (PyDict_Next(kwds, &pos, &key, &value)) {
+ name = first_kw_arg;
+ while (*name && (**name != key)) name++;
+ if (*name) {
+ values[name-argnames] = value;
+ continue;
+ }
+ name = first_kw_arg;
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
+ while (*name) {
+ if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**name, key)) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ if ((**argname == key) || (
+ (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**argname, key))) {
+ goto arg_passed_twice;
+ }
+ argname++;
+ }
+ }
+ } else
+ #endif
+ if (likely(PyUnicode_Check(key))) {
+ while (*name) {
+ int cmp = (**name == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**name, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ int cmp = (**argname == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**argname, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) goto arg_passed_twice;
+ argname++;
+ }
+ }
+ } else
+ goto invalid_keyword_type;
+ if (kwds2) {
+ if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
+ } else {
+ goto invalid_keyword;
+ }
+ }
+ return 0;
+arg_passed_twice:
+ __Pyx_RaiseDoubleKeywordsError(function_name, key);
+ goto bad;
+invalid_keyword_type:
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() keywords must be strings", function_name);
+ goto bad;
+invalid_keyword:
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION < 3
+ "%.200s() got an unexpected keyword argument '%.200s'",
+ function_name, PyString_AsString(key));
+ #else
+ "%s() got an unexpected keyword argument '%U'",
+ function_name, key);
+ #endif
+bad:
+ return -1;
+}
+
+static void __Pyx_RaiseArgtupleInvalid(
+ const char* func_name,
+ int exact,
+ Py_ssize_t num_min,
+ Py_ssize_t num_max,
+ Py_ssize_t num_found)
+{
+ Py_ssize_t num_expected;
+ const char *more_or_less;
+ if (num_found < num_min) {
+ num_expected = num_min;
+ more_or_less = "at least";
+ } else {
+ num_expected = num_max;
+ more_or_less = "at most";
+ }
+ if (exact) {
+ more_or_less = "exactly";
+ }
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+ func_name, more_or_less, num_expected,
+ (num_expected == 1) ? "" : "s", num_found);
+}
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+ PyObject *result;
+ ternaryfunc call = func->ob_type->tp_call;
+ if (unlikely(!call))
+ return PyObject_Call(func, arg, kw);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = (*call)(func, arg, kw);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyThreadState *tstate = PyThreadState_GET();
+ tmp_type = tstate->curexc_type;
+ tmp_value = tstate->curexc_value;
+ tmp_tb = tstate->curexc_traceback;
+ tstate->curexc_type = type;
+ tstate->curexc_value = value;
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_Restore(type, value, tb);
+#endif
+}
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ *type = tstate->curexc_type;
+ *value = tstate->curexc_value;
+ *tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(type, value, tb);
+#endif
+}
+
+#if PY_MAJOR_VERSION < 3
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
+ CYTHON_UNUSED PyObject *cause) {
+ Py_XINCREF(type);
+ if (!value || value == Py_None)
+ value = NULL;
+ else
+ Py_INCREF(value);
+ if (!tb || tb == Py_None)
+ tb = NULL;
+ else {
+ Py_INCREF(tb);
+ if (!PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto raise_error;
+ }
+ }
+ if (PyType_Check(type)) {
+#if CYTHON_COMPILING_IN_PYPY
+ if (!value) {
+ Py_INCREF(Py_None);
+ value = Py_None;
+ }
+#endif
+ PyErr_NormalizeException(&type, &value, &tb);
+ } else {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto raise_error;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(type);
+ Py_INCREF(type);
+ if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto raise_error;
+ }
+ }
+ __Pyx_ErrRestore(type, value, tb);
+ return;
+raise_error:
+ Py_XDECREF(value);
+ Py_XDECREF(type);
+ Py_XDECREF(tb);
+ return;
+}
+#else
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
+ PyObject* owned_instance = NULL;
+ if (tb == Py_None) {
+ tb = 0;
+ } else if (tb && !PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto bad;
+ }
+ if (value == Py_None)
+ value = 0;
+ if (PyExceptionInstance_Check(type)) {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto bad;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(value);
+ } else if (PyExceptionClass_Check(type)) {
+ PyObject *instance_class = NULL;
+ if (value && PyExceptionInstance_Check(value)) {
+ instance_class = (PyObject*) Py_TYPE(value);
+ if (instance_class != type) {
+ if (PyObject_IsSubclass(instance_class, type)) {
+ type = instance_class;
+ } else {
+ instance_class = NULL;
+ }
+ }
+ }
+ if (!instance_class) {
+ PyObject *args;
+ if (!value)
+ args = PyTuple_New(0);
+ else if (PyTuple_Check(value)) {
+ Py_INCREF(value);
+ args = value;
+ } else
+ args = PyTuple_Pack(1, value);
+ if (!args)
+ goto bad;
+ owned_instance = PyObject_Call(type, args, NULL);
+ Py_DECREF(args);
+ if (!owned_instance)
+ goto bad;
+ value = owned_instance;
+ if (!PyExceptionInstance_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "calling %R should have returned an instance of "
+ "BaseException, not %R",
+ type, Py_TYPE(value));
+ goto bad;
+ }
+ }
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto bad;
+ }
+#if PY_VERSION_HEX >= 0x03030000
+ if (cause) {
+#else
+ if (cause && cause != Py_None) {
+#endif
+ PyObject *fixed_cause;
+ if (cause == Py_None) {
+ fixed_cause = NULL;
+ } else if (PyExceptionClass_Check(cause)) {
+ fixed_cause = PyObject_CallObject(cause, NULL);
+ if (fixed_cause == NULL)
+ goto bad;
+ } else if (PyExceptionInstance_Check(cause)) {
+ fixed_cause = cause;
+ Py_INCREF(fixed_cause);
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "exception causes must derive from "
+ "BaseException");
+ goto bad;
+ }
+ PyException_SetCause(value, fixed_cause);
+ }
+ PyErr_SetObject(type, value);
+ if (tb) {
+#if CYTHON_COMPILING_IN_PYPY
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyErr_Fetch(tmp_type, tmp_value, tmp_tb);
+ Py_INCREF(tb);
+ PyErr_Restore(tmp_type, tmp_value, tb);
+ Py_XDECREF(tmp_tb);
+#else
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject* tmp_tb = tstate->curexc_traceback;
+ if (tb != tmp_tb) {
+ Py_INCREF(tb);
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_tb);
+ }
+#endif
+ }
+bad:
+ Py_XDECREF(owned_instance);
+ return;
+}
+#endif
+
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+ PyObject *r;
+ if (!j) return NULL;
+ r = PyObject_GetItem(o, j);
+ Py_DECREF(j);
+ return r;
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
+ int wraparound, int boundscheck) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
+ if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
+ PyObject *r = PyList_GET_ITEM(o, i);
+ Py_INCREF(r);
+ return r;
+ }
+ return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+#else
+ return PySequence_GetItem(o, i);
+#endif
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
+ int wraparound, int boundscheck) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
+ if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
+ PyObject *r = PyTuple_GET_ITEM(o, i);
+ Py_INCREF(r);
+ return r;
+ }
+ return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+#else
+ return PySequence_GetItem(o, i);
+#endif
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
+ int is_list, int wraparound, int boundscheck) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (is_list || PyList_CheckExact(o)) {
+ Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
+ if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
+ PyObject *r = PyList_GET_ITEM(o, n);
+ Py_INCREF(r);
+ return r;
+ }
+ }
+ else if (PyTuple_CheckExact(o)) {
+ Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
+ if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
+ PyObject *r = PyTuple_GET_ITEM(o, n);
+ Py_INCREF(r);
+ return r;
+ }
+ } else {
+ PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
+ if (likely(m && m->sq_item)) {
+ if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
+ Py_ssize_t l = m->sq_length(o);
+ if (likely(l >= 0)) {
+ i += l;
+ } else {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError))
+ PyErr_Clear();
+ else
+ return NULL;
+ }
+ }
+ return m->sq_item(o, i);
+ }
+ }
+#else
+ if (is_list || PySequence_Check(o)) {
+ return PySequence_GetItem(o, i);
+ }
+#endif
+ return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+}
+
+static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
+ PyErr_Format(PyExc_ValueError,
+ "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
+}
+
+static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
+ PyErr_Format(PyExc_ValueError,
+ "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
+ index, (index == 1) ? "" : "s");
+}
+
+static CYTHON_INLINE int __Pyx_IterFinish(void) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject* exc_type = tstate->curexc_type;
+ if (unlikely(exc_type)) {
+ if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
+ PyObject *exc_value, *exc_tb;
+ exc_value = tstate->curexc_value;
+ exc_tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+ Py_DECREF(exc_type);
+ Py_XDECREF(exc_value);
+ Py_XDECREF(exc_tb);
+ return 0;
+ } else {
+ return -1;
+ }
+ }
+ return 0;
+#else
+ if (unlikely(PyErr_Occurred())) {
+ if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
+ PyErr_Clear();
+ return 0;
+ } else {
+ return -1;
+ }
+ }
+ return 0;
+#endif
+}
+
+static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
+ if (unlikely(retval)) {
+ Py_DECREF(retval);
+ __Pyx_RaiseTooManyValuesError(expected);
+ return -1;
+ } else {
+ return __Pyx_IterFinish();
+ }
+ return 0;
+}
+
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
+ PyObject *result;
+#if CYTHON_COMPILING_IN_CPYTHON
+ result = PyDict_GetItem(__pyx_d, name);
+ if (likely(result)) {
+ Py_INCREF(result);
+ } else {
+#else
+ result = PyObject_GetItem(__pyx_d, name);
+ if (!result) {
+ PyErr_Clear();
+#endif
+ result = __Pyx_GetBuiltinName(name);
+ }
+ return result;
+}
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
+ PyObject *self, *result;
+ PyCFunction cfunc;
+ cfunc = PyCFunction_GET_FUNCTION(func);
+ self = PyCFunction_GET_SELF(func);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = cfunc(self, arg);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject *result;
+ PyObject *args = PyTuple_New(1);
+ if (unlikely(!args)) return NULL;
+ Py_INCREF(arg);
+ PyTuple_SET_ITEM(args, 0, arg);
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#ifdef __Pyx_CyFunction_USED
+ if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+ if (likely(PyCFunction_Check(func))) {
+#endif
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
+ return __Pyx_PyObject_CallMethO(func, arg);
+ }
+ }
+ return __Pyx__PyObject_CallOneArg(func, arg);
+}
+#else
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject* args = PyTuple_Pack(1, arg);
+ return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
+#ifdef __Pyx_CyFunction_USED
+ if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+ if (likely(PyCFunction_Check(func))) {
+#endif
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
+ return __Pyx_PyObject_CallMethO(func, NULL);
+ }
+ }
+ return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
+}
+#endif
+
+static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ *type = tstate->exc_type;
+ *value = tstate->exc_value;
+ *tb = tstate->exc_traceback;
+ Py_XINCREF(*type);
+ Py_XINCREF(*value);
+ Py_XINCREF(*tb);
+#else
+ PyErr_GetExcInfo(type, value, tb);
+#endif
+}
+static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyThreadState *tstate = PyThreadState_GET();
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = type;
+ tstate->exc_value = value;
+ tstate->exc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_SetExcInfo(type, value, tb);
+#endif
+}
+
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *local_type, *local_value, *local_tb;
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyThreadState *tstate = PyThreadState_GET();
+ local_type = tstate->curexc_type;
+ local_value = tstate->curexc_value;
+ local_tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(&local_type, &local_value, &local_tb);
+#endif
+ PyErr_NormalizeException(&local_type, &local_value, &local_tb);
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(tstate->curexc_type))
+#else
+ if (unlikely(PyErr_Occurred()))
+#endif
+ goto bad;
+ #if PY_MAJOR_VERSION >= 3
+ if (local_tb) {
+ if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
+ goto bad;
+ }
+ #endif
+ Py_XINCREF(local_tb);
+ Py_XINCREF(local_type);
+ Py_XINCREF(local_value);
+ *type = local_type;
+ *value = local_value;
+ *tb = local_tb;
+#if CYTHON_COMPILING_IN_CPYTHON
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = local_type;
+ tstate->exc_value = local_value;
+ tstate->exc_traceback = local_tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_SetExcInfo(local_type, local_value, local_tb);
+#endif
+ return 0;
+bad:
+ *type = 0;
+ *value = 0;
+ *tb = 0;
+ Py_XDECREF(local_type);
+ Py_XDECREF(local_value);
+ Py_XDECREF(local_tb);
+ return -1;
+}
+
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
+ PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
+ if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Format(PyExc_ImportError,
+ #if PY_MAJOR_VERSION < 3
+ "cannot import name %.230s", PyString_AS_STRING(name));
+ #else
+ "cannot import name %S", name);
+ #endif
+ }
+ return value;
+}
+
+static void* __Pyx_GetVtable(PyObject *dict) {
+ void* ptr;
+ PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
+ if (!ob)
+ goto bad;
+#if PY_VERSION_HEX >= 0x02070000
+ ptr = PyCapsule_GetPointer(ob, 0);
+#else
+ ptr = PyCObject_AsVoidPtr(ob);
+#endif
+ if (!ptr && !PyErr_Occurred())
+ PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
+ Py_DECREF(ob);
+ return ptr;
+bad:
+ Py_XDECREF(ob);
+ return NULL;
+}
+
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+ int start = 0, mid = 0, end = count - 1;
+ if (end >= 0 && code_line > entries[end].code_line) {
+ return count;
+ }
+ while (start < end) {
+ mid = (start + end) / 2;
+ if (code_line < entries[mid].code_line) {
+ end = mid;
+ } else if (code_line > entries[mid].code_line) {
+ start = mid + 1;
+ } else {
+ return mid;
+ }
+ }
+ if (code_line <= entries[mid].code_line) {
+ return mid;
+ } else {
+ return mid + 1;
+ }
+}
+static PyCodeObject *__pyx_find_code_object(int code_line) {
+ PyCodeObject* code_object;
+ int pos;
+ if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
+ return NULL;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
+ return NULL;
+ }
+ code_object = __pyx_code_cache.entries[pos].code_object;
+ Py_INCREF(code_object);
+ return code_object;
+}
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
+ int pos, i;
+ __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
+ if (unlikely(!code_line)) {
+ return;
+ }
+ if (unlikely(!entries)) {
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (likely(entries)) {
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = 64;
+ __pyx_code_cache.count = 1;
+ entries[0].code_line = code_line;
+ entries[0].code_object = code_object;
+ Py_INCREF(code_object);
+ }
+ return;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
+ PyCodeObject* tmp = entries[pos].code_object;
+ entries[pos].code_object = code_object;
+ Py_DECREF(tmp);
+ return;
+ }
+ if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
+ int new_max = __pyx_code_cache.max_count + 64;
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
+ __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (unlikely(!entries)) {
+ return;
+ }
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = new_max;
+ }
+ for (i=__pyx_code_cache.count; i>pos; i--) {
+ entries[i] = entries[i-1];
+ }
+ entries[pos].code_line = code_line;
+ entries[pos].code_object = code_object;
+ __pyx_code_cache.count++;
+ Py_INCREF(code_object);
+}
+
+#include "compile.h"
+#include "frameobject.h"
+#include "traceback.h"
+static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
+ const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyObject *py_srcfile = 0;
+ PyObject *py_funcname = 0;
+ #if PY_MAJOR_VERSION < 3
+ py_srcfile = PyString_FromString(filename);
+ #else
+ py_srcfile = PyUnicode_FromString(filename);
+ #endif
+ if (!py_srcfile) goto bad;
+ if (c_line) {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #else
+ py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #endif
+ }
+ else {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromString(funcname);
+ #else
+ py_funcname = PyUnicode_FromString(funcname);
+ #endif
+ }
+ if (!py_funcname) goto bad;
+ py_code = __Pyx_PyCode_New(
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ __pyx_empty_bytes, /*PyObject *code,*/
+ __pyx_empty_tuple, /*PyObject *consts,*/
+ __pyx_empty_tuple, /*PyObject *names,*/
+ __pyx_empty_tuple, /*PyObject *varnames,*/
+ __pyx_empty_tuple, /*PyObject *freevars,*/
+ __pyx_empty_tuple, /*PyObject *cellvars,*/
+ py_srcfile, /*PyObject *filename,*/
+ py_funcname, /*PyObject *name,*/
+ py_line,
+ __pyx_empty_bytes /*PyObject *lnotab*/
+ );
+ Py_DECREF(py_srcfile);
+ Py_DECREF(py_funcname);
+ return py_code;
+bad:
+ Py_XDECREF(py_srcfile);
+ Py_XDECREF(py_funcname);
+ return NULL;
+}
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyFrameObject *py_frame = 0;
+ py_code = __pyx_find_code_object(c_line ? c_line : py_line);
+ if (!py_code) {
+ py_code = __Pyx_CreateCodeObjectForTraceback(
+ funcname, c_line, py_line, filename);
+ if (!py_code) goto bad;
+ __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
+ }
+ py_frame = PyFrame_New(
+ PyThreadState_GET(), /*PyThreadState *tstate,*/
+ py_code, /*PyCodeObject *code,*/
+ __pyx_d, /*PyObject *globals,*/
+ 0 /*PyObject *locals*/
+ );
+ if (!py_frame) goto bad;
+ py_frame->f_lineno = py_line;
+ PyTraceBack_Here(py_frame);
+bad:
+ Py_XDECREF(py_code);
+ Py_XDECREF(py_frame);
+}
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
+ goto bad;
+ #endif
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ {
+ #if PY_MAJOR_VERSION >= 3
+ if (level == -1) {
+ if (strchr(__Pyx_MODULE_NAME, '.')) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(1);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, 1);
+ #endif
+ if (!module) {
+ if (!PyErr_ExceptionMatches(PyExc_ImportError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ level = 0;
+ }
+ #endif
+ if (!module) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(level);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, level);
+ #endif
+ }
+ }
+bad:
+ #if PY_VERSION_HEX < 0x03030000
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+ const long neg_one = (long) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(long) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(long) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(long),
+ little, !is_unsigned);
+ }
+}
+
+#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value) \
+ { \
+ func_type value = func_value; \
+ if (sizeof(target_type) < sizeof(func_type)) { \
+ if (unlikely(value != (func_type) (target_type) value)) { \
+ func_type zero = 0; \
+ if (is_unsigned && unlikely(value < zero)) \
+ goto raise_neg_overflow; \
+ else \
+ goto raise_overflow; \
+ } \
+ } \
+ return (target_type) value; \
+ }
+
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ #include "longintrepr.h"
+ #endif
+#endif
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+ const long neg_one = (long) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(long) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (long) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(long) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(long) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(long) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
+ } else if (sizeof(long) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ long val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (long) -1;
+ }
+ } else {
+ long val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (long) -1;
+ val = __Pyx_PyInt_As_long(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to long");
+ return (long) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to long");
+ return (long) -1;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+ const int neg_one = (int) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(int) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(int) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(int),
+ little, !is_unsigned);
+ }
+}
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+ const int neg_one = (int) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(int) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (int) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(int) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
+ } else if (sizeof(int) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ int val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (int) -1;
+ }
+ } else {
+ int val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (int) -1;
+ val = __Pyx_PyInt_As_int(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to int");
+ return (int) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to int");
+ return (int) -1;
+}
+
+static CYTHON_INLINE short __Pyx_PyInt_As_short(PyObject *x) {
+ const short neg_one = (short) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(short) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(short, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (short) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(short, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(short) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(short, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(short) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(short, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(short, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(short, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(short) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(short, long, PyLong_AsLong(x))
+ } else if (sizeof(short) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(short, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ short val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (short) -1;
+ }
+ } else {
+ short val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (short) -1;
+ val = __Pyx_PyInt_As_short(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to short");
+ return (short) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to short");
+ return (short) -1;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_short(short value) {
+ const short neg_one = (short) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(short) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(short) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(short) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(short) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(short) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(short),
+ little, !is_unsigned);
+ }
+}
+
+static int __Pyx_check_binary_version(void) {
+ char ctversion[4], rtversion[4];
+ PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
+ if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
+ char message[200];
+ PyOS_snprintf(message, sizeof(message),
+ "compiletime version %s of module '%.100s' "
+ "does not match runtime version %s",
+ ctversion, __Pyx_MODULE_NAME, rtversion);
+ return PyErr_WarnEx(NULL, message, 1);
+ }
+ return 0;
+}
+
+#ifndef __PYX_HAVE_RT_ImportModule
+#define __PYX_HAVE_RT_ImportModule
+static PyObject *__Pyx_ImportModule(const char *name) {
+ PyObject *py_name = 0;
+ PyObject *py_module = 0;
+ py_name = __Pyx_PyIdentifier_FromString(name);
+ if (!py_name)
+ goto bad;
+ py_module = PyImport_Import(py_name);
+ Py_DECREF(py_name);
+ return py_module;
+bad:
+ Py_XDECREF(py_name);
+ return 0;
+}
+#endif
+
+#ifndef __PYX_HAVE_RT_ImportType
+#define __PYX_HAVE_RT_ImportType
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
+ size_t size, int strict)
+{
+ PyObject *py_module = 0;
+ PyObject *result = 0;
+ PyObject *py_name = 0;
+ char warning[200];
+ Py_ssize_t basicsize;
+#ifdef Py_LIMITED_API
+ PyObject *py_basicsize;
+#endif
+ py_module = __Pyx_ImportModule(module_name);
+ if (!py_module)
+ goto bad;
+ py_name = __Pyx_PyIdentifier_FromString(class_name);
+ if (!py_name)
+ goto bad;
+ result = PyObject_GetAttr(py_module, py_name);
+ Py_DECREF(py_name);
+ py_name = 0;
+ Py_DECREF(py_module);
+ py_module = 0;
+ if (!result)
+ goto bad;
+ if (!PyType_Check(result)) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s.%.200s is not a type object",
+ module_name, class_name);
+ goto bad;
+ }
+#ifndef Py_LIMITED_API
+ basicsize = ((PyTypeObject *)result)->tp_basicsize;
+#else
+ py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
+ if (!py_basicsize)
+ goto bad;
+ basicsize = PyLong_AsSsize_t(py_basicsize);
+ Py_DECREF(py_basicsize);
+ py_basicsize = 0;
+ if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
+ goto bad;
+#endif
+ if (!strict && (size_t)basicsize > size) {
+ PyOS_snprintf(warning, sizeof(warning),
+ "%s.%s size changed, may indicate binary incompatibility",
+ module_name, class_name);
+ if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
+ }
+ else if ((size_t)basicsize != size) {
+ PyErr_Format(PyExc_ValueError,
+ "%.200s.%.200s has the wrong size, try recompiling",
+ module_name, class_name);
+ goto bad;
+ }
+ return (PyTypeObject *)result;
+bad:
+ Py_XDECREF(py_module);
+ Py_XDECREF(result);
+ return NULL;
+}
+#endif
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+ while (t->p) {
+ #if PY_MAJOR_VERSION < 3
+ if (t->is_unicode) {
+ *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
+ } else if (t->intern) {
+ *t->p = PyString_InternFromString(t->s);
+ } else {
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+ }
+ #else
+ if (t->is_unicode | t->is_str) {
+ if (t->intern) {
+ *t->p = PyUnicode_InternFromString(t->s);
+ } else if (t->encoding) {
+ *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
+ } else {
+ *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+ }
+ } else {
+ *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
+ }
+ #endif
+ if (!*t->p)
+ return -1;
+ ++t;
+ }
+ return 0;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
+ return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
+ Py_ssize_t ignore;
+ return __Pyx_PyObject_AsStringAndSize(o, &ignore);
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+ if (
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ __Pyx_sys_getdefaultencoding_not_ascii &&
+#endif
+ PyUnicode_Check(o)) {
+#if PY_VERSION_HEX < 0x03030000
+ char* defenc_c;
+ PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
+ if (!defenc) return NULL;
+ defenc_c = PyBytes_AS_STRING(defenc);
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ {
+ char* end = defenc_c + PyBytes_GET_SIZE(defenc);
+ char* c;
+ for (c = defenc_c; c < end; c++) {
+ if ((unsigned char) (*c) >= 128) {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+ }
+ }
+#endif
+ *length = PyBytes_GET_SIZE(defenc);
+ return defenc_c;
+#else
+ if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ if (PyUnicode_IS_ASCII(o)) {
+ *length = PyUnicode_GET_LENGTH(o);
+ return PyUnicode_AsUTF8(o);
+ } else {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+#else
+ return PyUnicode_AsUTF8AndSize(o, length);
+#endif
+#endif
+ } else
+#endif
+#if !CYTHON_COMPILING_IN_PYPY
+ if (PyByteArray_Check(o)) {
+ *length = PyByteArray_GET_SIZE(o);
+ return PyByteArray_AS_STRING(o);
+ } else
+#endif
+ {
+ char* result;
+ int r = PyBytes_AsStringAndSize(o, &result, length);
+ if (unlikely(r < 0)) {
+ return NULL;
+ } else {
+ return result;
+ }
+ }
+}
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
+ int is_true = x == Py_True;
+ if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
+ else return PyObject_IsTrue(x);
+}
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
+ PyNumberMethods *m;
+ const char *name = NULL;
+ PyObject *res = NULL;
+#if PY_MAJOR_VERSION < 3
+ if (PyInt_Check(x) || PyLong_Check(x))
+#else
+ if (PyLong_Check(x))
+#endif
+ return Py_INCREF(x), x;
+ m = Py_TYPE(x)->tp_as_number;
+#if PY_MAJOR_VERSION < 3
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Int(x);
+ }
+ else if (m && m->nb_long) {
+ name = "long";
+ res = PyNumber_Long(x);
+ }
+#else
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Long(x);
+ }
+#endif
+ if (res) {
+#if PY_MAJOR_VERSION < 3
+ if (!PyInt_Check(res) && !PyLong_Check(res)) {
+#else
+ if (!PyLong_Check(res)) {
+#endif
+ PyErr_Format(PyExc_TypeError,
+ "__%.4s__ returned non-%.4s (type %.200s)",
+ name, name, Py_TYPE(res)->tp_name);
+ Py_DECREF(res);
+ return NULL;
+ }
+ }
+ else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "an integer is required");
+ }
+ return res;
+}
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+ Py_ssize_t ival;
+ PyObject *x;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(b)))
+ return PyInt_AS_LONG(b);
+#endif
+ if (likely(PyLong_CheckExact(b))) {
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(b)) {
+ case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
+ case 0: return 0;
+ case 1: return ((PyLongObject*)b)->ob_digit[0];
+ }
+ #endif
+ #endif
+ return PyLong_AsSsize_t(b);
+ }
+ x = PyNumber_Index(b);
+ if (!x) return -1;
+ ival = PyInt_AsSsize_t(x);
+ Py_DECREF(x);
+ return ival;
+}
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
+ return PyInt_FromSize_t(ival);
+}
+
+
+#endif /* Py_PYTHON_H */
diff --git a/scripts/external_libs/platform/cel59/zmq/backend/cython/_poll.pyx b/scripts/external_libs/platform/cel59/zmq/backend/cython/_poll.pyx
new file mode 100644
index 00000000..5bed46b6
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/_poll.pyx
@@ -0,0 +1,137 @@
+"""0MQ polling related functions and classes."""
+
+#
+# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
+#
+# This file is part of pyzmq.
+#
+# pyzmq is free software; you can redistribute it and/or modify it under
+# the terms of the Lesser GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# pyzmq is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# Lesser GNU General Public License for more details.
+#
+# You should have received a copy of the Lesser GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+#-----------------------------------------------------------------------------
+# Imports
+#-----------------------------------------------------------------------------
+
+from libc.stdlib cimport free, malloc
+
+from libzmq cimport zmq_pollitem_t, ZMQ_VERSION_MAJOR
+from libzmq cimport zmq_poll as zmq_poll_c
+from socket cimport Socket
+
+import sys
+
+from zmq.backend.cython.checkrc cimport _check_rc
+
+#-----------------------------------------------------------------------------
+# Polling related methods
+#-----------------------------------------------------------------------------
+
+# version-independent typecheck for int/long
+if sys.version_info[0] >= 3:
+ int_t = int
+else:
+ int_t = (int,long)
+
+
+def zmq_poll(sockets, long timeout=-1):
+ """zmq_poll(sockets, timeout=-1)
+
+ Poll a set of 0MQ sockets, native file descs. or sockets.
+
+ Parameters
+ ----------
+ sockets : list of tuples of (socket, flags)
+ Each element of this list is a two-tuple containing a socket
+ and a flags. The socket may be a 0MQ socket or any object with
+ a ``fileno()`` method. The flags can be zmq.POLLIN (for detecting
+ for incoming messages), zmq.POLLOUT (for detecting that send is OK)
+ or zmq.POLLIN|zmq.POLLOUT for detecting both.
+ timeout : int
+ The number of milliseconds to poll for. Negative means no timeout.
+ """
+ cdef int rc, i
+ cdef zmq_pollitem_t *pollitems = NULL
+ cdef int nsockets = <int>len(sockets)
+ cdef Socket current_socket
+
+ if nsockets == 0:
+ return []
+
+ pollitems = <zmq_pollitem_t *>malloc(nsockets*sizeof(zmq_pollitem_t))
+ if pollitems == NULL:
+ raise MemoryError("Could not allocate poll items")
+
+ if ZMQ_VERSION_MAJOR < 3:
+ # timeout is us in 2.x, ms in 3.x
+ # expected input is ms (matches 3.x)
+ timeout = 1000*timeout
+
+ for i in range(nsockets):
+ s, events = sockets[i]
+ if isinstance(s, Socket):
+ pollitems[i].socket = (<Socket>s).handle
+ pollitems[i].events = events
+ pollitems[i].revents = 0
+ elif isinstance(s, int_t):
+ pollitems[i].socket = NULL
+ pollitems[i].fd = s
+ pollitems[i].events = events
+ pollitems[i].revents = 0
+ elif hasattr(s, 'fileno'):
+ try:
+ fileno = int(s.fileno())
+ except:
+ free(pollitems)
+ raise ValueError('fileno() must return a valid integer fd')
+ else:
+ pollitems[i].socket = NULL
+ pollitems[i].fd = fileno
+ pollitems[i].events = events
+ pollitems[i].revents = 0
+ else:
+ free(pollitems)
+ raise TypeError(
+ "Socket must be a 0MQ socket, an integer fd or have "
+ "a fileno() method: %r" % s
+ )
+
+
+ with nogil:
+ rc = zmq_poll_c(pollitems, nsockets, timeout)
+
+ if rc < 0:
+ free(pollitems)
+ _check_rc(rc)
+
+ results = []
+ for i in range(nsockets):
+ revents = pollitems[i].revents
+ # for compatibility with select.poll:
+ # - only return sockets with non-zero status
+ # - return the fd for plain sockets
+ if revents > 0:
+ if pollitems[i].socket != NULL:
+ s = sockets[i][0]
+ else:
+ s = pollitems[i].fd
+ results.append((s, revents))
+
+ free(pollitems)
+ return results
+
+#-----------------------------------------------------------------------------
+# Symbols to export
+#-----------------------------------------------------------------------------
+
+__all__ = [ 'zmq_poll' ]
diff --git a/scripts/external_libs/platform/cel59/zmq/backend/cython/_version.c b/scripts/external_libs/platform/cel59/zmq/backend/cython/_version.c
new file mode 100644
index 00000000..431df002
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/_version.c
@@ -0,0 +1,1484 @@
+/* Generated by Cython 0.21.2 */
+
+#define PY_SSIZE_T_CLEAN
+#ifndef CYTHON_USE_PYLONG_INTERNALS
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#else
+#include "pyconfig.h"
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 1
+#else
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#endif
+#endif
+#endif
+#include "Python.h"
+#ifndef Py_PYTHON_H
+ #error Python headers needed to compile C extensions, please install development version of Python.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+ #error Cython requires Python 2.6+ or Python 3.2+.
+#else
+#define CYTHON_ABI "0_21_2"
+#include <stddef.h>
+#ifndef offsetof
+#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+ #ifndef __stdcall
+ #define __stdcall
+ #endif
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
+ #ifndef __fastcall
+ #define __fastcall
+ #endif
+#endif
+#ifndef DL_IMPORT
+ #define DL_IMPORT(t) t
+#endif
+#ifndef DL_EXPORT
+ #define DL_EXPORT(t) t
+#endif
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifndef Py_HUGE_VAL
+ #define Py_HUGE_VAL HUGE_VAL
+#endif
+#ifdef PYPY_VERSION
+#define CYTHON_COMPILING_IN_PYPY 1
+#define CYTHON_COMPILING_IN_CPYTHON 0
+#else
+#define CYTHON_COMPILING_IN_PYPY 0
+#define CYTHON_COMPILING_IN_CPYTHON 1
+#endif
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
+#define Py_OptimizeFlag 0
+#endif
+#define __PYX_BUILD_PY_SSIZE_T "n"
+#define CYTHON_FORMAT_SSIZE_T "z"
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyClass_Type
+#else
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyType_Type
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define Py_TPFLAGS_CHECKTYPES 0
+ #define Py_TPFLAGS_HAVE_INDEX 0
+ #define Py_TPFLAGS_HAVE_NEWBUFFER 0
+#endif
+#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+ #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
+#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
+ #define CYTHON_PEP393_ENABLED 1
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
+ 0 : _PyUnicode_Ready((PyObject *)(op)))
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
+ #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
+ #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+#else
+ #define CYTHON_PEP393_ENABLED 0
+ #define __Pyx_PyUnicode_READY(op) (0)
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
+ #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
+ #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+ #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyFrozenSet_Size(s) PyObject_Size(s)
+#else
+ #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
+ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
+ #define __Pyx_PyFrozenSet_Size(s) PySet_Size(s)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
+#else
+ #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBaseString_Type PyUnicode_Type
+ #define PyStringObject PyUnicodeObject
+ #define PyString_Type PyUnicode_Type
+ #define PyString_Check PyUnicode_Check
+ #define PyString_CheckExact PyUnicode_CheckExact
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
+ #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
+#else
+ #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+ #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
+#endif
+#ifndef PySet_CheckExact
+ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
+#endif
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#if PY_MAJOR_VERSION >= 3
+ #define PyIntObject PyLongObject
+ #define PyInt_Type PyLong_Type
+ #define PyInt_Check(op) PyLong_Check(op)
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
+ #define PyInt_FromString PyLong_FromString
+ #define PyInt_FromUnicode PyLong_FromUnicode
+ #define PyInt_FromLong PyLong_FromLong
+ #define PyInt_FromSize_t PyLong_FromSize_t
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
+ #define PyInt_AsLong PyLong_AsLong
+ #define PyInt_AS_LONG PyLong_AS_LONG
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+ #define PyNumber_Int PyNumber_Long
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBoolObject PyLongObject
+#endif
+#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
+ #ifndef PyUnicode_InternFromString
+ #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
+ #endif
+#endif
+#if PY_VERSION_HEX < 0x030200A4
+ typedef long Py_hash_t;
+ #define __Pyx_PyInt_FromHash_t PyInt_FromLong
+ #define __Pyx_PyInt_AsHash_t PyInt_AsLong
+#else
+ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
+ #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+#else
+ #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
+#endif
+#ifndef CYTHON_INLINE
+ #if defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+#ifndef CYTHON_RESTRICT
+ #if defined(__GNUC__)
+ #define CYTHON_RESTRICT __restrict__
+ #elif defined(_MSC_VER) && _MSC_VER >= 1400
+ #define CYTHON_RESTRICT __restrict
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_RESTRICT restrict
+ #else
+ #define CYTHON_RESTRICT
+ #endif
+#endif
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
+#else
+static CYTHON_INLINE float __PYX_NAN() {
+ /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
+ a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
+ a quiet NaN. */
+ float value;
+ memset(&value, 0xFF, sizeof(value));
+ return value;
+}
+#endif
+#ifdef __cplusplus
+template<typename T>
+void __Pyx_call_destructor(T* x) {
+ x->~T();
+}
+#endif
+
+
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
+#else
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
+#endif
+
+#ifndef __PYX_EXTERN_C
+ #ifdef __cplusplus
+ #define __PYX_EXTERN_C extern "C"
+ #else
+ #define __PYX_EXTERN_C extern
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+#define _USE_MATH_DEFINES
+#endif
+#include <math.h>
+#define __PYX_HAVE__zmq__backend__cython___version
+#define __PYX_HAVE_API__zmq__backend__cython___version
+#include "zmq_compat.h"
+#include "zmq.h"
+#include "zmq_utils.h"
+#ifdef _OPENMP
+#include <omp.h>
+#endif /* _OPENMP */
+
+#ifdef PYREX_WITHOUT_ASSERTIONS
+#define CYTHON_WITHOUT_ASSERTIONS
+#endif
+
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
+ const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \
+ (sizeof(type) < sizeof(Py_ssize_t)) || \
+ (sizeof(type) > sizeof(Py_ssize_t) && \
+ likely(v < (type)PY_SSIZE_T_MAX || \
+ v == (type)PY_SSIZE_T_MAX) && \
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \
+ v == (type)PY_SSIZE_T_MIN))) || \
+ (sizeof(type) == sizeof(Py_ssize_t) && \
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \
+ v == (type)PY_SSIZE_T_MAX))) )
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
+#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
+#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
+#define __Pyx_PyBytes_FromString PyBytes_FromString
+#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#else
+ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
+#endif
+#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
+#if PY_MAJOR_VERSION < 3
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
+{
+ const Py_UNICODE *u_end = u;
+ while (*u_end++) ;
+ return (size_t)(u_end - u - 1);
+}
+#else
+#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
+#endif
+#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
+#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
+#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
+#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
+#else
+#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
+#endif
+#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ PyObject* ascii_chars_u = NULL;
+ PyObject* ascii_chars_b = NULL;
+ const char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ if (strcmp(default_encoding_c, "ascii") == 0) {
+ __Pyx_sys_getdefaultencoding_not_ascii = 0;
+ } else {
+ char ascii_chars[128];
+ int c;
+ for (c = 0; c < 128; c++) {
+ ascii_chars[c] = c;
+ }
+ __Pyx_sys_getdefaultencoding_not_ascii = 1;
+ ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
+ if (!ascii_chars_u) goto bad;
+ ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
+ if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
+ PyErr_Format(
+ PyExc_ValueError,
+ "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
+ default_encoding_c);
+ goto bad;
+ }
+ Py_DECREF(ascii_chars_u);
+ Py_DECREF(ascii_chars_b);
+ }
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ Py_XDECREF(ascii_chars_u);
+ Py_XDECREF(ascii_chars_b);
+ return -1;
+}
+#endif
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
+#else
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+static char* __PYX_DEFAULT_STRING_ENCODING;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
+ if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
+ strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ return -1;
+}
+#endif
+#endif
+
+
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+ #define likely(x) __builtin_expect(!!(x), 1)
+ #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
+ #define likely(x) (x)
+ #define unlikely(x) (x)
+#endif /* __GNUC__ */
+
+static PyObject *__pyx_m;
+static PyObject *__pyx_d;
+static PyObject *__pyx_b;
+static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
+static int __pyx_lineno;
+static int __pyx_clineno = 0;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+
+
+static const char *__pyx_f[] = {
+ "zmq/backend/cython/_version.pyx",
+};
+
+/*--- Type declarations ---*/
+#ifndef CYTHON_REFNANNY
+ #define CYTHON_REFNANNY 0
+#endif
+#if CYTHON_REFNANNY
+ typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*SetupContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+ } __Pyx_RefNannyAPIStruct;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
+ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
+#ifdef WITH_THREAD
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ if (acquire_gil) { \
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ PyGILState_Release(__pyx_gilstate_save); \
+ } else { \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ }
+#else
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+#endif
+ #define __Pyx_RefNannyFinishContext() \
+ __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
+ #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
+ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
+#else
+ #define __Pyx_RefNannyDeclarations
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)
+ #define __Pyx_RefNannyFinishContext()
+ #define __Pyx_INCREF(r) Py_INCREF(r)
+ #define __Pyx_DECREF(r) Py_DECREF(r)
+ #define __Pyx_GOTREF(r)
+ #define __Pyx_GIVEREF(r)
+ #define __Pyx_XINCREF(r) Py_XINCREF(r)
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
+ #define __Pyx_XGOTREF(r)
+ #define __Pyx_XGIVEREF(r)
+#endif
+#define __Pyx_XDECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_XDECREF(tmp); \
+ } while (0)
+#define __Pyx_DECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_DECREF(tmp); \
+ } while (0)
+#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
+#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
+
+typedef struct {
+ int code_line;
+ PyCodeObject* code_object;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+ int count;
+ int max_count;
+ __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+static int __Pyx_check_binary_version(void);
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+
+
+/* Module declarations from 'zmq.backend.cython.libzmq' */
+
+/* Module declarations from 'zmq.backend.cython._version' */
+#define __Pyx_MODULE_NAME "zmq.backend.cython._version"
+int __pyx_module_is_main_zmq__backend__cython___version = 0;
+
+/* Implementation of 'zmq.backend.cython._version' */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_8_version_zmq_version_info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static char __pyx_k_all[] = "__all__";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_major[] = "major";
+static char __pyx_k_minor[] = "minor";
+static char __pyx_k_patch[] = "patch";
+static char __pyx_k_zmq_version_info[] = "zmq_version_info";
+static char __pyx_k_zmq_backend_cython__version[] = "zmq.backend.cython._version";
+static char __pyx_k_PyZMQ_and_0MQ_version_functions[] = "PyZMQ and 0MQ version functions.";
+static char __pyx_k_private_tmp_pyzmq_release_zmq_b[] = "/private/tmp/pyzmq-release/zmq/backend/cython/_version.pyx";
+static PyObject *__pyx_n_s_all;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_major;
+static PyObject *__pyx_n_s_minor;
+static PyObject *__pyx_n_s_patch;
+static PyObject *__pyx_kp_s_private_tmp_pyzmq_release_zmq_b;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_n_s_zmq_backend_cython__version;
+static PyObject *__pyx_n_s_zmq_version_info;
+static PyObject *__pyx_tuple_;
+static PyObject *__pyx_codeobj__2;
+
+/* "zmq/backend/cython/_version.pyx":32
+ * #-----------------------------------------------------------------------------
+ *
+ * def zmq_version_info(): # <<<<<<<<<<<<<<
+ * """zmq_version_info()
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_8_version_1zmq_version_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_8_version_zmq_version_info[] = "zmq_version_info()\n\n Return the version of ZeroMQ itself as a 3-tuple of ints.\n ";
+static PyMethodDef __pyx_mdef_3zmq_7backend_6cython_8_version_1zmq_version_info = {"zmq_version_info", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_8_version_1zmq_version_info, METH_NOARGS, __pyx_doc_3zmq_7backend_6cython_8_version_zmq_version_info};
+static PyObject *__pyx_pw_3zmq_7backend_6cython_8_version_1zmq_version_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("zmq_version_info (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_8_version_zmq_version_info(__pyx_self);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_8_version_zmq_version_info(CYTHON_UNUSED PyObject *__pyx_self) {
+ int __pyx_v_major;
+ int __pyx_v_minor;
+ int __pyx_v_patch;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("zmq_version_info", 0);
+
+ /* "zmq/backend/cython/_version.pyx":38
+ * """
+ * cdef int major, minor, patch
+ * _zmq_version(&major, &minor, &patch) # <<<<<<<<<<<<<<
+ * return (major, minor, patch)
+ *
+ */
+ zmq_version((&__pyx_v_major), (&__pyx_v_minor), (&__pyx_v_patch));
+
+ /* "zmq/backend/cython/_version.pyx":39
+ * cdef int major, minor, patch
+ * _zmq_version(&major, &minor, &patch)
+ * return (major, minor, patch) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_major); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_minor); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_patch); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 0;
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/_version.pyx":32
+ * #-----------------------------------------------------------------------------
+ *
+ * def zmq_version_info(): # <<<<<<<<<<<<<<
+ * """zmq_version_info()
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("zmq.backend.cython._version.zmq_version_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyMethodDef __pyx_methods[] = {
+ {0, 0, 0, 0}
+};
+
+#if PY_MAJOR_VERSION >= 3
+static struct PyModuleDef __pyx_moduledef = {
+ #if PY_VERSION_HEX < 0x03020000
+ { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
+ #else
+ PyModuleDef_HEAD_INIT,
+ #endif
+ "_version",
+ __pyx_k_PyZMQ_and_0MQ_version_functions, /* m_doc */
+ -1, /* m_size */
+ __pyx_methods /* m_methods */,
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL /* m_free */
+};
+#endif
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+ {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
+ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+ {&__pyx_n_s_major, __pyx_k_major, sizeof(__pyx_k_major), 0, 0, 1, 1},
+ {&__pyx_n_s_minor, __pyx_k_minor, sizeof(__pyx_k_minor), 0, 0, 1, 1},
+ {&__pyx_n_s_patch, __pyx_k_patch, sizeof(__pyx_k_patch), 0, 0, 1, 1},
+ {&__pyx_kp_s_private_tmp_pyzmq_release_zmq_b, __pyx_k_private_tmp_pyzmq_release_zmq_b, sizeof(__pyx_k_private_tmp_pyzmq_release_zmq_b), 0, 0, 1, 0},
+ {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq_backend_cython__version, __pyx_k_zmq_backend_cython__version, sizeof(__pyx_k_zmq_backend_cython__version), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq_version_info, __pyx_k_zmq_version_info, sizeof(__pyx_k_zmq_version_info), 0, 0, 1, 1},
+ {0, 0, 0, 0, 0, 0, 0}
+};
+static int __Pyx_InitCachedBuiltins(void) {
+ return 0;
+}
+
+static int __Pyx_InitCachedConstants(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
+
+ /* "zmq/backend/cython/_version.pyx":32
+ * #-----------------------------------------------------------------------------
+ *
+ * def zmq_version_info(): # <<<<<<<<<<<<<<
+ * """zmq_version_info()
+ *
+ */
+ __pyx_tuple_ = PyTuple_Pack(3, __pyx_n_s_major, __pyx_n_s_minor, __pyx_n_s_patch); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple_);
+ __Pyx_GIVEREF(__pyx_tuple_);
+ __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_pyzmq_release_zmq_b, __pyx_n_s_zmq_version_info, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static int __Pyx_InitGlobals(void) {
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+#if PY_MAJOR_VERSION < 3
+PyMODINIT_FUNC init_version(void); /*proto*/
+PyMODINIT_FUNC init_version(void)
+#else
+PyMODINIT_FUNC PyInit__version(void); /*proto*/
+PyMODINIT_FUNC PyInit__version(void)
+#endif
+{
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ #if CYTHON_REFNANNY
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
+ if (!__Pyx_RefNanny) {
+ PyErr_Clear();
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
+ if (!__Pyx_RefNanny)
+ Py_FatalError("failed to import 'refnanny' module");
+ }
+ #endif
+ __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__version(void)", 0);
+ if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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;}
+ __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;}
+ #ifdef __Pyx_CyFunction_USED
+ if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_FusedFunction_USED
+ if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_Generator_USED
+ if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ /*--- Library function declarations ---*/
+ /*--- Threads initialization code ---*/
+ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
+ #ifdef WITH_THREAD /* Python build with threading support? */
+ PyEval_InitThreads();
+ #endif
+ #endif
+ /*--- Module creation code ---*/
+ #if PY_MAJOR_VERSION < 3
+ __pyx_m = Py_InitModule4("_version", __pyx_methods, __pyx_k_PyZMQ_and_0MQ_version_functions, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+ #else
+ __pyx_m = PyModule_Create(&__pyx_moduledef);
+ #endif
+ if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_INCREF(__pyx_d);
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_COMPILING_IN_PYPY
+ Py_INCREF(__pyx_b);
+ #endif
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ /*--- Initialize various global constants etc. ---*/
+ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ if (__pyx_module_is_main_zmq__backend__cython___version) {
+ if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ }
+ #if PY_MAJOR_VERSION >= 3
+ {
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!PyDict_GetItemString(modules, "zmq.backend.cython._version")) {
+ if (unlikely(PyDict_SetItemString(modules, "zmq.backend.cython._version", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+ /*--- Builtin init code ---*/
+ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Constants init code ---*/
+ if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Global init code ---*/
+ /*--- Variable export code ---*/
+ /*--- Function export code ---*/
+ /*--- Type init code ---*/
+ /*--- Type import code ---*/
+ /*--- Variable import code ---*/
+ /*--- Function import code ---*/
+ /*--- Execution code ---*/
+
+ /* "zmq/backend/cython/_version.pyx":32
+ * #-----------------------------------------------------------------------------
+ *
+ * def zmq_version_info(): # <<<<<<<<<<<<<<
+ * """zmq_version_info()
+ *
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3zmq_7backend_6cython_8_version_1zmq_version_info, NULL, __pyx_n_s_zmq_backend_cython__version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_zmq_version_info, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/_version.pyx":42
+ *
+ *
+ * __all__ = ['zmq_version_info'] # <<<<<<<<<<<<<<
+ *
+ */
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_s_zmq_version_info);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_zmq_version_info);
+ __Pyx_GIVEREF(__pyx_n_s_zmq_version_info);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/_version.pyx":1
+ * """PyZMQ and 0MQ version functions.""" # <<<<<<<<<<<<<<
+ *
+ * #
+ */
+ __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;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /*--- Wrapped vars code ---*/
+
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ if (__pyx_m) {
+ if (__pyx_d) {
+ __Pyx_AddTraceback("init zmq.backend.cython._version", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ }
+ Py_DECREF(__pyx_m); __pyx_m = 0;
+ } else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ImportError, "init zmq.backend.cython._version");
+ }
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ #if PY_MAJOR_VERSION < 3
+ return;
+ #else
+ return __pyx_m;
+ #endif
+}
+
+/* Runtime support code */
+#if CYTHON_REFNANNY
+static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
+ PyObject *m = NULL, *p = NULL;
+ void *r = NULL;
+ m = PyImport_ImportModule((char *)modname);
+ if (!m) goto end;
+ p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
+ if (!p) goto end;
+ r = PyLong_AsVoidPtr(p);
+end:
+ Py_XDECREF(p);
+ Py_XDECREF(m);
+ return (__Pyx_RefNannyAPIStruct *)r;
+}
+#endif
+
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+ int start = 0, mid = 0, end = count - 1;
+ if (end >= 0 && code_line > entries[end].code_line) {
+ return count;
+ }
+ while (start < end) {
+ mid = (start + end) / 2;
+ if (code_line < entries[mid].code_line) {
+ end = mid;
+ } else if (code_line > entries[mid].code_line) {
+ start = mid + 1;
+ } else {
+ return mid;
+ }
+ }
+ if (code_line <= entries[mid].code_line) {
+ return mid;
+ } else {
+ return mid + 1;
+ }
+}
+static PyCodeObject *__pyx_find_code_object(int code_line) {
+ PyCodeObject* code_object;
+ int pos;
+ if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
+ return NULL;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
+ return NULL;
+ }
+ code_object = __pyx_code_cache.entries[pos].code_object;
+ Py_INCREF(code_object);
+ return code_object;
+}
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
+ int pos, i;
+ __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
+ if (unlikely(!code_line)) {
+ return;
+ }
+ if (unlikely(!entries)) {
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (likely(entries)) {
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = 64;
+ __pyx_code_cache.count = 1;
+ entries[0].code_line = code_line;
+ entries[0].code_object = code_object;
+ Py_INCREF(code_object);
+ }
+ return;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
+ PyCodeObject* tmp = entries[pos].code_object;
+ entries[pos].code_object = code_object;
+ Py_DECREF(tmp);
+ return;
+ }
+ if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
+ int new_max = __pyx_code_cache.max_count + 64;
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
+ __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (unlikely(!entries)) {
+ return;
+ }
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = new_max;
+ }
+ for (i=__pyx_code_cache.count; i>pos; i--) {
+ entries[i] = entries[i-1];
+ }
+ entries[pos].code_line = code_line;
+ entries[pos].code_object = code_object;
+ __pyx_code_cache.count++;
+ Py_INCREF(code_object);
+}
+
+#include "compile.h"
+#include "frameobject.h"
+#include "traceback.h"
+static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
+ const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyObject *py_srcfile = 0;
+ PyObject *py_funcname = 0;
+ #if PY_MAJOR_VERSION < 3
+ py_srcfile = PyString_FromString(filename);
+ #else
+ py_srcfile = PyUnicode_FromString(filename);
+ #endif
+ if (!py_srcfile) goto bad;
+ if (c_line) {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #else
+ py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #endif
+ }
+ else {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromString(funcname);
+ #else
+ py_funcname = PyUnicode_FromString(funcname);
+ #endif
+ }
+ if (!py_funcname) goto bad;
+ py_code = __Pyx_PyCode_New(
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ __pyx_empty_bytes, /*PyObject *code,*/
+ __pyx_empty_tuple, /*PyObject *consts,*/
+ __pyx_empty_tuple, /*PyObject *names,*/
+ __pyx_empty_tuple, /*PyObject *varnames,*/
+ __pyx_empty_tuple, /*PyObject *freevars,*/
+ __pyx_empty_tuple, /*PyObject *cellvars,*/
+ py_srcfile, /*PyObject *filename,*/
+ py_funcname, /*PyObject *name,*/
+ py_line,
+ __pyx_empty_bytes /*PyObject *lnotab*/
+ );
+ Py_DECREF(py_srcfile);
+ Py_DECREF(py_funcname);
+ return py_code;
+bad:
+ Py_XDECREF(py_srcfile);
+ Py_XDECREF(py_funcname);
+ return NULL;
+}
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyFrameObject *py_frame = 0;
+ py_code = __pyx_find_code_object(c_line ? c_line : py_line);
+ if (!py_code) {
+ py_code = __Pyx_CreateCodeObjectForTraceback(
+ funcname, c_line, py_line, filename);
+ if (!py_code) goto bad;
+ __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
+ }
+ py_frame = PyFrame_New(
+ PyThreadState_GET(), /*PyThreadState *tstate,*/
+ py_code, /*PyCodeObject *code,*/
+ __pyx_d, /*PyObject *globals,*/
+ 0 /*PyObject *locals*/
+ );
+ if (!py_frame) goto bad;
+ py_frame->f_lineno = py_line;
+ PyTraceBack_Here(py_frame);
+bad:
+ Py_XDECREF(py_code);
+ Py_XDECREF(py_frame);
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+ const int neg_one = (int) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(int) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(int) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(int),
+ little, !is_unsigned);
+ }
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+ const long neg_one = (long) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(long) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(long) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(long),
+ little, !is_unsigned);
+ }
+}
+
+#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value) \
+ { \
+ func_type value = func_value; \
+ if (sizeof(target_type) < sizeof(func_type)) { \
+ if (unlikely(value != (func_type) (target_type) value)) { \
+ func_type zero = 0; \
+ if (is_unsigned && unlikely(value < zero)) \
+ goto raise_neg_overflow; \
+ else \
+ goto raise_overflow; \
+ } \
+ } \
+ return (target_type) value; \
+ }
+
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ #include "longintrepr.h"
+ #endif
+#endif
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+ const long neg_one = (long) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(long) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (long) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(long) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(long) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(long) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
+ } else if (sizeof(long) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ long val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (long) -1;
+ }
+ } else {
+ long val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (long) -1;
+ val = __Pyx_PyInt_As_long(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to long");
+ return (long) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to long");
+ return (long) -1;
+}
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+ const int neg_one = (int) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(int) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (int) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(int) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
+ } else if (sizeof(int) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ int val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (int) -1;
+ }
+ } else {
+ int val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (int) -1;
+ val = __Pyx_PyInt_As_int(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to int");
+ return (int) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to int");
+ return (int) -1;
+}
+
+static int __Pyx_check_binary_version(void) {
+ char ctversion[4], rtversion[4];
+ PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
+ if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
+ char message[200];
+ PyOS_snprintf(message, sizeof(message),
+ "compiletime version %s of module '%.100s' "
+ "does not match runtime version %s",
+ ctversion, __Pyx_MODULE_NAME, rtversion);
+ return PyErr_WarnEx(NULL, message, 1);
+ }
+ return 0;
+}
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+ while (t->p) {
+ #if PY_MAJOR_VERSION < 3
+ if (t->is_unicode) {
+ *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
+ } else if (t->intern) {
+ *t->p = PyString_InternFromString(t->s);
+ } else {
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+ }
+ #else
+ if (t->is_unicode | t->is_str) {
+ if (t->intern) {
+ *t->p = PyUnicode_InternFromString(t->s);
+ } else if (t->encoding) {
+ *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
+ } else {
+ *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+ }
+ } else {
+ *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
+ }
+ #endif
+ if (!*t->p)
+ return -1;
+ ++t;
+ }
+ return 0;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
+ return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
+ Py_ssize_t ignore;
+ return __Pyx_PyObject_AsStringAndSize(o, &ignore);
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+ if (
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ __Pyx_sys_getdefaultencoding_not_ascii &&
+#endif
+ PyUnicode_Check(o)) {
+#if PY_VERSION_HEX < 0x03030000
+ char* defenc_c;
+ PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
+ if (!defenc) return NULL;
+ defenc_c = PyBytes_AS_STRING(defenc);
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ {
+ char* end = defenc_c + PyBytes_GET_SIZE(defenc);
+ char* c;
+ for (c = defenc_c; c < end; c++) {
+ if ((unsigned char) (*c) >= 128) {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+ }
+ }
+#endif
+ *length = PyBytes_GET_SIZE(defenc);
+ return defenc_c;
+#else
+ if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ if (PyUnicode_IS_ASCII(o)) {
+ *length = PyUnicode_GET_LENGTH(o);
+ return PyUnicode_AsUTF8(o);
+ } else {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+#else
+ return PyUnicode_AsUTF8AndSize(o, length);
+#endif
+#endif
+ } else
+#endif
+#if !CYTHON_COMPILING_IN_PYPY
+ if (PyByteArray_Check(o)) {
+ *length = PyByteArray_GET_SIZE(o);
+ return PyByteArray_AS_STRING(o);
+ } else
+#endif
+ {
+ char* result;
+ int r = PyBytes_AsStringAndSize(o, &result, length);
+ if (unlikely(r < 0)) {
+ return NULL;
+ } else {
+ return result;
+ }
+ }
+}
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
+ int is_true = x == Py_True;
+ if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
+ else return PyObject_IsTrue(x);
+}
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
+ PyNumberMethods *m;
+ const char *name = NULL;
+ PyObject *res = NULL;
+#if PY_MAJOR_VERSION < 3
+ if (PyInt_Check(x) || PyLong_Check(x))
+#else
+ if (PyLong_Check(x))
+#endif
+ return Py_INCREF(x), x;
+ m = Py_TYPE(x)->tp_as_number;
+#if PY_MAJOR_VERSION < 3
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Int(x);
+ }
+ else if (m && m->nb_long) {
+ name = "long";
+ res = PyNumber_Long(x);
+ }
+#else
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Long(x);
+ }
+#endif
+ if (res) {
+#if PY_MAJOR_VERSION < 3
+ if (!PyInt_Check(res) && !PyLong_Check(res)) {
+#else
+ if (!PyLong_Check(res)) {
+#endif
+ PyErr_Format(PyExc_TypeError,
+ "__%.4s__ returned non-%.4s (type %.200s)",
+ name, name, Py_TYPE(res)->tp_name);
+ Py_DECREF(res);
+ return NULL;
+ }
+ }
+ else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "an integer is required");
+ }
+ return res;
+}
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+ Py_ssize_t ival;
+ PyObject *x;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(b)))
+ return PyInt_AS_LONG(b);
+#endif
+ if (likely(PyLong_CheckExact(b))) {
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(b)) {
+ case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
+ case 0: return 0;
+ case 1: return ((PyLongObject*)b)->ob_digit[0];
+ }
+ #endif
+ #endif
+ return PyLong_AsSsize_t(b);
+ }
+ x = PyNumber_Index(b);
+ if (!x) return -1;
+ ival = PyInt_AsSsize_t(x);
+ Py_DECREF(x);
+ return ival;
+}
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
+ return PyInt_FromSize_t(ival);
+}
+
+
+#endif /* Py_PYTHON_H */
diff --git a/scripts/external_libs/platform/cel59/zmq/backend/cython/_version.pyx b/scripts/external_libs/platform/cel59/zmq/backend/cython/_version.pyx
new file mode 100644
index 00000000..02cf6fcc
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/_version.pyx
@@ -0,0 +1,43 @@
+"""PyZMQ and 0MQ version functions."""
+
+#
+# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
+#
+# This file is part of pyzmq.
+#
+# pyzmq is free software; you can redistribute it and/or modify it under
+# the terms of the Lesser GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# pyzmq is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# Lesser GNU General Public License for more details.
+#
+# You should have received a copy of the Lesser GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+#-----------------------------------------------------------------------------
+# Imports
+#-----------------------------------------------------------------------------
+
+from libzmq cimport _zmq_version
+
+#-----------------------------------------------------------------------------
+# Code
+#-----------------------------------------------------------------------------
+
+def zmq_version_info():
+ """zmq_version_info()
+
+ Return the version of ZeroMQ itself as a 3-tuple of ints.
+ """
+ cdef int major, minor, patch
+ _zmq_version(&major, &minor, &patch)
+ return (major, minor, patch)
+
+
+__all__ = ['zmq_version_info']
+
diff --git a/scripts/external_libs/zmq/backend/cython/checkrc.pxd b/scripts/external_libs/platform/cel59/zmq/backend/cython/checkrc.pxd
index 3bf69fc3..3bf69fc3 100644
--- a/scripts/external_libs/zmq/backend/cython/checkrc.pxd
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/checkrc.pxd
diff --git a/scripts/external_libs/platform/cel59/zmq/backend/cython/constant_enums.pxi b/scripts/external_libs/platform/cel59/zmq/backend/cython/constant_enums.pxi
new file mode 100644
index 00000000..3d0efd9f
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/constant_enums.pxi
@@ -0,0 +1,156 @@
+cdef extern from "zmq.h" nogil:
+
+ enum: ZMQ_VERSION
+ enum: ZMQ_VERSION_MAJOR
+ enum: ZMQ_VERSION_MINOR
+ enum: ZMQ_VERSION_PATCH
+ enum: ZMQ_NOBLOCK
+ enum: ZMQ_DONTWAIT
+ enum: ZMQ_POLLIN
+ enum: ZMQ_POLLOUT
+ enum: ZMQ_POLLERR
+ enum: ZMQ_SNDMORE
+ enum: ZMQ_STREAMER
+ enum: ZMQ_FORWARDER
+ enum: ZMQ_QUEUE
+ enum: ZMQ_IO_THREADS_DFLT
+ enum: ZMQ_MAX_SOCKETS_DFLT
+ enum: ZMQ_POLLITEMS_DFLT
+ enum: ZMQ_THREAD_PRIORITY_DFLT
+ enum: ZMQ_THREAD_SCHED_POLICY_DFLT
+ enum: ZMQ_PAIR
+ enum: ZMQ_PUB
+ enum: ZMQ_SUB
+ enum: ZMQ_REQ
+ enum: ZMQ_REP
+ enum: ZMQ_DEALER
+ enum: ZMQ_ROUTER
+ enum: ZMQ_XREQ
+ enum: ZMQ_XREP
+ enum: ZMQ_PULL
+ enum: ZMQ_PUSH
+ enum: ZMQ_XPUB
+ enum: ZMQ_XSUB
+ enum: ZMQ_UPSTREAM
+ enum: ZMQ_DOWNSTREAM
+ enum: ZMQ_STREAM
+ enum: ZMQ_EVENT_CONNECTED
+ enum: ZMQ_EVENT_CONNECT_DELAYED
+ enum: ZMQ_EVENT_CONNECT_RETRIED
+ enum: ZMQ_EVENT_LISTENING
+ enum: ZMQ_EVENT_BIND_FAILED
+ enum: ZMQ_EVENT_ACCEPTED
+ enum: ZMQ_EVENT_ACCEPT_FAILED
+ enum: ZMQ_EVENT_CLOSED
+ enum: ZMQ_EVENT_CLOSE_FAILED
+ enum: ZMQ_EVENT_DISCONNECTED
+ enum: ZMQ_EVENT_ALL
+ enum: ZMQ_EVENT_MONITOR_STOPPED
+ enum: ZMQ_NULL
+ enum: ZMQ_PLAIN
+ enum: ZMQ_CURVE
+ enum: ZMQ_GSSAPI
+ enum: ZMQ_EAGAIN "EAGAIN"
+ enum: ZMQ_EINVAL "EINVAL"
+ enum: ZMQ_EFAULT "EFAULT"
+ enum: ZMQ_ENOMEM "ENOMEM"
+ enum: ZMQ_ENODEV "ENODEV"
+ enum: ZMQ_EMSGSIZE "EMSGSIZE"
+ enum: ZMQ_EAFNOSUPPORT "EAFNOSUPPORT"
+ enum: ZMQ_ENETUNREACH "ENETUNREACH"
+ enum: ZMQ_ECONNABORTED "ECONNABORTED"
+ enum: ZMQ_ECONNRESET "ECONNRESET"
+ enum: ZMQ_ENOTCONN "ENOTCONN"
+ enum: ZMQ_ETIMEDOUT "ETIMEDOUT"
+ enum: ZMQ_EHOSTUNREACH "EHOSTUNREACH"
+ enum: ZMQ_ENETRESET "ENETRESET"
+ enum: ZMQ_HAUSNUMERO
+ enum: ZMQ_ENOTSUP "ENOTSUP"
+ enum: ZMQ_EPROTONOSUPPORT "EPROTONOSUPPORT"
+ enum: ZMQ_ENOBUFS "ENOBUFS"
+ enum: ZMQ_ENETDOWN "ENETDOWN"
+ enum: ZMQ_EADDRINUSE "EADDRINUSE"
+ enum: ZMQ_EADDRNOTAVAIL "EADDRNOTAVAIL"
+ enum: ZMQ_ECONNREFUSED "ECONNREFUSED"
+ enum: ZMQ_EINPROGRESS "EINPROGRESS"
+ enum: ZMQ_ENOTSOCK "ENOTSOCK"
+ enum: ZMQ_EFSM "EFSM"
+ enum: ZMQ_ENOCOMPATPROTO "ENOCOMPATPROTO"
+ enum: ZMQ_ETERM "ETERM"
+ enum: ZMQ_EMTHREAD "EMTHREAD"
+ enum: ZMQ_IO_THREADS
+ enum: ZMQ_MAX_SOCKETS
+ enum: ZMQ_SOCKET_LIMIT
+ enum: ZMQ_THREAD_PRIORITY
+ enum: ZMQ_THREAD_SCHED_POLICY
+ enum: ZMQ_IDENTITY
+ enum: ZMQ_SUBSCRIBE
+ enum: ZMQ_UNSUBSCRIBE
+ enum: ZMQ_LAST_ENDPOINT
+ enum: ZMQ_TCP_ACCEPT_FILTER
+ enum: ZMQ_PLAIN_USERNAME
+ enum: ZMQ_PLAIN_PASSWORD
+ enum: ZMQ_CURVE_PUBLICKEY
+ enum: ZMQ_CURVE_SECRETKEY
+ enum: ZMQ_CURVE_SERVERKEY
+ enum: ZMQ_ZAP_DOMAIN
+ enum: ZMQ_CONNECT_RID
+ enum: ZMQ_GSSAPI_PRINCIPAL
+ enum: ZMQ_GSSAPI_SERVICE_PRINCIPAL
+ enum: ZMQ_SOCKS_PROXY
+ enum: ZMQ_FD
+ enum: ZMQ_IDENTITY_FD
+ enum: ZMQ_RECONNECT_IVL_MAX
+ enum: ZMQ_SNDTIMEO
+ enum: ZMQ_RCVTIMEO
+ enum: ZMQ_SNDHWM
+ enum: ZMQ_RCVHWM
+ enum: ZMQ_MULTICAST_HOPS
+ enum: ZMQ_IPV4ONLY
+ enum: ZMQ_ROUTER_BEHAVIOR
+ enum: ZMQ_TCP_KEEPALIVE
+ enum: ZMQ_TCP_KEEPALIVE_CNT
+ enum: ZMQ_TCP_KEEPALIVE_IDLE
+ enum: ZMQ_TCP_KEEPALIVE_INTVL
+ enum: ZMQ_DELAY_ATTACH_ON_CONNECT
+ enum: ZMQ_XPUB_VERBOSE
+ enum: ZMQ_EVENTS
+ enum: ZMQ_TYPE
+ enum: ZMQ_LINGER
+ enum: ZMQ_RECONNECT_IVL
+ enum: ZMQ_BACKLOG
+ enum: ZMQ_ROUTER_MANDATORY
+ enum: ZMQ_FAIL_UNROUTABLE
+ enum: ZMQ_ROUTER_RAW
+ enum: ZMQ_IMMEDIATE
+ enum: ZMQ_IPV6
+ enum: ZMQ_MECHANISM
+ enum: ZMQ_PLAIN_SERVER
+ enum: ZMQ_CURVE_SERVER
+ enum: ZMQ_PROBE_ROUTER
+ enum: ZMQ_REQ_RELAXED
+ enum: ZMQ_REQ_CORRELATE
+ enum: ZMQ_CONFLATE
+ enum: ZMQ_ROUTER_HANDOVER
+ enum: ZMQ_TOS
+ enum: ZMQ_IPC_FILTER_PID
+ enum: ZMQ_IPC_FILTER_UID
+ enum: ZMQ_IPC_FILTER_GID
+ enum: ZMQ_GSSAPI_SERVER
+ enum: ZMQ_GSSAPI_PLAINTEXT
+ enum: ZMQ_HANDSHAKE_IVL
+ enum: ZMQ_XPUB_NODROP
+ enum: ZMQ_AFFINITY
+ enum: ZMQ_MAXMSGSIZE
+ enum: ZMQ_HWM
+ enum: ZMQ_SWAP
+ enum: ZMQ_MCAST_LOOP
+ enum: ZMQ_RECOVERY_IVL_MSEC
+ enum: ZMQ_RATE
+ enum: ZMQ_RECOVERY_IVL
+ enum: ZMQ_SNDBUF
+ enum: ZMQ_RCVBUF
+ enum: ZMQ_RCVMORE
+ enum: ZMQ_MORE
+ enum: ZMQ_SRCFD
+ enum: ZMQ_SHARED
diff --git a/scripts/external_libs/platform/cel59/zmq/backend/cython/constants.c b/scripts/external_libs/platform/cel59/zmq/backend/cython/constants.c
new file mode 100644
index 00000000..24c1fbc5
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/constants.c
@@ -0,0 +1,4189 @@
+/* Generated by Cython 0.21.2 */
+
+#define PY_SSIZE_T_CLEAN
+#ifndef CYTHON_USE_PYLONG_INTERNALS
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#else
+#include "pyconfig.h"
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 1
+#else
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#endif
+#endif
+#endif
+#include "Python.h"
+#ifndef Py_PYTHON_H
+ #error Python headers needed to compile C extensions, please install development version of Python.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+ #error Cython requires Python 2.6+ or Python 3.2+.
+#else
+#define CYTHON_ABI "0_21_2"
+#include <stddef.h>
+#ifndef offsetof
+#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+ #ifndef __stdcall
+ #define __stdcall
+ #endif
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
+ #ifndef __fastcall
+ #define __fastcall
+ #endif
+#endif
+#ifndef DL_IMPORT
+ #define DL_IMPORT(t) t
+#endif
+#ifndef DL_EXPORT
+ #define DL_EXPORT(t) t
+#endif
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifndef Py_HUGE_VAL
+ #define Py_HUGE_VAL HUGE_VAL
+#endif
+#ifdef PYPY_VERSION
+#define CYTHON_COMPILING_IN_PYPY 1
+#define CYTHON_COMPILING_IN_CPYTHON 0
+#else
+#define CYTHON_COMPILING_IN_PYPY 0
+#define CYTHON_COMPILING_IN_CPYTHON 1
+#endif
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
+#define Py_OptimizeFlag 0
+#endif
+#define __PYX_BUILD_PY_SSIZE_T "n"
+#define CYTHON_FORMAT_SSIZE_T "z"
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyClass_Type
+#else
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyType_Type
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define Py_TPFLAGS_CHECKTYPES 0
+ #define Py_TPFLAGS_HAVE_INDEX 0
+ #define Py_TPFLAGS_HAVE_NEWBUFFER 0
+#endif
+#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+ #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
+#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
+ #define CYTHON_PEP393_ENABLED 1
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
+ 0 : _PyUnicode_Ready((PyObject *)(op)))
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
+ #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
+ #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+#else
+ #define CYTHON_PEP393_ENABLED 0
+ #define __Pyx_PyUnicode_READY(op) (0)
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
+ #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
+ #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+ #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyFrozenSet_Size(s) PyObject_Size(s)
+#else
+ #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
+ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
+ #define __Pyx_PyFrozenSet_Size(s) PySet_Size(s)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
+#else
+ #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBaseString_Type PyUnicode_Type
+ #define PyStringObject PyUnicodeObject
+ #define PyString_Type PyUnicode_Type
+ #define PyString_Check PyUnicode_Check
+ #define PyString_CheckExact PyUnicode_CheckExact
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
+ #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
+#else
+ #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+ #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
+#endif
+#ifndef PySet_CheckExact
+ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
+#endif
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#if PY_MAJOR_VERSION >= 3
+ #define PyIntObject PyLongObject
+ #define PyInt_Type PyLong_Type
+ #define PyInt_Check(op) PyLong_Check(op)
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
+ #define PyInt_FromString PyLong_FromString
+ #define PyInt_FromUnicode PyLong_FromUnicode
+ #define PyInt_FromLong PyLong_FromLong
+ #define PyInt_FromSize_t PyLong_FromSize_t
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
+ #define PyInt_AsLong PyLong_AsLong
+ #define PyInt_AS_LONG PyLong_AS_LONG
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+ #define PyNumber_Int PyNumber_Long
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBoolObject PyLongObject
+#endif
+#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
+ #ifndef PyUnicode_InternFromString
+ #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
+ #endif
+#endif
+#if PY_VERSION_HEX < 0x030200A4
+ typedef long Py_hash_t;
+ #define __Pyx_PyInt_FromHash_t PyInt_FromLong
+ #define __Pyx_PyInt_AsHash_t PyInt_AsLong
+#else
+ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
+ #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+#else
+ #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
+#endif
+#ifndef CYTHON_INLINE
+ #if defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+#ifndef CYTHON_RESTRICT
+ #if defined(__GNUC__)
+ #define CYTHON_RESTRICT __restrict__
+ #elif defined(_MSC_VER) && _MSC_VER >= 1400
+ #define CYTHON_RESTRICT __restrict
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_RESTRICT restrict
+ #else
+ #define CYTHON_RESTRICT
+ #endif
+#endif
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
+#else
+static CYTHON_INLINE float __PYX_NAN() {
+ /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
+ a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
+ a quiet NaN. */
+ float value;
+ memset(&value, 0xFF, sizeof(value));
+ return value;
+}
+#endif
+#ifdef __cplusplus
+template<typename T>
+void __Pyx_call_destructor(T* x) {
+ x->~T();
+}
+#endif
+
+
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
+#else
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
+#endif
+
+#ifndef __PYX_EXTERN_C
+ #ifdef __cplusplus
+ #define __PYX_EXTERN_C extern "C"
+ #else
+ #define __PYX_EXTERN_C extern
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+#define _USE_MATH_DEFINES
+#endif
+#include <math.h>
+#define __PYX_HAVE__zmq__backend__cython__constants
+#define __PYX_HAVE_API__zmq__backend__cython__constants
+#include "zmq_compat.h"
+#include "zmq.h"
+#include "zmq_utils.h"
+#ifdef _OPENMP
+#include <omp.h>
+#endif /* _OPENMP */
+
+#ifdef PYREX_WITHOUT_ASSERTIONS
+#define CYTHON_WITHOUT_ASSERTIONS
+#endif
+
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
+ const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \
+ (sizeof(type) < sizeof(Py_ssize_t)) || \
+ (sizeof(type) > sizeof(Py_ssize_t) && \
+ likely(v < (type)PY_SSIZE_T_MAX || \
+ v == (type)PY_SSIZE_T_MAX) && \
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \
+ v == (type)PY_SSIZE_T_MIN))) || \
+ (sizeof(type) == sizeof(Py_ssize_t) && \
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \
+ v == (type)PY_SSIZE_T_MAX))) )
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
+#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
+#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
+#define __Pyx_PyBytes_FromString PyBytes_FromString
+#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#else
+ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
+#endif
+#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
+#if PY_MAJOR_VERSION < 3
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
+{
+ const Py_UNICODE *u_end = u;
+ while (*u_end++) ;
+ return (size_t)(u_end - u - 1);
+}
+#else
+#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
+#endif
+#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
+#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
+#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
+#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
+#else
+#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
+#endif
+#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ PyObject* ascii_chars_u = NULL;
+ PyObject* ascii_chars_b = NULL;
+ const char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ if (strcmp(default_encoding_c, "ascii") == 0) {
+ __Pyx_sys_getdefaultencoding_not_ascii = 0;
+ } else {
+ char ascii_chars[128];
+ int c;
+ for (c = 0; c < 128; c++) {
+ ascii_chars[c] = c;
+ }
+ __Pyx_sys_getdefaultencoding_not_ascii = 1;
+ ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
+ if (!ascii_chars_u) goto bad;
+ ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
+ if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
+ PyErr_Format(
+ PyExc_ValueError,
+ "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
+ default_encoding_c);
+ goto bad;
+ }
+ Py_DECREF(ascii_chars_u);
+ Py_DECREF(ascii_chars_b);
+ }
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ Py_XDECREF(ascii_chars_u);
+ Py_XDECREF(ascii_chars_b);
+ return -1;
+}
+#endif
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
+#else
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+static char* __PYX_DEFAULT_STRING_ENCODING;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
+ if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
+ strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ return -1;
+}
+#endif
+#endif
+
+
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+ #define likely(x) __builtin_expect(!!(x), 1)
+ #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
+ #define likely(x) (x)
+ #define unlikely(x) (x)
+#endif /* __GNUC__ */
+
+static PyObject *__pyx_m;
+static PyObject *__pyx_d;
+static PyObject *__pyx_b;
+static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
+static int __pyx_lineno;
+static int __pyx_clineno = 0;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+
+
+static const char *__pyx_f[] = {
+ "zmq/backend/cython/constants.pyx",
+ "zmq/backend/cython/constants.pxi",
+};
+
+/*--- Type declarations ---*/
+#ifndef CYTHON_REFNANNY
+ #define CYTHON_REFNANNY 0
+#endif
+#if CYTHON_REFNANNY
+ typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*SetupContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+ } __Pyx_RefNannyAPIStruct;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
+ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
+#ifdef WITH_THREAD
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ if (acquire_gil) { \
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ PyGILState_Release(__pyx_gilstate_save); \
+ } else { \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ }
+#else
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+#endif
+ #define __Pyx_RefNannyFinishContext() \
+ __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
+ #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
+ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
+#else
+ #define __Pyx_RefNannyDeclarations
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)
+ #define __Pyx_RefNannyFinishContext()
+ #define __Pyx_INCREF(r) Py_INCREF(r)
+ #define __Pyx_DECREF(r) Py_DECREF(r)
+ #define __Pyx_GOTREF(r)
+ #define __Pyx_GIVEREF(r)
+ #define __Pyx_XINCREF(r) Py_XINCREF(r)
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
+ #define __Pyx_XGOTREF(r)
+ #define __Pyx_XGIVEREF(r)
+#endif
+#define __Pyx_XDECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_XDECREF(tmp); \
+ } while (0)
+#define __Pyx_DECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_DECREF(tmp); \
+ } while (0)
+#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
+#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_getattro))
+ return tp->tp_getattro(obj, attr_name);
+#if PY_MAJOR_VERSION < 3
+ if (likely(tp->tp_getattr))
+ return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
+#endif
+ return PyObject_GetAttr(obj, attr_name);
+}
+#else
+#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
+#endif
+
+static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
+
+static PyObject* __Pyx_Globals(void);
+
+typedef struct {
+ int code_line;
+ PyCodeObject* code_object;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+ int count;
+ int max_count;
+ __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+static int __Pyx_check_binary_version(void);
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+
+
+/* Module declarations from 'zmq.backend.cython.libzmq' */
+
+/* Module declarations from 'zmq.backend.cython.constants' */
+#define __Pyx_MODULE_NAME "zmq.backend.cython.constants"
+int __pyx_module_is_main_zmq__backend__cython__constants = 0;
+
+/* Implementation of 'zmq.backend.cython.constants' */
+static char __pyx_k_FD[] = "FD";
+static char __pyx_k_HWM[] = "HWM";
+static char __pyx_k_PUB[] = "PUB";
+static char __pyx_k_REP[] = "REP";
+static char __pyx_k_REQ[] = "REQ";
+static char __pyx_k_SUB[] = "SUB";
+static char __pyx_k_TOS[] = "TOS";
+static char __pyx_k_all[] = "__all__";
+static char __pyx_k_EFSM[] = "EFSM";
+static char __pyx_k_IPV6[] = "IPV6";
+static char __pyx_k_MORE[] = "MORE";
+static char __pyx_k_NULL[] = "NULL";
+static char __pyx_k_PAIR[] = "PAIR";
+static char __pyx_k_PULL[] = "PULL";
+static char __pyx_k_PUSH[] = "PUSH";
+static char __pyx_k_RATE[] = "RATE";
+static char __pyx_k_SWAP[] = "SWAP";
+static char __pyx_k_TYPE[] = "TYPE";
+static char __pyx_k_XPUB[] = "XPUB";
+static char __pyx_k_XREP[] = "XREP";
+static char __pyx_k_XREQ[] = "XREQ";
+static char __pyx_k_XSUB[] = "XSUB";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_CURVE[] = "CURVE";
+static char __pyx_k_ETERM[] = "ETERM";
+static char __pyx_k_PLAIN[] = "PLAIN";
+static char __pyx_k_QUEUE[] = "QUEUE";
+static char __pyx_k_SRCFD[] = "SRCFD";
+static char __pyx_k_DEALER[] = "DEALER";
+static char __pyx_k_EAGAIN[] = "EAGAIN";
+static char __pyx_k_EFAULT[] = "EFAULT";
+static char __pyx_k_EINVAL[] = "EINVAL";
+static char __pyx_k_ENODEV[] = "ENODEV";
+static char __pyx_k_ENOMEM[] = "ENOMEM";
+static char __pyx_k_EVENTS[] = "EVENTS";
+static char __pyx_k_GSSAPI[] = "GSSAPI";
+static char __pyx_k_LINGER[] = "LINGER";
+static char __pyx_k_POLLIN[] = "POLLIN";
+static char __pyx_k_RCVBUF[] = "RCVBUF";
+static char __pyx_k_RCVHWM[] = "RCVHWM";
+static char __pyx_k_ROUTER[] = "ROUTER";
+static char __pyx_k_SHARED[] = "SHARED";
+static char __pyx_k_SNDBUF[] = "SNDBUF";
+static char __pyx_k_SNDHWM[] = "SNDHWM";
+static char __pyx_k_STREAM[] = "STREAM";
+static char __pyx_k_BACKLOG[] = "BACKLOG";
+static char __pyx_k_ENOBUFS[] = "ENOBUFS";
+static char __pyx_k_ENOTSUP[] = "ENOTSUP";
+static char __pyx_k_NOBLOCK[] = "NOBLOCK";
+static char __pyx_k_POLLERR[] = "POLLERR";
+static char __pyx_k_POLLOUT[] = "POLLOUT";
+static char __pyx_k_RCVMORE[] = "RCVMORE";
+static char __pyx_k_SNDMORE[] = "SNDMORE";
+static char __pyx_k_VERSION[] = "VERSION";
+static char __pyx_k_AFFINITY[] = "AFFINITY";
+static char __pyx_k_CONFLATE[] = "CONFLATE";
+static char __pyx_k_DONTWAIT[] = "DONTWAIT";
+static char __pyx_k_EMSGSIZE[] = "EMSGSIZE";
+static char __pyx_k_EMTHREAD[] = "EMTHREAD";
+static char __pyx_k_ENETDOWN[] = "ENETDOWN";
+static char __pyx_k_ENOTCONN[] = "ENOTCONN";
+static char __pyx_k_ENOTSOCK[] = "ENOTSOCK";
+static char __pyx_k_IDENTITY[] = "IDENTITY";
+static char __pyx_k_IPV4ONLY[] = "IPV4ONLY";
+static char __pyx_k_RCVTIMEO[] = "RCVTIMEO";
+static char __pyx_k_SNDTIMEO[] = "SNDTIMEO";
+static char __pyx_k_STREAMER[] = "STREAMER";
+static char __pyx_k_UPSTREAM[] = "UPSTREAM";
+static char __pyx_k_ENETRESET[] = "ENETRESET";
+static char __pyx_k_ETIMEDOUT[] = "ETIMEDOUT";
+static char __pyx_k_EVENT_ALL[] = "EVENT_ALL";
+static char __pyx_k_FORWARDER[] = "FORWARDER";
+static char __pyx_k_IMMEDIATE[] = "IMMEDIATE";
+static char __pyx_k_MECHANISM[] = "MECHANISM";
+static char __pyx_k_SUBSCRIBE[] = "SUBSCRIBE";
+static char __pyx_k_DOWNSTREAM[] = "DOWNSTREAM";
+static char __pyx_k_EADDRINUSE[] = "EADDRINUSE";
+static char __pyx_k_ECONNRESET[] = "ECONNRESET";
+static char __pyx_k_HAUSNUMERO[] = "HAUSNUMERO";
+static char __pyx_k_IO_THREADS[] = "IO_THREADS";
+static char __pyx_k_MAXMSGSIZE[] = "MAXMSGSIZE";
+static char __pyx_k_MCAST_LOOP[] = "MCAST_LOOP";
+static char __pyx_k_ROUTER_RAW[] = "ROUTER_RAW";
+static char __pyx_k_ZAP_DOMAIN[] = "ZAP_DOMAIN";
+static char __pyx_k_CONNECT_RID[] = "CONNECT_RID";
+static char __pyx_k_EINPROGRESS[] = "EINPROGRESS";
+static char __pyx_k_ENETUNREACH[] = "ENETUNREACH";
+static char __pyx_k_IDENTITY_FD[] = "IDENTITY_FD";
+static char __pyx_k_MAX_SOCKETS[] = "MAX_SOCKETS";
+static char __pyx_k_REQ_RELAXED[] = "REQ_RELAXED";
+static char __pyx_k_SOCKS_PROXY[] = "SOCKS_PROXY";
+static char __pyx_k_UNSUBSCRIBE[] = "UNSUBSCRIBE";
+static char __pyx_k_XPUB_NODROP[] = "XPUB_NODROP";
+static char __pyx_k_CURVE_SERVER[] = "CURVE_SERVER";
+static char __pyx_k_EAFNOSUPPORT[] = "EAFNOSUPPORT";
+static char __pyx_k_ECONNABORTED[] = "ECONNABORTED";
+static char __pyx_k_ECONNREFUSED[] = "ECONNREFUSED";
+static char __pyx_k_EHOSTUNREACH[] = "EHOSTUNREACH";
+static char __pyx_k_EVENT_CLOSED[] = "EVENT_CLOSED";
+static char __pyx_k_PLAIN_SERVER[] = "PLAIN_SERVER";
+static char __pyx_k_PROBE_ROUTER[] = "PROBE_ROUTER";
+static char __pyx_k_RECOVERY_IVL[] = "RECOVERY_IVL";
+static char __pyx_k_SOCKET_LIMIT[] = "SOCKET_LIMIT";
+static char __pyx_k_XPUB_VERBOSE[] = "XPUB_VERBOSE";
+static char __pyx_k_0MQ_Constants[] = "0MQ Constants.";
+static char __pyx_k_EADDRNOTAVAIL[] = "EADDRNOTAVAIL";
+static char __pyx_k_GSSAPI_SERVER[] = "GSSAPI_SERVER";
+static char __pyx_k_HANDSHAKE_IVL[] = "HANDSHAKE_IVL";
+static char __pyx_k_LAST_ENDPOINT[] = "LAST_ENDPOINT";
+static char __pyx_k_RECONNECT_IVL[] = "RECONNECT_IVL";
+static char __pyx_k_REQ_CORRELATE[] = "REQ_CORRELATE";
+static char __pyx_k_TCP_KEEPALIVE[] = "TCP_KEEPALIVE";
+static char __pyx_k_VERSION_MAJOR[] = "VERSION_MAJOR";
+static char __pyx_k_VERSION_MINOR[] = "VERSION_MINOR";
+static char __pyx_k_VERSION_PATCH[] = "VERSION_PATCH";
+static char __pyx_k_ENOCOMPATPROTO[] = "ENOCOMPATPROTO";
+static char __pyx_k_EVENT_ACCEPTED[] = "EVENT_ACCEPTED";
+static char __pyx_k_IPC_FILTER_GID[] = "IPC_FILTER_GID";
+static char __pyx_k_IPC_FILTER_PID[] = "IPC_FILTER_PID";
+static char __pyx_k_IPC_FILTER_UID[] = "IPC_FILTER_UID";
+static char __pyx_k_MULTICAST_HOPS[] = "MULTICAST_HOPS";
+static char __pyx_k_PLAIN_PASSWORD[] = "PLAIN_PASSWORD";
+static char __pyx_k_PLAIN_USERNAME[] = "PLAIN_USERNAME";
+static char __pyx_k_POLLITEMS_DFLT[] = "POLLITEMS_DFLT";
+static char __pyx_k_CURVE_PUBLICKEY[] = "CURVE_PUBLICKEY";
+static char __pyx_k_CURVE_SECRETKEY[] = "CURVE_SECRETKEY";
+static char __pyx_k_CURVE_SERVERKEY[] = "CURVE_SERVERKEY";
+static char __pyx_k_EPROTONOSUPPORT[] = "EPROTONOSUPPORT";
+static char __pyx_k_EVENT_CONNECTED[] = "EVENT_CONNECTED";
+static char __pyx_k_EVENT_LISTENING[] = "EVENT_LISTENING";
+static char __pyx_k_FAIL_UNROUTABLE[] = "FAIL_UNROUTABLE";
+static char __pyx_k_IO_THREADS_DFLT[] = "IO_THREADS_DFLT";
+static char __pyx_k_ROUTER_BEHAVIOR[] = "ROUTER_BEHAVIOR";
+static char __pyx_k_ROUTER_HANDOVER[] = "ROUTER_HANDOVER";
+static char __pyx_k_THREAD_PRIORITY[] = "THREAD_PRIORITY";
+static char __pyx_k_GSSAPI_PLAINTEXT[] = "GSSAPI_PLAINTEXT";
+static char __pyx_k_GSSAPI_PRINCIPAL[] = "GSSAPI_PRINCIPAL";
+static char __pyx_k_MAX_SOCKETS_DFLT[] = "MAX_SOCKETS_DFLT";
+static char __pyx_k_ROUTER_MANDATORY[] = "ROUTER_MANDATORY";
+static char __pyx_k_EVENT_BIND_FAILED[] = "EVENT_BIND_FAILED";
+static char __pyx_k_RECONNECT_IVL_MAX[] = "RECONNECT_IVL_MAX";
+static char __pyx_k_RECOVERY_IVL_MSEC[] = "RECOVERY_IVL_MSEC";
+static char __pyx_k_TCP_ACCEPT_FILTER[] = "TCP_ACCEPT_FILTER";
+static char __pyx_k_TCP_KEEPALIVE_CNT[] = "TCP_KEEPALIVE_CNT";
+static char __pyx_k_EVENT_CLOSE_FAILED[] = "EVENT_CLOSE_FAILED";
+static char __pyx_k_EVENT_DISCONNECTED[] = "EVENT_DISCONNECTED";
+static char __pyx_k_TCP_KEEPALIVE_IDLE[] = "TCP_KEEPALIVE_IDLE";
+static char __pyx_k_EVENT_ACCEPT_FAILED[] = "EVENT_ACCEPT_FAILED";
+static char __pyx_k_TCP_KEEPALIVE_INTVL[] = "TCP_KEEPALIVE_INTVL";
+static char __pyx_k_THREAD_SCHED_POLICY[] = "THREAD_SCHED_POLICY";
+static char __pyx_k_THREAD_PRIORITY_DFLT[] = "THREAD_PRIORITY_DFLT";
+static char __pyx_k_EVENT_CONNECT_DELAYED[] = "EVENT_CONNECT_DELAYED";
+static char __pyx_k_EVENT_CONNECT_RETRIED[] = "EVENT_CONNECT_RETRIED";
+static char __pyx_k_EVENT_MONITOR_STOPPED[] = "EVENT_MONITOR_STOPPED";
+static char __pyx_k_DELAY_ATTACH_ON_CONNECT[] = "DELAY_ATTACH_ON_CONNECT";
+static char __pyx_k_GSSAPI_SERVICE_PRINCIPAL[] = "GSSAPI_SERVICE_PRINCIPAL";
+static char __pyx_k_THREAD_SCHED_POLICY_DFLT[] = "THREAD_SCHED_POLICY_DFLT";
+static PyObject *__pyx_n_s_AFFINITY;
+static PyObject *__pyx_n_s_BACKLOG;
+static PyObject *__pyx_n_s_CONFLATE;
+static PyObject *__pyx_n_s_CONNECT_RID;
+static PyObject *__pyx_n_s_CURVE;
+static PyObject *__pyx_n_s_CURVE_PUBLICKEY;
+static PyObject *__pyx_n_s_CURVE_SECRETKEY;
+static PyObject *__pyx_n_s_CURVE_SERVER;
+static PyObject *__pyx_n_s_CURVE_SERVERKEY;
+static PyObject *__pyx_n_s_DEALER;
+static PyObject *__pyx_n_s_DELAY_ATTACH_ON_CONNECT;
+static PyObject *__pyx_n_s_DONTWAIT;
+static PyObject *__pyx_n_s_DOWNSTREAM;
+static PyObject *__pyx_n_s_EADDRINUSE;
+static PyObject *__pyx_n_s_EADDRNOTAVAIL;
+static PyObject *__pyx_n_s_EAFNOSUPPORT;
+static PyObject *__pyx_n_s_EAGAIN;
+static PyObject *__pyx_n_s_ECONNABORTED;
+static PyObject *__pyx_n_s_ECONNREFUSED;
+static PyObject *__pyx_n_s_ECONNRESET;
+static PyObject *__pyx_n_s_EFAULT;
+static PyObject *__pyx_n_s_EFSM;
+static PyObject *__pyx_n_s_EHOSTUNREACH;
+static PyObject *__pyx_n_s_EINPROGRESS;
+static PyObject *__pyx_n_s_EINVAL;
+static PyObject *__pyx_n_s_EMSGSIZE;
+static PyObject *__pyx_n_s_EMTHREAD;
+static PyObject *__pyx_n_s_ENETDOWN;
+static PyObject *__pyx_n_s_ENETRESET;
+static PyObject *__pyx_n_s_ENETUNREACH;
+static PyObject *__pyx_n_s_ENOBUFS;
+static PyObject *__pyx_n_s_ENOCOMPATPROTO;
+static PyObject *__pyx_n_s_ENODEV;
+static PyObject *__pyx_n_s_ENOMEM;
+static PyObject *__pyx_n_s_ENOTCONN;
+static PyObject *__pyx_n_s_ENOTSOCK;
+static PyObject *__pyx_n_s_ENOTSUP;
+static PyObject *__pyx_n_s_EPROTONOSUPPORT;
+static PyObject *__pyx_n_s_ETERM;
+static PyObject *__pyx_n_s_ETIMEDOUT;
+static PyObject *__pyx_n_s_EVENTS;
+static PyObject *__pyx_n_s_EVENT_ACCEPTED;
+static PyObject *__pyx_n_s_EVENT_ACCEPT_FAILED;
+static PyObject *__pyx_n_s_EVENT_ALL;
+static PyObject *__pyx_n_s_EVENT_BIND_FAILED;
+static PyObject *__pyx_n_s_EVENT_CLOSED;
+static PyObject *__pyx_n_s_EVENT_CLOSE_FAILED;
+static PyObject *__pyx_n_s_EVENT_CONNECTED;
+static PyObject *__pyx_n_s_EVENT_CONNECT_DELAYED;
+static PyObject *__pyx_n_s_EVENT_CONNECT_RETRIED;
+static PyObject *__pyx_n_s_EVENT_DISCONNECTED;
+static PyObject *__pyx_n_s_EVENT_LISTENING;
+static PyObject *__pyx_n_s_EVENT_MONITOR_STOPPED;
+static PyObject *__pyx_n_s_FAIL_UNROUTABLE;
+static PyObject *__pyx_n_s_FD;
+static PyObject *__pyx_n_s_FORWARDER;
+static PyObject *__pyx_n_s_GSSAPI;
+static PyObject *__pyx_n_s_GSSAPI_PLAINTEXT;
+static PyObject *__pyx_n_s_GSSAPI_PRINCIPAL;
+static PyObject *__pyx_n_s_GSSAPI_SERVER;
+static PyObject *__pyx_n_s_GSSAPI_SERVICE_PRINCIPAL;
+static PyObject *__pyx_n_s_HANDSHAKE_IVL;
+static PyObject *__pyx_n_s_HAUSNUMERO;
+static PyObject *__pyx_n_s_HWM;
+static PyObject *__pyx_n_s_IDENTITY;
+static PyObject *__pyx_n_s_IDENTITY_FD;
+static PyObject *__pyx_n_s_IMMEDIATE;
+static PyObject *__pyx_n_s_IO_THREADS;
+static PyObject *__pyx_n_s_IO_THREADS_DFLT;
+static PyObject *__pyx_n_s_IPC_FILTER_GID;
+static PyObject *__pyx_n_s_IPC_FILTER_PID;
+static PyObject *__pyx_n_s_IPC_FILTER_UID;
+static PyObject *__pyx_n_s_IPV4ONLY;
+static PyObject *__pyx_n_s_IPV6;
+static PyObject *__pyx_n_s_LAST_ENDPOINT;
+static PyObject *__pyx_n_s_LINGER;
+static PyObject *__pyx_n_s_MAXMSGSIZE;
+static PyObject *__pyx_n_s_MAX_SOCKETS;
+static PyObject *__pyx_n_s_MAX_SOCKETS_DFLT;
+static PyObject *__pyx_n_s_MCAST_LOOP;
+static PyObject *__pyx_n_s_MECHANISM;
+static PyObject *__pyx_n_s_MORE;
+static PyObject *__pyx_n_s_MULTICAST_HOPS;
+static PyObject *__pyx_n_s_NOBLOCK;
+static PyObject *__pyx_n_s_NULL;
+static PyObject *__pyx_n_s_PAIR;
+static PyObject *__pyx_n_s_PLAIN;
+static PyObject *__pyx_n_s_PLAIN_PASSWORD;
+static PyObject *__pyx_n_s_PLAIN_SERVER;
+static PyObject *__pyx_n_s_PLAIN_USERNAME;
+static PyObject *__pyx_n_s_POLLERR;
+static PyObject *__pyx_n_s_POLLIN;
+static PyObject *__pyx_n_s_POLLITEMS_DFLT;
+static PyObject *__pyx_n_s_POLLOUT;
+static PyObject *__pyx_n_s_PROBE_ROUTER;
+static PyObject *__pyx_n_s_PUB;
+static PyObject *__pyx_n_s_PULL;
+static PyObject *__pyx_n_s_PUSH;
+static PyObject *__pyx_n_s_QUEUE;
+static PyObject *__pyx_n_s_RATE;
+static PyObject *__pyx_n_s_RCVBUF;
+static PyObject *__pyx_n_s_RCVHWM;
+static PyObject *__pyx_n_s_RCVMORE;
+static PyObject *__pyx_n_s_RCVTIMEO;
+static PyObject *__pyx_n_s_RECONNECT_IVL;
+static PyObject *__pyx_n_s_RECONNECT_IVL_MAX;
+static PyObject *__pyx_n_s_RECOVERY_IVL;
+static PyObject *__pyx_n_s_RECOVERY_IVL_MSEC;
+static PyObject *__pyx_n_s_REP;
+static PyObject *__pyx_n_s_REQ;
+static PyObject *__pyx_n_s_REQ_CORRELATE;
+static PyObject *__pyx_n_s_REQ_RELAXED;
+static PyObject *__pyx_n_s_ROUTER;
+static PyObject *__pyx_n_s_ROUTER_BEHAVIOR;
+static PyObject *__pyx_n_s_ROUTER_HANDOVER;
+static PyObject *__pyx_n_s_ROUTER_MANDATORY;
+static PyObject *__pyx_n_s_ROUTER_RAW;
+static PyObject *__pyx_n_s_SHARED;
+static PyObject *__pyx_n_s_SNDBUF;
+static PyObject *__pyx_n_s_SNDHWM;
+static PyObject *__pyx_n_s_SNDMORE;
+static PyObject *__pyx_n_s_SNDTIMEO;
+static PyObject *__pyx_n_s_SOCKET_LIMIT;
+static PyObject *__pyx_n_s_SOCKS_PROXY;
+static PyObject *__pyx_n_s_SRCFD;
+static PyObject *__pyx_n_s_STREAM;
+static PyObject *__pyx_n_s_STREAMER;
+static PyObject *__pyx_n_s_SUB;
+static PyObject *__pyx_n_s_SUBSCRIBE;
+static PyObject *__pyx_n_s_SWAP;
+static PyObject *__pyx_n_s_TCP_ACCEPT_FILTER;
+static PyObject *__pyx_n_s_TCP_KEEPALIVE;
+static PyObject *__pyx_n_s_TCP_KEEPALIVE_CNT;
+static PyObject *__pyx_n_s_TCP_KEEPALIVE_IDLE;
+static PyObject *__pyx_n_s_TCP_KEEPALIVE_INTVL;
+static PyObject *__pyx_n_s_THREAD_PRIORITY;
+static PyObject *__pyx_n_s_THREAD_PRIORITY_DFLT;
+static PyObject *__pyx_n_s_THREAD_SCHED_POLICY;
+static PyObject *__pyx_n_s_THREAD_SCHED_POLICY_DFLT;
+static PyObject *__pyx_n_s_TOS;
+static PyObject *__pyx_n_s_TYPE;
+static PyObject *__pyx_n_s_UNSUBSCRIBE;
+static PyObject *__pyx_n_s_UPSTREAM;
+static PyObject *__pyx_n_s_VERSION;
+static PyObject *__pyx_n_s_VERSION_MAJOR;
+static PyObject *__pyx_n_s_VERSION_MINOR;
+static PyObject *__pyx_n_s_VERSION_PATCH;
+static PyObject *__pyx_n_s_XPUB;
+static PyObject *__pyx_n_s_XPUB_NODROP;
+static PyObject *__pyx_n_s_XPUB_VERBOSE;
+static PyObject *__pyx_n_s_XREP;
+static PyObject *__pyx_n_s_XREQ;
+static PyObject *__pyx_n_s_XSUB;
+static PyObject *__pyx_n_s_ZAP_DOMAIN;
+static PyObject *__pyx_n_s_all;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_test;
+
+static PyMethodDef __pyx_methods[] = {
+ {0, 0, 0, 0}
+};
+
+#if PY_MAJOR_VERSION >= 3
+static struct PyModuleDef __pyx_moduledef = {
+ #if PY_VERSION_HEX < 0x03020000
+ { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
+ #else
+ PyModuleDef_HEAD_INIT,
+ #endif
+ "constants",
+ __pyx_k_0MQ_Constants, /* m_doc */
+ -1, /* m_size */
+ __pyx_methods /* m_methods */,
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL /* m_free */
+};
+#endif
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+ {&__pyx_n_s_AFFINITY, __pyx_k_AFFINITY, sizeof(__pyx_k_AFFINITY), 0, 0, 1, 1},
+ {&__pyx_n_s_BACKLOG, __pyx_k_BACKLOG, sizeof(__pyx_k_BACKLOG), 0, 0, 1, 1},
+ {&__pyx_n_s_CONFLATE, __pyx_k_CONFLATE, sizeof(__pyx_k_CONFLATE), 0, 0, 1, 1},
+ {&__pyx_n_s_CONNECT_RID, __pyx_k_CONNECT_RID, sizeof(__pyx_k_CONNECT_RID), 0, 0, 1, 1},
+ {&__pyx_n_s_CURVE, __pyx_k_CURVE, sizeof(__pyx_k_CURVE), 0, 0, 1, 1},
+ {&__pyx_n_s_CURVE_PUBLICKEY, __pyx_k_CURVE_PUBLICKEY, sizeof(__pyx_k_CURVE_PUBLICKEY), 0, 0, 1, 1},
+ {&__pyx_n_s_CURVE_SECRETKEY, __pyx_k_CURVE_SECRETKEY, sizeof(__pyx_k_CURVE_SECRETKEY), 0, 0, 1, 1},
+ {&__pyx_n_s_CURVE_SERVER, __pyx_k_CURVE_SERVER, sizeof(__pyx_k_CURVE_SERVER), 0, 0, 1, 1},
+ {&__pyx_n_s_CURVE_SERVERKEY, __pyx_k_CURVE_SERVERKEY, sizeof(__pyx_k_CURVE_SERVERKEY), 0, 0, 1, 1},
+ {&__pyx_n_s_DEALER, __pyx_k_DEALER, sizeof(__pyx_k_DEALER), 0, 0, 1, 1},
+ {&__pyx_n_s_DELAY_ATTACH_ON_CONNECT, __pyx_k_DELAY_ATTACH_ON_CONNECT, sizeof(__pyx_k_DELAY_ATTACH_ON_CONNECT), 0, 0, 1, 1},
+ {&__pyx_n_s_DONTWAIT, __pyx_k_DONTWAIT, sizeof(__pyx_k_DONTWAIT), 0, 0, 1, 1},
+ {&__pyx_n_s_DOWNSTREAM, __pyx_k_DOWNSTREAM, sizeof(__pyx_k_DOWNSTREAM), 0, 0, 1, 1},
+ {&__pyx_n_s_EADDRINUSE, __pyx_k_EADDRINUSE, sizeof(__pyx_k_EADDRINUSE), 0, 0, 1, 1},
+ {&__pyx_n_s_EADDRNOTAVAIL, __pyx_k_EADDRNOTAVAIL, sizeof(__pyx_k_EADDRNOTAVAIL), 0, 0, 1, 1},
+ {&__pyx_n_s_EAFNOSUPPORT, __pyx_k_EAFNOSUPPORT, sizeof(__pyx_k_EAFNOSUPPORT), 0, 0, 1, 1},
+ {&__pyx_n_s_EAGAIN, __pyx_k_EAGAIN, sizeof(__pyx_k_EAGAIN), 0, 0, 1, 1},
+ {&__pyx_n_s_ECONNABORTED, __pyx_k_ECONNABORTED, sizeof(__pyx_k_ECONNABORTED), 0, 0, 1, 1},
+ {&__pyx_n_s_ECONNREFUSED, __pyx_k_ECONNREFUSED, sizeof(__pyx_k_ECONNREFUSED), 0, 0, 1, 1},
+ {&__pyx_n_s_ECONNRESET, __pyx_k_ECONNRESET, sizeof(__pyx_k_ECONNRESET), 0, 0, 1, 1},
+ {&__pyx_n_s_EFAULT, __pyx_k_EFAULT, sizeof(__pyx_k_EFAULT), 0, 0, 1, 1},
+ {&__pyx_n_s_EFSM, __pyx_k_EFSM, sizeof(__pyx_k_EFSM), 0, 0, 1, 1},
+ {&__pyx_n_s_EHOSTUNREACH, __pyx_k_EHOSTUNREACH, sizeof(__pyx_k_EHOSTUNREACH), 0, 0, 1, 1},
+ {&__pyx_n_s_EINPROGRESS, __pyx_k_EINPROGRESS, sizeof(__pyx_k_EINPROGRESS), 0, 0, 1, 1},
+ {&__pyx_n_s_EINVAL, __pyx_k_EINVAL, sizeof(__pyx_k_EINVAL), 0, 0, 1, 1},
+ {&__pyx_n_s_EMSGSIZE, __pyx_k_EMSGSIZE, sizeof(__pyx_k_EMSGSIZE), 0, 0, 1, 1},
+ {&__pyx_n_s_EMTHREAD, __pyx_k_EMTHREAD, sizeof(__pyx_k_EMTHREAD), 0, 0, 1, 1},
+ {&__pyx_n_s_ENETDOWN, __pyx_k_ENETDOWN, sizeof(__pyx_k_ENETDOWN), 0, 0, 1, 1},
+ {&__pyx_n_s_ENETRESET, __pyx_k_ENETRESET, sizeof(__pyx_k_ENETRESET), 0, 0, 1, 1},
+ {&__pyx_n_s_ENETUNREACH, __pyx_k_ENETUNREACH, sizeof(__pyx_k_ENETUNREACH), 0, 0, 1, 1},
+ {&__pyx_n_s_ENOBUFS, __pyx_k_ENOBUFS, sizeof(__pyx_k_ENOBUFS), 0, 0, 1, 1},
+ {&__pyx_n_s_ENOCOMPATPROTO, __pyx_k_ENOCOMPATPROTO, sizeof(__pyx_k_ENOCOMPATPROTO), 0, 0, 1, 1},
+ {&__pyx_n_s_ENODEV, __pyx_k_ENODEV, sizeof(__pyx_k_ENODEV), 0, 0, 1, 1},
+ {&__pyx_n_s_ENOMEM, __pyx_k_ENOMEM, sizeof(__pyx_k_ENOMEM), 0, 0, 1, 1},
+ {&__pyx_n_s_ENOTCONN, __pyx_k_ENOTCONN, sizeof(__pyx_k_ENOTCONN), 0, 0, 1, 1},
+ {&__pyx_n_s_ENOTSOCK, __pyx_k_ENOTSOCK, sizeof(__pyx_k_ENOTSOCK), 0, 0, 1, 1},
+ {&__pyx_n_s_ENOTSUP, __pyx_k_ENOTSUP, sizeof(__pyx_k_ENOTSUP), 0, 0, 1, 1},
+ {&__pyx_n_s_EPROTONOSUPPORT, __pyx_k_EPROTONOSUPPORT, sizeof(__pyx_k_EPROTONOSUPPORT), 0, 0, 1, 1},
+ {&__pyx_n_s_ETERM, __pyx_k_ETERM, sizeof(__pyx_k_ETERM), 0, 0, 1, 1},
+ {&__pyx_n_s_ETIMEDOUT, __pyx_k_ETIMEDOUT, sizeof(__pyx_k_ETIMEDOUT), 0, 0, 1, 1},
+ {&__pyx_n_s_EVENTS, __pyx_k_EVENTS, sizeof(__pyx_k_EVENTS), 0, 0, 1, 1},
+ {&__pyx_n_s_EVENT_ACCEPTED, __pyx_k_EVENT_ACCEPTED, sizeof(__pyx_k_EVENT_ACCEPTED), 0, 0, 1, 1},
+ {&__pyx_n_s_EVENT_ACCEPT_FAILED, __pyx_k_EVENT_ACCEPT_FAILED, sizeof(__pyx_k_EVENT_ACCEPT_FAILED), 0, 0, 1, 1},
+ {&__pyx_n_s_EVENT_ALL, __pyx_k_EVENT_ALL, sizeof(__pyx_k_EVENT_ALL), 0, 0, 1, 1},
+ {&__pyx_n_s_EVENT_BIND_FAILED, __pyx_k_EVENT_BIND_FAILED, sizeof(__pyx_k_EVENT_BIND_FAILED), 0, 0, 1, 1},
+ {&__pyx_n_s_EVENT_CLOSED, __pyx_k_EVENT_CLOSED, sizeof(__pyx_k_EVENT_CLOSED), 0, 0, 1, 1},
+ {&__pyx_n_s_EVENT_CLOSE_FAILED, __pyx_k_EVENT_CLOSE_FAILED, sizeof(__pyx_k_EVENT_CLOSE_FAILED), 0, 0, 1, 1},
+ {&__pyx_n_s_EVENT_CONNECTED, __pyx_k_EVENT_CONNECTED, sizeof(__pyx_k_EVENT_CONNECTED), 0, 0, 1, 1},
+ {&__pyx_n_s_EVENT_CONNECT_DELAYED, __pyx_k_EVENT_CONNECT_DELAYED, sizeof(__pyx_k_EVENT_CONNECT_DELAYED), 0, 0, 1, 1},
+ {&__pyx_n_s_EVENT_CONNECT_RETRIED, __pyx_k_EVENT_CONNECT_RETRIED, sizeof(__pyx_k_EVENT_CONNECT_RETRIED), 0, 0, 1, 1},
+ {&__pyx_n_s_EVENT_DISCONNECTED, __pyx_k_EVENT_DISCONNECTED, sizeof(__pyx_k_EVENT_DISCONNECTED), 0, 0, 1, 1},
+ {&__pyx_n_s_EVENT_LISTENING, __pyx_k_EVENT_LISTENING, sizeof(__pyx_k_EVENT_LISTENING), 0, 0, 1, 1},
+ {&__pyx_n_s_EVENT_MONITOR_STOPPED, __pyx_k_EVENT_MONITOR_STOPPED, sizeof(__pyx_k_EVENT_MONITOR_STOPPED), 0, 0, 1, 1},
+ {&__pyx_n_s_FAIL_UNROUTABLE, __pyx_k_FAIL_UNROUTABLE, sizeof(__pyx_k_FAIL_UNROUTABLE), 0, 0, 1, 1},
+ {&__pyx_n_s_FD, __pyx_k_FD, sizeof(__pyx_k_FD), 0, 0, 1, 1},
+ {&__pyx_n_s_FORWARDER, __pyx_k_FORWARDER, sizeof(__pyx_k_FORWARDER), 0, 0, 1, 1},
+ {&__pyx_n_s_GSSAPI, __pyx_k_GSSAPI, sizeof(__pyx_k_GSSAPI), 0, 0, 1, 1},
+ {&__pyx_n_s_GSSAPI_PLAINTEXT, __pyx_k_GSSAPI_PLAINTEXT, sizeof(__pyx_k_GSSAPI_PLAINTEXT), 0, 0, 1, 1},
+ {&__pyx_n_s_GSSAPI_PRINCIPAL, __pyx_k_GSSAPI_PRINCIPAL, sizeof(__pyx_k_GSSAPI_PRINCIPAL), 0, 0, 1, 1},
+ {&__pyx_n_s_GSSAPI_SERVER, __pyx_k_GSSAPI_SERVER, sizeof(__pyx_k_GSSAPI_SERVER), 0, 0, 1, 1},
+ {&__pyx_n_s_GSSAPI_SERVICE_PRINCIPAL, __pyx_k_GSSAPI_SERVICE_PRINCIPAL, sizeof(__pyx_k_GSSAPI_SERVICE_PRINCIPAL), 0, 0, 1, 1},
+ {&__pyx_n_s_HANDSHAKE_IVL, __pyx_k_HANDSHAKE_IVL, sizeof(__pyx_k_HANDSHAKE_IVL), 0, 0, 1, 1},
+ {&__pyx_n_s_HAUSNUMERO, __pyx_k_HAUSNUMERO, sizeof(__pyx_k_HAUSNUMERO), 0, 0, 1, 1},
+ {&__pyx_n_s_HWM, __pyx_k_HWM, sizeof(__pyx_k_HWM), 0, 0, 1, 1},
+ {&__pyx_n_s_IDENTITY, __pyx_k_IDENTITY, sizeof(__pyx_k_IDENTITY), 0, 0, 1, 1},
+ {&__pyx_n_s_IDENTITY_FD, __pyx_k_IDENTITY_FD, sizeof(__pyx_k_IDENTITY_FD), 0, 0, 1, 1},
+ {&__pyx_n_s_IMMEDIATE, __pyx_k_IMMEDIATE, sizeof(__pyx_k_IMMEDIATE), 0, 0, 1, 1},
+ {&__pyx_n_s_IO_THREADS, __pyx_k_IO_THREADS, sizeof(__pyx_k_IO_THREADS), 0, 0, 1, 1},
+ {&__pyx_n_s_IO_THREADS_DFLT, __pyx_k_IO_THREADS_DFLT, sizeof(__pyx_k_IO_THREADS_DFLT), 0, 0, 1, 1},
+ {&__pyx_n_s_IPC_FILTER_GID, __pyx_k_IPC_FILTER_GID, sizeof(__pyx_k_IPC_FILTER_GID), 0, 0, 1, 1},
+ {&__pyx_n_s_IPC_FILTER_PID, __pyx_k_IPC_FILTER_PID, sizeof(__pyx_k_IPC_FILTER_PID), 0, 0, 1, 1},
+ {&__pyx_n_s_IPC_FILTER_UID, __pyx_k_IPC_FILTER_UID, sizeof(__pyx_k_IPC_FILTER_UID), 0, 0, 1, 1},
+ {&__pyx_n_s_IPV4ONLY, __pyx_k_IPV4ONLY, sizeof(__pyx_k_IPV4ONLY), 0, 0, 1, 1},
+ {&__pyx_n_s_IPV6, __pyx_k_IPV6, sizeof(__pyx_k_IPV6), 0, 0, 1, 1},
+ {&__pyx_n_s_LAST_ENDPOINT, __pyx_k_LAST_ENDPOINT, sizeof(__pyx_k_LAST_ENDPOINT), 0, 0, 1, 1},
+ {&__pyx_n_s_LINGER, __pyx_k_LINGER, sizeof(__pyx_k_LINGER), 0, 0, 1, 1},
+ {&__pyx_n_s_MAXMSGSIZE, __pyx_k_MAXMSGSIZE, sizeof(__pyx_k_MAXMSGSIZE), 0, 0, 1, 1},
+ {&__pyx_n_s_MAX_SOCKETS, __pyx_k_MAX_SOCKETS, sizeof(__pyx_k_MAX_SOCKETS), 0, 0, 1, 1},
+ {&__pyx_n_s_MAX_SOCKETS_DFLT, __pyx_k_MAX_SOCKETS_DFLT, sizeof(__pyx_k_MAX_SOCKETS_DFLT), 0, 0, 1, 1},
+ {&__pyx_n_s_MCAST_LOOP, __pyx_k_MCAST_LOOP, sizeof(__pyx_k_MCAST_LOOP), 0, 0, 1, 1},
+ {&__pyx_n_s_MECHANISM, __pyx_k_MECHANISM, sizeof(__pyx_k_MECHANISM), 0, 0, 1, 1},
+ {&__pyx_n_s_MORE, __pyx_k_MORE, sizeof(__pyx_k_MORE), 0, 0, 1, 1},
+ {&__pyx_n_s_MULTICAST_HOPS, __pyx_k_MULTICAST_HOPS, sizeof(__pyx_k_MULTICAST_HOPS), 0, 0, 1, 1},
+ {&__pyx_n_s_NOBLOCK, __pyx_k_NOBLOCK, sizeof(__pyx_k_NOBLOCK), 0, 0, 1, 1},
+ {&__pyx_n_s_NULL, __pyx_k_NULL, sizeof(__pyx_k_NULL), 0, 0, 1, 1},
+ {&__pyx_n_s_PAIR, __pyx_k_PAIR, sizeof(__pyx_k_PAIR), 0, 0, 1, 1},
+ {&__pyx_n_s_PLAIN, __pyx_k_PLAIN, sizeof(__pyx_k_PLAIN), 0, 0, 1, 1},
+ {&__pyx_n_s_PLAIN_PASSWORD, __pyx_k_PLAIN_PASSWORD, sizeof(__pyx_k_PLAIN_PASSWORD), 0, 0, 1, 1},
+ {&__pyx_n_s_PLAIN_SERVER, __pyx_k_PLAIN_SERVER, sizeof(__pyx_k_PLAIN_SERVER), 0, 0, 1, 1},
+ {&__pyx_n_s_PLAIN_USERNAME, __pyx_k_PLAIN_USERNAME, sizeof(__pyx_k_PLAIN_USERNAME), 0, 0, 1, 1},
+ {&__pyx_n_s_POLLERR, __pyx_k_POLLERR, sizeof(__pyx_k_POLLERR), 0, 0, 1, 1},
+ {&__pyx_n_s_POLLIN, __pyx_k_POLLIN, sizeof(__pyx_k_POLLIN), 0, 0, 1, 1},
+ {&__pyx_n_s_POLLITEMS_DFLT, __pyx_k_POLLITEMS_DFLT, sizeof(__pyx_k_POLLITEMS_DFLT), 0, 0, 1, 1},
+ {&__pyx_n_s_POLLOUT, __pyx_k_POLLOUT, sizeof(__pyx_k_POLLOUT), 0, 0, 1, 1},
+ {&__pyx_n_s_PROBE_ROUTER, __pyx_k_PROBE_ROUTER, sizeof(__pyx_k_PROBE_ROUTER), 0, 0, 1, 1},
+ {&__pyx_n_s_PUB, __pyx_k_PUB, sizeof(__pyx_k_PUB), 0, 0, 1, 1},
+ {&__pyx_n_s_PULL, __pyx_k_PULL, sizeof(__pyx_k_PULL), 0, 0, 1, 1},
+ {&__pyx_n_s_PUSH, __pyx_k_PUSH, sizeof(__pyx_k_PUSH), 0, 0, 1, 1},
+ {&__pyx_n_s_QUEUE, __pyx_k_QUEUE, sizeof(__pyx_k_QUEUE), 0, 0, 1, 1},
+ {&__pyx_n_s_RATE, __pyx_k_RATE, sizeof(__pyx_k_RATE), 0, 0, 1, 1},
+ {&__pyx_n_s_RCVBUF, __pyx_k_RCVBUF, sizeof(__pyx_k_RCVBUF), 0, 0, 1, 1},
+ {&__pyx_n_s_RCVHWM, __pyx_k_RCVHWM, sizeof(__pyx_k_RCVHWM), 0, 0, 1, 1},
+ {&__pyx_n_s_RCVMORE, __pyx_k_RCVMORE, sizeof(__pyx_k_RCVMORE), 0, 0, 1, 1},
+ {&__pyx_n_s_RCVTIMEO, __pyx_k_RCVTIMEO, sizeof(__pyx_k_RCVTIMEO), 0, 0, 1, 1},
+ {&__pyx_n_s_RECONNECT_IVL, __pyx_k_RECONNECT_IVL, sizeof(__pyx_k_RECONNECT_IVL), 0, 0, 1, 1},
+ {&__pyx_n_s_RECONNECT_IVL_MAX, __pyx_k_RECONNECT_IVL_MAX, sizeof(__pyx_k_RECONNECT_IVL_MAX), 0, 0, 1, 1},
+ {&__pyx_n_s_RECOVERY_IVL, __pyx_k_RECOVERY_IVL, sizeof(__pyx_k_RECOVERY_IVL), 0, 0, 1, 1},
+ {&__pyx_n_s_RECOVERY_IVL_MSEC, __pyx_k_RECOVERY_IVL_MSEC, sizeof(__pyx_k_RECOVERY_IVL_MSEC), 0, 0, 1, 1},
+ {&__pyx_n_s_REP, __pyx_k_REP, sizeof(__pyx_k_REP), 0, 0, 1, 1},
+ {&__pyx_n_s_REQ, __pyx_k_REQ, sizeof(__pyx_k_REQ), 0, 0, 1, 1},
+ {&__pyx_n_s_REQ_CORRELATE, __pyx_k_REQ_CORRELATE, sizeof(__pyx_k_REQ_CORRELATE), 0, 0, 1, 1},
+ {&__pyx_n_s_REQ_RELAXED, __pyx_k_REQ_RELAXED, sizeof(__pyx_k_REQ_RELAXED), 0, 0, 1, 1},
+ {&__pyx_n_s_ROUTER, __pyx_k_ROUTER, sizeof(__pyx_k_ROUTER), 0, 0, 1, 1},
+ {&__pyx_n_s_ROUTER_BEHAVIOR, __pyx_k_ROUTER_BEHAVIOR, sizeof(__pyx_k_ROUTER_BEHAVIOR), 0, 0, 1, 1},
+ {&__pyx_n_s_ROUTER_HANDOVER, __pyx_k_ROUTER_HANDOVER, sizeof(__pyx_k_ROUTER_HANDOVER), 0, 0, 1, 1},
+ {&__pyx_n_s_ROUTER_MANDATORY, __pyx_k_ROUTER_MANDATORY, sizeof(__pyx_k_ROUTER_MANDATORY), 0, 0, 1, 1},
+ {&__pyx_n_s_ROUTER_RAW, __pyx_k_ROUTER_RAW, sizeof(__pyx_k_ROUTER_RAW), 0, 0, 1, 1},
+ {&__pyx_n_s_SHARED, __pyx_k_SHARED, sizeof(__pyx_k_SHARED), 0, 0, 1, 1},
+ {&__pyx_n_s_SNDBUF, __pyx_k_SNDBUF, sizeof(__pyx_k_SNDBUF), 0, 0, 1, 1},
+ {&__pyx_n_s_SNDHWM, __pyx_k_SNDHWM, sizeof(__pyx_k_SNDHWM), 0, 0, 1, 1},
+ {&__pyx_n_s_SNDMORE, __pyx_k_SNDMORE, sizeof(__pyx_k_SNDMORE), 0, 0, 1, 1},
+ {&__pyx_n_s_SNDTIMEO, __pyx_k_SNDTIMEO, sizeof(__pyx_k_SNDTIMEO), 0, 0, 1, 1},
+ {&__pyx_n_s_SOCKET_LIMIT, __pyx_k_SOCKET_LIMIT, sizeof(__pyx_k_SOCKET_LIMIT), 0, 0, 1, 1},
+ {&__pyx_n_s_SOCKS_PROXY, __pyx_k_SOCKS_PROXY, sizeof(__pyx_k_SOCKS_PROXY), 0, 0, 1, 1},
+ {&__pyx_n_s_SRCFD, __pyx_k_SRCFD, sizeof(__pyx_k_SRCFD), 0, 0, 1, 1},
+ {&__pyx_n_s_STREAM, __pyx_k_STREAM, sizeof(__pyx_k_STREAM), 0, 0, 1, 1},
+ {&__pyx_n_s_STREAMER, __pyx_k_STREAMER, sizeof(__pyx_k_STREAMER), 0, 0, 1, 1},
+ {&__pyx_n_s_SUB, __pyx_k_SUB, sizeof(__pyx_k_SUB), 0, 0, 1, 1},
+ {&__pyx_n_s_SUBSCRIBE, __pyx_k_SUBSCRIBE, sizeof(__pyx_k_SUBSCRIBE), 0, 0, 1, 1},
+ {&__pyx_n_s_SWAP, __pyx_k_SWAP, sizeof(__pyx_k_SWAP), 0, 0, 1, 1},
+ {&__pyx_n_s_TCP_ACCEPT_FILTER, __pyx_k_TCP_ACCEPT_FILTER, sizeof(__pyx_k_TCP_ACCEPT_FILTER), 0, 0, 1, 1},
+ {&__pyx_n_s_TCP_KEEPALIVE, __pyx_k_TCP_KEEPALIVE, sizeof(__pyx_k_TCP_KEEPALIVE), 0, 0, 1, 1},
+ {&__pyx_n_s_TCP_KEEPALIVE_CNT, __pyx_k_TCP_KEEPALIVE_CNT, sizeof(__pyx_k_TCP_KEEPALIVE_CNT), 0, 0, 1, 1},
+ {&__pyx_n_s_TCP_KEEPALIVE_IDLE, __pyx_k_TCP_KEEPALIVE_IDLE, sizeof(__pyx_k_TCP_KEEPALIVE_IDLE), 0, 0, 1, 1},
+ {&__pyx_n_s_TCP_KEEPALIVE_INTVL, __pyx_k_TCP_KEEPALIVE_INTVL, sizeof(__pyx_k_TCP_KEEPALIVE_INTVL), 0, 0, 1, 1},
+ {&__pyx_n_s_THREAD_PRIORITY, __pyx_k_THREAD_PRIORITY, sizeof(__pyx_k_THREAD_PRIORITY), 0, 0, 1, 1},
+ {&__pyx_n_s_THREAD_PRIORITY_DFLT, __pyx_k_THREAD_PRIORITY_DFLT, sizeof(__pyx_k_THREAD_PRIORITY_DFLT), 0, 0, 1, 1},
+ {&__pyx_n_s_THREAD_SCHED_POLICY, __pyx_k_THREAD_SCHED_POLICY, sizeof(__pyx_k_THREAD_SCHED_POLICY), 0, 0, 1, 1},
+ {&__pyx_n_s_THREAD_SCHED_POLICY_DFLT, __pyx_k_THREAD_SCHED_POLICY_DFLT, sizeof(__pyx_k_THREAD_SCHED_POLICY_DFLT), 0, 0, 1, 1},
+ {&__pyx_n_s_TOS, __pyx_k_TOS, sizeof(__pyx_k_TOS), 0, 0, 1, 1},
+ {&__pyx_n_s_TYPE, __pyx_k_TYPE, sizeof(__pyx_k_TYPE), 0, 0, 1, 1},
+ {&__pyx_n_s_UNSUBSCRIBE, __pyx_k_UNSUBSCRIBE, sizeof(__pyx_k_UNSUBSCRIBE), 0, 0, 1, 1},
+ {&__pyx_n_s_UPSTREAM, __pyx_k_UPSTREAM, sizeof(__pyx_k_UPSTREAM), 0, 0, 1, 1},
+ {&__pyx_n_s_VERSION, __pyx_k_VERSION, sizeof(__pyx_k_VERSION), 0, 0, 1, 1},
+ {&__pyx_n_s_VERSION_MAJOR, __pyx_k_VERSION_MAJOR, sizeof(__pyx_k_VERSION_MAJOR), 0, 0, 1, 1},
+ {&__pyx_n_s_VERSION_MINOR, __pyx_k_VERSION_MINOR, sizeof(__pyx_k_VERSION_MINOR), 0, 0, 1, 1},
+ {&__pyx_n_s_VERSION_PATCH, __pyx_k_VERSION_PATCH, sizeof(__pyx_k_VERSION_PATCH), 0, 0, 1, 1},
+ {&__pyx_n_s_XPUB, __pyx_k_XPUB, sizeof(__pyx_k_XPUB), 0, 0, 1, 1},
+ {&__pyx_n_s_XPUB_NODROP, __pyx_k_XPUB_NODROP, sizeof(__pyx_k_XPUB_NODROP), 0, 0, 1, 1},
+ {&__pyx_n_s_XPUB_VERBOSE, __pyx_k_XPUB_VERBOSE, sizeof(__pyx_k_XPUB_VERBOSE), 0, 0, 1, 1},
+ {&__pyx_n_s_XREP, __pyx_k_XREP, sizeof(__pyx_k_XREP), 0, 0, 1, 1},
+ {&__pyx_n_s_XREQ, __pyx_k_XREQ, sizeof(__pyx_k_XREQ), 0, 0, 1, 1},
+ {&__pyx_n_s_XSUB, __pyx_k_XSUB, sizeof(__pyx_k_XSUB), 0, 0, 1, 1},
+ {&__pyx_n_s_ZAP_DOMAIN, __pyx_k_ZAP_DOMAIN, sizeof(__pyx_k_ZAP_DOMAIN), 0, 0, 1, 1},
+ {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
+ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+ {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+ {0, 0, 0, 0, 0, 0, 0}
+};
+static int __Pyx_InitCachedBuiltins(void) {
+ return 0;
+}
+
+static int __Pyx_InitCachedConstants(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_InitGlobals(void) {
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+#if PY_MAJOR_VERSION < 3
+PyMODINIT_FUNC initconstants(void); /*proto*/
+PyMODINIT_FUNC initconstants(void)
+#else
+PyMODINIT_FUNC PyInit_constants(void); /*proto*/
+PyMODINIT_FUNC PyInit_constants(void)
+#endif
+{
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ #if CYTHON_REFNANNY
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
+ if (!__Pyx_RefNanny) {
+ PyErr_Clear();
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
+ if (!__Pyx_RefNanny)
+ Py_FatalError("failed to import 'refnanny' module");
+ }
+ #endif
+ __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_constants(void)", 0);
+ if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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;}
+ __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;}
+ #ifdef __Pyx_CyFunction_USED
+ if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_FusedFunction_USED
+ if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_Generator_USED
+ if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ /*--- Library function declarations ---*/
+ /*--- Threads initialization code ---*/
+ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
+ #ifdef WITH_THREAD /* Python build with threading support? */
+ PyEval_InitThreads();
+ #endif
+ #endif
+ /*--- Module creation code ---*/
+ #if PY_MAJOR_VERSION < 3
+ __pyx_m = Py_InitModule4("constants", __pyx_methods, __pyx_k_0MQ_Constants, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+ #else
+ __pyx_m = PyModule_Create(&__pyx_moduledef);
+ #endif
+ if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_INCREF(__pyx_d);
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_COMPILING_IN_PYPY
+ Py_INCREF(__pyx_b);
+ #endif
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ /*--- Initialize various global constants etc. ---*/
+ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ if (__pyx_module_is_main_zmq__backend__cython__constants) {
+ if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ }
+ #if PY_MAJOR_VERSION >= 3
+ {
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!PyDict_GetItemString(modules, "zmq.backend.cython.constants")) {
+ if (unlikely(PyDict_SetItemString(modules, "zmq.backend.cython.constants", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+ /*--- Builtin init code ---*/
+ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Constants init code ---*/
+ if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Global init code ---*/
+ /*--- Variable export code ---*/
+ /*--- Function export code ---*/
+ /*--- Type init code ---*/
+ /*--- Type import code ---*/
+ /*--- Variable import code ---*/
+ /*--- Function import code ---*/
+ /*--- Execution code ---*/
+
+ /* "zmq/backend/cython/constants.pxi":5
+ * #-----------------------------------------------------------------------------
+ *
+ * VERSION = ZMQ_VERSION # <<<<<<<<<<<<<<
+ * VERSION_MAJOR = ZMQ_VERSION_MAJOR
+ * VERSION_MINOR = ZMQ_VERSION_MINOR
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_VERSION); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_VERSION, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":6
+ *
+ * VERSION = ZMQ_VERSION
+ * VERSION_MAJOR = ZMQ_VERSION_MAJOR # <<<<<<<<<<<<<<
+ * VERSION_MINOR = ZMQ_VERSION_MINOR
+ * VERSION_PATCH = ZMQ_VERSION_PATCH
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_VERSION_MAJOR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_VERSION_MAJOR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":7
+ * VERSION = ZMQ_VERSION
+ * VERSION_MAJOR = ZMQ_VERSION_MAJOR
+ * VERSION_MINOR = ZMQ_VERSION_MINOR # <<<<<<<<<<<<<<
+ * VERSION_PATCH = ZMQ_VERSION_PATCH
+ * NOBLOCK = ZMQ_NOBLOCK
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_VERSION_MINOR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_VERSION_MINOR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":8
+ * VERSION_MAJOR = ZMQ_VERSION_MAJOR
+ * VERSION_MINOR = ZMQ_VERSION_MINOR
+ * VERSION_PATCH = ZMQ_VERSION_PATCH # <<<<<<<<<<<<<<
+ * NOBLOCK = ZMQ_NOBLOCK
+ * DONTWAIT = ZMQ_DONTWAIT
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_VERSION_PATCH); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_VERSION_PATCH, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":9
+ * VERSION_MINOR = ZMQ_VERSION_MINOR
+ * VERSION_PATCH = ZMQ_VERSION_PATCH
+ * NOBLOCK = ZMQ_NOBLOCK # <<<<<<<<<<<<<<
+ * DONTWAIT = ZMQ_DONTWAIT
+ * POLLIN = ZMQ_POLLIN
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_NOBLOCK); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOBLOCK, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":10
+ * VERSION_PATCH = ZMQ_VERSION_PATCH
+ * NOBLOCK = ZMQ_NOBLOCK
+ * DONTWAIT = ZMQ_DONTWAIT # <<<<<<<<<<<<<<
+ * POLLIN = ZMQ_POLLIN
+ * POLLOUT = ZMQ_POLLOUT
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_DONTWAIT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_DONTWAIT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":11
+ * NOBLOCK = ZMQ_NOBLOCK
+ * DONTWAIT = ZMQ_DONTWAIT
+ * POLLIN = ZMQ_POLLIN # <<<<<<<<<<<<<<
+ * POLLOUT = ZMQ_POLLOUT
+ * POLLERR = ZMQ_POLLERR
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_POLLIN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_POLLIN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":12
+ * DONTWAIT = ZMQ_DONTWAIT
+ * POLLIN = ZMQ_POLLIN
+ * POLLOUT = ZMQ_POLLOUT # <<<<<<<<<<<<<<
+ * POLLERR = ZMQ_POLLERR
+ * SNDMORE = ZMQ_SNDMORE
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_POLLOUT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_POLLOUT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":13
+ * POLLIN = ZMQ_POLLIN
+ * POLLOUT = ZMQ_POLLOUT
+ * POLLERR = ZMQ_POLLERR # <<<<<<<<<<<<<<
+ * SNDMORE = ZMQ_SNDMORE
+ * STREAMER = ZMQ_STREAMER
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_POLLERR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_POLLERR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":14
+ * POLLOUT = ZMQ_POLLOUT
+ * POLLERR = ZMQ_POLLERR
+ * SNDMORE = ZMQ_SNDMORE # <<<<<<<<<<<<<<
+ * STREAMER = ZMQ_STREAMER
+ * FORWARDER = ZMQ_FORWARDER
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_SNDMORE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SNDMORE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":15
+ * POLLERR = ZMQ_POLLERR
+ * SNDMORE = ZMQ_SNDMORE
+ * STREAMER = ZMQ_STREAMER # <<<<<<<<<<<<<<
+ * FORWARDER = ZMQ_FORWARDER
+ * QUEUE = ZMQ_QUEUE
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_STREAMER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_STREAMER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":16
+ * SNDMORE = ZMQ_SNDMORE
+ * STREAMER = ZMQ_STREAMER
+ * FORWARDER = ZMQ_FORWARDER # <<<<<<<<<<<<<<
+ * QUEUE = ZMQ_QUEUE
+ * IO_THREADS_DFLT = ZMQ_IO_THREADS_DFLT
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_FORWARDER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORWARDER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":17
+ * STREAMER = ZMQ_STREAMER
+ * FORWARDER = ZMQ_FORWARDER
+ * QUEUE = ZMQ_QUEUE # <<<<<<<<<<<<<<
+ * IO_THREADS_DFLT = ZMQ_IO_THREADS_DFLT
+ * MAX_SOCKETS_DFLT = ZMQ_MAX_SOCKETS_DFLT
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_QUEUE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUEUE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":18
+ * FORWARDER = ZMQ_FORWARDER
+ * QUEUE = ZMQ_QUEUE
+ * IO_THREADS_DFLT = ZMQ_IO_THREADS_DFLT # <<<<<<<<<<<<<<
+ * MAX_SOCKETS_DFLT = ZMQ_MAX_SOCKETS_DFLT
+ * POLLITEMS_DFLT = ZMQ_POLLITEMS_DFLT
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_IO_THREADS_DFLT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_IO_THREADS_DFLT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":19
+ * QUEUE = ZMQ_QUEUE
+ * IO_THREADS_DFLT = ZMQ_IO_THREADS_DFLT
+ * MAX_SOCKETS_DFLT = ZMQ_MAX_SOCKETS_DFLT # <<<<<<<<<<<<<<
+ * POLLITEMS_DFLT = ZMQ_POLLITEMS_DFLT
+ * THREAD_PRIORITY_DFLT = ZMQ_THREAD_PRIORITY_DFLT
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_MAX_SOCKETS_DFLT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAX_SOCKETS_DFLT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":20
+ * IO_THREADS_DFLT = ZMQ_IO_THREADS_DFLT
+ * MAX_SOCKETS_DFLT = ZMQ_MAX_SOCKETS_DFLT
+ * POLLITEMS_DFLT = ZMQ_POLLITEMS_DFLT # <<<<<<<<<<<<<<
+ * THREAD_PRIORITY_DFLT = ZMQ_THREAD_PRIORITY_DFLT
+ * THREAD_SCHED_POLICY_DFLT = ZMQ_THREAD_SCHED_POLICY_DFLT
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_POLLITEMS_DFLT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_POLLITEMS_DFLT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":21
+ * MAX_SOCKETS_DFLT = ZMQ_MAX_SOCKETS_DFLT
+ * POLLITEMS_DFLT = ZMQ_POLLITEMS_DFLT
+ * THREAD_PRIORITY_DFLT = ZMQ_THREAD_PRIORITY_DFLT # <<<<<<<<<<<<<<
+ * THREAD_SCHED_POLICY_DFLT = ZMQ_THREAD_SCHED_POLICY_DFLT
+ * PAIR = ZMQ_PAIR
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_THREAD_PRIORITY_DFLT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_THREAD_PRIORITY_DFLT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":22
+ * POLLITEMS_DFLT = ZMQ_POLLITEMS_DFLT
+ * THREAD_PRIORITY_DFLT = ZMQ_THREAD_PRIORITY_DFLT
+ * THREAD_SCHED_POLICY_DFLT = ZMQ_THREAD_SCHED_POLICY_DFLT # <<<<<<<<<<<<<<
+ * PAIR = ZMQ_PAIR
+ * PUB = ZMQ_PUB
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_THREAD_SCHED_POLICY_DFLT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_THREAD_SCHED_POLICY_DFLT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":23
+ * THREAD_PRIORITY_DFLT = ZMQ_THREAD_PRIORITY_DFLT
+ * THREAD_SCHED_POLICY_DFLT = ZMQ_THREAD_SCHED_POLICY_DFLT
+ * PAIR = ZMQ_PAIR # <<<<<<<<<<<<<<
+ * PUB = ZMQ_PUB
+ * SUB = ZMQ_SUB
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_PAIR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_PAIR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":24
+ * THREAD_SCHED_POLICY_DFLT = ZMQ_THREAD_SCHED_POLICY_DFLT
+ * PAIR = ZMQ_PAIR
+ * PUB = ZMQ_PUB # <<<<<<<<<<<<<<
+ * SUB = ZMQ_SUB
+ * REQ = ZMQ_REQ
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_PUB); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_PUB, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":25
+ * PAIR = ZMQ_PAIR
+ * PUB = ZMQ_PUB
+ * SUB = ZMQ_SUB # <<<<<<<<<<<<<<
+ * REQ = ZMQ_REQ
+ * REP = ZMQ_REP
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_SUB); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SUB, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":26
+ * PUB = ZMQ_PUB
+ * SUB = ZMQ_SUB
+ * REQ = ZMQ_REQ # <<<<<<<<<<<<<<
+ * REP = ZMQ_REP
+ * DEALER = ZMQ_DEALER
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_REQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_REQ, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":27
+ * SUB = ZMQ_SUB
+ * REQ = ZMQ_REQ
+ * REP = ZMQ_REP # <<<<<<<<<<<<<<
+ * DEALER = ZMQ_DEALER
+ * ROUTER = ZMQ_ROUTER
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_REP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_REP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":28
+ * REQ = ZMQ_REQ
+ * REP = ZMQ_REP
+ * DEALER = ZMQ_DEALER # <<<<<<<<<<<<<<
+ * ROUTER = ZMQ_ROUTER
+ * XREQ = ZMQ_XREQ
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_DEALER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEALER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":29
+ * REP = ZMQ_REP
+ * DEALER = ZMQ_DEALER
+ * ROUTER = ZMQ_ROUTER # <<<<<<<<<<<<<<
+ * XREQ = ZMQ_XREQ
+ * XREP = ZMQ_XREP
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_ROUTER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ROUTER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":30
+ * DEALER = ZMQ_DEALER
+ * ROUTER = ZMQ_ROUTER
+ * XREQ = ZMQ_XREQ # <<<<<<<<<<<<<<
+ * XREP = ZMQ_XREP
+ * PULL = ZMQ_PULL
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_XREQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_XREQ, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":31
+ * ROUTER = ZMQ_ROUTER
+ * XREQ = ZMQ_XREQ
+ * XREP = ZMQ_XREP # <<<<<<<<<<<<<<
+ * PULL = ZMQ_PULL
+ * PUSH = ZMQ_PUSH
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_XREP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_XREP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":32
+ * XREQ = ZMQ_XREQ
+ * XREP = ZMQ_XREP
+ * PULL = ZMQ_PULL # <<<<<<<<<<<<<<
+ * PUSH = ZMQ_PUSH
+ * XPUB = ZMQ_XPUB
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_PULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_PULL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":33
+ * XREP = ZMQ_XREP
+ * PULL = ZMQ_PULL
+ * PUSH = ZMQ_PUSH # <<<<<<<<<<<<<<
+ * XPUB = ZMQ_XPUB
+ * XSUB = ZMQ_XSUB
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_PUSH); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_PUSH, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":34
+ * PULL = ZMQ_PULL
+ * PUSH = ZMQ_PUSH
+ * XPUB = ZMQ_XPUB # <<<<<<<<<<<<<<
+ * XSUB = ZMQ_XSUB
+ * UPSTREAM = ZMQ_UPSTREAM
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_XPUB); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_XPUB, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":35
+ * PUSH = ZMQ_PUSH
+ * XPUB = ZMQ_XPUB
+ * XSUB = ZMQ_XSUB # <<<<<<<<<<<<<<
+ * UPSTREAM = ZMQ_UPSTREAM
+ * DOWNSTREAM = ZMQ_DOWNSTREAM
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_XSUB); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_XSUB, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":36
+ * XPUB = ZMQ_XPUB
+ * XSUB = ZMQ_XSUB
+ * UPSTREAM = ZMQ_UPSTREAM # <<<<<<<<<<<<<<
+ * DOWNSTREAM = ZMQ_DOWNSTREAM
+ * STREAM = ZMQ_STREAM
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_UPSTREAM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_UPSTREAM, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":37
+ * XSUB = ZMQ_XSUB
+ * UPSTREAM = ZMQ_UPSTREAM
+ * DOWNSTREAM = ZMQ_DOWNSTREAM # <<<<<<<<<<<<<<
+ * STREAM = ZMQ_STREAM
+ * EVENT_CONNECTED = ZMQ_EVENT_CONNECTED
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_DOWNSTREAM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOWNSTREAM, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":38
+ * UPSTREAM = ZMQ_UPSTREAM
+ * DOWNSTREAM = ZMQ_DOWNSTREAM
+ * STREAM = ZMQ_STREAM # <<<<<<<<<<<<<<
+ * EVENT_CONNECTED = ZMQ_EVENT_CONNECTED
+ * EVENT_CONNECT_DELAYED = ZMQ_EVENT_CONNECT_DELAYED
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_STREAM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_STREAM, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":39
+ * DOWNSTREAM = ZMQ_DOWNSTREAM
+ * STREAM = ZMQ_STREAM
+ * EVENT_CONNECTED = ZMQ_EVENT_CONNECTED # <<<<<<<<<<<<<<
+ * EVENT_CONNECT_DELAYED = ZMQ_EVENT_CONNECT_DELAYED
+ * EVENT_CONNECT_RETRIED = ZMQ_EVENT_CONNECT_RETRIED
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_EVENT_CONNECTED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EVENT_CONNECTED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":40
+ * STREAM = ZMQ_STREAM
+ * EVENT_CONNECTED = ZMQ_EVENT_CONNECTED
+ * EVENT_CONNECT_DELAYED = ZMQ_EVENT_CONNECT_DELAYED # <<<<<<<<<<<<<<
+ * EVENT_CONNECT_RETRIED = ZMQ_EVENT_CONNECT_RETRIED
+ * EVENT_LISTENING = ZMQ_EVENT_LISTENING
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_EVENT_CONNECT_DELAYED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EVENT_CONNECT_DELAYED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":41
+ * EVENT_CONNECTED = ZMQ_EVENT_CONNECTED
+ * EVENT_CONNECT_DELAYED = ZMQ_EVENT_CONNECT_DELAYED
+ * EVENT_CONNECT_RETRIED = ZMQ_EVENT_CONNECT_RETRIED # <<<<<<<<<<<<<<
+ * EVENT_LISTENING = ZMQ_EVENT_LISTENING
+ * EVENT_BIND_FAILED = ZMQ_EVENT_BIND_FAILED
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_EVENT_CONNECT_RETRIED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EVENT_CONNECT_RETRIED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":42
+ * EVENT_CONNECT_DELAYED = ZMQ_EVENT_CONNECT_DELAYED
+ * EVENT_CONNECT_RETRIED = ZMQ_EVENT_CONNECT_RETRIED
+ * EVENT_LISTENING = ZMQ_EVENT_LISTENING # <<<<<<<<<<<<<<
+ * EVENT_BIND_FAILED = ZMQ_EVENT_BIND_FAILED
+ * EVENT_ACCEPTED = ZMQ_EVENT_ACCEPTED
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_EVENT_LISTENING); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EVENT_LISTENING, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":43
+ * EVENT_CONNECT_RETRIED = ZMQ_EVENT_CONNECT_RETRIED
+ * EVENT_LISTENING = ZMQ_EVENT_LISTENING
+ * EVENT_BIND_FAILED = ZMQ_EVENT_BIND_FAILED # <<<<<<<<<<<<<<
+ * EVENT_ACCEPTED = ZMQ_EVENT_ACCEPTED
+ * EVENT_ACCEPT_FAILED = ZMQ_EVENT_ACCEPT_FAILED
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_EVENT_BIND_FAILED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EVENT_BIND_FAILED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":44
+ * EVENT_LISTENING = ZMQ_EVENT_LISTENING
+ * EVENT_BIND_FAILED = ZMQ_EVENT_BIND_FAILED
+ * EVENT_ACCEPTED = ZMQ_EVENT_ACCEPTED # <<<<<<<<<<<<<<
+ * EVENT_ACCEPT_FAILED = ZMQ_EVENT_ACCEPT_FAILED
+ * EVENT_CLOSED = ZMQ_EVENT_CLOSED
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_EVENT_ACCEPTED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EVENT_ACCEPTED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":45
+ * EVENT_BIND_FAILED = ZMQ_EVENT_BIND_FAILED
+ * EVENT_ACCEPTED = ZMQ_EVENT_ACCEPTED
+ * EVENT_ACCEPT_FAILED = ZMQ_EVENT_ACCEPT_FAILED # <<<<<<<<<<<<<<
+ * EVENT_CLOSED = ZMQ_EVENT_CLOSED
+ * EVENT_CLOSE_FAILED = ZMQ_EVENT_CLOSE_FAILED
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_EVENT_ACCEPT_FAILED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EVENT_ACCEPT_FAILED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":46
+ * EVENT_ACCEPTED = ZMQ_EVENT_ACCEPTED
+ * EVENT_ACCEPT_FAILED = ZMQ_EVENT_ACCEPT_FAILED
+ * EVENT_CLOSED = ZMQ_EVENT_CLOSED # <<<<<<<<<<<<<<
+ * EVENT_CLOSE_FAILED = ZMQ_EVENT_CLOSE_FAILED
+ * EVENT_DISCONNECTED = ZMQ_EVENT_DISCONNECTED
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_EVENT_CLOSED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EVENT_CLOSED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":47
+ * EVENT_ACCEPT_FAILED = ZMQ_EVENT_ACCEPT_FAILED
+ * EVENT_CLOSED = ZMQ_EVENT_CLOSED
+ * EVENT_CLOSE_FAILED = ZMQ_EVENT_CLOSE_FAILED # <<<<<<<<<<<<<<
+ * EVENT_DISCONNECTED = ZMQ_EVENT_DISCONNECTED
+ * EVENT_ALL = ZMQ_EVENT_ALL
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_EVENT_CLOSE_FAILED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EVENT_CLOSE_FAILED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":48
+ * EVENT_CLOSED = ZMQ_EVENT_CLOSED
+ * EVENT_CLOSE_FAILED = ZMQ_EVENT_CLOSE_FAILED
+ * EVENT_DISCONNECTED = ZMQ_EVENT_DISCONNECTED # <<<<<<<<<<<<<<
+ * EVENT_ALL = ZMQ_EVENT_ALL
+ * EVENT_MONITOR_STOPPED = ZMQ_EVENT_MONITOR_STOPPED
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_EVENT_DISCONNECTED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EVENT_DISCONNECTED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":49
+ * EVENT_CLOSE_FAILED = ZMQ_EVENT_CLOSE_FAILED
+ * EVENT_DISCONNECTED = ZMQ_EVENT_DISCONNECTED
+ * EVENT_ALL = ZMQ_EVENT_ALL # <<<<<<<<<<<<<<
+ * EVENT_MONITOR_STOPPED = ZMQ_EVENT_MONITOR_STOPPED
+ * globals()['NULL'] = ZMQ_NULL
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_EVENT_ALL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EVENT_ALL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":50
+ * EVENT_DISCONNECTED = ZMQ_EVENT_DISCONNECTED
+ * EVENT_ALL = ZMQ_EVENT_ALL
+ * EVENT_MONITOR_STOPPED = ZMQ_EVENT_MONITOR_STOPPED # <<<<<<<<<<<<<<
+ * globals()['NULL'] = ZMQ_NULL
+ * PLAIN = ZMQ_PLAIN
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_EVENT_MONITOR_STOPPED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EVENT_MONITOR_STOPPED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":51
+ * EVENT_ALL = ZMQ_EVENT_ALL
+ * EVENT_MONITOR_STOPPED = ZMQ_EVENT_MONITOR_STOPPED
+ * globals()['NULL'] = ZMQ_NULL # <<<<<<<<<<<<<<
+ * PLAIN = ZMQ_PLAIN
+ * CURVE = ZMQ_CURVE
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_s_NULL, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":52
+ * EVENT_MONITOR_STOPPED = ZMQ_EVENT_MONITOR_STOPPED
+ * globals()['NULL'] = ZMQ_NULL
+ * PLAIN = ZMQ_PLAIN # <<<<<<<<<<<<<<
+ * CURVE = ZMQ_CURVE
+ * GSSAPI = ZMQ_GSSAPI
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_PLAIN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_PLAIN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":53
+ * globals()['NULL'] = ZMQ_NULL
+ * PLAIN = ZMQ_PLAIN
+ * CURVE = ZMQ_CURVE # <<<<<<<<<<<<<<
+ * GSSAPI = ZMQ_GSSAPI
+ * EAGAIN = ZMQ_EAGAIN
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_CURVE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_CURVE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":54
+ * PLAIN = ZMQ_PLAIN
+ * CURVE = ZMQ_CURVE
+ * GSSAPI = ZMQ_GSSAPI # <<<<<<<<<<<<<<
+ * EAGAIN = ZMQ_EAGAIN
+ * EINVAL = ZMQ_EINVAL
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_GSSAPI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_GSSAPI, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":55
+ * CURVE = ZMQ_CURVE
+ * GSSAPI = ZMQ_GSSAPI
+ * EAGAIN = ZMQ_EAGAIN # <<<<<<<<<<<<<<
+ * EINVAL = ZMQ_EINVAL
+ * EFAULT = ZMQ_EFAULT
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(EAGAIN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EAGAIN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":56
+ * GSSAPI = ZMQ_GSSAPI
+ * EAGAIN = ZMQ_EAGAIN
+ * EINVAL = ZMQ_EINVAL # <<<<<<<<<<<<<<
+ * EFAULT = ZMQ_EFAULT
+ * ENOMEM = ZMQ_ENOMEM
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(EINVAL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EINVAL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":57
+ * EAGAIN = ZMQ_EAGAIN
+ * EINVAL = ZMQ_EINVAL
+ * EFAULT = ZMQ_EFAULT # <<<<<<<<<<<<<<
+ * ENOMEM = ZMQ_ENOMEM
+ * ENODEV = ZMQ_ENODEV
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(EFAULT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EFAULT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":58
+ * EINVAL = ZMQ_EINVAL
+ * EFAULT = ZMQ_EFAULT
+ * ENOMEM = ZMQ_ENOMEM # <<<<<<<<<<<<<<
+ * ENODEV = ZMQ_ENODEV
+ * EMSGSIZE = ZMQ_EMSGSIZE
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ENOMEM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENOMEM, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":59
+ * EFAULT = ZMQ_EFAULT
+ * ENOMEM = ZMQ_ENOMEM
+ * ENODEV = ZMQ_ENODEV # <<<<<<<<<<<<<<
+ * EMSGSIZE = ZMQ_EMSGSIZE
+ * EAFNOSUPPORT = ZMQ_EAFNOSUPPORT
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ENODEV); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENODEV, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":60
+ * ENOMEM = ZMQ_ENOMEM
+ * ENODEV = ZMQ_ENODEV
+ * EMSGSIZE = ZMQ_EMSGSIZE # <<<<<<<<<<<<<<
+ * EAFNOSUPPORT = ZMQ_EAFNOSUPPORT
+ * ENETUNREACH = ZMQ_ENETUNREACH
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(EMSGSIZE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EMSGSIZE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":61
+ * ENODEV = ZMQ_ENODEV
+ * EMSGSIZE = ZMQ_EMSGSIZE
+ * EAFNOSUPPORT = ZMQ_EAFNOSUPPORT # <<<<<<<<<<<<<<
+ * ENETUNREACH = ZMQ_ENETUNREACH
+ * ECONNABORTED = ZMQ_ECONNABORTED
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(EAFNOSUPPORT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EAFNOSUPPORT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":62
+ * EMSGSIZE = ZMQ_EMSGSIZE
+ * EAFNOSUPPORT = ZMQ_EAFNOSUPPORT
+ * ENETUNREACH = ZMQ_ENETUNREACH # <<<<<<<<<<<<<<
+ * ECONNABORTED = ZMQ_ECONNABORTED
+ * ECONNRESET = ZMQ_ECONNRESET
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ENETUNREACH); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENETUNREACH, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":63
+ * EAFNOSUPPORT = ZMQ_EAFNOSUPPORT
+ * ENETUNREACH = ZMQ_ENETUNREACH
+ * ECONNABORTED = ZMQ_ECONNABORTED # <<<<<<<<<<<<<<
+ * ECONNRESET = ZMQ_ECONNRESET
+ * ENOTCONN = ZMQ_ENOTCONN
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ECONNABORTED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ECONNABORTED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":64
+ * ENETUNREACH = ZMQ_ENETUNREACH
+ * ECONNABORTED = ZMQ_ECONNABORTED
+ * ECONNRESET = ZMQ_ECONNRESET # <<<<<<<<<<<<<<
+ * ENOTCONN = ZMQ_ENOTCONN
+ * ETIMEDOUT = ZMQ_ETIMEDOUT
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ECONNRESET); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ECONNRESET, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":65
+ * ECONNABORTED = ZMQ_ECONNABORTED
+ * ECONNRESET = ZMQ_ECONNRESET
+ * ENOTCONN = ZMQ_ENOTCONN # <<<<<<<<<<<<<<
+ * ETIMEDOUT = ZMQ_ETIMEDOUT
+ * EHOSTUNREACH = ZMQ_EHOSTUNREACH
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ENOTCONN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENOTCONN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":66
+ * ECONNRESET = ZMQ_ECONNRESET
+ * ENOTCONN = ZMQ_ENOTCONN
+ * ETIMEDOUT = ZMQ_ETIMEDOUT # <<<<<<<<<<<<<<
+ * EHOSTUNREACH = ZMQ_EHOSTUNREACH
+ * ENETRESET = ZMQ_ENETRESET
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ETIMEDOUT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ETIMEDOUT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":67
+ * ENOTCONN = ZMQ_ENOTCONN
+ * ETIMEDOUT = ZMQ_ETIMEDOUT
+ * EHOSTUNREACH = ZMQ_EHOSTUNREACH # <<<<<<<<<<<<<<
+ * ENETRESET = ZMQ_ENETRESET
+ * HAUSNUMERO = ZMQ_HAUSNUMERO
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(EHOSTUNREACH); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EHOSTUNREACH, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":68
+ * ETIMEDOUT = ZMQ_ETIMEDOUT
+ * EHOSTUNREACH = ZMQ_EHOSTUNREACH
+ * ENETRESET = ZMQ_ENETRESET # <<<<<<<<<<<<<<
+ * HAUSNUMERO = ZMQ_HAUSNUMERO
+ * ENOTSUP = ZMQ_ENOTSUP
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ENETRESET); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENETRESET, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":69
+ * EHOSTUNREACH = ZMQ_EHOSTUNREACH
+ * ENETRESET = ZMQ_ENETRESET
+ * HAUSNUMERO = ZMQ_HAUSNUMERO # <<<<<<<<<<<<<<
+ * ENOTSUP = ZMQ_ENOTSUP
+ * EPROTONOSUPPORT = ZMQ_EPROTONOSUPPORT
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_HAUSNUMERO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_HAUSNUMERO, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":70
+ * ENETRESET = ZMQ_ENETRESET
+ * HAUSNUMERO = ZMQ_HAUSNUMERO
+ * ENOTSUP = ZMQ_ENOTSUP # <<<<<<<<<<<<<<
+ * EPROTONOSUPPORT = ZMQ_EPROTONOSUPPORT
+ * ENOBUFS = ZMQ_ENOBUFS
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ENOTSUP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENOTSUP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":71
+ * HAUSNUMERO = ZMQ_HAUSNUMERO
+ * ENOTSUP = ZMQ_ENOTSUP
+ * EPROTONOSUPPORT = ZMQ_EPROTONOSUPPORT # <<<<<<<<<<<<<<
+ * ENOBUFS = ZMQ_ENOBUFS
+ * ENETDOWN = ZMQ_ENETDOWN
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(EPROTONOSUPPORT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EPROTONOSUPPORT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":72
+ * ENOTSUP = ZMQ_ENOTSUP
+ * EPROTONOSUPPORT = ZMQ_EPROTONOSUPPORT
+ * ENOBUFS = ZMQ_ENOBUFS # <<<<<<<<<<<<<<
+ * ENETDOWN = ZMQ_ENETDOWN
+ * EADDRINUSE = ZMQ_EADDRINUSE
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ENOBUFS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENOBUFS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":73
+ * EPROTONOSUPPORT = ZMQ_EPROTONOSUPPORT
+ * ENOBUFS = ZMQ_ENOBUFS
+ * ENETDOWN = ZMQ_ENETDOWN # <<<<<<<<<<<<<<
+ * EADDRINUSE = ZMQ_EADDRINUSE
+ * EADDRNOTAVAIL = ZMQ_EADDRNOTAVAIL
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ENETDOWN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENETDOWN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":74
+ * ENOBUFS = ZMQ_ENOBUFS
+ * ENETDOWN = ZMQ_ENETDOWN
+ * EADDRINUSE = ZMQ_EADDRINUSE # <<<<<<<<<<<<<<
+ * EADDRNOTAVAIL = ZMQ_EADDRNOTAVAIL
+ * ECONNREFUSED = ZMQ_ECONNREFUSED
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(EADDRINUSE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EADDRINUSE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":75
+ * ENETDOWN = ZMQ_ENETDOWN
+ * EADDRINUSE = ZMQ_EADDRINUSE
+ * EADDRNOTAVAIL = ZMQ_EADDRNOTAVAIL # <<<<<<<<<<<<<<
+ * ECONNREFUSED = ZMQ_ECONNREFUSED
+ * EINPROGRESS = ZMQ_EINPROGRESS
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(EADDRNOTAVAIL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EADDRNOTAVAIL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":76
+ * EADDRINUSE = ZMQ_EADDRINUSE
+ * EADDRNOTAVAIL = ZMQ_EADDRNOTAVAIL
+ * ECONNREFUSED = ZMQ_ECONNREFUSED # <<<<<<<<<<<<<<
+ * EINPROGRESS = ZMQ_EINPROGRESS
+ * ENOTSOCK = ZMQ_ENOTSOCK
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ECONNREFUSED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ECONNREFUSED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":77
+ * EADDRNOTAVAIL = ZMQ_EADDRNOTAVAIL
+ * ECONNREFUSED = ZMQ_ECONNREFUSED
+ * EINPROGRESS = ZMQ_EINPROGRESS # <<<<<<<<<<<<<<
+ * ENOTSOCK = ZMQ_ENOTSOCK
+ * EFSM = ZMQ_EFSM
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(EINPROGRESS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EINPROGRESS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":78
+ * ECONNREFUSED = ZMQ_ECONNREFUSED
+ * EINPROGRESS = ZMQ_EINPROGRESS
+ * ENOTSOCK = ZMQ_ENOTSOCK # <<<<<<<<<<<<<<
+ * EFSM = ZMQ_EFSM
+ * ENOCOMPATPROTO = ZMQ_ENOCOMPATPROTO
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ENOTSOCK); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENOTSOCK, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":79
+ * EINPROGRESS = ZMQ_EINPROGRESS
+ * ENOTSOCK = ZMQ_ENOTSOCK
+ * EFSM = ZMQ_EFSM # <<<<<<<<<<<<<<
+ * ENOCOMPATPROTO = ZMQ_ENOCOMPATPROTO
+ * ETERM = ZMQ_ETERM
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(EFSM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EFSM, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":80
+ * ENOTSOCK = ZMQ_ENOTSOCK
+ * EFSM = ZMQ_EFSM
+ * ENOCOMPATPROTO = ZMQ_ENOCOMPATPROTO # <<<<<<<<<<<<<<
+ * ETERM = ZMQ_ETERM
+ * EMTHREAD = ZMQ_EMTHREAD
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ENOCOMPATPROTO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENOCOMPATPROTO, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":81
+ * EFSM = ZMQ_EFSM
+ * ENOCOMPATPROTO = ZMQ_ENOCOMPATPROTO
+ * ETERM = ZMQ_ETERM # <<<<<<<<<<<<<<
+ * EMTHREAD = ZMQ_EMTHREAD
+ * IO_THREADS = ZMQ_IO_THREADS
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ETERM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ETERM, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":82
+ * ENOCOMPATPROTO = ZMQ_ENOCOMPATPROTO
+ * ETERM = ZMQ_ETERM
+ * EMTHREAD = ZMQ_EMTHREAD # <<<<<<<<<<<<<<
+ * IO_THREADS = ZMQ_IO_THREADS
+ * MAX_SOCKETS = ZMQ_MAX_SOCKETS
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(EMTHREAD); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EMTHREAD, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":83
+ * ETERM = ZMQ_ETERM
+ * EMTHREAD = ZMQ_EMTHREAD
+ * IO_THREADS = ZMQ_IO_THREADS # <<<<<<<<<<<<<<
+ * MAX_SOCKETS = ZMQ_MAX_SOCKETS
+ * SOCKET_LIMIT = ZMQ_SOCKET_LIMIT
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_IO_THREADS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_IO_THREADS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":84
+ * EMTHREAD = ZMQ_EMTHREAD
+ * IO_THREADS = ZMQ_IO_THREADS
+ * MAX_SOCKETS = ZMQ_MAX_SOCKETS # <<<<<<<<<<<<<<
+ * SOCKET_LIMIT = ZMQ_SOCKET_LIMIT
+ * THREAD_PRIORITY = ZMQ_THREAD_PRIORITY
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_MAX_SOCKETS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAX_SOCKETS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":85
+ * IO_THREADS = ZMQ_IO_THREADS
+ * MAX_SOCKETS = ZMQ_MAX_SOCKETS
+ * SOCKET_LIMIT = ZMQ_SOCKET_LIMIT # <<<<<<<<<<<<<<
+ * THREAD_PRIORITY = ZMQ_THREAD_PRIORITY
+ * THREAD_SCHED_POLICY = ZMQ_THREAD_SCHED_POLICY
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_SOCKET_LIMIT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SOCKET_LIMIT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":86
+ * MAX_SOCKETS = ZMQ_MAX_SOCKETS
+ * SOCKET_LIMIT = ZMQ_SOCKET_LIMIT
+ * THREAD_PRIORITY = ZMQ_THREAD_PRIORITY # <<<<<<<<<<<<<<
+ * THREAD_SCHED_POLICY = ZMQ_THREAD_SCHED_POLICY
+ * IDENTITY = ZMQ_IDENTITY
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_THREAD_PRIORITY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_THREAD_PRIORITY, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":87
+ * SOCKET_LIMIT = ZMQ_SOCKET_LIMIT
+ * THREAD_PRIORITY = ZMQ_THREAD_PRIORITY
+ * THREAD_SCHED_POLICY = ZMQ_THREAD_SCHED_POLICY # <<<<<<<<<<<<<<
+ * IDENTITY = ZMQ_IDENTITY
+ * SUBSCRIBE = ZMQ_SUBSCRIBE
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_THREAD_SCHED_POLICY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_THREAD_SCHED_POLICY, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":88
+ * THREAD_PRIORITY = ZMQ_THREAD_PRIORITY
+ * THREAD_SCHED_POLICY = ZMQ_THREAD_SCHED_POLICY
+ * IDENTITY = ZMQ_IDENTITY # <<<<<<<<<<<<<<
+ * SUBSCRIBE = ZMQ_SUBSCRIBE
+ * UNSUBSCRIBE = ZMQ_UNSUBSCRIBE
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_IDENTITY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_IDENTITY, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":89
+ * THREAD_SCHED_POLICY = ZMQ_THREAD_SCHED_POLICY
+ * IDENTITY = ZMQ_IDENTITY
+ * SUBSCRIBE = ZMQ_SUBSCRIBE # <<<<<<<<<<<<<<
+ * UNSUBSCRIBE = ZMQ_UNSUBSCRIBE
+ * LAST_ENDPOINT = ZMQ_LAST_ENDPOINT
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_SUBSCRIBE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SUBSCRIBE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":90
+ * IDENTITY = ZMQ_IDENTITY
+ * SUBSCRIBE = ZMQ_SUBSCRIBE
+ * UNSUBSCRIBE = ZMQ_UNSUBSCRIBE # <<<<<<<<<<<<<<
+ * LAST_ENDPOINT = ZMQ_LAST_ENDPOINT
+ * TCP_ACCEPT_FILTER = ZMQ_TCP_ACCEPT_FILTER
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_UNSUBSCRIBE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNSUBSCRIBE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":91
+ * SUBSCRIBE = ZMQ_SUBSCRIBE
+ * UNSUBSCRIBE = ZMQ_UNSUBSCRIBE
+ * LAST_ENDPOINT = ZMQ_LAST_ENDPOINT # <<<<<<<<<<<<<<
+ * TCP_ACCEPT_FILTER = ZMQ_TCP_ACCEPT_FILTER
+ * PLAIN_USERNAME = ZMQ_PLAIN_USERNAME
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_LAST_ENDPOINT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_LAST_ENDPOINT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":92
+ * UNSUBSCRIBE = ZMQ_UNSUBSCRIBE
+ * LAST_ENDPOINT = ZMQ_LAST_ENDPOINT
+ * TCP_ACCEPT_FILTER = ZMQ_TCP_ACCEPT_FILTER # <<<<<<<<<<<<<<
+ * PLAIN_USERNAME = ZMQ_PLAIN_USERNAME
+ * PLAIN_PASSWORD = ZMQ_PLAIN_PASSWORD
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_TCP_ACCEPT_FILTER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_TCP_ACCEPT_FILTER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":93
+ * LAST_ENDPOINT = ZMQ_LAST_ENDPOINT
+ * TCP_ACCEPT_FILTER = ZMQ_TCP_ACCEPT_FILTER
+ * PLAIN_USERNAME = ZMQ_PLAIN_USERNAME # <<<<<<<<<<<<<<
+ * PLAIN_PASSWORD = ZMQ_PLAIN_PASSWORD
+ * CURVE_PUBLICKEY = ZMQ_CURVE_PUBLICKEY
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_PLAIN_USERNAME); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_PLAIN_USERNAME, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":94
+ * TCP_ACCEPT_FILTER = ZMQ_TCP_ACCEPT_FILTER
+ * PLAIN_USERNAME = ZMQ_PLAIN_USERNAME
+ * PLAIN_PASSWORD = ZMQ_PLAIN_PASSWORD # <<<<<<<<<<<<<<
+ * CURVE_PUBLICKEY = ZMQ_CURVE_PUBLICKEY
+ * CURVE_SECRETKEY = ZMQ_CURVE_SECRETKEY
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_PLAIN_PASSWORD); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_PLAIN_PASSWORD, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":95
+ * PLAIN_USERNAME = ZMQ_PLAIN_USERNAME
+ * PLAIN_PASSWORD = ZMQ_PLAIN_PASSWORD
+ * CURVE_PUBLICKEY = ZMQ_CURVE_PUBLICKEY # <<<<<<<<<<<<<<
+ * CURVE_SECRETKEY = ZMQ_CURVE_SECRETKEY
+ * CURVE_SERVERKEY = ZMQ_CURVE_SERVERKEY
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_CURVE_PUBLICKEY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_CURVE_PUBLICKEY, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":96
+ * PLAIN_PASSWORD = ZMQ_PLAIN_PASSWORD
+ * CURVE_PUBLICKEY = ZMQ_CURVE_PUBLICKEY
+ * CURVE_SECRETKEY = ZMQ_CURVE_SECRETKEY # <<<<<<<<<<<<<<
+ * CURVE_SERVERKEY = ZMQ_CURVE_SERVERKEY
+ * ZAP_DOMAIN = ZMQ_ZAP_DOMAIN
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_CURVE_SECRETKEY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_CURVE_SECRETKEY, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":97
+ * CURVE_PUBLICKEY = ZMQ_CURVE_PUBLICKEY
+ * CURVE_SECRETKEY = ZMQ_CURVE_SECRETKEY
+ * CURVE_SERVERKEY = ZMQ_CURVE_SERVERKEY # <<<<<<<<<<<<<<
+ * ZAP_DOMAIN = ZMQ_ZAP_DOMAIN
+ * CONNECT_RID = ZMQ_CONNECT_RID
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_CURVE_SERVERKEY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_CURVE_SERVERKEY, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":98
+ * CURVE_SECRETKEY = ZMQ_CURVE_SECRETKEY
+ * CURVE_SERVERKEY = ZMQ_CURVE_SERVERKEY
+ * ZAP_DOMAIN = ZMQ_ZAP_DOMAIN # <<<<<<<<<<<<<<
+ * CONNECT_RID = ZMQ_CONNECT_RID
+ * GSSAPI_PRINCIPAL = ZMQ_GSSAPI_PRINCIPAL
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_ZAP_DOMAIN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ZAP_DOMAIN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":99
+ * CURVE_SERVERKEY = ZMQ_CURVE_SERVERKEY
+ * ZAP_DOMAIN = ZMQ_ZAP_DOMAIN
+ * CONNECT_RID = ZMQ_CONNECT_RID # <<<<<<<<<<<<<<
+ * GSSAPI_PRINCIPAL = ZMQ_GSSAPI_PRINCIPAL
+ * GSSAPI_SERVICE_PRINCIPAL = ZMQ_GSSAPI_SERVICE_PRINCIPAL
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_CONNECT_RID); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONNECT_RID, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":100
+ * ZAP_DOMAIN = ZMQ_ZAP_DOMAIN
+ * CONNECT_RID = ZMQ_CONNECT_RID
+ * GSSAPI_PRINCIPAL = ZMQ_GSSAPI_PRINCIPAL # <<<<<<<<<<<<<<
+ * GSSAPI_SERVICE_PRINCIPAL = ZMQ_GSSAPI_SERVICE_PRINCIPAL
+ * SOCKS_PROXY = ZMQ_SOCKS_PROXY
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_GSSAPI_PRINCIPAL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_GSSAPI_PRINCIPAL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":101
+ * CONNECT_RID = ZMQ_CONNECT_RID
+ * GSSAPI_PRINCIPAL = ZMQ_GSSAPI_PRINCIPAL
+ * GSSAPI_SERVICE_PRINCIPAL = ZMQ_GSSAPI_SERVICE_PRINCIPAL # <<<<<<<<<<<<<<
+ * SOCKS_PROXY = ZMQ_SOCKS_PROXY
+ * FD = ZMQ_FD
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_GSSAPI_SERVICE_PRINCIPAL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_GSSAPI_SERVICE_PRINCIPAL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":102
+ * GSSAPI_PRINCIPAL = ZMQ_GSSAPI_PRINCIPAL
+ * GSSAPI_SERVICE_PRINCIPAL = ZMQ_GSSAPI_SERVICE_PRINCIPAL
+ * SOCKS_PROXY = ZMQ_SOCKS_PROXY # <<<<<<<<<<<<<<
+ * FD = ZMQ_FD
+ * IDENTITY_FD = ZMQ_IDENTITY_FD
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_SOCKS_PROXY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SOCKS_PROXY, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":103
+ * GSSAPI_SERVICE_PRINCIPAL = ZMQ_GSSAPI_SERVICE_PRINCIPAL
+ * SOCKS_PROXY = ZMQ_SOCKS_PROXY
+ * FD = ZMQ_FD # <<<<<<<<<<<<<<
+ * IDENTITY_FD = ZMQ_IDENTITY_FD
+ * RECONNECT_IVL_MAX = ZMQ_RECONNECT_IVL_MAX
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_FD); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FD, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":104
+ * SOCKS_PROXY = ZMQ_SOCKS_PROXY
+ * FD = ZMQ_FD
+ * IDENTITY_FD = ZMQ_IDENTITY_FD # <<<<<<<<<<<<<<
+ * RECONNECT_IVL_MAX = ZMQ_RECONNECT_IVL_MAX
+ * SNDTIMEO = ZMQ_SNDTIMEO
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_IDENTITY_FD); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_IDENTITY_FD, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":105
+ * FD = ZMQ_FD
+ * IDENTITY_FD = ZMQ_IDENTITY_FD
+ * RECONNECT_IVL_MAX = ZMQ_RECONNECT_IVL_MAX # <<<<<<<<<<<<<<
+ * SNDTIMEO = ZMQ_SNDTIMEO
+ * RCVTIMEO = ZMQ_RCVTIMEO
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_RECONNECT_IVL_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_RECONNECT_IVL_MAX, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":106
+ * IDENTITY_FD = ZMQ_IDENTITY_FD
+ * RECONNECT_IVL_MAX = ZMQ_RECONNECT_IVL_MAX
+ * SNDTIMEO = ZMQ_SNDTIMEO # <<<<<<<<<<<<<<
+ * RCVTIMEO = ZMQ_RCVTIMEO
+ * SNDHWM = ZMQ_SNDHWM
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_SNDTIMEO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SNDTIMEO, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":107
+ * RECONNECT_IVL_MAX = ZMQ_RECONNECT_IVL_MAX
+ * SNDTIMEO = ZMQ_SNDTIMEO
+ * RCVTIMEO = ZMQ_RCVTIMEO # <<<<<<<<<<<<<<
+ * SNDHWM = ZMQ_SNDHWM
+ * RCVHWM = ZMQ_RCVHWM
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_RCVTIMEO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_RCVTIMEO, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":108
+ * SNDTIMEO = ZMQ_SNDTIMEO
+ * RCVTIMEO = ZMQ_RCVTIMEO
+ * SNDHWM = ZMQ_SNDHWM # <<<<<<<<<<<<<<
+ * RCVHWM = ZMQ_RCVHWM
+ * MULTICAST_HOPS = ZMQ_MULTICAST_HOPS
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_SNDHWM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SNDHWM, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":109
+ * RCVTIMEO = ZMQ_RCVTIMEO
+ * SNDHWM = ZMQ_SNDHWM
+ * RCVHWM = ZMQ_RCVHWM # <<<<<<<<<<<<<<
+ * MULTICAST_HOPS = ZMQ_MULTICAST_HOPS
+ * IPV4ONLY = ZMQ_IPV4ONLY
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_RCVHWM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_RCVHWM, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":110
+ * SNDHWM = ZMQ_SNDHWM
+ * RCVHWM = ZMQ_RCVHWM
+ * MULTICAST_HOPS = ZMQ_MULTICAST_HOPS # <<<<<<<<<<<<<<
+ * IPV4ONLY = ZMQ_IPV4ONLY
+ * ROUTER_BEHAVIOR = ZMQ_ROUTER_BEHAVIOR
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_MULTICAST_HOPS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_MULTICAST_HOPS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":111
+ * RCVHWM = ZMQ_RCVHWM
+ * MULTICAST_HOPS = ZMQ_MULTICAST_HOPS
+ * IPV4ONLY = ZMQ_IPV4ONLY # <<<<<<<<<<<<<<
+ * ROUTER_BEHAVIOR = ZMQ_ROUTER_BEHAVIOR
+ * TCP_KEEPALIVE = ZMQ_TCP_KEEPALIVE
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_IPV4ONLY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_IPV4ONLY, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":112
+ * MULTICAST_HOPS = ZMQ_MULTICAST_HOPS
+ * IPV4ONLY = ZMQ_IPV4ONLY
+ * ROUTER_BEHAVIOR = ZMQ_ROUTER_BEHAVIOR # <<<<<<<<<<<<<<
+ * TCP_KEEPALIVE = ZMQ_TCP_KEEPALIVE
+ * TCP_KEEPALIVE_CNT = ZMQ_TCP_KEEPALIVE_CNT
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_ROUTER_BEHAVIOR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ROUTER_BEHAVIOR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":113
+ * IPV4ONLY = ZMQ_IPV4ONLY
+ * ROUTER_BEHAVIOR = ZMQ_ROUTER_BEHAVIOR
+ * TCP_KEEPALIVE = ZMQ_TCP_KEEPALIVE # <<<<<<<<<<<<<<
+ * TCP_KEEPALIVE_CNT = ZMQ_TCP_KEEPALIVE_CNT
+ * TCP_KEEPALIVE_IDLE = ZMQ_TCP_KEEPALIVE_IDLE
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_TCP_KEEPALIVE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_TCP_KEEPALIVE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":114
+ * ROUTER_BEHAVIOR = ZMQ_ROUTER_BEHAVIOR
+ * TCP_KEEPALIVE = ZMQ_TCP_KEEPALIVE
+ * TCP_KEEPALIVE_CNT = ZMQ_TCP_KEEPALIVE_CNT # <<<<<<<<<<<<<<
+ * TCP_KEEPALIVE_IDLE = ZMQ_TCP_KEEPALIVE_IDLE
+ * TCP_KEEPALIVE_INTVL = ZMQ_TCP_KEEPALIVE_INTVL
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_TCP_KEEPALIVE_CNT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_TCP_KEEPALIVE_CNT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":115
+ * TCP_KEEPALIVE = ZMQ_TCP_KEEPALIVE
+ * TCP_KEEPALIVE_CNT = ZMQ_TCP_KEEPALIVE_CNT
+ * TCP_KEEPALIVE_IDLE = ZMQ_TCP_KEEPALIVE_IDLE # <<<<<<<<<<<<<<
+ * TCP_KEEPALIVE_INTVL = ZMQ_TCP_KEEPALIVE_INTVL
+ * DELAY_ATTACH_ON_CONNECT = ZMQ_DELAY_ATTACH_ON_CONNECT
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_TCP_KEEPALIVE_IDLE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_TCP_KEEPALIVE_IDLE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":116
+ * TCP_KEEPALIVE_CNT = ZMQ_TCP_KEEPALIVE_CNT
+ * TCP_KEEPALIVE_IDLE = ZMQ_TCP_KEEPALIVE_IDLE
+ * TCP_KEEPALIVE_INTVL = ZMQ_TCP_KEEPALIVE_INTVL # <<<<<<<<<<<<<<
+ * DELAY_ATTACH_ON_CONNECT = ZMQ_DELAY_ATTACH_ON_CONNECT
+ * XPUB_VERBOSE = ZMQ_XPUB_VERBOSE
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_TCP_KEEPALIVE_INTVL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_TCP_KEEPALIVE_INTVL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":117
+ * TCP_KEEPALIVE_IDLE = ZMQ_TCP_KEEPALIVE_IDLE
+ * TCP_KEEPALIVE_INTVL = ZMQ_TCP_KEEPALIVE_INTVL
+ * DELAY_ATTACH_ON_CONNECT = ZMQ_DELAY_ATTACH_ON_CONNECT # <<<<<<<<<<<<<<
+ * XPUB_VERBOSE = ZMQ_XPUB_VERBOSE
+ * EVENTS = ZMQ_EVENTS
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_DELAY_ATTACH_ON_CONNECT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELAY_ATTACH_ON_CONNECT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":118
+ * TCP_KEEPALIVE_INTVL = ZMQ_TCP_KEEPALIVE_INTVL
+ * DELAY_ATTACH_ON_CONNECT = ZMQ_DELAY_ATTACH_ON_CONNECT
+ * XPUB_VERBOSE = ZMQ_XPUB_VERBOSE # <<<<<<<<<<<<<<
+ * EVENTS = ZMQ_EVENTS
+ * TYPE = ZMQ_TYPE
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_XPUB_VERBOSE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_XPUB_VERBOSE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":119
+ * DELAY_ATTACH_ON_CONNECT = ZMQ_DELAY_ATTACH_ON_CONNECT
+ * XPUB_VERBOSE = ZMQ_XPUB_VERBOSE
+ * EVENTS = ZMQ_EVENTS # <<<<<<<<<<<<<<
+ * TYPE = ZMQ_TYPE
+ * LINGER = ZMQ_LINGER
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_EVENTS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EVENTS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":120
+ * XPUB_VERBOSE = ZMQ_XPUB_VERBOSE
+ * EVENTS = ZMQ_EVENTS
+ * TYPE = ZMQ_TYPE # <<<<<<<<<<<<<<
+ * LINGER = ZMQ_LINGER
+ * RECONNECT_IVL = ZMQ_RECONNECT_IVL
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_TYPE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_TYPE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":121
+ * EVENTS = ZMQ_EVENTS
+ * TYPE = ZMQ_TYPE
+ * LINGER = ZMQ_LINGER # <<<<<<<<<<<<<<
+ * RECONNECT_IVL = ZMQ_RECONNECT_IVL
+ * BACKLOG = ZMQ_BACKLOG
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_LINGER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_LINGER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":122
+ * TYPE = ZMQ_TYPE
+ * LINGER = ZMQ_LINGER
+ * RECONNECT_IVL = ZMQ_RECONNECT_IVL # <<<<<<<<<<<<<<
+ * BACKLOG = ZMQ_BACKLOG
+ * ROUTER_MANDATORY = ZMQ_ROUTER_MANDATORY
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_RECONNECT_IVL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_RECONNECT_IVL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":123
+ * LINGER = ZMQ_LINGER
+ * RECONNECT_IVL = ZMQ_RECONNECT_IVL
+ * BACKLOG = ZMQ_BACKLOG # <<<<<<<<<<<<<<
+ * ROUTER_MANDATORY = ZMQ_ROUTER_MANDATORY
+ * FAIL_UNROUTABLE = ZMQ_FAIL_UNROUTABLE
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_BACKLOG); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKLOG, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":124
+ * RECONNECT_IVL = ZMQ_RECONNECT_IVL
+ * BACKLOG = ZMQ_BACKLOG
+ * ROUTER_MANDATORY = ZMQ_ROUTER_MANDATORY # <<<<<<<<<<<<<<
+ * FAIL_UNROUTABLE = ZMQ_FAIL_UNROUTABLE
+ * ROUTER_RAW = ZMQ_ROUTER_RAW
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_ROUTER_MANDATORY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ROUTER_MANDATORY, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":125
+ * BACKLOG = ZMQ_BACKLOG
+ * ROUTER_MANDATORY = ZMQ_ROUTER_MANDATORY
+ * FAIL_UNROUTABLE = ZMQ_FAIL_UNROUTABLE # <<<<<<<<<<<<<<
+ * ROUTER_RAW = ZMQ_ROUTER_RAW
+ * IMMEDIATE = ZMQ_IMMEDIATE
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_FAIL_UNROUTABLE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FAIL_UNROUTABLE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":126
+ * ROUTER_MANDATORY = ZMQ_ROUTER_MANDATORY
+ * FAIL_UNROUTABLE = ZMQ_FAIL_UNROUTABLE
+ * ROUTER_RAW = ZMQ_ROUTER_RAW # <<<<<<<<<<<<<<
+ * IMMEDIATE = ZMQ_IMMEDIATE
+ * IPV6 = ZMQ_IPV6
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_ROUTER_RAW); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ROUTER_RAW, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":127
+ * FAIL_UNROUTABLE = ZMQ_FAIL_UNROUTABLE
+ * ROUTER_RAW = ZMQ_ROUTER_RAW
+ * IMMEDIATE = ZMQ_IMMEDIATE # <<<<<<<<<<<<<<
+ * IPV6 = ZMQ_IPV6
+ * MECHANISM = ZMQ_MECHANISM
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_IMMEDIATE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_IMMEDIATE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":128
+ * ROUTER_RAW = ZMQ_ROUTER_RAW
+ * IMMEDIATE = ZMQ_IMMEDIATE
+ * IPV6 = ZMQ_IPV6 # <<<<<<<<<<<<<<
+ * MECHANISM = ZMQ_MECHANISM
+ * PLAIN_SERVER = ZMQ_PLAIN_SERVER
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_IPV6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_IPV6, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":129
+ * IMMEDIATE = ZMQ_IMMEDIATE
+ * IPV6 = ZMQ_IPV6
+ * MECHANISM = ZMQ_MECHANISM # <<<<<<<<<<<<<<
+ * PLAIN_SERVER = ZMQ_PLAIN_SERVER
+ * CURVE_SERVER = ZMQ_CURVE_SERVER
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_MECHANISM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_MECHANISM, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":130
+ * IPV6 = ZMQ_IPV6
+ * MECHANISM = ZMQ_MECHANISM
+ * PLAIN_SERVER = ZMQ_PLAIN_SERVER # <<<<<<<<<<<<<<
+ * CURVE_SERVER = ZMQ_CURVE_SERVER
+ * PROBE_ROUTER = ZMQ_PROBE_ROUTER
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_PLAIN_SERVER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_PLAIN_SERVER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":131
+ * MECHANISM = ZMQ_MECHANISM
+ * PLAIN_SERVER = ZMQ_PLAIN_SERVER
+ * CURVE_SERVER = ZMQ_CURVE_SERVER # <<<<<<<<<<<<<<
+ * PROBE_ROUTER = ZMQ_PROBE_ROUTER
+ * REQ_RELAXED = ZMQ_REQ_RELAXED
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_CURVE_SERVER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_CURVE_SERVER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":132
+ * PLAIN_SERVER = ZMQ_PLAIN_SERVER
+ * CURVE_SERVER = ZMQ_CURVE_SERVER
+ * PROBE_ROUTER = ZMQ_PROBE_ROUTER # <<<<<<<<<<<<<<
+ * REQ_RELAXED = ZMQ_REQ_RELAXED
+ * REQ_CORRELATE = ZMQ_REQ_CORRELATE
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_PROBE_ROUTER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_PROBE_ROUTER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":133
+ * CURVE_SERVER = ZMQ_CURVE_SERVER
+ * PROBE_ROUTER = ZMQ_PROBE_ROUTER
+ * REQ_RELAXED = ZMQ_REQ_RELAXED # <<<<<<<<<<<<<<
+ * REQ_CORRELATE = ZMQ_REQ_CORRELATE
+ * CONFLATE = ZMQ_CONFLATE
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_REQ_RELAXED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_REQ_RELAXED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":134
+ * PROBE_ROUTER = ZMQ_PROBE_ROUTER
+ * REQ_RELAXED = ZMQ_REQ_RELAXED
+ * REQ_CORRELATE = ZMQ_REQ_CORRELATE # <<<<<<<<<<<<<<
+ * CONFLATE = ZMQ_CONFLATE
+ * ROUTER_HANDOVER = ZMQ_ROUTER_HANDOVER
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_REQ_CORRELATE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_REQ_CORRELATE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":135
+ * REQ_RELAXED = ZMQ_REQ_RELAXED
+ * REQ_CORRELATE = ZMQ_REQ_CORRELATE
+ * CONFLATE = ZMQ_CONFLATE # <<<<<<<<<<<<<<
+ * ROUTER_HANDOVER = ZMQ_ROUTER_HANDOVER
+ * TOS = ZMQ_TOS
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_CONFLATE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONFLATE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":136
+ * REQ_CORRELATE = ZMQ_REQ_CORRELATE
+ * CONFLATE = ZMQ_CONFLATE
+ * ROUTER_HANDOVER = ZMQ_ROUTER_HANDOVER # <<<<<<<<<<<<<<
+ * TOS = ZMQ_TOS
+ * IPC_FILTER_PID = ZMQ_IPC_FILTER_PID
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_ROUTER_HANDOVER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ROUTER_HANDOVER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":137
+ * CONFLATE = ZMQ_CONFLATE
+ * ROUTER_HANDOVER = ZMQ_ROUTER_HANDOVER
+ * TOS = ZMQ_TOS # <<<<<<<<<<<<<<
+ * IPC_FILTER_PID = ZMQ_IPC_FILTER_PID
+ * IPC_FILTER_UID = ZMQ_IPC_FILTER_UID
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_TOS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_TOS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":138
+ * ROUTER_HANDOVER = ZMQ_ROUTER_HANDOVER
+ * TOS = ZMQ_TOS
+ * IPC_FILTER_PID = ZMQ_IPC_FILTER_PID # <<<<<<<<<<<<<<
+ * IPC_FILTER_UID = ZMQ_IPC_FILTER_UID
+ * IPC_FILTER_GID = ZMQ_IPC_FILTER_GID
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_IPC_FILTER_PID); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_IPC_FILTER_PID, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":139
+ * TOS = ZMQ_TOS
+ * IPC_FILTER_PID = ZMQ_IPC_FILTER_PID
+ * IPC_FILTER_UID = ZMQ_IPC_FILTER_UID # <<<<<<<<<<<<<<
+ * IPC_FILTER_GID = ZMQ_IPC_FILTER_GID
+ * GSSAPI_SERVER = ZMQ_GSSAPI_SERVER
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_IPC_FILTER_UID); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_IPC_FILTER_UID, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":140
+ * IPC_FILTER_PID = ZMQ_IPC_FILTER_PID
+ * IPC_FILTER_UID = ZMQ_IPC_FILTER_UID
+ * IPC_FILTER_GID = ZMQ_IPC_FILTER_GID # <<<<<<<<<<<<<<
+ * GSSAPI_SERVER = ZMQ_GSSAPI_SERVER
+ * GSSAPI_PLAINTEXT = ZMQ_GSSAPI_PLAINTEXT
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_IPC_FILTER_GID); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_IPC_FILTER_GID, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":141
+ * IPC_FILTER_UID = ZMQ_IPC_FILTER_UID
+ * IPC_FILTER_GID = ZMQ_IPC_FILTER_GID
+ * GSSAPI_SERVER = ZMQ_GSSAPI_SERVER # <<<<<<<<<<<<<<
+ * GSSAPI_PLAINTEXT = ZMQ_GSSAPI_PLAINTEXT
+ * HANDSHAKE_IVL = ZMQ_HANDSHAKE_IVL
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_GSSAPI_SERVER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_GSSAPI_SERVER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":142
+ * IPC_FILTER_GID = ZMQ_IPC_FILTER_GID
+ * GSSAPI_SERVER = ZMQ_GSSAPI_SERVER
+ * GSSAPI_PLAINTEXT = ZMQ_GSSAPI_PLAINTEXT # <<<<<<<<<<<<<<
+ * HANDSHAKE_IVL = ZMQ_HANDSHAKE_IVL
+ * XPUB_NODROP = ZMQ_XPUB_NODROP
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_GSSAPI_PLAINTEXT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_GSSAPI_PLAINTEXT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":143
+ * GSSAPI_SERVER = ZMQ_GSSAPI_SERVER
+ * GSSAPI_PLAINTEXT = ZMQ_GSSAPI_PLAINTEXT
+ * HANDSHAKE_IVL = ZMQ_HANDSHAKE_IVL # <<<<<<<<<<<<<<
+ * XPUB_NODROP = ZMQ_XPUB_NODROP
+ * AFFINITY = ZMQ_AFFINITY
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_HANDSHAKE_IVL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_HANDSHAKE_IVL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":144
+ * GSSAPI_PLAINTEXT = ZMQ_GSSAPI_PLAINTEXT
+ * HANDSHAKE_IVL = ZMQ_HANDSHAKE_IVL
+ * XPUB_NODROP = ZMQ_XPUB_NODROP # <<<<<<<<<<<<<<
+ * AFFINITY = ZMQ_AFFINITY
+ * MAXMSGSIZE = ZMQ_MAXMSGSIZE
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_XPUB_NODROP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_XPUB_NODROP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":145
+ * HANDSHAKE_IVL = ZMQ_HANDSHAKE_IVL
+ * XPUB_NODROP = ZMQ_XPUB_NODROP
+ * AFFINITY = ZMQ_AFFINITY # <<<<<<<<<<<<<<
+ * MAXMSGSIZE = ZMQ_MAXMSGSIZE
+ * HWM = ZMQ_HWM
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_AFFINITY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_AFFINITY, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":146
+ * XPUB_NODROP = ZMQ_XPUB_NODROP
+ * AFFINITY = ZMQ_AFFINITY
+ * MAXMSGSIZE = ZMQ_MAXMSGSIZE # <<<<<<<<<<<<<<
+ * HWM = ZMQ_HWM
+ * SWAP = ZMQ_SWAP
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_MAXMSGSIZE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAXMSGSIZE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":147
+ * AFFINITY = ZMQ_AFFINITY
+ * MAXMSGSIZE = ZMQ_MAXMSGSIZE
+ * HWM = ZMQ_HWM # <<<<<<<<<<<<<<
+ * SWAP = ZMQ_SWAP
+ * MCAST_LOOP = ZMQ_MCAST_LOOP
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_HWM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_HWM, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":148
+ * MAXMSGSIZE = ZMQ_MAXMSGSIZE
+ * HWM = ZMQ_HWM
+ * SWAP = ZMQ_SWAP # <<<<<<<<<<<<<<
+ * MCAST_LOOP = ZMQ_MCAST_LOOP
+ * RECOVERY_IVL_MSEC = ZMQ_RECOVERY_IVL_MSEC
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_SWAP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SWAP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":149
+ * HWM = ZMQ_HWM
+ * SWAP = ZMQ_SWAP
+ * MCAST_LOOP = ZMQ_MCAST_LOOP # <<<<<<<<<<<<<<
+ * RECOVERY_IVL_MSEC = ZMQ_RECOVERY_IVL_MSEC
+ * RATE = ZMQ_RATE
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_MCAST_LOOP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_MCAST_LOOP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":150
+ * SWAP = ZMQ_SWAP
+ * MCAST_LOOP = ZMQ_MCAST_LOOP
+ * RECOVERY_IVL_MSEC = ZMQ_RECOVERY_IVL_MSEC # <<<<<<<<<<<<<<
+ * RATE = ZMQ_RATE
+ * RECOVERY_IVL = ZMQ_RECOVERY_IVL
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_RECOVERY_IVL_MSEC); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_RECOVERY_IVL_MSEC, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":151
+ * MCAST_LOOP = ZMQ_MCAST_LOOP
+ * RECOVERY_IVL_MSEC = ZMQ_RECOVERY_IVL_MSEC
+ * RATE = ZMQ_RATE # <<<<<<<<<<<<<<
+ * RECOVERY_IVL = ZMQ_RECOVERY_IVL
+ * SNDBUF = ZMQ_SNDBUF
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_RATE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_RATE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":152
+ * RECOVERY_IVL_MSEC = ZMQ_RECOVERY_IVL_MSEC
+ * RATE = ZMQ_RATE
+ * RECOVERY_IVL = ZMQ_RECOVERY_IVL # <<<<<<<<<<<<<<
+ * SNDBUF = ZMQ_SNDBUF
+ * RCVBUF = ZMQ_RCVBUF
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_RECOVERY_IVL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_RECOVERY_IVL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":153
+ * RATE = ZMQ_RATE
+ * RECOVERY_IVL = ZMQ_RECOVERY_IVL
+ * SNDBUF = ZMQ_SNDBUF # <<<<<<<<<<<<<<
+ * RCVBUF = ZMQ_RCVBUF
+ * RCVMORE = ZMQ_RCVMORE
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_SNDBUF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SNDBUF, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":154
+ * RECOVERY_IVL = ZMQ_RECOVERY_IVL
+ * SNDBUF = ZMQ_SNDBUF
+ * RCVBUF = ZMQ_RCVBUF # <<<<<<<<<<<<<<
+ * RCVMORE = ZMQ_RCVMORE
+ * MORE = ZMQ_MORE
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_RCVBUF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_RCVBUF, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":155
+ * SNDBUF = ZMQ_SNDBUF
+ * RCVBUF = ZMQ_RCVBUF
+ * RCVMORE = ZMQ_RCVMORE # <<<<<<<<<<<<<<
+ * MORE = ZMQ_MORE
+ * SRCFD = ZMQ_SRCFD
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_RCVMORE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_RCVMORE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":156
+ * RCVBUF = ZMQ_RCVBUF
+ * RCVMORE = ZMQ_RCVMORE
+ * MORE = ZMQ_MORE # <<<<<<<<<<<<<<
+ * SRCFD = ZMQ_SRCFD
+ * SHARED = ZMQ_SHARED
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_MORE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_MORE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":157
+ * RCVMORE = ZMQ_RCVMORE
+ * MORE = ZMQ_MORE
+ * SRCFD = ZMQ_SRCFD # <<<<<<<<<<<<<<
+ * SHARED = ZMQ_SHARED
+ *
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_SRCFD); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SRCFD, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":158
+ * MORE = ZMQ_MORE
+ * SRCFD = ZMQ_SRCFD
+ * SHARED = ZMQ_SHARED # <<<<<<<<<<<<<<
+ *
+ * #-----------------------------------------------------------------------------
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(ZMQ_SHARED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SHARED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pxi":163
+ * # Symbols to export
+ * #-----------------------------------------------------------------------------
+ * __all__ = [ # <<<<<<<<<<<<<<
+ * "VERSION",
+ * "VERSION_MAJOR",
+ */
+ __pyx_t_1 = PyList_New(154); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_s_VERSION);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_VERSION);
+ __Pyx_GIVEREF(__pyx_n_s_VERSION);
+ __Pyx_INCREF(__pyx_n_s_VERSION_MAJOR);
+ PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_VERSION_MAJOR);
+ __Pyx_GIVEREF(__pyx_n_s_VERSION_MAJOR);
+ __Pyx_INCREF(__pyx_n_s_VERSION_MINOR);
+ PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_VERSION_MINOR);
+ __Pyx_GIVEREF(__pyx_n_s_VERSION_MINOR);
+ __Pyx_INCREF(__pyx_n_s_VERSION_PATCH);
+ PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_VERSION_PATCH);
+ __Pyx_GIVEREF(__pyx_n_s_VERSION_PATCH);
+ __Pyx_INCREF(__pyx_n_s_NOBLOCK);
+ PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_NOBLOCK);
+ __Pyx_GIVEREF(__pyx_n_s_NOBLOCK);
+ __Pyx_INCREF(__pyx_n_s_DONTWAIT);
+ PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_DONTWAIT);
+ __Pyx_GIVEREF(__pyx_n_s_DONTWAIT);
+ __Pyx_INCREF(__pyx_n_s_POLLIN);
+ PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_POLLIN);
+ __Pyx_GIVEREF(__pyx_n_s_POLLIN);
+ __Pyx_INCREF(__pyx_n_s_POLLOUT);
+ PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_s_POLLOUT);
+ __Pyx_GIVEREF(__pyx_n_s_POLLOUT);
+ __Pyx_INCREF(__pyx_n_s_POLLERR);
+ PyList_SET_ITEM(__pyx_t_1, 8, __pyx_n_s_POLLERR);
+ __Pyx_GIVEREF(__pyx_n_s_POLLERR);
+ __Pyx_INCREF(__pyx_n_s_SNDMORE);
+ PyList_SET_ITEM(__pyx_t_1, 9, __pyx_n_s_SNDMORE);
+ __Pyx_GIVEREF(__pyx_n_s_SNDMORE);
+ __Pyx_INCREF(__pyx_n_s_STREAMER);
+ PyList_SET_ITEM(__pyx_t_1, 10, __pyx_n_s_STREAMER);
+ __Pyx_GIVEREF(__pyx_n_s_STREAMER);
+ __Pyx_INCREF(__pyx_n_s_FORWARDER);
+ PyList_SET_ITEM(__pyx_t_1, 11, __pyx_n_s_FORWARDER);
+ __Pyx_GIVEREF(__pyx_n_s_FORWARDER);
+ __Pyx_INCREF(__pyx_n_s_QUEUE);
+ PyList_SET_ITEM(__pyx_t_1, 12, __pyx_n_s_QUEUE);
+ __Pyx_GIVEREF(__pyx_n_s_QUEUE);
+ __Pyx_INCREF(__pyx_n_s_IO_THREADS_DFLT);
+ PyList_SET_ITEM(__pyx_t_1, 13, __pyx_n_s_IO_THREADS_DFLT);
+ __Pyx_GIVEREF(__pyx_n_s_IO_THREADS_DFLT);
+ __Pyx_INCREF(__pyx_n_s_MAX_SOCKETS_DFLT);
+ PyList_SET_ITEM(__pyx_t_1, 14, __pyx_n_s_MAX_SOCKETS_DFLT);
+ __Pyx_GIVEREF(__pyx_n_s_MAX_SOCKETS_DFLT);
+ __Pyx_INCREF(__pyx_n_s_POLLITEMS_DFLT);
+ PyList_SET_ITEM(__pyx_t_1, 15, __pyx_n_s_POLLITEMS_DFLT);
+ __Pyx_GIVEREF(__pyx_n_s_POLLITEMS_DFLT);
+ __Pyx_INCREF(__pyx_n_s_THREAD_PRIORITY_DFLT);
+ PyList_SET_ITEM(__pyx_t_1, 16, __pyx_n_s_THREAD_PRIORITY_DFLT);
+ __Pyx_GIVEREF(__pyx_n_s_THREAD_PRIORITY_DFLT);
+ __Pyx_INCREF(__pyx_n_s_THREAD_SCHED_POLICY_DFLT);
+ PyList_SET_ITEM(__pyx_t_1, 17, __pyx_n_s_THREAD_SCHED_POLICY_DFLT);
+ __Pyx_GIVEREF(__pyx_n_s_THREAD_SCHED_POLICY_DFLT);
+ __Pyx_INCREF(__pyx_n_s_PAIR);
+ PyList_SET_ITEM(__pyx_t_1, 18, __pyx_n_s_PAIR);
+ __Pyx_GIVEREF(__pyx_n_s_PAIR);
+ __Pyx_INCREF(__pyx_n_s_PUB);
+ PyList_SET_ITEM(__pyx_t_1, 19, __pyx_n_s_PUB);
+ __Pyx_GIVEREF(__pyx_n_s_PUB);
+ __Pyx_INCREF(__pyx_n_s_SUB);
+ PyList_SET_ITEM(__pyx_t_1, 20, __pyx_n_s_SUB);
+ __Pyx_GIVEREF(__pyx_n_s_SUB);
+ __Pyx_INCREF(__pyx_n_s_REQ);
+ PyList_SET_ITEM(__pyx_t_1, 21, __pyx_n_s_REQ);
+ __Pyx_GIVEREF(__pyx_n_s_REQ);
+ __Pyx_INCREF(__pyx_n_s_REP);
+ PyList_SET_ITEM(__pyx_t_1, 22, __pyx_n_s_REP);
+ __Pyx_GIVEREF(__pyx_n_s_REP);
+ __Pyx_INCREF(__pyx_n_s_DEALER);
+ PyList_SET_ITEM(__pyx_t_1, 23, __pyx_n_s_DEALER);
+ __Pyx_GIVEREF(__pyx_n_s_DEALER);
+ __Pyx_INCREF(__pyx_n_s_ROUTER);
+ PyList_SET_ITEM(__pyx_t_1, 24, __pyx_n_s_ROUTER);
+ __Pyx_GIVEREF(__pyx_n_s_ROUTER);
+ __Pyx_INCREF(__pyx_n_s_XREQ);
+ PyList_SET_ITEM(__pyx_t_1, 25, __pyx_n_s_XREQ);
+ __Pyx_GIVEREF(__pyx_n_s_XREQ);
+ __Pyx_INCREF(__pyx_n_s_XREP);
+ PyList_SET_ITEM(__pyx_t_1, 26, __pyx_n_s_XREP);
+ __Pyx_GIVEREF(__pyx_n_s_XREP);
+ __Pyx_INCREF(__pyx_n_s_PULL);
+ PyList_SET_ITEM(__pyx_t_1, 27, __pyx_n_s_PULL);
+ __Pyx_GIVEREF(__pyx_n_s_PULL);
+ __Pyx_INCREF(__pyx_n_s_PUSH);
+ PyList_SET_ITEM(__pyx_t_1, 28, __pyx_n_s_PUSH);
+ __Pyx_GIVEREF(__pyx_n_s_PUSH);
+ __Pyx_INCREF(__pyx_n_s_XPUB);
+ PyList_SET_ITEM(__pyx_t_1, 29, __pyx_n_s_XPUB);
+ __Pyx_GIVEREF(__pyx_n_s_XPUB);
+ __Pyx_INCREF(__pyx_n_s_XSUB);
+ PyList_SET_ITEM(__pyx_t_1, 30, __pyx_n_s_XSUB);
+ __Pyx_GIVEREF(__pyx_n_s_XSUB);
+ __Pyx_INCREF(__pyx_n_s_UPSTREAM);
+ PyList_SET_ITEM(__pyx_t_1, 31, __pyx_n_s_UPSTREAM);
+ __Pyx_GIVEREF(__pyx_n_s_UPSTREAM);
+ __Pyx_INCREF(__pyx_n_s_DOWNSTREAM);
+ PyList_SET_ITEM(__pyx_t_1, 32, __pyx_n_s_DOWNSTREAM);
+ __Pyx_GIVEREF(__pyx_n_s_DOWNSTREAM);
+ __Pyx_INCREF(__pyx_n_s_STREAM);
+ PyList_SET_ITEM(__pyx_t_1, 33, __pyx_n_s_STREAM);
+ __Pyx_GIVEREF(__pyx_n_s_STREAM);
+ __Pyx_INCREF(__pyx_n_s_EVENT_CONNECTED);
+ PyList_SET_ITEM(__pyx_t_1, 34, __pyx_n_s_EVENT_CONNECTED);
+ __Pyx_GIVEREF(__pyx_n_s_EVENT_CONNECTED);
+ __Pyx_INCREF(__pyx_n_s_EVENT_CONNECT_DELAYED);
+ PyList_SET_ITEM(__pyx_t_1, 35, __pyx_n_s_EVENT_CONNECT_DELAYED);
+ __Pyx_GIVEREF(__pyx_n_s_EVENT_CONNECT_DELAYED);
+ __Pyx_INCREF(__pyx_n_s_EVENT_CONNECT_RETRIED);
+ PyList_SET_ITEM(__pyx_t_1, 36, __pyx_n_s_EVENT_CONNECT_RETRIED);
+ __Pyx_GIVEREF(__pyx_n_s_EVENT_CONNECT_RETRIED);
+ __Pyx_INCREF(__pyx_n_s_EVENT_LISTENING);
+ PyList_SET_ITEM(__pyx_t_1, 37, __pyx_n_s_EVENT_LISTENING);
+ __Pyx_GIVEREF(__pyx_n_s_EVENT_LISTENING);
+ __Pyx_INCREF(__pyx_n_s_EVENT_BIND_FAILED);
+ PyList_SET_ITEM(__pyx_t_1, 38, __pyx_n_s_EVENT_BIND_FAILED);
+ __Pyx_GIVEREF(__pyx_n_s_EVENT_BIND_FAILED);
+ __Pyx_INCREF(__pyx_n_s_EVENT_ACCEPTED);
+ PyList_SET_ITEM(__pyx_t_1, 39, __pyx_n_s_EVENT_ACCEPTED);
+ __Pyx_GIVEREF(__pyx_n_s_EVENT_ACCEPTED);
+ __Pyx_INCREF(__pyx_n_s_EVENT_ACCEPT_FAILED);
+ PyList_SET_ITEM(__pyx_t_1, 40, __pyx_n_s_EVENT_ACCEPT_FAILED);
+ __Pyx_GIVEREF(__pyx_n_s_EVENT_ACCEPT_FAILED);
+ __Pyx_INCREF(__pyx_n_s_EVENT_CLOSED);
+ PyList_SET_ITEM(__pyx_t_1, 41, __pyx_n_s_EVENT_CLOSED);
+ __Pyx_GIVEREF(__pyx_n_s_EVENT_CLOSED);
+ __Pyx_INCREF(__pyx_n_s_EVENT_CLOSE_FAILED);
+ PyList_SET_ITEM(__pyx_t_1, 42, __pyx_n_s_EVENT_CLOSE_FAILED);
+ __Pyx_GIVEREF(__pyx_n_s_EVENT_CLOSE_FAILED);
+ __Pyx_INCREF(__pyx_n_s_EVENT_DISCONNECTED);
+ PyList_SET_ITEM(__pyx_t_1, 43, __pyx_n_s_EVENT_DISCONNECTED);
+ __Pyx_GIVEREF(__pyx_n_s_EVENT_DISCONNECTED);
+ __Pyx_INCREF(__pyx_n_s_EVENT_ALL);
+ PyList_SET_ITEM(__pyx_t_1, 44, __pyx_n_s_EVENT_ALL);
+ __Pyx_GIVEREF(__pyx_n_s_EVENT_ALL);
+ __Pyx_INCREF(__pyx_n_s_EVENT_MONITOR_STOPPED);
+ PyList_SET_ITEM(__pyx_t_1, 45, __pyx_n_s_EVENT_MONITOR_STOPPED);
+ __Pyx_GIVEREF(__pyx_n_s_EVENT_MONITOR_STOPPED);
+ __Pyx_INCREF(__pyx_n_s_NULL);
+ PyList_SET_ITEM(__pyx_t_1, 46, __pyx_n_s_NULL);
+ __Pyx_GIVEREF(__pyx_n_s_NULL);
+ __Pyx_INCREF(__pyx_n_s_PLAIN);
+ PyList_SET_ITEM(__pyx_t_1, 47, __pyx_n_s_PLAIN);
+ __Pyx_GIVEREF(__pyx_n_s_PLAIN);
+ __Pyx_INCREF(__pyx_n_s_CURVE);
+ PyList_SET_ITEM(__pyx_t_1, 48, __pyx_n_s_CURVE);
+ __Pyx_GIVEREF(__pyx_n_s_CURVE);
+ __Pyx_INCREF(__pyx_n_s_GSSAPI);
+ PyList_SET_ITEM(__pyx_t_1, 49, __pyx_n_s_GSSAPI);
+ __Pyx_GIVEREF(__pyx_n_s_GSSAPI);
+ __Pyx_INCREF(__pyx_n_s_EAGAIN);
+ PyList_SET_ITEM(__pyx_t_1, 50, __pyx_n_s_EAGAIN);
+ __Pyx_GIVEREF(__pyx_n_s_EAGAIN);
+ __Pyx_INCREF(__pyx_n_s_EINVAL);
+ PyList_SET_ITEM(__pyx_t_1, 51, __pyx_n_s_EINVAL);
+ __Pyx_GIVEREF(__pyx_n_s_EINVAL);
+ __Pyx_INCREF(__pyx_n_s_EFAULT);
+ PyList_SET_ITEM(__pyx_t_1, 52, __pyx_n_s_EFAULT);
+ __Pyx_GIVEREF(__pyx_n_s_EFAULT);
+ __Pyx_INCREF(__pyx_n_s_ENOMEM);
+ PyList_SET_ITEM(__pyx_t_1, 53, __pyx_n_s_ENOMEM);
+ __Pyx_GIVEREF(__pyx_n_s_ENOMEM);
+ __Pyx_INCREF(__pyx_n_s_ENODEV);
+ PyList_SET_ITEM(__pyx_t_1, 54, __pyx_n_s_ENODEV);
+ __Pyx_GIVEREF(__pyx_n_s_ENODEV);
+ __Pyx_INCREF(__pyx_n_s_EMSGSIZE);
+ PyList_SET_ITEM(__pyx_t_1, 55, __pyx_n_s_EMSGSIZE);
+ __Pyx_GIVEREF(__pyx_n_s_EMSGSIZE);
+ __Pyx_INCREF(__pyx_n_s_EAFNOSUPPORT);
+ PyList_SET_ITEM(__pyx_t_1, 56, __pyx_n_s_EAFNOSUPPORT);
+ __Pyx_GIVEREF(__pyx_n_s_EAFNOSUPPORT);
+ __Pyx_INCREF(__pyx_n_s_ENETUNREACH);
+ PyList_SET_ITEM(__pyx_t_1, 57, __pyx_n_s_ENETUNREACH);
+ __Pyx_GIVEREF(__pyx_n_s_ENETUNREACH);
+ __Pyx_INCREF(__pyx_n_s_ECONNABORTED);
+ PyList_SET_ITEM(__pyx_t_1, 58, __pyx_n_s_ECONNABORTED);
+ __Pyx_GIVEREF(__pyx_n_s_ECONNABORTED);
+ __Pyx_INCREF(__pyx_n_s_ECONNRESET);
+ PyList_SET_ITEM(__pyx_t_1, 59, __pyx_n_s_ECONNRESET);
+ __Pyx_GIVEREF(__pyx_n_s_ECONNRESET);
+ __Pyx_INCREF(__pyx_n_s_ENOTCONN);
+ PyList_SET_ITEM(__pyx_t_1, 60, __pyx_n_s_ENOTCONN);
+ __Pyx_GIVEREF(__pyx_n_s_ENOTCONN);
+ __Pyx_INCREF(__pyx_n_s_ETIMEDOUT);
+ PyList_SET_ITEM(__pyx_t_1, 61, __pyx_n_s_ETIMEDOUT);
+ __Pyx_GIVEREF(__pyx_n_s_ETIMEDOUT);
+ __Pyx_INCREF(__pyx_n_s_EHOSTUNREACH);
+ PyList_SET_ITEM(__pyx_t_1, 62, __pyx_n_s_EHOSTUNREACH);
+ __Pyx_GIVEREF(__pyx_n_s_EHOSTUNREACH);
+ __Pyx_INCREF(__pyx_n_s_ENETRESET);
+ PyList_SET_ITEM(__pyx_t_1, 63, __pyx_n_s_ENETRESET);
+ __Pyx_GIVEREF(__pyx_n_s_ENETRESET);
+ __Pyx_INCREF(__pyx_n_s_HAUSNUMERO);
+ PyList_SET_ITEM(__pyx_t_1, 64, __pyx_n_s_HAUSNUMERO);
+ __Pyx_GIVEREF(__pyx_n_s_HAUSNUMERO);
+ __Pyx_INCREF(__pyx_n_s_ENOTSUP);
+ PyList_SET_ITEM(__pyx_t_1, 65, __pyx_n_s_ENOTSUP);
+ __Pyx_GIVEREF(__pyx_n_s_ENOTSUP);
+ __Pyx_INCREF(__pyx_n_s_EPROTONOSUPPORT);
+ PyList_SET_ITEM(__pyx_t_1, 66, __pyx_n_s_EPROTONOSUPPORT);
+ __Pyx_GIVEREF(__pyx_n_s_EPROTONOSUPPORT);
+ __Pyx_INCREF(__pyx_n_s_ENOBUFS);
+ PyList_SET_ITEM(__pyx_t_1, 67, __pyx_n_s_ENOBUFS);
+ __Pyx_GIVEREF(__pyx_n_s_ENOBUFS);
+ __Pyx_INCREF(__pyx_n_s_ENETDOWN);
+ PyList_SET_ITEM(__pyx_t_1, 68, __pyx_n_s_ENETDOWN);
+ __Pyx_GIVEREF(__pyx_n_s_ENETDOWN);
+ __Pyx_INCREF(__pyx_n_s_EADDRINUSE);
+ PyList_SET_ITEM(__pyx_t_1, 69, __pyx_n_s_EADDRINUSE);
+ __Pyx_GIVEREF(__pyx_n_s_EADDRINUSE);
+ __Pyx_INCREF(__pyx_n_s_EADDRNOTAVAIL);
+ PyList_SET_ITEM(__pyx_t_1, 70, __pyx_n_s_EADDRNOTAVAIL);
+ __Pyx_GIVEREF(__pyx_n_s_EADDRNOTAVAIL);
+ __Pyx_INCREF(__pyx_n_s_ECONNREFUSED);
+ PyList_SET_ITEM(__pyx_t_1, 71, __pyx_n_s_ECONNREFUSED);
+ __Pyx_GIVEREF(__pyx_n_s_ECONNREFUSED);
+ __Pyx_INCREF(__pyx_n_s_EINPROGRESS);
+ PyList_SET_ITEM(__pyx_t_1, 72, __pyx_n_s_EINPROGRESS);
+ __Pyx_GIVEREF(__pyx_n_s_EINPROGRESS);
+ __Pyx_INCREF(__pyx_n_s_ENOTSOCK);
+ PyList_SET_ITEM(__pyx_t_1, 73, __pyx_n_s_ENOTSOCK);
+ __Pyx_GIVEREF(__pyx_n_s_ENOTSOCK);
+ __Pyx_INCREF(__pyx_n_s_EFSM);
+ PyList_SET_ITEM(__pyx_t_1, 74, __pyx_n_s_EFSM);
+ __Pyx_GIVEREF(__pyx_n_s_EFSM);
+ __Pyx_INCREF(__pyx_n_s_ENOCOMPATPROTO);
+ PyList_SET_ITEM(__pyx_t_1, 75, __pyx_n_s_ENOCOMPATPROTO);
+ __Pyx_GIVEREF(__pyx_n_s_ENOCOMPATPROTO);
+ __Pyx_INCREF(__pyx_n_s_ETERM);
+ PyList_SET_ITEM(__pyx_t_1, 76, __pyx_n_s_ETERM);
+ __Pyx_GIVEREF(__pyx_n_s_ETERM);
+ __Pyx_INCREF(__pyx_n_s_EMTHREAD);
+ PyList_SET_ITEM(__pyx_t_1, 77, __pyx_n_s_EMTHREAD);
+ __Pyx_GIVEREF(__pyx_n_s_EMTHREAD);
+ __Pyx_INCREF(__pyx_n_s_IO_THREADS);
+ PyList_SET_ITEM(__pyx_t_1, 78, __pyx_n_s_IO_THREADS);
+ __Pyx_GIVEREF(__pyx_n_s_IO_THREADS);
+ __Pyx_INCREF(__pyx_n_s_MAX_SOCKETS);
+ PyList_SET_ITEM(__pyx_t_1, 79, __pyx_n_s_MAX_SOCKETS);
+ __Pyx_GIVEREF(__pyx_n_s_MAX_SOCKETS);
+ __Pyx_INCREF(__pyx_n_s_SOCKET_LIMIT);
+ PyList_SET_ITEM(__pyx_t_1, 80, __pyx_n_s_SOCKET_LIMIT);
+ __Pyx_GIVEREF(__pyx_n_s_SOCKET_LIMIT);
+ __Pyx_INCREF(__pyx_n_s_THREAD_PRIORITY);
+ PyList_SET_ITEM(__pyx_t_1, 81, __pyx_n_s_THREAD_PRIORITY);
+ __Pyx_GIVEREF(__pyx_n_s_THREAD_PRIORITY);
+ __Pyx_INCREF(__pyx_n_s_THREAD_SCHED_POLICY);
+ PyList_SET_ITEM(__pyx_t_1, 82, __pyx_n_s_THREAD_SCHED_POLICY);
+ __Pyx_GIVEREF(__pyx_n_s_THREAD_SCHED_POLICY);
+ __Pyx_INCREF(__pyx_n_s_IDENTITY);
+ PyList_SET_ITEM(__pyx_t_1, 83, __pyx_n_s_IDENTITY);
+ __Pyx_GIVEREF(__pyx_n_s_IDENTITY);
+ __Pyx_INCREF(__pyx_n_s_SUBSCRIBE);
+ PyList_SET_ITEM(__pyx_t_1, 84, __pyx_n_s_SUBSCRIBE);
+ __Pyx_GIVEREF(__pyx_n_s_SUBSCRIBE);
+ __Pyx_INCREF(__pyx_n_s_UNSUBSCRIBE);
+ PyList_SET_ITEM(__pyx_t_1, 85, __pyx_n_s_UNSUBSCRIBE);
+ __Pyx_GIVEREF(__pyx_n_s_UNSUBSCRIBE);
+ __Pyx_INCREF(__pyx_n_s_LAST_ENDPOINT);
+ PyList_SET_ITEM(__pyx_t_1, 86, __pyx_n_s_LAST_ENDPOINT);
+ __Pyx_GIVEREF(__pyx_n_s_LAST_ENDPOINT);
+ __Pyx_INCREF(__pyx_n_s_TCP_ACCEPT_FILTER);
+ PyList_SET_ITEM(__pyx_t_1, 87, __pyx_n_s_TCP_ACCEPT_FILTER);
+ __Pyx_GIVEREF(__pyx_n_s_TCP_ACCEPT_FILTER);
+ __Pyx_INCREF(__pyx_n_s_PLAIN_USERNAME);
+ PyList_SET_ITEM(__pyx_t_1, 88, __pyx_n_s_PLAIN_USERNAME);
+ __Pyx_GIVEREF(__pyx_n_s_PLAIN_USERNAME);
+ __Pyx_INCREF(__pyx_n_s_PLAIN_PASSWORD);
+ PyList_SET_ITEM(__pyx_t_1, 89, __pyx_n_s_PLAIN_PASSWORD);
+ __Pyx_GIVEREF(__pyx_n_s_PLAIN_PASSWORD);
+ __Pyx_INCREF(__pyx_n_s_CURVE_PUBLICKEY);
+ PyList_SET_ITEM(__pyx_t_1, 90, __pyx_n_s_CURVE_PUBLICKEY);
+ __Pyx_GIVEREF(__pyx_n_s_CURVE_PUBLICKEY);
+ __Pyx_INCREF(__pyx_n_s_CURVE_SECRETKEY);
+ PyList_SET_ITEM(__pyx_t_1, 91, __pyx_n_s_CURVE_SECRETKEY);
+ __Pyx_GIVEREF(__pyx_n_s_CURVE_SECRETKEY);
+ __Pyx_INCREF(__pyx_n_s_CURVE_SERVERKEY);
+ PyList_SET_ITEM(__pyx_t_1, 92, __pyx_n_s_CURVE_SERVERKEY);
+ __Pyx_GIVEREF(__pyx_n_s_CURVE_SERVERKEY);
+ __Pyx_INCREF(__pyx_n_s_ZAP_DOMAIN);
+ PyList_SET_ITEM(__pyx_t_1, 93, __pyx_n_s_ZAP_DOMAIN);
+ __Pyx_GIVEREF(__pyx_n_s_ZAP_DOMAIN);
+ __Pyx_INCREF(__pyx_n_s_CONNECT_RID);
+ PyList_SET_ITEM(__pyx_t_1, 94, __pyx_n_s_CONNECT_RID);
+ __Pyx_GIVEREF(__pyx_n_s_CONNECT_RID);
+ __Pyx_INCREF(__pyx_n_s_GSSAPI_PRINCIPAL);
+ PyList_SET_ITEM(__pyx_t_1, 95, __pyx_n_s_GSSAPI_PRINCIPAL);
+ __Pyx_GIVEREF(__pyx_n_s_GSSAPI_PRINCIPAL);
+ __Pyx_INCREF(__pyx_n_s_GSSAPI_SERVICE_PRINCIPAL);
+ PyList_SET_ITEM(__pyx_t_1, 96, __pyx_n_s_GSSAPI_SERVICE_PRINCIPAL);
+ __Pyx_GIVEREF(__pyx_n_s_GSSAPI_SERVICE_PRINCIPAL);
+ __Pyx_INCREF(__pyx_n_s_SOCKS_PROXY);
+ PyList_SET_ITEM(__pyx_t_1, 97, __pyx_n_s_SOCKS_PROXY);
+ __Pyx_GIVEREF(__pyx_n_s_SOCKS_PROXY);
+ __Pyx_INCREF(__pyx_n_s_FD);
+ PyList_SET_ITEM(__pyx_t_1, 98, __pyx_n_s_FD);
+ __Pyx_GIVEREF(__pyx_n_s_FD);
+ __Pyx_INCREF(__pyx_n_s_IDENTITY_FD);
+ PyList_SET_ITEM(__pyx_t_1, 99, __pyx_n_s_IDENTITY_FD);
+ __Pyx_GIVEREF(__pyx_n_s_IDENTITY_FD);
+ __Pyx_INCREF(__pyx_n_s_RECONNECT_IVL_MAX);
+ PyList_SET_ITEM(__pyx_t_1, 100, __pyx_n_s_RECONNECT_IVL_MAX);
+ __Pyx_GIVEREF(__pyx_n_s_RECONNECT_IVL_MAX);
+ __Pyx_INCREF(__pyx_n_s_SNDTIMEO);
+ PyList_SET_ITEM(__pyx_t_1, 101, __pyx_n_s_SNDTIMEO);
+ __Pyx_GIVEREF(__pyx_n_s_SNDTIMEO);
+ __Pyx_INCREF(__pyx_n_s_RCVTIMEO);
+ PyList_SET_ITEM(__pyx_t_1, 102, __pyx_n_s_RCVTIMEO);
+ __Pyx_GIVEREF(__pyx_n_s_RCVTIMEO);
+ __Pyx_INCREF(__pyx_n_s_SNDHWM);
+ PyList_SET_ITEM(__pyx_t_1, 103, __pyx_n_s_SNDHWM);
+ __Pyx_GIVEREF(__pyx_n_s_SNDHWM);
+ __Pyx_INCREF(__pyx_n_s_RCVHWM);
+ PyList_SET_ITEM(__pyx_t_1, 104, __pyx_n_s_RCVHWM);
+ __Pyx_GIVEREF(__pyx_n_s_RCVHWM);
+ __Pyx_INCREF(__pyx_n_s_MULTICAST_HOPS);
+ PyList_SET_ITEM(__pyx_t_1, 105, __pyx_n_s_MULTICAST_HOPS);
+ __Pyx_GIVEREF(__pyx_n_s_MULTICAST_HOPS);
+ __Pyx_INCREF(__pyx_n_s_IPV4ONLY);
+ PyList_SET_ITEM(__pyx_t_1, 106, __pyx_n_s_IPV4ONLY);
+ __Pyx_GIVEREF(__pyx_n_s_IPV4ONLY);
+ __Pyx_INCREF(__pyx_n_s_ROUTER_BEHAVIOR);
+ PyList_SET_ITEM(__pyx_t_1, 107, __pyx_n_s_ROUTER_BEHAVIOR);
+ __Pyx_GIVEREF(__pyx_n_s_ROUTER_BEHAVIOR);
+ __Pyx_INCREF(__pyx_n_s_TCP_KEEPALIVE);
+ PyList_SET_ITEM(__pyx_t_1, 108, __pyx_n_s_TCP_KEEPALIVE);
+ __Pyx_GIVEREF(__pyx_n_s_TCP_KEEPALIVE);
+ __Pyx_INCREF(__pyx_n_s_TCP_KEEPALIVE_CNT);
+ PyList_SET_ITEM(__pyx_t_1, 109, __pyx_n_s_TCP_KEEPALIVE_CNT);
+ __Pyx_GIVEREF(__pyx_n_s_TCP_KEEPALIVE_CNT);
+ __Pyx_INCREF(__pyx_n_s_TCP_KEEPALIVE_IDLE);
+ PyList_SET_ITEM(__pyx_t_1, 110, __pyx_n_s_TCP_KEEPALIVE_IDLE);
+ __Pyx_GIVEREF(__pyx_n_s_TCP_KEEPALIVE_IDLE);
+ __Pyx_INCREF(__pyx_n_s_TCP_KEEPALIVE_INTVL);
+ PyList_SET_ITEM(__pyx_t_1, 111, __pyx_n_s_TCP_KEEPALIVE_INTVL);
+ __Pyx_GIVEREF(__pyx_n_s_TCP_KEEPALIVE_INTVL);
+ __Pyx_INCREF(__pyx_n_s_DELAY_ATTACH_ON_CONNECT);
+ PyList_SET_ITEM(__pyx_t_1, 112, __pyx_n_s_DELAY_ATTACH_ON_CONNECT);
+ __Pyx_GIVEREF(__pyx_n_s_DELAY_ATTACH_ON_CONNECT);
+ __Pyx_INCREF(__pyx_n_s_XPUB_VERBOSE);
+ PyList_SET_ITEM(__pyx_t_1, 113, __pyx_n_s_XPUB_VERBOSE);
+ __Pyx_GIVEREF(__pyx_n_s_XPUB_VERBOSE);
+ __Pyx_INCREF(__pyx_n_s_EVENTS);
+ PyList_SET_ITEM(__pyx_t_1, 114, __pyx_n_s_EVENTS);
+ __Pyx_GIVEREF(__pyx_n_s_EVENTS);
+ __Pyx_INCREF(__pyx_n_s_TYPE);
+ PyList_SET_ITEM(__pyx_t_1, 115, __pyx_n_s_TYPE);
+ __Pyx_GIVEREF(__pyx_n_s_TYPE);
+ __Pyx_INCREF(__pyx_n_s_LINGER);
+ PyList_SET_ITEM(__pyx_t_1, 116, __pyx_n_s_LINGER);
+ __Pyx_GIVEREF(__pyx_n_s_LINGER);
+ __Pyx_INCREF(__pyx_n_s_RECONNECT_IVL);
+ PyList_SET_ITEM(__pyx_t_1, 117, __pyx_n_s_RECONNECT_IVL);
+ __Pyx_GIVEREF(__pyx_n_s_RECONNECT_IVL);
+ __Pyx_INCREF(__pyx_n_s_BACKLOG);
+ PyList_SET_ITEM(__pyx_t_1, 118, __pyx_n_s_BACKLOG);
+ __Pyx_GIVEREF(__pyx_n_s_BACKLOG);
+ __Pyx_INCREF(__pyx_n_s_ROUTER_MANDATORY);
+ PyList_SET_ITEM(__pyx_t_1, 119, __pyx_n_s_ROUTER_MANDATORY);
+ __Pyx_GIVEREF(__pyx_n_s_ROUTER_MANDATORY);
+ __Pyx_INCREF(__pyx_n_s_FAIL_UNROUTABLE);
+ PyList_SET_ITEM(__pyx_t_1, 120, __pyx_n_s_FAIL_UNROUTABLE);
+ __Pyx_GIVEREF(__pyx_n_s_FAIL_UNROUTABLE);
+ __Pyx_INCREF(__pyx_n_s_ROUTER_RAW);
+ PyList_SET_ITEM(__pyx_t_1, 121, __pyx_n_s_ROUTER_RAW);
+ __Pyx_GIVEREF(__pyx_n_s_ROUTER_RAW);
+ __Pyx_INCREF(__pyx_n_s_IMMEDIATE);
+ PyList_SET_ITEM(__pyx_t_1, 122, __pyx_n_s_IMMEDIATE);
+ __Pyx_GIVEREF(__pyx_n_s_IMMEDIATE);
+ __Pyx_INCREF(__pyx_n_s_IPV6);
+ PyList_SET_ITEM(__pyx_t_1, 123, __pyx_n_s_IPV6);
+ __Pyx_GIVEREF(__pyx_n_s_IPV6);
+ __Pyx_INCREF(__pyx_n_s_MECHANISM);
+ PyList_SET_ITEM(__pyx_t_1, 124, __pyx_n_s_MECHANISM);
+ __Pyx_GIVEREF(__pyx_n_s_MECHANISM);
+ __Pyx_INCREF(__pyx_n_s_PLAIN_SERVER);
+ PyList_SET_ITEM(__pyx_t_1, 125, __pyx_n_s_PLAIN_SERVER);
+ __Pyx_GIVEREF(__pyx_n_s_PLAIN_SERVER);
+ __Pyx_INCREF(__pyx_n_s_CURVE_SERVER);
+ PyList_SET_ITEM(__pyx_t_1, 126, __pyx_n_s_CURVE_SERVER);
+ __Pyx_GIVEREF(__pyx_n_s_CURVE_SERVER);
+ __Pyx_INCREF(__pyx_n_s_PROBE_ROUTER);
+ PyList_SET_ITEM(__pyx_t_1, 127, __pyx_n_s_PROBE_ROUTER);
+ __Pyx_GIVEREF(__pyx_n_s_PROBE_ROUTER);
+ __Pyx_INCREF(__pyx_n_s_REQ_RELAXED);
+ PyList_SET_ITEM(__pyx_t_1, 128, __pyx_n_s_REQ_RELAXED);
+ __Pyx_GIVEREF(__pyx_n_s_REQ_RELAXED);
+ __Pyx_INCREF(__pyx_n_s_REQ_CORRELATE);
+ PyList_SET_ITEM(__pyx_t_1, 129, __pyx_n_s_REQ_CORRELATE);
+ __Pyx_GIVEREF(__pyx_n_s_REQ_CORRELATE);
+ __Pyx_INCREF(__pyx_n_s_CONFLATE);
+ PyList_SET_ITEM(__pyx_t_1, 130, __pyx_n_s_CONFLATE);
+ __Pyx_GIVEREF(__pyx_n_s_CONFLATE);
+ __Pyx_INCREF(__pyx_n_s_ROUTER_HANDOVER);
+ PyList_SET_ITEM(__pyx_t_1, 131, __pyx_n_s_ROUTER_HANDOVER);
+ __Pyx_GIVEREF(__pyx_n_s_ROUTER_HANDOVER);
+ __Pyx_INCREF(__pyx_n_s_TOS);
+ PyList_SET_ITEM(__pyx_t_1, 132, __pyx_n_s_TOS);
+ __Pyx_GIVEREF(__pyx_n_s_TOS);
+ __Pyx_INCREF(__pyx_n_s_IPC_FILTER_PID);
+ PyList_SET_ITEM(__pyx_t_1, 133, __pyx_n_s_IPC_FILTER_PID);
+ __Pyx_GIVEREF(__pyx_n_s_IPC_FILTER_PID);
+ __Pyx_INCREF(__pyx_n_s_IPC_FILTER_UID);
+ PyList_SET_ITEM(__pyx_t_1, 134, __pyx_n_s_IPC_FILTER_UID);
+ __Pyx_GIVEREF(__pyx_n_s_IPC_FILTER_UID);
+ __Pyx_INCREF(__pyx_n_s_IPC_FILTER_GID);
+ PyList_SET_ITEM(__pyx_t_1, 135, __pyx_n_s_IPC_FILTER_GID);
+ __Pyx_GIVEREF(__pyx_n_s_IPC_FILTER_GID);
+ __Pyx_INCREF(__pyx_n_s_GSSAPI_SERVER);
+ PyList_SET_ITEM(__pyx_t_1, 136, __pyx_n_s_GSSAPI_SERVER);
+ __Pyx_GIVEREF(__pyx_n_s_GSSAPI_SERVER);
+ __Pyx_INCREF(__pyx_n_s_GSSAPI_PLAINTEXT);
+ PyList_SET_ITEM(__pyx_t_1, 137, __pyx_n_s_GSSAPI_PLAINTEXT);
+ __Pyx_GIVEREF(__pyx_n_s_GSSAPI_PLAINTEXT);
+ __Pyx_INCREF(__pyx_n_s_HANDSHAKE_IVL);
+ PyList_SET_ITEM(__pyx_t_1, 138, __pyx_n_s_HANDSHAKE_IVL);
+ __Pyx_GIVEREF(__pyx_n_s_HANDSHAKE_IVL);
+ __Pyx_INCREF(__pyx_n_s_XPUB_NODROP);
+ PyList_SET_ITEM(__pyx_t_1, 139, __pyx_n_s_XPUB_NODROP);
+ __Pyx_GIVEREF(__pyx_n_s_XPUB_NODROP);
+ __Pyx_INCREF(__pyx_n_s_AFFINITY);
+ PyList_SET_ITEM(__pyx_t_1, 140, __pyx_n_s_AFFINITY);
+ __Pyx_GIVEREF(__pyx_n_s_AFFINITY);
+ __Pyx_INCREF(__pyx_n_s_MAXMSGSIZE);
+ PyList_SET_ITEM(__pyx_t_1, 141, __pyx_n_s_MAXMSGSIZE);
+ __Pyx_GIVEREF(__pyx_n_s_MAXMSGSIZE);
+ __Pyx_INCREF(__pyx_n_s_HWM);
+ PyList_SET_ITEM(__pyx_t_1, 142, __pyx_n_s_HWM);
+ __Pyx_GIVEREF(__pyx_n_s_HWM);
+ __Pyx_INCREF(__pyx_n_s_SWAP);
+ PyList_SET_ITEM(__pyx_t_1, 143, __pyx_n_s_SWAP);
+ __Pyx_GIVEREF(__pyx_n_s_SWAP);
+ __Pyx_INCREF(__pyx_n_s_MCAST_LOOP);
+ PyList_SET_ITEM(__pyx_t_1, 144, __pyx_n_s_MCAST_LOOP);
+ __Pyx_GIVEREF(__pyx_n_s_MCAST_LOOP);
+ __Pyx_INCREF(__pyx_n_s_RECOVERY_IVL_MSEC);
+ PyList_SET_ITEM(__pyx_t_1, 145, __pyx_n_s_RECOVERY_IVL_MSEC);
+ __Pyx_GIVEREF(__pyx_n_s_RECOVERY_IVL_MSEC);
+ __Pyx_INCREF(__pyx_n_s_RATE);
+ PyList_SET_ITEM(__pyx_t_1, 146, __pyx_n_s_RATE);
+ __Pyx_GIVEREF(__pyx_n_s_RATE);
+ __Pyx_INCREF(__pyx_n_s_RECOVERY_IVL);
+ PyList_SET_ITEM(__pyx_t_1, 147, __pyx_n_s_RECOVERY_IVL);
+ __Pyx_GIVEREF(__pyx_n_s_RECOVERY_IVL);
+ __Pyx_INCREF(__pyx_n_s_SNDBUF);
+ PyList_SET_ITEM(__pyx_t_1, 148, __pyx_n_s_SNDBUF);
+ __Pyx_GIVEREF(__pyx_n_s_SNDBUF);
+ __Pyx_INCREF(__pyx_n_s_RCVBUF);
+ PyList_SET_ITEM(__pyx_t_1, 149, __pyx_n_s_RCVBUF);
+ __Pyx_GIVEREF(__pyx_n_s_RCVBUF);
+ __Pyx_INCREF(__pyx_n_s_RCVMORE);
+ PyList_SET_ITEM(__pyx_t_1, 150, __pyx_n_s_RCVMORE);
+ __Pyx_GIVEREF(__pyx_n_s_RCVMORE);
+ __Pyx_INCREF(__pyx_n_s_MORE);
+ PyList_SET_ITEM(__pyx_t_1, 151, __pyx_n_s_MORE);
+ __Pyx_GIVEREF(__pyx_n_s_MORE);
+ __Pyx_INCREF(__pyx_n_s_SRCFD);
+ PyList_SET_ITEM(__pyx_t_1, 152, __pyx_n_s_SRCFD);
+ __Pyx_GIVEREF(__pyx_n_s_SRCFD);
+ __Pyx_INCREF(__pyx_n_s_SHARED);
+ PyList_SET_ITEM(__pyx_t_1, 153, __pyx_n_s_SHARED);
+ __Pyx_GIVEREF(__pyx_n_s_SHARED);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/constants.pyx":1
+ * """0MQ Constants.""" # <<<<<<<<<<<<<<
+ *
+ * #
+ */
+ __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;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /*--- Wrapped vars code ---*/
+
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ if (__pyx_m) {
+ if (__pyx_d) {
+ __Pyx_AddTraceback("init zmq.backend.cython.constants", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ }
+ Py_DECREF(__pyx_m); __pyx_m = 0;
+ } else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ImportError, "init zmq.backend.cython.constants");
+ }
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ #if PY_MAJOR_VERSION < 3
+ return;
+ #else
+ return __pyx_m;
+ #endif
+}
+
+/* Runtime support code */
+#if CYTHON_REFNANNY
+static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
+ PyObject *m = NULL, *p = NULL;
+ void *r = NULL;
+ m = PyImport_ImportModule((char *)modname);
+ if (!m) goto end;
+ p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
+ if (!p) goto end;
+ r = PyLong_AsVoidPtr(p);
+end:
+ Py_XDECREF(p);
+ Py_XDECREF(m);
+ return (__Pyx_RefNannyAPIStruct *)r;
+}
+#endif
+
+static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
+#if CYTHON_COMPILING_IN_CPYTHON
+#if PY_MAJOR_VERSION >= 3
+ if (likely(PyUnicode_Check(n)))
+#else
+ if (likely(PyString_Check(n)))
+#endif
+ return __Pyx_PyObject_GetAttrStr(o, n);
+#endif
+ return PyObject_GetAttr(o, n);
+}
+
+static PyObject* __Pyx_Globals(void) {
+ Py_ssize_t i;
+ PyObject *names;
+ PyObject *globals = __pyx_d;
+ Py_INCREF(globals);
+ names = PyObject_Dir(__pyx_m);
+ if (!names)
+ goto bad;
+ for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) {
+#if CYTHON_COMPILING_IN_PYPY
+ PyObject* name = PySequence_GetItem(names, i);
+ if (!name)
+ goto bad;
+#else
+ PyObject* name = PyList_GET_ITEM(names, i);
+#endif
+ if (!PyDict_Contains(globals, name)) {
+ PyObject* value = __Pyx_GetAttr(__pyx_m, name);
+ if (!value) {
+#if CYTHON_COMPILING_IN_PYPY
+ Py_DECREF(name);
+#endif
+ goto bad;
+ }
+ if (PyDict_SetItem(globals, name, value) < 0) {
+#if CYTHON_COMPILING_IN_PYPY
+ Py_DECREF(name);
+#endif
+ Py_DECREF(value);
+ goto bad;
+ }
+ }
+#if CYTHON_COMPILING_IN_PYPY
+ Py_DECREF(name);
+#endif
+ }
+ Py_DECREF(names);
+ return globals;
+bad:
+ Py_XDECREF(names);
+ Py_XDECREF(globals);
+ return NULL;
+}
+
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+ int start = 0, mid = 0, end = count - 1;
+ if (end >= 0 && code_line > entries[end].code_line) {
+ return count;
+ }
+ while (start < end) {
+ mid = (start + end) / 2;
+ if (code_line < entries[mid].code_line) {
+ end = mid;
+ } else if (code_line > entries[mid].code_line) {
+ start = mid + 1;
+ } else {
+ return mid;
+ }
+ }
+ if (code_line <= entries[mid].code_line) {
+ return mid;
+ } else {
+ return mid + 1;
+ }
+}
+static PyCodeObject *__pyx_find_code_object(int code_line) {
+ PyCodeObject* code_object;
+ int pos;
+ if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
+ return NULL;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
+ return NULL;
+ }
+ code_object = __pyx_code_cache.entries[pos].code_object;
+ Py_INCREF(code_object);
+ return code_object;
+}
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
+ int pos, i;
+ __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
+ if (unlikely(!code_line)) {
+ return;
+ }
+ if (unlikely(!entries)) {
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (likely(entries)) {
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = 64;
+ __pyx_code_cache.count = 1;
+ entries[0].code_line = code_line;
+ entries[0].code_object = code_object;
+ Py_INCREF(code_object);
+ }
+ return;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
+ PyCodeObject* tmp = entries[pos].code_object;
+ entries[pos].code_object = code_object;
+ Py_DECREF(tmp);
+ return;
+ }
+ if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
+ int new_max = __pyx_code_cache.max_count + 64;
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
+ __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (unlikely(!entries)) {
+ return;
+ }
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = new_max;
+ }
+ for (i=__pyx_code_cache.count; i>pos; i--) {
+ entries[i] = entries[i-1];
+ }
+ entries[pos].code_line = code_line;
+ entries[pos].code_object = code_object;
+ __pyx_code_cache.count++;
+ Py_INCREF(code_object);
+}
+
+#include "compile.h"
+#include "frameobject.h"
+#include "traceback.h"
+static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
+ const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyObject *py_srcfile = 0;
+ PyObject *py_funcname = 0;
+ #if PY_MAJOR_VERSION < 3
+ py_srcfile = PyString_FromString(filename);
+ #else
+ py_srcfile = PyUnicode_FromString(filename);
+ #endif
+ if (!py_srcfile) goto bad;
+ if (c_line) {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #else
+ py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #endif
+ }
+ else {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromString(funcname);
+ #else
+ py_funcname = PyUnicode_FromString(funcname);
+ #endif
+ }
+ if (!py_funcname) goto bad;
+ py_code = __Pyx_PyCode_New(
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ __pyx_empty_bytes, /*PyObject *code,*/
+ __pyx_empty_tuple, /*PyObject *consts,*/
+ __pyx_empty_tuple, /*PyObject *names,*/
+ __pyx_empty_tuple, /*PyObject *varnames,*/
+ __pyx_empty_tuple, /*PyObject *freevars,*/
+ __pyx_empty_tuple, /*PyObject *cellvars,*/
+ py_srcfile, /*PyObject *filename,*/
+ py_funcname, /*PyObject *name,*/
+ py_line,
+ __pyx_empty_bytes /*PyObject *lnotab*/
+ );
+ Py_DECREF(py_srcfile);
+ Py_DECREF(py_funcname);
+ return py_code;
+bad:
+ Py_XDECREF(py_srcfile);
+ Py_XDECREF(py_funcname);
+ return NULL;
+}
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyFrameObject *py_frame = 0;
+ py_code = __pyx_find_code_object(c_line ? c_line : py_line);
+ if (!py_code) {
+ py_code = __Pyx_CreateCodeObjectForTraceback(
+ funcname, c_line, py_line, filename);
+ if (!py_code) goto bad;
+ __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
+ }
+ py_frame = PyFrame_New(
+ PyThreadState_GET(), /*PyThreadState *tstate,*/
+ py_code, /*PyCodeObject *code,*/
+ __pyx_d, /*PyObject *globals,*/
+ 0 /*PyObject *locals*/
+ );
+ if (!py_frame) goto bad;
+ py_frame->f_lineno = py_line;
+ PyTraceBack_Here(py_frame);
+bad:
+ Py_XDECREF(py_code);
+ Py_XDECREF(py_frame);
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+ const int neg_one = (int) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(int) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(int) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(int),
+ little, !is_unsigned);
+ }
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+ const long neg_one = (long) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(long) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(long) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(long),
+ little, !is_unsigned);
+ }
+}
+
+#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value) \
+ { \
+ func_type value = func_value; \
+ if (sizeof(target_type) < sizeof(func_type)) { \
+ if (unlikely(value != (func_type) (target_type) value)) { \
+ func_type zero = 0; \
+ if (is_unsigned && unlikely(value < zero)) \
+ goto raise_neg_overflow; \
+ else \
+ goto raise_overflow; \
+ } \
+ } \
+ return (target_type) value; \
+ }
+
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ #include "longintrepr.h"
+ #endif
+#endif
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+ const long neg_one = (long) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(long) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (long) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(long) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(long) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(long) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
+ } else if (sizeof(long) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ long val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (long) -1;
+ }
+ } else {
+ long val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (long) -1;
+ val = __Pyx_PyInt_As_long(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to long");
+ return (long) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to long");
+ return (long) -1;
+}
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+ const int neg_one = (int) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(int) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (int) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(int) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
+ } else if (sizeof(int) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ int val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (int) -1;
+ }
+ } else {
+ int val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (int) -1;
+ val = __Pyx_PyInt_As_int(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to int");
+ return (int) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to int");
+ return (int) -1;
+}
+
+static int __Pyx_check_binary_version(void) {
+ char ctversion[4], rtversion[4];
+ PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
+ if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
+ char message[200];
+ PyOS_snprintf(message, sizeof(message),
+ "compiletime version %s of module '%.100s' "
+ "does not match runtime version %s",
+ ctversion, __Pyx_MODULE_NAME, rtversion);
+ return PyErr_WarnEx(NULL, message, 1);
+ }
+ return 0;
+}
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+ while (t->p) {
+ #if PY_MAJOR_VERSION < 3
+ if (t->is_unicode) {
+ *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
+ } else if (t->intern) {
+ *t->p = PyString_InternFromString(t->s);
+ } else {
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+ }
+ #else
+ if (t->is_unicode | t->is_str) {
+ if (t->intern) {
+ *t->p = PyUnicode_InternFromString(t->s);
+ } else if (t->encoding) {
+ *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
+ } else {
+ *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+ }
+ } else {
+ *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
+ }
+ #endif
+ if (!*t->p)
+ return -1;
+ ++t;
+ }
+ return 0;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
+ return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
+ Py_ssize_t ignore;
+ return __Pyx_PyObject_AsStringAndSize(o, &ignore);
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+ if (
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ __Pyx_sys_getdefaultencoding_not_ascii &&
+#endif
+ PyUnicode_Check(o)) {
+#if PY_VERSION_HEX < 0x03030000
+ char* defenc_c;
+ PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
+ if (!defenc) return NULL;
+ defenc_c = PyBytes_AS_STRING(defenc);
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ {
+ char* end = defenc_c + PyBytes_GET_SIZE(defenc);
+ char* c;
+ for (c = defenc_c; c < end; c++) {
+ if ((unsigned char) (*c) >= 128) {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+ }
+ }
+#endif
+ *length = PyBytes_GET_SIZE(defenc);
+ return defenc_c;
+#else
+ if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ if (PyUnicode_IS_ASCII(o)) {
+ *length = PyUnicode_GET_LENGTH(o);
+ return PyUnicode_AsUTF8(o);
+ } else {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+#else
+ return PyUnicode_AsUTF8AndSize(o, length);
+#endif
+#endif
+ } else
+#endif
+#if !CYTHON_COMPILING_IN_PYPY
+ if (PyByteArray_Check(o)) {
+ *length = PyByteArray_GET_SIZE(o);
+ return PyByteArray_AS_STRING(o);
+ } else
+#endif
+ {
+ char* result;
+ int r = PyBytes_AsStringAndSize(o, &result, length);
+ if (unlikely(r < 0)) {
+ return NULL;
+ } else {
+ return result;
+ }
+ }
+}
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
+ int is_true = x == Py_True;
+ if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
+ else return PyObject_IsTrue(x);
+}
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
+ PyNumberMethods *m;
+ const char *name = NULL;
+ PyObject *res = NULL;
+#if PY_MAJOR_VERSION < 3
+ if (PyInt_Check(x) || PyLong_Check(x))
+#else
+ if (PyLong_Check(x))
+#endif
+ return Py_INCREF(x), x;
+ m = Py_TYPE(x)->tp_as_number;
+#if PY_MAJOR_VERSION < 3
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Int(x);
+ }
+ else if (m && m->nb_long) {
+ name = "long";
+ res = PyNumber_Long(x);
+ }
+#else
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Long(x);
+ }
+#endif
+ if (res) {
+#if PY_MAJOR_VERSION < 3
+ if (!PyInt_Check(res) && !PyLong_Check(res)) {
+#else
+ if (!PyLong_Check(res)) {
+#endif
+ PyErr_Format(PyExc_TypeError,
+ "__%.4s__ returned non-%.4s (type %.200s)",
+ name, name, Py_TYPE(res)->tp_name);
+ Py_DECREF(res);
+ return NULL;
+ }
+ }
+ else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "an integer is required");
+ }
+ return res;
+}
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+ Py_ssize_t ival;
+ PyObject *x;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(b)))
+ return PyInt_AS_LONG(b);
+#endif
+ if (likely(PyLong_CheckExact(b))) {
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(b)) {
+ case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
+ case 0: return 0;
+ case 1: return ((PyLongObject*)b)->ob_digit[0];
+ }
+ #endif
+ #endif
+ return PyLong_AsSsize_t(b);
+ }
+ x = PyNumber_Index(b);
+ if (!x) return -1;
+ ival = PyInt_AsSsize_t(x);
+ Py_DECREF(x);
+ return ival;
+}
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
+ return PyInt_FromSize_t(ival);
+}
+
+
+#endif /* Py_PYTHON_H */
diff --git a/scripts/external_libs/platform/cel59/zmq/backend/cython/constants.pxi b/scripts/external_libs/platform/cel59/zmq/backend/cython/constants.pxi
new file mode 100644
index 00000000..606e6cbf
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/constants.pxi
@@ -0,0 +1,318 @@
+#-----------------------------------------------------------------------------
+# Python module level constants
+#-----------------------------------------------------------------------------
+
+VERSION = ZMQ_VERSION
+VERSION_MAJOR = ZMQ_VERSION_MAJOR
+VERSION_MINOR = ZMQ_VERSION_MINOR
+VERSION_PATCH = ZMQ_VERSION_PATCH
+NOBLOCK = ZMQ_NOBLOCK
+DONTWAIT = ZMQ_DONTWAIT
+POLLIN = ZMQ_POLLIN
+POLLOUT = ZMQ_POLLOUT
+POLLERR = ZMQ_POLLERR
+SNDMORE = ZMQ_SNDMORE
+STREAMER = ZMQ_STREAMER
+FORWARDER = ZMQ_FORWARDER
+QUEUE = ZMQ_QUEUE
+IO_THREADS_DFLT = ZMQ_IO_THREADS_DFLT
+MAX_SOCKETS_DFLT = ZMQ_MAX_SOCKETS_DFLT
+POLLITEMS_DFLT = ZMQ_POLLITEMS_DFLT
+THREAD_PRIORITY_DFLT = ZMQ_THREAD_PRIORITY_DFLT
+THREAD_SCHED_POLICY_DFLT = ZMQ_THREAD_SCHED_POLICY_DFLT
+PAIR = ZMQ_PAIR
+PUB = ZMQ_PUB
+SUB = ZMQ_SUB
+REQ = ZMQ_REQ
+REP = ZMQ_REP
+DEALER = ZMQ_DEALER
+ROUTER = ZMQ_ROUTER
+XREQ = ZMQ_XREQ
+XREP = ZMQ_XREP
+PULL = ZMQ_PULL
+PUSH = ZMQ_PUSH
+XPUB = ZMQ_XPUB
+XSUB = ZMQ_XSUB
+UPSTREAM = ZMQ_UPSTREAM
+DOWNSTREAM = ZMQ_DOWNSTREAM
+STREAM = ZMQ_STREAM
+EVENT_CONNECTED = ZMQ_EVENT_CONNECTED
+EVENT_CONNECT_DELAYED = ZMQ_EVENT_CONNECT_DELAYED
+EVENT_CONNECT_RETRIED = ZMQ_EVENT_CONNECT_RETRIED
+EVENT_LISTENING = ZMQ_EVENT_LISTENING
+EVENT_BIND_FAILED = ZMQ_EVENT_BIND_FAILED
+EVENT_ACCEPTED = ZMQ_EVENT_ACCEPTED
+EVENT_ACCEPT_FAILED = ZMQ_EVENT_ACCEPT_FAILED
+EVENT_CLOSED = ZMQ_EVENT_CLOSED
+EVENT_CLOSE_FAILED = ZMQ_EVENT_CLOSE_FAILED
+EVENT_DISCONNECTED = ZMQ_EVENT_DISCONNECTED
+EVENT_ALL = ZMQ_EVENT_ALL
+EVENT_MONITOR_STOPPED = ZMQ_EVENT_MONITOR_STOPPED
+globals()['NULL'] = ZMQ_NULL
+PLAIN = ZMQ_PLAIN
+CURVE = ZMQ_CURVE
+GSSAPI = ZMQ_GSSAPI
+EAGAIN = ZMQ_EAGAIN
+EINVAL = ZMQ_EINVAL
+EFAULT = ZMQ_EFAULT
+ENOMEM = ZMQ_ENOMEM
+ENODEV = ZMQ_ENODEV
+EMSGSIZE = ZMQ_EMSGSIZE
+EAFNOSUPPORT = ZMQ_EAFNOSUPPORT
+ENETUNREACH = ZMQ_ENETUNREACH
+ECONNABORTED = ZMQ_ECONNABORTED
+ECONNRESET = ZMQ_ECONNRESET
+ENOTCONN = ZMQ_ENOTCONN
+ETIMEDOUT = ZMQ_ETIMEDOUT
+EHOSTUNREACH = ZMQ_EHOSTUNREACH
+ENETRESET = ZMQ_ENETRESET
+HAUSNUMERO = ZMQ_HAUSNUMERO
+ENOTSUP = ZMQ_ENOTSUP
+EPROTONOSUPPORT = ZMQ_EPROTONOSUPPORT
+ENOBUFS = ZMQ_ENOBUFS
+ENETDOWN = ZMQ_ENETDOWN
+EADDRINUSE = ZMQ_EADDRINUSE
+EADDRNOTAVAIL = ZMQ_EADDRNOTAVAIL
+ECONNREFUSED = ZMQ_ECONNREFUSED
+EINPROGRESS = ZMQ_EINPROGRESS
+ENOTSOCK = ZMQ_ENOTSOCK
+EFSM = ZMQ_EFSM
+ENOCOMPATPROTO = ZMQ_ENOCOMPATPROTO
+ETERM = ZMQ_ETERM
+EMTHREAD = ZMQ_EMTHREAD
+IO_THREADS = ZMQ_IO_THREADS
+MAX_SOCKETS = ZMQ_MAX_SOCKETS
+SOCKET_LIMIT = ZMQ_SOCKET_LIMIT
+THREAD_PRIORITY = ZMQ_THREAD_PRIORITY
+THREAD_SCHED_POLICY = ZMQ_THREAD_SCHED_POLICY
+IDENTITY = ZMQ_IDENTITY
+SUBSCRIBE = ZMQ_SUBSCRIBE
+UNSUBSCRIBE = ZMQ_UNSUBSCRIBE
+LAST_ENDPOINT = ZMQ_LAST_ENDPOINT
+TCP_ACCEPT_FILTER = ZMQ_TCP_ACCEPT_FILTER
+PLAIN_USERNAME = ZMQ_PLAIN_USERNAME
+PLAIN_PASSWORD = ZMQ_PLAIN_PASSWORD
+CURVE_PUBLICKEY = ZMQ_CURVE_PUBLICKEY
+CURVE_SECRETKEY = ZMQ_CURVE_SECRETKEY
+CURVE_SERVERKEY = ZMQ_CURVE_SERVERKEY
+ZAP_DOMAIN = ZMQ_ZAP_DOMAIN
+CONNECT_RID = ZMQ_CONNECT_RID
+GSSAPI_PRINCIPAL = ZMQ_GSSAPI_PRINCIPAL
+GSSAPI_SERVICE_PRINCIPAL = ZMQ_GSSAPI_SERVICE_PRINCIPAL
+SOCKS_PROXY = ZMQ_SOCKS_PROXY
+FD = ZMQ_FD
+IDENTITY_FD = ZMQ_IDENTITY_FD
+RECONNECT_IVL_MAX = ZMQ_RECONNECT_IVL_MAX
+SNDTIMEO = ZMQ_SNDTIMEO
+RCVTIMEO = ZMQ_RCVTIMEO
+SNDHWM = ZMQ_SNDHWM
+RCVHWM = ZMQ_RCVHWM
+MULTICAST_HOPS = ZMQ_MULTICAST_HOPS
+IPV4ONLY = ZMQ_IPV4ONLY
+ROUTER_BEHAVIOR = ZMQ_ROUTER_BEHAVIOR
+TCP_KEEPALIVE = ZMQ_TCP_KEEPALIVE
+TCP_KEEPALIVE_CNT = ZMQ_TCP_KEEPALIVE_CNT
+TCP_KEEPALIVE_IDLE = ZMQ_TCP_KEEPALIVE_IDLE
+TCP_KEEPALIVE_INTVL = ZMQ_TCP_KEEPALIVE_INTVL
+DELAY_ATTACH_ON_CONNECT = ZMQ_DELAY_ATTACH_ON_CONNECT
+XPUB_VERBOSE = ZMQ_XPUB_VERBOSE
+EVENTS = ZMQ_EVENTS
+TYPE = ZMQ_TYPE
+LINGER = ZMQ_LINGER
+RECONNECT_IVL = ZMQ_RECONNECT_IVL
+BACKLOG = ZMQ_BACKLOG
+ROUTER_MANDATORY = ZMQ_ROUTER_MANDATORY
+FAIL_UNROUTABLE = ZMQ_FAIL_UNROUTABLE
+ROUTER_RAW = ZMQ_ROUTER_RAW
+IMMEDIATE = ZMQ_IMMEDIATE
+IPV6 = ZMQ_IPV6
+MECHANISM = ZMQ_MECHANISM
+PLAIN_SERVER = ZMQ_PLAIN_SERVER
+CURVE_SERVER = ZMQ_CURVE_SERVER
+PROBE_ROUTER = ZMQ_PROBE_ROUTER
+REQ_RELAXED = ZMQ_REQ_RELAXED
+REQ_CORRELATE = ZMQ_REQ_CORRELATE
+CONFLATE = ZMQ_CONFLATE
+ROUTER_HANDOVER = ZMQ_ROUTER_HANDOVER
+TOS = ZMQ_TOS
+IPC_FILTER_PID = ZMQ_IPC_FILTER_PID
+IPC_FILTER_UID = ZMQ_IPC_FILTER_UID
+IPC_FILTER_GID = ZMQ_IPC_FILTER_GID
+GSSAPI_SERVER = ZMQ_GSSAPI_SERVER
+GSSAPI_PLAINTEXT = ZMQ_GSSAPI_PLAINTEXT
+HANDSHAKE_IVL = ZMQ_HANDSHAKE_IVL
+XPUB_NODROP = ZMQ_XPUB_NODROP
+AFFINITY = ZMQ_AFFINITY
+MAXMSGSIZE = ZMQ_MAXMSGSIZE
+HWM = ZMQ_HWM
+SWAP = ZMQ_SWAP
+MCAST_LOOP = ZMQ_MCAST_LOOP
+RECOVERY_IVL_MSEC = ZMQ_RECOVERY_IVL_MSEC
+RATE = ZMQ_RATE
+RECOVERY_IVL = ZMQ_RECOVERY_IVL
+SNDBUF = ZMQ_SNDBUF
+RCVBUF = ZMQ_RCVBUF
+RCVMORE = ZMQ_RCVMORE
+MORE = ZMQ_MORE
+SRCFD = ZMQ_SRCFD
+SHARED = ZMQ_SHARED
+
+#-----------------------------------------------------------------------------
+# Symbols to export
+#-----------------------------------------------------------------------------
+__all__ = [
+ "VERSION",
+ "VERSION_MAJOR",
+ "VERSION_MINOR",
+ "VERSION_PATCH",
+ "NOBLOCK",
+ "DONTWAIT",
+ "POLLIN",
+ "POLLOUT",
+ "POLLERR",
+ "SNDMORE",
+ "STREAMER",
+ "FORWARDER",
+ "QUEUE",
+ "IO_THREADS_DFLT",
+ "MAX_SOCKETS_DFLT",
+ "POLLITEMS_DFLT",
+ "THREAD_PRIORITY_DFLT",
+ "THREAD_SCHED_POLICY_DFLT",
+ "PAIR",
+ "PUB",
+ "SUB",
+ "REQ",
+ "REP",
+ "DEALER",
+ "ROUTER",
+ "XREQ",
+ "XREP",
+ "PULL",
+ "PUSH",
+ "XPUB",
+ "XSUB",
+ "UPSTREAM",
+ "DOWNSTREAM",
+ "STREAM",
+ "EVENT_CONNECTED",
+ "EVENT_CONNECT_DELAYED",
+ "EVENT_CONNECT_RETRIED",
+ "EVENT_LISTENING",
+ "EVENT_BIND_FAILED",
+ "EVENT_ACCEPTED",
+ "EVENT_ACCEPT_FAILED",
+ "EVENT_CLOSED",
+ "EVENT_CLOSE_FAILED",
+ "EVENT_DISCONNECTED",
+ "EVENT_ALL",
+ "EVENT_MONITOR_STOPPED",
+ "NULL",
+ "PLAIN",
+ "CURVE",
+ "GSSAPI",
+ "EAGAIN",
+ "EINVAL",
+ "EFAULT",
+ "ENOMEM",
+ "ENODEV",
+ "EMSGSIZE",
+ "EAFNOSUPPORT",
+ "ENETUNREACH",
+ "ECONNABORTED",
+ "ECONNRESET",
+ "ENOTCONN",
+ "ETIMEDOUT",
+ "EHOSTUNREACH",
+ "ENETRESET",
+ "HAUSNUMERO",
+ "ENOTSUP",
+ "EPROTONOSUPPORT",
+ "ENOBUFS",
+ "ENETDOWN",
+ "EADDRINUSE",
+ "EADDRNOTAVAIL",
+ "ECONNREFUSED",
+ "EINPROGRESS",
+ "ENOTSOCK",
+ "EFSM",
+ "ENOCOMPATPROTO",
+ "ETERM",
+ "EMTHREAD",
+ "IO_THREADS",
+ "MAX_SOCKETS",
+ "SOCKET_LIMIT",
+ "THREAD_PRIORITY",
+ "THREAD_SCHED_POLICY",
+ "IDENTITY",
+ "SUBSCRIBE",
+ "UNSUBSCRIBE",
+ "LAST_ENDPOINT",
+ "TCP_ACCEPT_FILTER",
+ "PLAIN_USERNAME",
+ "PLAIN_PASSWORD",
+ "CURVE_PUBLICKEY",
+ "CURVE_SECRETKEY",
+ "CURVE_SERVERKEY",
+ "ZAP_DOMAIN",
+ "CONNECT_RID",
+ "GSSAPI_PRINCIPAL",
+ "GSSAPI_SERVICE_PRINCIPAL",
+ "SOCKS_PROXY",
+ "FD",
+ "IDENTITY_FD",
+ "RECONNECT_IVL_MAX",
+ "SNDTIMEO",
+ "RCVTIMEO",
+ "SNDHWM",
+ "RCVHWM",
+ "MULTICAST_HOPS",
+ "IPV4ONLY",
+ "ROUTER_BEHAVIOR",
+ "TCP_KEEPALIVE",
+ "TCP_KEEPALIVE_CNT",
+ "TCP_KEEPALIVE_IDLE",
+ "TCP_KEEPALIVE_INTVL",
+ "DELAY_ATTACH_ON_CONNECT",
+ "XPUB_VERBOSE",
+ "EVENTS",
+ "TYPE",
+ "LINGER",
+ "RECONNECT_IVL",
+ "BACKLOG",
+ "ROUTER_MANDATORY",
+ "FAIL_UNROUTABLE",
+ "ROUTER_RAW",
+ "IMMEDIATE",
+ "IPV6",
+ "MECHANISM",
+ "PLAIN_SERVER",
+ "CURVE_SERVER",
+ "PROBE_ROUTER",
+ "REQ_RELAXED",
+ "REQ_CORRELATE",
+ "CONFLATE",
+ "ROUTER_HANDOVER",
+ "TOS",
+ "IPC_FILTER_PID",
+ "IPC_FILTER_UID",
+ "IPC_FILTER_GID",
+ "GSSAPI_SERVER",
+ "GSSAPI_PLAINTEXT",
+ "HANDSHAKE_IVL",
+ "XPUB_NODROP",
+ "AFFINITY",
+ "MAXMSGSIZE",
+ "HWM",
+ "SWAP",
+ "MCAST_LOOP",
+ "RECOVERY_IVL_MSEC",
+ "RATE",
+ "RECOVERY_IVL",
+ "SNDBUF",
+ "RCVBUF",
+ "RCVMORE",
+ "MORE",
+ "SRCFD",
+ "SHARED",
+]
diff --git a/scripts/external_libs/platform/cel59/zmq/backend/cython/constants.pyx b/scripts/external_libs/platform/cel59/zmq/backend/cython/constants.pyx
new file mode 100644
index 00000000..f924f030
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/constants.pyx
@@ -0,0 +1,32 @@
+"""0MQ Constants."""
+
+#
+# Copyright (c) 2010 Brian E. Granger & Min Ragan-Kelley
+#
+# This file is part of pyzmq.
+#
+# pyzmq is free software; you can redistribute it and/or modify it under
+# the terms of the Lesser GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# pyzmq is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# Lesser GNU General Public License for more details.
+#
+# You should have received a copy of the Lesser GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+#-----------------------------------------------------------------------------
+# Imports
+#-----------------------------------------------------------------------------
+
+from libzmq cimport *
+
+#-----------------------------------------------------------------------------
+# Python module level constants
+#-----------------------------------------------------------------------------
+
+include "constants.pxi"
diff --git a/scripts/external_libs/platform/cel59/zmq/backend/cython/context.c b/scripts/external_libs/platform/cel59/zmq/backend/cython/context.c
new file mode 100644
index 00000000..11eb40c9
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/context.c
@@ -0,0 +1,4754 @@
+/* Generated by Cython 0.21.2 */
+
+#define PY_SSIZE_T_CLEAN
+#ifndef CYTHON_USE_PYLONG_INTERNALS
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#else
+#include "pyconfig.h"
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 1
+#else
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#endif
+#endif
+#endif
+#include "Python.h"
+#ifndef Py_PYTHON_H
+ #error Python headers needed to compile C extensions, please install development version of Python.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+ #error Cython requires Python 2.6+ or Python 3.2+.
+#else
+#define CYTHON_ABI "0_21_2"
+#include <stddef.h>
+#ifndef offsetof
+#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+ #ifndef __stdcall
+ #define __stdcall
+ #endif
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
+ #ifndef __fastcall
+ #define __fastcall
+ #endif
+#endif
+#ifndef DL_IMPORT
+ #define DL_IMPORT(t) t
+#endif
+#ifndef DL_EXPORT
+ #define DL_EXPORT(t) t
+#endif
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifndef Py_HUGE_VAL
+ #define Py_HUGE_VAL HUGE_VAL
+#endif
+#ifdef PYPY_VERSION
+#define CYTHON_COMPILING_IN_PYPY 1
+#define CYTHON_COMPILING_IN_CPYTHON 0
+#else
+#define CYTHON_COMPILING_IN_PYPY 0
+#define CYTHON_COMPILING_IN_CPYTHON 1
+#endif
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
+#define Py_OptimizeFlag 0
+#endif
+#define __PYX_BUILD_PY_SSIZE_T "n"
+#define CYTHON_FORMAT_SSIZE_T "z"
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyClass_Type
+#else
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyType_Type
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define Py_TPFLAGS_CHECKTYPES 0
+ #define Py_TPFLAGS_HAVE_INDEX 0
+ #define Py_TPFLAGS_HAVE_NEWBUFFER 0
+#endif
+#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+ #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
+#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
+ #define CYTHON_PEP393_ENABLED 1
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
+ 0 : _PyUnicode_Ready((PyObject *)(op)))
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
+ #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
+ #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+#else
+ #define CYTHON_PEP393_ENABLED 0
+ #define __Pyx_PyUnicode_READY(op) (0)
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
+ #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
+ #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+ #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyFrozenSet_Size(s) PyObject_Size(s)
+#else
+ #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
+ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
+ #define __Pyx_PyFrozenSet_Size(s) PySet_Size(s)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
+#else
+ #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBaseString_Type PyUnicode_Type
+ #define PyStringObject PyUnicodeObject
+ #define PyString_Type PyUnicode_Type
+ #define PyString_Check PyUnicode_Check
+ #define PyString_CheckExact PyUnicode_CheckExact
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
+ #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
+#else
+ #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+ #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
+#endif
+#ifndef PySet_CheckExact
+ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
+#endif
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#if PY_MAJOR_VERSION >= 3
+ #define PyIntObject PyLongObject
+ #define PyInt_Type PyLong_Type
+ #define PyInt_Check(op) PyLong_Check(op)
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
+ #define PyInt_FromString PyLong_FromString
+ #define PyInt_FromUnicode PyLong_FromUnicode
+ #define PyInt_FromLong PyLong_FromLong
+ #define PyInt_FromSize_t PyLong_FromSize_t
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
+ #define PyInt_AsLong PyLong_AsLong
+ #define PyInt_AS_LONG PyLong_AS_LONG
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+ #define PyNumber_Int PyNumber_Long
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBoolObject PyLongObject
+#endif
+#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
+ #ifndef PyUnicode_InternFromString
+ #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
+ #endif
+#endif
+#if PY_VERSION_HEX < 0x030200A4
+ typedef long Py_hash_t;
+ #define __Pyx_PyInt_FromHash_t PyInt_FromLong
+ #define __Pyx_PyInt_AsHash_t PyInt_AsLong
+#else
+ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
+ #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+#else
+ #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
+#endif
+#ifndef CYTHON_INLINE
+ #if defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+#ifndef CYTHON_RESTRICT
+ #if defined(__GNUC__)
+ #define CYTHON_RESTRICT __restrict__
+ #elif defined(_MSC_VER) && _MSC_VER >= 1400
+ #define CYTHON_RESTRICT __restrict
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_RESTRICT restrict
+ #else
+ #define CYTHON_RESTRICT
+ #endif
+#endif
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
+#else
+static CYTHON_INLINE float __PYX_NAN() {
+ /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
+ a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
+ a quiet NaN. */
+ float value;
+ memset(&value, 0xFF, sizeof(value));
+ return value;
+}
+#endif
+#ifdef __cplusplus
+template<typename T>
+void __Pyx_call_destructor(T* x) {
+ x->~T();
+}
+#endif
+
+
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
+#else
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
+#endif
+
+#ifndef __PYX_EXTERN_C
+ #ifdef __cplusplus
+ #define __PYX_EXTERN_C extern "C"
+ #else
+ #define __PYX_EXTERN_C extern
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+#define _USE_MATH_DEFINES
+#endif
+#include <math.h>
+#define __PYX_HAVE__zmq__backend__cython__context
+#define __PYX_HAVE_API__zmq__backend__cython__context
+#include "string.h"
+#include "stdlib.h"
+#include "zmq_compat.h"
+#include "zmq.h"
+#include "zmq_utils.h"
+#include "getpid_compat.h"
+#include "errno.h"
+#include "stdio.h"
+#include "pythread.h"
+#ifdef _OPENMP
+#include <omp.h>
+#endif /* _OPENMP */
+
+#ifdef PYREX_WITHOUT_ASSERTIONS
+#define CYTHON_WITHOUT_ASSERTIONS
+#endif
+
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
+ const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \
+ (sizeof(type) < sizeof(Py_ssize_t)) || \
+ (sizeof(type) > sizeof(Py_ssize_t) && \
+ likely(v < (type)PY_SSIZE_T_MAX || \
+ v == (type)PY_SSIZE_T_MAX) && \
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \
+ v == (type)PY_SSIZE_T_MIN))) || \
+ (sizeof(type) == sizeof(Py_ssize_t) && \
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \
+ v == (type)PY_SSIZE_T_MAX))) )
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
+#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
+#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
+#define __Pyx_PyBytes_FromString PyBytes_FromString
+#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#else
+ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
+#endif
+#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
+#if PY_MAJOR_VERSION < 3
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
+{
+ const Py_UNICODE *u_end = u;
+ while (*u_end++) ;
+ return (size_t)(u_end - u - 1);
+}
+#else
+#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
+#endif
+#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
+#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
+#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
+#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
+#else
+#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
+#endif
+#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ PyObject* ascii_chars_u = NULL;
+ PyObject* ascii_chars_b = NULL;
+ const char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ if (strcmp(default_encoding_c, "ascii") == 0) {
+ __Pyx_sys_getdefaultencoding_not_ascii = 0;
+ } else {
+ char ascii_chars[128];
+ int c;
+ for (c = 0; c < 128; c++) {
+ ascii_chars[c] = c;
+ }
+ __Pyx_sys_getdefaultencoding_not_ascii = 1;
+ ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
+ if (!ascii_chars_u) goto bad;
+ ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
+ if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
+ PyErr_Format(
+ PyExc_ValueError,
+ "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
+ default_encoding_c);
+ goto bad;
+ }
+ Py_DECREF(ascii_chars_u);
+ Py_DECREF(ascii_chars_b);
+ }
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ Py_XDECREF(ascii_chars_u);
+ Py_XDECREF(ascii_chars_b);
+ return -1;
+}
+#endif
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
+#else
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+static char* __PYX_DEFAULT_STRING_ENCODING;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
+ if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
+ strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ return -1;
+}
+#endif
+#endif
+
+
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+ #define likely(x) __builtin_expect(!!(x), 1)
+ #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
+ #define likely(x) (x)
+ #define unlikely(x) (x)
+#endif /* __GNUC__ */
+
+static PyObject *__pyx_m;
+static PyObject *__pyx_d;
+static PyObject *__pyx_b;
+static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
+static int __pyx_lineno;
+static int __pyx_clineno = 0;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+
+
+static const char *__pyx_f[] = {
+ "zmq/backend/cython/context.pyx",
+ "zmq/backend/cython/context.pxd",
+ "zmq/backend/cython/checkrc.pxd",
+ "type.pxd",
+ "bool.pxd",
+ "complex.pxd",
+};
+
+/*--- Type declarations ---*/
+struct __pyx_obj_3zmq_7backend_6cython_7context_Context;
+
+/* "zmq/backend/cython/context.pxd":26
+ * #-----------------------------------------------------------------------------
+ *
+ * cdef class Context: # <<<<<<<<<<<<<<
+ *
+ * cdef object __weakref__ # enable weakref
+ */
+struct __pyx_obj_3zmq_7backend_6cython_7context_Context {
+ PyObject_HEAD
+ struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context *__pyx_vtab;
+ PyObject *__weakref__;
+ void *handle;
+ int _shadow;
+ void **_sockets;
+ size_t _n_sockets;
+ size_t _max_sockets;
+ int _pid;
+ int closed;
+};
+
+
+
+/* "zmq/backend/cython/context.pyx":20
+ * _instance = None
+ *
+ * cdef class Context: # <<<<<<<<<<<<<<
+ * """Context(io_threads=1)
+ *
+ */
+
+struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context {
+ int (*_term)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *);
+ void (*_add_socket)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *, void *);
+ void (*_remove_socket)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *, void *);
+};
+static struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context *__pyx_vtabptr_3zmq_7backend_6cython_7context_Context;
+static CYTHON_INLINE int __pyx_f_3zmq_7backend_6cython_7context_7Context__term(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *);
+static CYTHON_INLINE void __pyx_f_3zmq_7backend_6cython_7context_7Context__add_socket(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *, void *);
+static CYTHON_INLINE void __pyx_f_3zmq_7backend_6cython_7context_7Context__remove_socket(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *, void *);
+#ifndef CYTHON_REFNANNY
+ #define CYTHON_REFNANNY 0
+#endif
+#if CYTHON_REFNANNY
+ typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*SetupContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+ } __Pyx_RefNannyAPIStruct;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
+ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
+#ifdef WITH_THREAD
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ if (acquire_gil) { \
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ PyGILState_Release(__pyx_gilstate_save); \
+ } else { \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ }
+#else
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+#endif
+ #define __Pyx_RefNannyFinishContext() \
+ __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
+ #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
+ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
+#else
+ #define __Pyx_RefNannyDeclarations
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)
+ #define __Pyx_RefNannyFinishContext()
+ #define __Pyx_INCREF(r) Py_INCREF(r)
+ #define __Pyx_DECREF(r) Py_DECREF(r)
+ #define __Pyx_GOTREF(r)
+ #define __Pyx_GIVEREF(r)
+ #define __Pyx_XINCREF(r) Py_XINCREF(r)
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
+ #define __Pyx_XGOTREF(r)
+ #define __Pyx_XGIVEREF(r)
+#endif
+#define __Pyx_XDECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_XDECREF(tmp); \
+ } while (0)
+#define __Pyx_DECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_DECREF(tmp); \
+ } while (0)
+#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
+#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_getattro))
+ return tp->tp_getattro(obj, attr_name);
+#if PY_MAJOR_VERSION < 3
+ if (likely(tp->tp_getattr))
+ return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
+#endif
+ return PyObject_GetAttr(obj, attr_name);
+}
+#else
+#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
+#endif
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
+
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+ const char* function_name);
+
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+ Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
+#else
+#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
+#else
+#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
+#endif
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
+
+static void __Pyx_WriteUnraisable(const char *name, int clineno,
+ int lineno, const char *filename,
+ int full_traceback);
+
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
+
+static int __Pyx_SetVtable(PyObject *dict, void *vtable);
+
+static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name);
+
+typedef struct {
+ int code_line;
+ PyCodeObject* code_object;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+ int count;
+ int max_count;
+ __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename);
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);
+
+#ifndef __PYX_FORCE_INIT_THREADS
+ #define __PYX_FORCE_INIT_THREADS 0
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+
+static int __Pyx_check_binary_version(void);
+
+#if !defined(__Pyx_PyIdentifier_FromString)
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
+#else
+ #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
+#endif
+#endif
+
+static PyObject *__Pyx_ImportModule(const char *name);
+
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+
+static CYTHON_INLINE void __pyx_f_3zmq_7backend_6cython_7context_7Context__add_socket(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, void *__pyx_v_handle); /* proto*/
+static CYTHON_INLINE void __pyx_f_3zmq_7backend_6cython_7context_7Context__remove_socket(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, void *__pyx_v_handle); /* proto*/
+static CYTHON_INLINE int __pyx_f_3zmq_7backend_6cython_7context_7Context__term(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self); /* proto*/
+
+/* Module declarations from 'libc.string' */
+
+/* Module declarations from 'libc.stdlib' */
+
+/* Module declarations from 'zmq.backend.cython.libzmq' */
+
+/* Module declarations from 'libc.errno' */
+
+/* Module declarations from 'cpython.version' */
+
+/* Module declarations from 'cpython.ref' */
+
+/* Module declarations from 'cpython.exc' */
+
+/* Module declarations from 'cpython.module' */
+
+/* Module declarations from 'cpython.mem' */
+
+/* Module declarations from 'cpython.tuple' */
+
+/* Module declarations from 'cpython.list' */
+
+/* Module declarations from 'libc.stdio' */
+
+/* Module declarations from 'cpython.object' */
+
+/* Module declarations from 'cpython.sequence' */
+
+/* Module declarations from 'cpython.mapping' */
+
+/* Module declarations from 'cpython.iterator' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.type' */
+static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
+
+/* Module declarations from 'cpython.number' */
+
+/* Module declarations from 'cpython.int' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.bool' */
+static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
+
+/* Module declarations from 'cpython.long' */
+
+/* Module declarations from 'cpython.float' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.complex' */
+static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
+
+/* Module declarations from 'cpython.string' */
+
+/* Module declarations from 'cpython.unicode' */
+
+/* Module declarations from 'cpython.dict' */
+
+/* Module declarations from 'cpython.instance' */
+
+/* Module declarations from 'cpython.function' */
+
+/* Module declarations from 'cpython.method' */
+
+/* Module declarations from 'cpython.weakref' */
+
+/* Module declarations from 'cpython.getargs' */
+
+/* Module declarations from 'cpython.pythread' */
+
+/* Module declarations from 'cpython.pystate' */
+
+/* Module declarations from 'cpython.cobject' */
+
+/* Module declarations from 'cpython.oldbuffer' */
+
+/* Module declarations from 'cpython.set' */
+
+/* Module declarations from 'cpython.buffer' */
+
+/* Module declarations from 'cpython.bytes' */
+
+/* Module declarations from 'cpython.pycapsule' */
+
+/* Module declarations from 'cpython' */
+
+/* Module declarations from 'zmq.backend.cython.checkrc' */
+static CYTHON_INLINE int __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(int); /*proto*/
+
+/* Module declarations from 'zmq.backend.cython.context' */
+static PyTypeObject *__pyx_ptype_3zmq_7backend_6cython_7context_Context = 0;
+#define __Pyx_MODULE_NAME "zmq.backend.cython.context"
+int __pyx_module_is_main_zmq__backend__cython__context = 0;
+
+/* Implementation of 'zmq.backend.cython.context' */
+static PyObject *__pyx_builtin_property;
+static PyObject *__pyx_builtin_MemoryError;
+static PyObject *__pyx_builtin_range;
+static PyObject *__pyx_builtin_RuntimeError;
+static PyObject *__pyx_builtin_TypeError;
+static int __pyx_pf_3zmq_7backend_6cython_7context_7Context___init__(CYTHON_UNUSED struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_io_threads, CYTHON_UNUSED PyObject *__pyx_v_shadow); /* proto */
+static int __pyx_pf_3zmq_7backend_6cython_7context_7Context_2__cinit__(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, int __pyx_v_io_threads, size_t __pyx_v_shadow, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
+static void __pyx_pf_3zmq_7backend_6cython_7context_7Context_4__dealloc__(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7context_7Context_6underlying(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7context_7Context_8term(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7context_7Context_10set(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, int __pyx_v_option, PyObject *__pyx_v_optval); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7context_7Context_12get(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, int __pyx_v_option); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7context_7Context_14destroy(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, PyObject *__pyx_v_linger); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7context_7Context_6closed___get__(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self); /* proto */
+static int __pyx_pf_3zmq_7backend_6cython_7context_7Context_6closed_2__set__(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
+static PyObject *__pyx_tp_new_3zmq_7backend_6cython_7context_Context(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static char __pyx_k_all[] = "__all__";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_term[] = "term";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_Again[] = "Again";
+static char __pyx_k_range[] = "range";
+static char __pyx_k_handle[] = "_handle";
+static char __pyx_k_import[] = "__import__";
+static char __pyx_k_linger[] = "linger";
+static char __pyx_k_option[] = "option";
+static char __pyx_k_optval[] = "optval";
+static char __pyx_k_shadow[] = "shadow";
+static char __pyx_k_Context[] = "Context";
+static char __pyx_k_ZMQError[] = "ZMQError";
+static char __pyx_k_instance[] = "_instance";
+static char __pyx_k_property[] = "property";
+static char __pyx_k_TypeError[] = "TypeError";
+static char __pyx_k_zmq_error[] = "zmq.error";
+static char __pyx_k_io_threads[] = "io_threads";
+static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static char __pyx_k_underlying[] = "underlying";
+static char __pyx_k_MemoryError[] = "MemoryError";
+static char __pyx_k_RuntimeError[] = "RuntimeError";
+static char __pyx_k_0MQ_Context_class[] = "0MQ Context class.";
+static char __pyx_k_ContextTerminated[] = "ContextTerminated";
+static char __pyx_k_expected_int_got_r[] = "expected int, got: %r";
+static char __pyx_k_Context_has_been_destroyed[] = "Context has been destroyed";
+static char __pyx_k_Could_not_allocate__sockets_arra[] = "Could not allocate _sockets array";
+static char __pyx_k_Could_not_reallocate__sockets_ar[] = "Could not reallocate _sockets array";
+static PyObject *__pyx_n_s_Again;
+static PyObject *__pyx_n_s_Context;
+static PyObject *__pyx_n_s_ContextTerminated;
+static PyObject *__pyx_kp_s_Context_has_been_destroyed;
+static PyObject *__pyx_kp_s_Could_not_allocate__sockets_arra;
+static PyObject *__pyx_kp_s_Could_not_reallocate__sockets_ar;
+static PyObject *__pyx_n_s_MemoryError;
+static PyObject *__pyx_n_s_RuntimeError;
+static PyObject *__pyx_n_s_TypeError;
+static PyObject *__pyx_n_s_ZMQError;
+static PyObject *__pyx_n_s_all;
+static PyObject *__pyx_kp_s_expected_int_got_r;
+static PyObject *__pyx_n_s_handle;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_s_instance;
+static PyObject *__pyx_n_s_io_threads;
+static PyObject *__pyx_n_s_linger;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_option;
+static PyObject *__pyx_n_s_optval;
+static PyObject *__pyx_n_s_property;
+static PyObject *__pyx_n_s_pyx_vtable;
+static PyObject *__pyx_n_s_range;
+static PyObject *__pyx_n_s_shadow;
+static PyObject *__pyx_n_s_term;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_n_s_underlying;
+static PyObject *__pyx_n_s_zmq_error;
+static PyObject *__pyx_int_0;
+static PyObject *__pyx_int_1;
+static PyObject *__pyx_tuple_;
+static PyObject *__pyx_tuple__2;
+static PyObject *__pyx_tuple__3;
+static PyObject *__pyx_tuple__4;
+
+/* "zmq/backend/cython/context.pyx":32
+ *
+ * # no-op for the signature
+ * def __init__(self, io_threads=1, shadow=0): # <<<<<<<<<<<<<<
+ * pass
+ *
+ */
+
+/* Python wrapper */
+static int __pyx_pw_3zmq_7backend_6cython_7context_7Context_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_3zmq_7backend_6cython_7context_7Context_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ CYTHON_UNUSED PyObject *__pyx_v_io_threads = 0;
+ CYTHON_UNUSED PyObject *__pyx_v_shadow = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_io_threads,&__pyx_n_s_shadow,0};
+ PyObject* values[2] = {0,0};
+ values[0] = ((PyObject *)__pyx_int_1);
+ values[1] = ((PyObject *)__pyx_int_0);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_io_threads);
+ if (value) { values[0] = value; kw_args--; }
+ }
+ case 1:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shadow);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_io_threads = values[0];
+ __pyx_v_shadow = values[1];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("zmq.backend.cython.context.Context.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7context_7Context___init__(((struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)__pyx_v_self), __pyx_v_io_threads, __pyx_v_shadow);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_3zmq_7backend_6cython_7context_7Context___init__(CYTHON_UNUSED struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_io_threads, CYTHON_UNUSED PyObject *__pyx_v_shadow) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__init__", 0);
+
+ /* function exit code */
+ __pyx_r = 0;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/context.pyx":35
+ * pass
+ *
+ * def __cinit__(self, int io_threads=1, size_t shadow=0, **kwargs): # <<<<<<<<<<<<<<
+ * self.handle = NULL
+ * self._sockets = NULL
+ */
+
+/* Python wrapper */
+static int __pyx_pw_3zmq_7backend_6cython_7context_7Context_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_3zmq_7backend_6cython_7context_7Context_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ int __pyx_v_io_threads;
+ size_t __pyx_v_shadow;
+ CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+ __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
+ __Pyx_GOTREF(__pyx_v_kwargs);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_io_threads,&__pyx_n_s_shadow,0};
+ PyObject* values[2] = {0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_io_threads);
+ if (value) { values[0] = value; kw_args--; }
+ }
+ case 1:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shadow);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ if (values[0]) {
+ __pyx_v_io_threads = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_io_threads == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ } else {
+ __pyx_v_io_threads = ((int)1);
+ }
+ if (values[1]) {
+ __pyx_v_shadow = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_shadow == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ } else {
+ __pyx_v_shadow = ((size_t)0);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
+ __Pyx_AddTraceback("zmq.backend.cython.context.Context.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7context_7Context_2__cinit__(((struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)__pyx_v_self), __pyx_v_io_threads, __pyx_v_shadow, __pyx_v_kwargs);
+
+ /* function exit code */
+ __Pyx_XDECREF(__pyx_v_kwargs);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_3zmq_7backend_6cython_7context_7Context_2__cinit__(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, int __pyx_v_io_threads, size_t __pyx_v_shadow, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
+ int __pyx_v_rc;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_t_5;
+ int __pyx_t_6;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__cinit__", 0);
+
+ /* "zmq/backend/cython/context.pyx":36
+ *
+ * def __cinit__(self, int io_threads=1, size_t shadow=0, **kwargs):
+ * self.handle = NULL # <<<<<<<<<<<<<<
+ * self._sockets = NULL
+ * if shadow:
+ */
+ __pyx_v_self->handle = NULL;
+
+ /* "zmq/backend/cython/context.pyx":37
+ * def __cinit__(self, int io_threads=1, size_t shadow=0, **kwargs):
+ * self.handle = NULL
+ * self._sockets = NULL # <<<<<<<<<<<<<<
+ * if shadow:
+ * self.handle = <void *>shadow
+ */
+ __pyx_v_self->_sockets = NULL;
+
+ /* "zmq/backend/cython/context.pyx":38
+ * self.handle = NULL
+ * self._sockets = NULL
+ * if shadow: # <<<<<<<<<<<<<<
+ * self.handle = <void *>shadow
+ * self._shadow = True
+ */
+ __pyx_t_1 = (__pyx_v_shadow != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/context.pyx":39
+ * self._sockets = NULL
+ * if shadow:
+ * self.handle = <void *>shadow # <<<<<<<<<<<<<<
+ * self._shadow = True
+ * else:
+ */
+ __pyx_v_self->handle = ((void *)__pyx_v_shadow);
+
+ /* "zmq/backend/cython/context.pyx":40
+ * if shadow:
+ * self.handle = <void *>shadow
+ * self._shadow = True # <<<<<<<<<<<<<<
+ * else:
+ * self._shadow = False
+ */
+ __pyx_v_self->_shadow = 1;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "zmq/backend/cython/context.pyx":42
+ * self._shadow = True
+ * else:
+ * self._shadow = False # <<<<<<<<<<<<<<
+ * if ZMQ_VERSION_MAJOR >= 3:
+ * self.handle = zmq_ctx_new()
+ */
+ __pyx_v_self->_shadow = 0;
+
+ /* "zmq/backend/cython/context.pyx":43
+ * else:
+ * self._shadow = False
+ * if ZMQ_VERSION_MAJOR >= 3: # <<<<<<<<<<<<<<
+ * self.handle = zmq_ctx_new()
+ * else:
+ */
+ __pyx_t_1 = ((ZMQ_VERSION_MAJOR >= 3) != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/context.pyx":44
+ * self._shadow = False
+ * if ZMQ_VERSION_MAJOR >= 3:
+ * self.handle = zmq_ctx_new() # <<<<<<<<<<<<<<
+ * else:
+ * self.handle = zmq_init(io_threads)
+ */
+ __pyx_v_self->handle = zmq_ctx_new();
+ goto __pyx_L4;
+ }
+ /*else*/ {
+
+ /* "zmq/backend/cython/context.pyx":46
+ * self.handle = zmq_ctx_new()
+ * else:
+ * self.handle = zmq_init(io_threads) # <<<<<<<<<<<<<<
+ *
+ * if self.handle == NULL:
+ */
+ __pyx_v_self->handle = zmq_init(__pyx_v_io_threads);
+ }
+ __pyx_L4:;
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/context.pyx":48
+ * self.handle = zmq_init(io_threads)
+ *
+ * if self.handle == NULL: # <<<<<<<<<<<<<<
+ * raise ZMQError()
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->handle == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/context.pyx":49
+ *
+ * if self.handle == NULL:
+ * raise ZMQError() # <<<<<<<<<<<<<<
+ *
+ * cdef int rc = 0
+ */
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_ZMQError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ if (__pyx_t_4) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else {
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/context.pyx":51
+ * raise ZMQError()
+ *
+ * cdef int rc = 0 # <<<<<<<<<<<<<<
+ * if ZMQ_VERSION_MAJOR >= 3 and not self._shadow:
+ * rc = zmq_ctx_set(self.handle, ZMQ_IO_THREADS, io_threads)
+ */
+ __pyx_v_rc = 0;
+
+ /* "zmq/backend/cython/context.pyx":52
+ *
+ * cdef int rc = 0
+ * if ZMQ_VERSION_MAJOR >= 3 and not self._shadow: # <<<<<<<<<<<<<<
+ * rc = zmq_ctx_set(self.handle, ZMQ_IO_THREADS, io_threads)
+ * _check_rc(rc)
+ */
+ __pyx_t_5 = ((ZMQ_VERSION_MAJOR >= 3) != 0);
+ if (__pyx_t_5) {
+ } else {
+ __pyx_t_1 = __pyx_t_5;
+ goto __pyx_L7_bool_binop_done;
+ }
+ __pyx_t_5 = ((!(__pyx_v_self->_shadow != 0)) != 0);
+ __pyx_t_1 = __pyx_t_5;
+ __pyx_L7_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/context.pyx":53
+ * cdef int rc = 0
+ * if ZMQ_VERSION_MAJOR >= 3 and not self._shadow:
+ * rc = zmq_ctx_set(self.handle, ZMQ_IO_THREADS, io_threads) # <<<<<<<<<<<<<<
+ * _check_rc(rc)
+ *
+ */
+ __pyx_v_rc = zmq_ctx_set(__pyx_v_self->handle, ZMQ_IO_THREADS, __pyx_v_io_threads);
+
+ /* "zmq/backend/cython/context.pyx":54
+ * if ZMQ_VERSION_MAJOR >= 3 and not self._shadow:
+ * rc = zmq_ctx_set(self.handle, ZMQ_IO_THREADS, io_threads)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ *
+ * self.closed = False
+ */
+ __pyx_t_6 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+
+ /* "zmq/backend/cython/context.pyx":56
+ * _check_rc(rc)
+ *
+ * self.closed = False # <<<<<<<<<<<<<<
+ * self._n_sockets = 0
+ * self._max_sockets = 32
+ */
+ __pyx_v_self->closed = 0;
+
+ /* "zmq/backend/cython/context.pyx":57
+ *
+ * self.closed = False
+ * self._n_sockets = 0 # <<<<<<<<<<<<<<
+ * self._max_sockets = 32
+ *
+ */
+ __pyx_v_self->_n_sockets = 0;
+
+ /* "zmq/backend/cython/context.pyx":58
+ * self.closed = False
+ * self._n_sockets = 0
+ * self._max_sockets = 32 # <<<<<<<<<<<<<<
+ *
+ * self._sockets = <void **>malloc(self._max_sockets*sizeof(void *))
+ */
+ __pyx_v_self->_max_sockets = 32;
+
+ /* "zmq/backend/cython/context.pyx":60
+ * self._max_sockets = 32
+ *
+ * self._sockets = <void **>malloc(self._max_sockets*sizeof(void *)) # <<<<<<<<<<<<<<
+ * if self._sockets == NULL:
+ * raise MemoryError("Could not allocate _sockets array")
+ */
+ __pyx_v_self->_sockets = ((void **)malloc((__pyx_v_self->_max_sockets * (sizeof(void *)))));
+
+ /* "zmq/backend/cython/context.pyx":61
+ *
+ * self._sockets = <void **>malloc(self._max_sockets*sizeof(void *))
+ * if self._sockets == NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError("Could not allocate _sockets array")
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->_sockets == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/context.pyx":62
+ * self._sockets = <void **>malloc(self._max_sockets*sizeof(void *))
+ * if self._sockets == NULL:
+ * raise MemoryError("Could not allocate _sockets array") # <<<<<<<<<<<<<<
+ *
+ * self._pid = getpid()
+ */
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/context.pyx":64
+ * raise MemoryError("Could not allocate _sockets array")
+ *
+ * self._pid = getpid() # <<<<<<<<<<<<<<
+ *
+ * def __dealloc__(self):
+ */
+ __pyx_v_self->_pid = getpid();
+
+ /* "zmq/backend/cython/context.pyx":35
+ * pass
+ *
+ * def __cinit__(self, int io_threads=1, size_t shadow=0, **kwargs): # <<<<<<<<<<<<<<
+ * self.handle = NULL
+ * self._sockets = NULL
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("zmq.backend.cython.context.Context.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/context.pyx":66
+ * self._pid = getpid()
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * """don't touch members in dealloc, just cleanup allocations"""
+ * cdef int rc
+ */
+
+/* Python wrapper */
+static void __pyx_pw_3zmq_7backend_6cython_7context_7Context_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_pw_3zmq_7backend_6cython_7context_7Context_5__dealloc__(PyObject *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+ __pyx_pf_3zmq_7backend_6cython_7context_7Context_4__dealloc__(((struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_pf_3zmq_7backend_6cython_7context_7Context_4__dealloc__(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+ /* "zmq/backend/cython/context.pyx":69
+ * """don't touch members in dealloc, just cleanup allocations"""
+ * cdef int rc
+ * if self._sockets != NULL: # <<<<<<<<<<<<<<
+ * free(self._sockets)
+ * self._sockets = NULL
+ */
+ __pyx_t_1 = ((__pyx_v_self->_sockets != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/context.pyx":70
+ * cdef int rc
+ * if self._sockets != NULL:
+ * free(self._sockets) # <<<<<<<<<<<<<<
+ * self._sockets = NULL
+ * self._n_sockets = 0
+ */
+ free(__pyx_v_self->_sockets);
+
+ /* "zmq/backend/cython/context.pyx":71
+ * if self._sockets != NULL:
+ * free(self._sockets)
+ * self._sockets = NULL # <<<<<<<<<<<<<<
+ * self._n_sockets = 0
+ *
+ */
+ __pyx_v_self->_sockets = NULL;
+
+ /* "zmq/backend/cython/context.pyx":72
+ * free(self._sockets)
+ * self._sockets = NULL
+ * self._n_sockets = 0 # <<<<<<<<<<<<<<
+ *
+ * # we can't call object methods in dealloc as it
+ */
+ __pyx_v_self->_n_sockets = 0;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/context.pyx":76
+ * # we can't call object methods in dealloc as it
+ * # might already be partially deleted
+ * if not self._shadow: # <<<<<<<<<<<<<<
+ * self._term()
+ *
+ */
+ __pyx_t_1 = ((!(__pyx_v_self->_shadow != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/context.pyx":77
+ * # might already be partially deleted
+ * if not self._shadow:
+ * self._term() # <<<<<<<<<<<<<<
+ *
+ * cdef inline void _add_socket(self, void* handle):
+ */
+ __pyx_f_3zmq_7backend_6cython_7context_7Context__term(__pyx_v_self);
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "zmq/backend/cython/context.pyx":66
+ * self._pid = getpid()
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * """don't touch members in dealloc, just cleanup allocations"""
+ * cdef int rc
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "zmq/backend/cython/context.pyx":79
+ * self._term()
+ *
+ * cdef inline void _add_socket(self, void* handle): # <<<<<<<<<<<<<<
+ * """Add a socket handle to be closed when Context terminates.
+ *
+ */
+
+static CYTHON_INLINE void __pyx_f_3zmq_7backend_6cython_7context_7Context__add_socket(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, void *__pyx_v_handle) {
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_add_socket", 0);
+
+ /* "zmq/backend/cython/context.pyx":84
+ * This is to be called in the Socket constructor.
+ * """
+ * if self._n_sockets >= self._max_sockets: # <<<<<<<<<<<<<<
+ * self._max_sockets *= 2
+ * self._sockets = <void **>realloc(self._sockets, self._max_sockets*sizeof(void *))
+ */
+ __pyx_t_1 = ((__pyx_v_self->_n_sockets >= __pyx_v_self->_max_sockets) != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/context.pyx":85
+ * """
+ * if self._n_sockets >= self._max_sockets:
+ * self._max_sockets *= 2 # <<<<<<<<<<<<<<
+ * self._sockets = <void **>realloc(self._sockets, self._max_sockets*sizeof(void *))
+ * if self._sockets == NULL:
+ */
+ __pyx_v_self->_max_sockets = (__pyx_v_self->_max_sockets * 2);
+
+ /* "zmq/backend/cython/context.pyx":86
+ * if self._n_sockets >= self._max_sockets:
+ * self._max_sockets *= 2
+ * self._sockets = <void **>realloc(self._sockets, self._max_sockets*sizeof(void *)) # <<<<<<<<<<<<<<
+ * if self._sockets == NULL:
+ * raise MemoryError("Could not reallocate _sockets array")
+ */
+ __pyx_v_self->_sockets = ((void **)realloc(__pyx_v_self->_sockets, (__pyx_v_self->_max_sockets * (sizeof(void *)))));
+
+ /* "zmq/backend/cython/context.pyx":87
+ * self._max_sockets *= 2
+ * self._sockets = <void **>realloc(self._sockets, self._max_sockets*sizeof(void *))
+ * if self._sockets == NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError("Could not reallocate _sockets array")
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->_sockets == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/context.pyx":88
+ * self._sockets = <void **>realloc(self._sockets, self._max_sockets*sizeof(void *))
+ * if self._sockets == NULL:
+ * raise MemoryError("Could not reallocate _sockets array") # <<<<<<<<<<<<<<
+ *
+ * self._sockets[self._n_sockets] = handle
+ */
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/context.pyx":90
+ * raise MemoryError("Could not reallocate _sockets array")
+ *
+ * self._sockets[self._n_sockets] = handle # <<<<<<<<<<<<<<
+ * self._n_sockets += 1
+ *
+ */
+ (__pyx_v_self->_sockets[__pyx_v_self->_n_sockets]) = __pyx_v_handle;
+
+ /* "zmq/backend/cython/context.pyx":91
+ *
+ * self._sockets[self._n_sockets] = handle
+ * self._n_sockets += 1 # <<<<<<<<<<<<<<
+ *
+ * cdef inline void _remove_socket(self, void* handle):
+ */
+ __pyx_v_self->_n_sockets = (__pyx_v_self->_n_sockets + 1);
+
+ /* "zmq/backend/cython/context.pyx":79
+ * self._term()
+ *
+ * cdef inline void _add_socket(self, void* handle): # <<<<<<<<<<<<<<
+ * """Add a socket handle to be closed when Context terminates.
+ *
+ */
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_WriteUnraisable("zmq.backend.cython.context.Context._add_socket", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "zmq/backend/cython/context.pyx":93
+ * self._n_sockets += 1
+ *
+ * cdef inline void _remove_socket(self, void* handle): # <<<<<<<<<<<<<<
+ * """Remove a socket from the collected handles.
+ *
+ */
+
+static CYTHON_INLINE void __pyx_f_3zmq_7backend_6cython_7context_7Context__remove_socket(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, void *__pyx_v_handle) {
+ int __pyx_v_found;
+ size_t __pyx_v_idx;
+ __Pyx_RefNannyDeclarations
+ size_t __pyx_t_1;
+ size_t __pyx_t_2;
+ int __pyx_t_3;
+ __Pyx_RefNannySetupContext("_remove_socket", 0);
+
+ /* "zmq/backend/cython/context.pyx":99
+ * close a socket a second time.
+ * """
+ * cdef bint found = False # <<<<<<<<<<<<<<
+ *
+ * for idx in range(self._n_sockets):
+ */
+ __pyx_v_found = 0;
+
+ /* "zmq/backend/cython/context.pyx":101
+ * cdef bint found = False
+ *
+ * for idx in range(self._n_sockets): # <<<<<<<<<<<<<<
+ * if self._sockets[idx] == handle:
+ * found=True
+ */
+ __pyx_t_1 = __pyx_v_self->_n_sockets;
+ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_idx = __pyx_t_2;
+
+ /* "zmq/backend/cython/context.pyx":102
+ *
+ * for idx in range(self._n_sockets):
+ * if self._sockets[idx] == handle: # <<<<<<<<<<<<<<
+ * found=True
+ * break
+ */
+ __pyx_t_3 = (((__pyx_v_self->_sockets[__pyx_v_idx]) == __pyx_v_handle) != 0);
+ if (__pyx_t_3) {
+
+ /* "zmq/backend/cython/context.pyx":103
+ * for idx in range(self._n_sockets):
+ * if self._sockets[idx] == handle:
+ * found=True # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_found = 1;
+
+ /* "zmq/backend/cython/context.pyx":104
+ * if self._sockets[idx] == handle:
+ * found=True
+ * break # <<<<<<<<<<<<<<
+ *
+ * if found:
+ */
+ goto __pyx_L4_break;
+ }
+ }
+ __pyx_L4_break:;
+
+ /* "zmq/backend/cython/context.pyx":106
+ * break
+ *
+ * if found: # <<<<<<<<<<<<<<
+ * self._n_sockets -= 1
+ * if self._n_sockets:
+ */
+ __pyx_t_3 = (__pyx_v_found != 0);
+ if (__pyx_t_3) {
+
+ /* "zmq/backend/cython/context.pyx":107
+ *
+ * if found:
+ * self._n_sockets -= 1 # <<<<<<<<<<<<<<
+ * if self._n_sockets:
+ * # move last handle to closed socket's index
+ */
+ __pyx_v_self->_n_sockets = (__pyx_v_self->_n_sockets - 1);
+
+ /* "zmq/backend/cython/context.pyx":108
+ * if found:
+ * self._n_sockets -= 1
+ * if self._n_sockets: # <<<<<<<<<<<<<<
+ * # move last handle to closed socket's index
+ * self._sockets[idx] = self._sockets[self._n_sockets]
+ */
+ __pyx_t_3 = (__pyx_v_self->_n_sockets != 0);
+ if (__pyx_t_3) {
+
+ /* "zmq/backend/cython/context.pyx":110
+ * if self._n_sockets:
+ * # move last handle to closed socket's index
+ * self._sockets[idx] = self._sockets[self._n_sockets] # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ (__pyx_v_self->_sockets[__pyx_v_idx]) = (__pyx_v_self->_sockets[__pyx_v_self->_n_sockets]);
+ goto __pyx_L7;
+ }
+ __pyx_L7:;
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+
+ /* "zmq/backend/cython/context.pyx":93
+ * self._n_sockets += 1
+ *
+ * cdef inline void _remove_socket(self, void* handle): # <<<<<<<<<<<<<<
+ * """Remove a socket from the collected handles.
+ *
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "zmq/backend/cython/context.pyx":114
+ *
+ * @property
+ * def underlying(self): # <<<<<<<<<<<<<<
+ * """The address of the underlying libzmq context"""
+ * return <size_t> self.handle
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7context_7Context_7underlying(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_7context_7Context_6underlying[] = "The address of the underlying libzmq context";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7context_7Context_7underlying(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("underlying (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7context_7Context_6underlying(((struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7context_7Context_6underlying(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("underlying", 0);
+
+ /* "zmq/backend/cython/context.pyx":116
+ * def underlying(self):
+ * """The address of the underlying libzmq context"""
+ * return <size_t> self.handle # <<<<<<<<<<<<<<
+ *
+ * # backward-compat, though nobody is using it
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_self->handle)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/context.pyx":114
+ *
+ * @property
+ * def underlying(self): # <<<<<<<<<<<<<<
+ * """The address of the underlying libzmq context"""
+ * return <size_t> self.handle
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("zmq.backend.cython.context.Context.underlying", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/context.pyx":121
+ * _handle = underlying
+ *
+ * cdef inline int _term(self): # <<<<<<<<<<<<<<
+ * cdef int rc=0
+ * if self.handle != NULL and not self.closed and getpid() == self._pid:
+ */
+
+static CYTHON_INLINE int __pyx_f_3zmq_7backend_6cython_7context_7Context__term(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self) {
+ int __pyx_v_rc;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ __Pyx_RefNannySetupContext("_term", 0);
+
+ /* "zmq/backend/cython/context.pyx":122
+ *
+ * cdef inline int _term(self):
+ * cdef int rc=0 # <<<<<<<<<<<<<<
+ * if self.handle != NULL and not self.closed and getpid() == self._pid:
+ * with nogil:
+ */
+ __pyx_v_rc = 0;
+
+ /* "zmq/backend/cython/context.pyx":123
+ * cdef inline int _term(self):
+ * cdef int rc=0
+ * if self.handle != NULL and not self.closed and getpid() == self._pid: # <<<<<<<<<<<<<<
+ * with nogil:
+ * rc = zmq_ctx_destroy(self.handle)
+ */
+ __pyx_t_2 = ((__pyx_v_self->handle != NULL) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_2 = ((!(__pyx_v_self->closed != 0)) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_2 = ((getpid() == __pyx_v_self->_pid) != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L4_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/context.pyx":124
+ * cdef int rc=0
+ * if self.handle != NULL and not self.closed and getpid() == self._pid:
+ * with nogil: # <<<<<<<<<<<<<<
+ * rc = zmq_ctx_destroy(self.handle)
+ * self.handle = NULL
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ #endif
+ /*try:*/ {
+
+ /* "zmq/backend/cython/context.pyx":125
+ * if self.handle != NULL and not self.closed and getpid() == self._pid:
+ * with nogil:
+ * rc = zmq_ctx_destroy(self.handle) # <<<<<<<<<<<<<<
+ * self.handle = NULL
+ * return rc
+ */
+ __pyx_v_rc = zmq_ctx_destroy(__pyx_v_self->handle);
+ }
+
+ /* "zmq/backend/cython/context.pyx":124
+ * cdef int rc=0
+ * if self.handle != NULL and not self.closed and getpid() == self._pid:
+ * with nogil: # <<<<<<<<<<<<<<
+ * rc = zmq_ctx_destroy(self.handle)
+ * self.handle = NULL
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L9;
+ }
+ __pyx_L9:;
+ }
+ }
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/context.pyx":126
+ * with nogil:
+ * rc = zmq_ctx_destroy(self.handle)
+ * self.handle = NULL # <<<<<<<<<<<<<<
+ * return rc
+ *
+ */
+ __pyx_v_self->handle = NULL;
+
+ /* "zmq/backend/cython/context.pyx":127
+ * rc = zmq_ctx_destroy(self.handle)
+ * self.handle = NULL
+ * return rc # <<<<<<<<<<<<<<
+ *
+ * def term(self):
+ */
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/context.pyx":121
+ * _handle = underlying
+ *
+ * cdef inline int _term(self): # <<<<<<<<<<<<<<
+ * cdef int rc=0
+ * if self.handle != NULL and not self.closed and getpid() == self._pid:
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/context.pyx":129
+ * return rc
+ *
+ * def term(self): # <<<<<<<<<<<<<<
+ * """ctx.term()
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7context_7Context_9term(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_7context_7Context_8term[] = "ctx.term()\n\n Close or terminate the context.\n \n This can be called to close the context by hand. If this is not called,\n the context will automatically be closed when it is garbage collected.\n ";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7context_7Context_9term(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("term (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7context_7Context_8term(((struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7context_7Context_8term(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self) {
+ CYTHON_UNUSED int __pyx_v_rc;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("term", 0);
+
+ /* "zmq/backend/cython/context.pyx":138
+ * """
+ * cdef int rc
+ * rc = self._term() # <<<<<<<<<<<<<<
+ * self.closed = True
+ *
+ */
+ __pyx_v_rc = __pyx_f_3zmq_7backend_6cython_7context_7Context__term(__pyx_v_self);
+
+ /* "zmq/backend/cython/context.pyx":139
+ * cdef int rc
+ * rc = self._term()
+ * self.closed = True # <<<<<<<<<<<<<<
+ *
+ * def set(self, int option, optval):
+ */
+ __pyx_v_self->closed = 1;
+
+ /* "zmq/backend/cython/context.pyx":129
+ * return rc
+ *
+ * def term(self): # <<<<<<<<<<<<<<
+ * """ctx.term()
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/context.pyx":141
+ * self.closed = True
+ *
+ * def set(self, int option, optval): # <<<<<<<<<<<<<<
+ * """ctx.set(option, optval)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7context_7Context_11set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_7context_7Context_10set[] = "ctx.set(option, optval)\n\n Set a context option.\n\n See the 0MQ API documentation for zmq_ctx_set\n for details on specific options.\n \n .. versionadded:: libzmq-3.2\n .. versionadded:: 13.0\n\n Parameters\n ----------\n option : int\n The option to set. Available values will depend on your\n version of libzmq. Examples include::\n \n zmq.IO_THREADS, zmq.MAX_SOCKETS\n \n optval : int\n The value of the option to set.\n ";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7context_7Context_11set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ int __pyx_v_option;
+ PyObject *__pyx_v_optval = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("set (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_option,&__pyx_n_s_optval,0};
+ PyObject* values[2] = {0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_option)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_optval)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ }
+ __pyx_v_option = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_option == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_optval = values[1];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("zmq.backend.cython.context.Context.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7context_7Context_10set(((struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)__pyx_v_self), __pyx_v_option, __pyx_v_optval);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7context_7Context_10set(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, int __pyx_v_option, PyObject *__pyx_v_optval) {
+ int __pyx_v_optval_int_c;
+ int __pyx_v_rc;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("set", 0);
+
+ /* "zmq/backend/cython/context.pyx":167
+ * cdef char* optval_c
+ *
+ * if self.closed: # <<<<<<<<<<<<<<
+ * raise RuntimeError("Context has been destroyed")
+ *
+ */
+ __pyx_t_1 = (__pyx_v_self->closed != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/context.pyx":168
+ *
+ * if self.closed:
+ * raise RuntimeError("Context has been destroyed") # <<<<<<<<<<<<<<
+ *
+ * if not isinstance(optval, int):
+ */
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/context.pyx":170
+ * raise RuntimeError("Context has been destroyed")
+ *
+ * if not isinstance(optval, int): # <<<<<<<<<<<<<<
+ * raise TypeError('expected int, got: %r' % optval)
+ * optval_int_c = optval
+ */
+ __pyx_t_1 = PyInt_Check(__pyx_v_optval);
+ __pyx_t_3 = ((!(__pyx_t_1 != 0)) != 0);
+ if (__pyx_t_3) {
+
+ /* "zmq/backend/cython/context.pyx":171
+ *
+ * if not isinstance(optval, int):
+ * raise TypeError('expected int, got: %r' % optval) # <<<<<<<<<<<<<<
+ * optval_int_c = optval
+ * rc = zmq_ctx_set(self.handle, option, optval_int_c)
+ */
+ __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_expected_int_got_r, __pyx_v_optval); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/context.pyx":172
+ * if not isinstance(optval, int):
+ * raise TypeError('expected int, got: %r' % optval)
+ * optval_int_c = optval # <<<<<<<<<<<<<<
+ * rc = zmq_ctx_set(self.handle, option, optval_int_c)
+ * _check_rc(rc)
+ */
+ __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_optval); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_optval_int_c = __pyx_t_5;
+
+ /* "zmq/backend/cython/context.pyx":173
+ * raise TypeError('expected int, got: %r' % optval)
+ * optval_int_c = optval
+ * rc = zmq_ctx_set(self.handle, option, optval_int_c) # <<<<<<<<<<<<<<
+ * _check_rc(rc)
+ *
+ */
+ __pyx_v_rc = zmq_ctx_set(__pyx_v_self->handle, __pyx_v_option, __pyx_v_optval_int_c);
+
+ /* "zmq/backend/cython/context.pyx":174
+ * optval_int_c = optval
+ * rc = zmq_ctx_set(self.handle, option, optval_int_c)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ *
+ * def get(self, int option):
+ */
+ __pyx_t_5 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/context.pyx":141
+ * self.closed = True
+ *
+ * def set(self, int option, optval): # <<<<<<<<<<<<<<
+ * """ctx.set(option, optval)
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("zmq.backend.cython.context.Context.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/context.pyx":176
+ * _check_rc(rc)
+ *
+ * def get(self, int option): # <<<<<<<<<<<<<<
+ * """ctx.get(option)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7context_7Context_13get(PyObject *__pyx_v_self, PyObject *__pyx_arg_option); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_7context_7Context_12get[] = "ctx.get(option)\n\n Get the value of a context option.\n\n See the 0MQ API documentation for zmq_ctx_get\n for details on specific options.\n \n .. versionadded:: libzmq-3.2\n .. versionadded:: 13.0\n\n Parameters\n ----------\n option : int\n The option to get. Available values will depend on your\n version of libzmq. Examples include::\n \n zmq.IO_THREADS, zmq.MAX_SOCKETS\n \n Returns\n -------\n optval : int\n The value of the option as an integer.\n ";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7context_7Context_13get(PyObject *__pyx_v_self, PyObject *__pyx_arg_option) {
+ int __pyx_v_option;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("get (wrapper)", 0);
+ assert(__pyx_arg_option); {
+ __pyx_v_option = __Pyx_PyInt_As_int(__pyx_arg_option); if (unlikely((__pyx_v_option == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("zmq.backend.cython.context.Context.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7context_7Context_12get(((struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)__pyx_v_self), ((int)__pyx_v_option));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7context_7Context_12get(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, int __pyx_v_option) {
+ int __pyx_v_rc;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("get", 0);
+
+ /* "zmq/backend/cython/context.pyx":204
+ * cdef int rc
+ *
+ * if self.closed: # <<<<<<<<<<<<<<
+ * raise RuntimeError("Context has been destroyed")
+ *
+ */
+ __pyx_t_1 = (__pyx_v_self->closed != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/context.pyx":205
+ *
+ * if self.closed:
+ * raise RuntimeError("Context has been destroyed") # <<<<<<<<<<<<<<
+ *
+ * rc = zmq_ctx_get(self.handle, option)
+ */
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/context.pyx":207
+ * raise RuntimeError("Context has been destroyed")
+ *
+ * rc = zmq_ctx_get(self.handle, option) # <<<<<<<<<<<<<<
+ * _check_rc(rc)
+ *
+ */
+ __pyx_v_rc = zmq_ctx_get(__pyx_v_self->handle, __pyx_v_option);
+
+ /* "zmq/backend/cython/context.pyx":208
+ *
+ * rc = zmq_ctx_get(self.handle, option)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ *
+ * return rc
+ */
+ __pyx_t_3 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/context.pyx":210
+ * _check_rc(rc)
+ *
+ * return rc # <<<<<<<<<<<<<<
+ *
+ * def destroy(self, linger=None):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/context.pyx":176
+ * _check_rc(rc)
+ *
+ * def get(self, int option): # <<<<<<<<<<<<<<
+ * """ctx.get(option)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("zmq.backend.cython.context.Context.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/context.pyx":212
+ * return rc
+ *
+ * def destroy(self, linger=None): # <<<<<<<<<<<<<<
+ * """ctx.destroy(linger=None)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7context_7Context_15destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_7context_7Context_14destroy[] = "ctx.destroy(linger=None)\n \n Close all sockets associated with this context, and then terminate\n the context. If linger is specified,\n the LINGER sockopt of the sockets will be set prior to closing.\n \n .. warning::\n \n destroy involves calling ``zmq_close()``, which is **NOT** threadsafe.\n If there are active sockets in other threads, this must not be called.\n ";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7context_7Context_15destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_linger = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("destroy (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_linger,0};
+ PyObject* values[1] = {0};
+ values[0] = ((PyObject *)Py_None);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_linger);
+ if (value) { values[0] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "destroy") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_linger = values[0];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("destroy", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("zmq.backend.cython.context.Context.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7context_7Context_14destroy(((struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)__pyx_v_self), __pyx_v_linger);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7context_7Context_14destroy(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, PyObject *__pyx_v_linger) {
+ int __pyx_v_linger_c;
+ int __pyx_v_setlinger;
+ int __pyx_v_rc;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("destroy", 0);
+
+ /* "zmq/backend/cython/context.pyx":226
+ *
+ * cdef int linger_c
+ * cdef bint setlinger=False # <<<<<<<<<<<<<<
+ *
+ * if linger is not None:
+ */
+ __pyx_v_setlinger = 0;
+
+ /* "zmq/backend/cython/context.pyx":228
+ * cdef bint setlinger=False
+ *
+ * if linger is not None: # <<<<<<<<<<<<<<
+ * linger_c = linger
+ * setlinger=True
+ */
+ __pyx_t_1 = (__pyx_v_linger != Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/context.pyx":229
+ *
+ * if linger is not None:
+ * linger_c = linger # <<<<<<<<<<<<<<
+ * setlinger=True
+ *
+ */
+ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_linger); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_linger_c = __pyx_t_3;
+
+ /* "zmq/backend/cython/context.pyx":230
+ * if linger is not None:
+ * linger_c = linger
+ * setlinger=True # <<<<<<<<<<<<<<
+ *
+ * if self.handle != NULL and not self.closed and self._n_sockets:
+ */
+ __pyx_v_setlinger = 1;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/context.pyx":232
+ * setlinger=True
+ *
+ * if self.handle != NULL and not self.closed and self._n_sockets: # <<<<<<<<<<<<<<
+ * while self._n_sockets:
+ * if setlinger:
+ */
+ __pyx_t_1 = ((__pyx_v_self->handle != NULL) != 0);
+ if (__pyx_t_1) {
+ } else {
+ __pyx_t_2 = __pyx_t_1;
+ goto __pyx_L5_bool_binop_done;
+ }
+ __pyx_t_1 = ((!(__pyx_v_self->closed != 0)) != 0);
+ if (__pyx_t_1) {
+ } else {
+ __pyx_t_2 = __pyx_t_1;
+ goto __pyx_L5_bool_binop_done;
+ }
+ __pyx_t_1 = (__pyx_v_self->_n_sockets != 0);
+ __pyx_t_2 = __pyx_t_1;
+ __pyx_L5_bool_binop_done:;
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/context.pyx":233
+ *
+ * if self.handle != NULL and not self.closed and self._n_sockets:
+ * while self._n_sockets: # <<<<<<<<<<<<<<
+ * if setlinger:
+ * zmq_setsockopt(self._sockets[0], ZMQ_LINGER, &linger_c, sizeof(int))
+ */
+ while (1) {
+ __pyx_t_2 = (__pyx_v_self->_n_sockets != 0);
+ if (!__pyx_t_2) break;
+
+ /* "zmq/backend/cython/context.pyx":234
+ * if self.handle != NULL and not self.closed and self._n_sockets:
+ * while self._n_sockets:
+ * if setlinger: # <<<<<<<<<<<<<<
+ * zmq_setsockopt(self._sockets[0], ZMQ_LINGER, &linger_c, sizeof(int))
+ * rc = zmq_close(self._sockets[0])
+ */
+ __pyx_t_2 = (__pyx_v_setlinger != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/context.pyx":235
+ * while self._n_sockets:
+ * if setlinger:
+ * zmq_setsockopt(self._sockets[0], ZMQ_LINGER, &linger_c, sizeof(int)) # <<<<<<<<<<<<<<
+ * rc = zmq_close(self._sockets[0])
+ * if rc < 0 and zmq_errno() != ZMQ_ENOTSOCK:
+ */
+ zmq_setsockopt((__pyx_v_self->_sockets[0]), ZMQ_LINGER, (&__pyx_v_linger_c), (sizeof(int)));
+ goto __pyx_L10;
+ }
+ __pyx_L10:;
+
+ /* "zmq/backend/cython/context.pyx":236
+ * if setlinger:
+ * zmq_setsockopt(self._sockets[0], ZMQ_LINGER, &linger_c, sizeof(int))
+ * rc = zmq_close(self._sockets[0]) # <<<<<<<<<<<<<<
+ * if rc < 0 and zmq_errno() != ZMQ_ENOTSOCK:
+ * raise ZMQError()
+ */
+ __pyx_v_rc = zmq_close((__pyx_v_self->_sockets[0]));
+
+ /* "zmq/backend/cython/context.pyx":237
+ * zmq_setsockopt(self._sockets[0], ZMQ_LINGER, &linger_c, sizeof(int))
+ * rc = zmq_close(self._sockets[0])
+ * if rc < 0 and zmq_errno() != ZMQ_ENOTSOCK: # <<<<<<<<<<<<<<
+ * raise ZMQError()
+ * self._n_sockets -= 1
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ } else {
+ __pyx_t_2 = __pyx_t_1;
+ goto __pyx_L12_bool_binop_done;
+ }
+ __pyx_t_1 = ((zmq_errno() != ENOTSOCK) != 0);
+ __pyx_t_2 = __pyx_t_1;
+ __pyx_L12_bool_binop_done:;
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/context.pyx":238
+ * rc = zmq_close(self._sockets[0])
+ * if rc < 0 and zmq_errno() != ZMQ_ENOTSOCK:
+ * raise ZMQError() # <<<<<<<<<<<<<<
+ * self._n_sockets -= 1
+ * self._sockets[0] = self._sockets[self._n_sockets]
+ */
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_ZMQError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ }
+ }
+ if (__pyx_t_6) {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else {
+ __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/context.pyx":239
+ * if rc < 0 and zmq_errno() != ZMQ_ENOTSOCK:
+ * raise ZMQError()
+ * self._n_sockets -= 1 # <<<<<<<<<<<<<<
+ * self._sockets[0] = self._sockets[self._n_sockets]
+ * self.term()
+ */
+ __pyx_v_self->_n_sockets = (__pyx_v_self->_n_sockets - 1);
+
+ /* "zmq/backend/cython/context.pyx":240
+ * raise ZMQError()
+ * self._n_sockets -= 1
+ * self._sockets[0] = self._sockets[self._n_sockets] # <<<<<<<<<<<<<<
+ * self.term()
+ *
+ */
+ (__pyx_v_self->_sockets[0]) = (__pyx_v_self->_sockets[__pyx_v_self->_n_sockets]);
+ }
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "zmq/backend/cython/context.pyx":241
+ * self._n_sockets -= 1
+ * self._sockets[0] = self._sockets[self._n_sockets]
+ * self.term() # <<<<<<<<<<<<<<
+ *
+ * __all__ = ['Context']
+ */
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_term); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ }
+ }
+ if (__pyx_t_6) {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else {
+ __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "zmq/backend/cython/context.pyx":212
+ * return rc
+ *
+ * def destroy(self, linger=None): # <<<<<<<<<<<<<<
+ * """ctx.destroy(linger=None)
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("zmq.backend.cython.context.Context.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/context.pxd":36
+ * cdef int _pid # the pid of the process which created me (for fork safety)
+ *
+ * cdef public bint closed # bool property for a closed context. # <<<<<<<<<<<<<<
+ * cdef inline int _term(self)
+ * # helpers for events on _sockets in Socket.__cinit__()/close()
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7context_7Context_6closed_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7context_7Context_6closed_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7context_7Context_6closed___get__(((struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7context_7Context_6closed___get__(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->closed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("zmq.backend.cython.context.Context.closed.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_3zmq_7backend_6cython_7context_7Context_6closed_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_3zmq_7backend_6cython_7context_7Context_6closed_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7context_7Context_6closed_2__set__(((struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_3zmq_7backend_6cython_7context_7Context_6closed_2__set__(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_self, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__set__", 0);
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_self->closed = __pyx_t_1;
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_AddTraceback("zmq.backend.cython.context.Context.closed.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/checkrc.pxd":5
+ * from libzmq cimport zmq_errno, ZMQ_ETERM
+ *
+ * cdef inline int _check_rc(int rc) except -1: # <<<<<<<<<<<<<<
+ * """internal utility for checking zmq return condition
+ *
+ */
+
+static CYTHON_INLINE int __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(int __pyx_v_rc) {
+ int __pyx_v_errno;
+ PyObject *__pyx_v_Again = NULL;
+ PyObject *__pyx_v_ContextTerminated = NULL;
+ PyObject *__pyx_v_ZMQError = NULL;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_check_rc", 0);
+
+ /* "zmq/backend/cython/checkrc.pxd":10
+ * and raising the appropriate Exception class
+ * """
+ * cdef int errno = zmq_errno() # <<<<<<<<<<<<<<
+ * PyErr_CheckSignals()
+ * if rc < 0:
+ */
+ __pyx_v_errno = zmq_errno();
+
+ /* "zmq/backend/cython/checkrc.pxd":11
+ * """
+ * cdef int errno = zmq_errno()
+ * PyErr_CheckSignals() # <<<<<<<<<<<<<<
+ * if rc < 0:
+ * if errno == EAGAIN:
+ */
+ __pyx_t_1 = PyErr_CheckSignals(); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/checkrc.pxd":12
+ * cdef int errno = zmq_errno()
+ * PyErr_CheckSignals()
+ * if rc < 0: # <<<<<<<<<<<<<<
+ * if errno == EAGAIN:
+ * from zmq.error import Again
+ */
+ __pyx_t_2 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/checkrc.pxd":16
+ * from zmq.error import Again
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM: # <<<<<<<<<<<<<<
+ * from zmq.error import ContextTerminated
+ * raise ContextTerminated(errno)
+ */
+ switch (__pyx_v_errno) {
+
+ /* "zmq/backend/cython/checkrc.pxd":13
+ * PyErr_CheckSignals()
+ * if rc < 0:
+ * if errno == EAGAIN: # <<<<<<<<<<<<<<
+ * from zmq.error import Again
+ * raise Again(errno)
+ */
+ case EAGAIN:
+
+ /* "zmq/backend/cython/checkrc.pxd":14
+ * if rc < 0:
+ * if errno == EAGAIN:
+ * from zmq.error import Again # <<<<<<<<<<<<<<
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM:
+ */
+ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_n_s_Again);
+ PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Again);
+ __Pyx_GIVEREF(__pyx_n_s_Again);
+ __pyx_t_4 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Again); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_Again = __pyx_t_3;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "zmq/backend/cython/checkrc.pxd":15
+ * if errno == EAGAIN:
+ * from zmq.error import Again
+ * raise Again(errno) # <<<<<<<<<<<<<<
+ * elif errno == ZMQ_ETERM:
+ * from zmq.error import ContextTerminated
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_Again);
+ __pyx_t_5 = __pyx_v_Again; __pyx_t_6 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ }
+ }
+ if (!__pyx_t_6) {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ } else {
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ break;
+
+ /* "zmq/backend/cython/checkrc.pxd":16
+ * from zmq.error import Again
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM: # <<<<<<<<<<<<<<
+ * from zmq.error import ContextTerminated
+ * raise ContextTerminated(errno)
+ */
+ case ETERM:
+
+ /* "zmq/backend/cython/checkrc.pxd":17
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM:
+ * from zmq.error import ContextTerminated # <<<<<<<<<<<<<<
+ * raise ContextTerminated(errno)
+ * else:
+ */
+ __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_n_s_ContextTerminated);
+ PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_ContextTerminated);
+ __Pyx_GIVEREF(__pyx_n_s_ContextTerminated);
+ __pyx_t_5 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_ContextTerminated); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_4);
+ __pyx_v_ContextTerminated = __pyx_t_4;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+ /* "zmq/backend/cython/checkrc.pxd":18
+ * elif errno == ZMQ_ETERM:
+ * from zmq.error import ContextTerminated
+ * raise ContextTerminated(errno) # <<<<<<<<<<<<<<
+ * else:
+ * from zmq.error import ZMQError
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_v_ContextTerminated);
+ __pyx_t_7 = __pyx_v_ContextTerminated; __pyx_t_3 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
+ if (likely(__pyx_t_3)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_7, function);
+ }
+ }
+ if (!__pyx_t_3) {
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ } else {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ break;
+ default:
+
+ /* "zmq/backend/cython/checkrc.pxd":20
+ * raise ContextTerminated(errno)
+ * else:
+ * from zmq.error import ZMQError # <<<<<<<<<<<<<<
+ * raise ZMQError(errno)
+ * # return -1
+ */
+ __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_n_s_ZMQError);
+ PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_ZMQError);
+ __Pyx_GIVEREF(__pyx_n_s_ZMQError);
+ __pyx_t_7 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_5, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_ZMQError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_5);
+ __pyx_v_ZMQError = __pyx_t_5;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "zmq/backend/cython/checkrc.pxd":21
+ * else:
+ * from zmq.error import ZMQError
+ * raise ZMQError(errno) # <<<<<<<<<<<<<<
+ * # return -1
+ * return 0
+ */
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_v_ZMQError);
+ __pyx_t_6 = __pyx_v_ZMQError; __pyx_t_4 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
+ }
+ }
+ if (!__pyx_t_4) {
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ } else {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_Raise(__pyx_t_7, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ break;
+ }
+ }
+
+ /* "zmq/backend/cython/checkrc.pxd":23
+ * raise ZMQError(errno)
+ * # return -1
+ * return 0 # <<<<<<<<<<<<<<
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/checkrc.pxd":5
+ * from libzmq cimport zmq_errno, ZMQ_ETERM
+ *
+ * cdef inline int _check_rc(int rc) except -1: # <<<<<<<<<<<<<<
+ * """internal utility for checking zmq return condition
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_AddTraceback("zmq.backend.cython.checkrc._check_rc", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_Again);
+ __Pyx_XDECREF(__pyx_v_ContextTerminated);
+ __Pyx_XDECREF(__pyx_v_ZMQError);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+static struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context __pyx_vtable_3zmq_7backend_6cython_7context_Context;
+
+static PyObject *__pyx_tp_new_3zmq_7backend_6cython_7context_Context(PyTypeObject *t, PyObject *a, PyObject *k) {
+ struct __pyx_obj_3zmq_7backend_6cython_7context_Context *p;
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)o);
+ p->__pyx_vtab = __pyx_vtabptr_3zmq_7backend_6cython_7context_Context;
+ if (unlikely(__pyx_pw_3zmq_7backend_6cython_7context_7Context_3__cinit__(o, a, k) < 0)) {
+ Py_DECREF(o); o = 0;
+ }
+ return o;
+}
+
+static void __pyx_tp_dealloc_3zmq_7backend_6cython_7context_Context(PyObject *o) {
+ struct __pyx_obj_3zmq_7backend_6cython_7context_Context *p = (struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)o;
+ #if PY_VERSION_HEX >= 0x030400a1
+ if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ {
+ PyObject *etype, *eval, *etb;
+ PyErr_Fetch(&etype, &eval, &etb);
+ ++Py_REFCNT(o);
+ __pyx_pw_3zmq_7backend_6cython_7context_7Context_5__dealloc__(o);
+ --Py_REFCNT(o);
+ PyErr_Restore(etype, eval, etb);
+ }
+ if (p->__weakref__) PyObject_ClearWeakRefs(o);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+
+static PyObject *__pyx_getprop_3zmq_7backend_6cython_7context_7Context_closed(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_3zmq_7backend_6cython_7context_7Context_6closed_1__get__(o);
+}
+
+static int __pyx_setprop_3zmq_7backend_6cython_7context_7Context_closed(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
+ if (v) {
+ return __pyx_pw_3zmq_7backend_6cython_7context_7Context_6closed_3__set__(o, v);
+ }
+ else {
+ PyErr_SetString(PyExc_NotImplementedError, "__del__");
+ return -1;
+ }
+}
+
+static PyMethodDef __pyx_methods_3zmq_7backend_6cython_7context_Context[] = {
+ {"underlying", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_7context_7Context_7underlying, METH_NOARGS, __pyx_doc_3zmq_7backend_6cython_7context_7Context_6underlying},
+ {"term", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_7context_7Context_9term, METH_NOARGS, __pyx_doc_3zmq_7backend_6cython_7context_7Context_8term},
+ {"set", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_7context_7Context_11set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3zmq_7backend_6cython_7context_7Context_10set},
+ {"get", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_7context_7Context_13get, METH_O, __pyx_doc_3zmq_7backend_6cython_7context_7Context_12get},
+ {"destroy", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_7context_7Context_15destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3zmq_7backend_6cython_7context_7Context_14destroy},
+ {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets_3zmq_7backend_6cython_7context_Context[] = {
+ {(char *)"closed", __pyx_getprop_3zmq_7backend_6cython_7context_7Context_closed, __pyx_setprop_3zmq_7backend_6cython_7context_7Context_closed, 0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type_3zmq_7backend_6cython_7context_Context = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "zmq.backend.cython.context.Context", /*tp_name*/
+ sizeof(struct __pyx_obj_3zmq_7backend_6cython_7context_Context), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_3zmq_7backend_6cython_7context_Context, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ "Context(io_threads=1)\n\n Manage the lifecycle of a 0MQ context.\n\n Parameters\n ----------\n io_threads : int\n The number of IO threads.\n ", /*tp_doc*/
+ 0, /*tp_traverse*/
+ 0, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_3zmq_7backend_6cython_7context_Context, /*tp_methods*/
+ 0, /*tp_members*/
+ __pyx_getsets_3zmq_7backend_6cython_7context_Context, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ __pyx_pw_3zmq_7backend_6cython_7context_7Context_1__init__, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_3zmq_7backend_6cython_7context_Context, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+
+static PyMethodDef __pyx_methods[] = {
+ {0, 0, 0, 0}
+};
+
+#if PY_MAJOR_VERSION >= 3
+static struct PyModuleDef __pyx_moduledef = {
+ #if PY_VERSION_HEX < 0x03020000
+ { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
+ #else
+ PyModuleDef_HEAD_INIT,
+ #endif
+ "context",
+ __pyx_k_0MQ_Context_class, /* m_doc */
+ -1, /* m_size */
+ __pyx_methods /* m_methods */,
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL /* m_free */
+};
+#endif
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+ {&__pyx_n_s_Again, __pyx_k_Again, sizeof(__pyx_k_Again), 0, 0, 1, 1},
+ {&__pyx_n_s_Context, __pyx_k_Context, sizeof(__pyx_k_Context), 0, 0, 1, 1},
+ {&__pyx_n_s_ContextTerminated, __pyx_k_ContextTerminated, sizeof(__pyx_k_ContextTerminated), 0, 0, 1, 1},
+ {&__pyx_kp_s_Context_has_been_destroyed, __pyx_k_Context_has_been_destroyed, sizeof(__pyx_k_Context_has_been_destroyed), 0, 0, 1, 0},
+ {&__pyx_kp_s_Could_not_allocate__sockets_arra, __pyx_k_Could_not_allocate__sockets_arra, sizeof(__pyx_k_Could_not_allocate__sockets_arra), 0, 0, 1, 0},
+ {&__pyx_kp_s_Could_not_reallocate__sockets_ar, __pyx_k_Could_not_reallocate__sockets_ar, sizeof(__pyx_k_Could_not_reallocate__sockets_ar), 0, 0, 1, 0},
+ {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
+ {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
+ {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
+ {&__pyx_n_s_ZMQError, __pyx_k_ZMQError, sizeof(__pyx_k_ZMQError), 0, 0, 1, 1},
+ {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
+ {&__pyx_kp_s_expected_int_got_r, __pyx_k_expected_int_got_r, sizeof(__pyx_k_expected_int_got_r), 0, 0, 1, 0},
+ {&__pyx_n_s_handle, __pyx_k_handle, sizeof(__pyx_k_handle), 0, 0, 1, 1},
+ {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+ {&__pyx_n_s_instance, __pyx_k_instance, sizeof(__pyx_k_instance), 0, 0, 1, 1},
+ {&__pyx_n_s_io_threads, __pyx_k_io_threads, sizeof(__pyx_k_io_threads), 0, 0, 1, 1},
+ {&__pyx_n_s_linger, __pyx_k_linger, sizeof(__pyx_k_linger), 0, 0, 1, 1},
+ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+ {&__pyx_n_s_option, __pyx_k_option, sizeof(__pyx_k_option), 0, 0, 1, 1},
+ {&__pyx_n_s_optval, __pyx_k_optval, sizeof(__pyx_k_optval), 0, 0, 1, 1},
+ {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
+ {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
+ {&__pyx_n_s_shadow, __pyx_k_shadow, sizeof(__pyx_k_shadow), 0, 0, 1, 1},
+ {&__pyx_n_s_term, __pyx_k_term, sizeof(__pyx_k_term), 0, 0, 1, 1},
+ {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+ {&__pyx_n_s_underlying, __pyx_k_underlying, sizeof(__pyx_k_underlying), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq_error, __pyx_k_zmq_error, sizeof(__pyx_k_zmq_error), 0, 0, 1, 1},
+ {0, 0, 0, 0, 0, 0, 0}
+};
+static int __Pyx_InitCachedBuiltins(void) {
+ __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+static int __Pyx_InitCachedConstants(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
+
+ /* "zmq/backend/cython/context.pyx":62
+ * self._sockets = <void **>malloc(self._max_sockets*sizeof(void *))
+ * if self._sockets == NULL:
+ * raise MemoryError("Could not allocate _sockets array") # <<<<<<<<<<<<<<
+ *
+ * self._pid = getpid()
+ */
+ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Could_not_allocate__sockets_arra); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple_);
+ __Pyx_GIVEREF(__pyx_tuple_);
+
+ /* "zmq/backend/cython/context.pyx":88
+ * self._sockets = <void **>realloc(self._sockets, self._max_sockets*sizeof(void *))
+ * if self._sockets == NULL:
+ * raise MemoryError("Could not reallocate _sockets array") # <<<<<<<<<<<<<<
+ *
+ * self._sockets[self._n_sockets] = handle
+ */
+ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Could_not_reallocate__sockets_ar); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__2);
+ __Pyx_GIVEREF(__pyx_tuple__2);
+
+ /* "zmq/backend/cython/context.pyx":168
+ *
+ * if self.closed:
+ * raise RuntimeError("Context has been destroyed") # <<<<<<<<<<<<<<
+ *
+ * if not isinstance(optval, int):
+ */
+ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Context_has_been_destroyed); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__3);
+ __Pyx_GIVEREF(__pyx_tuple__3);
+
+ /* "zmq/backend/cython/context.pyx":205
+ *
+ * if self.closed:
+ * raise RuntimeError("Context has been destroyed") # <<<<<<<<<<<<<<
+ *
+ * rc = zmq_ctx_get(self.handle, option)
+ */
+ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Context_has_been_destroyed); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__4);
+ __Pyx_GIVEREF(__pyx_tuple__4);
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static int __Pyx_InitGlobals(void) {
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+#if PY_MAJOR_VERSION < 3
+PyMODINIT_FUNC initcontext(void); /*proto*/
+PyMODINIT_FUNC initcontext(void)
+#else
+PyMODINIT_FUNC PyInit_context(void); /*proto*/
+PyMODINIT_FUNC PyInit_context(void)
+#endif
+{
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ #if CYTHON_REFNANNY
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
+ if (!__Pyx_RefNanny) {
+ PyErr_Clear();
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
+ if (!__Pyx_RefNanny)
+ Py_FatalError("failed to import 'refnanny' module");
+ }
+ #endif
+ __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_context(void)", 0);
+ if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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;}
+ __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;}
+ #ifdef __Pyx_CyFunction_USED
+ if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_FusedFunction_USED
+ if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_Generator_USED
+ if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ /*--- Library function declarations ---*/
+ /*--- Threads initialization code ---*/
+ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
+ #ifdef WITH_THREAD /* Python build with threading support? */
+ PyEval_InitThreads();
+ #endif
+ #endif
+ /*--- Module creation code ---*/
+ #if PY_MAJOR_VERSION < 3
+ __pyx_m = Py_InitModule4("context", __pyx_methods, __pyx_k_0MQ_Context_class, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+ #else
+ __pyx_m = PyModule_Create(&__pyx_moduledef);
+ #endif
+ if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_INCREF(__pyx_d);
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_COMPILING_IN_PYPY
+ Py_INCREF(__pyx_b);
+ #endif
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ /*--- Initialize various global constants etc. ---*/
+ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ if (__pyx_module_is_main_zmq__backend__cython__context) {
+ if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ }
+ #if PY_MAJOR_VERSION >= 3
+ {
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!PyDict_GetItemString(modules, "zmq.backend.cython.context")) {
+ if (unlikely(PyDict_SetItemString(modules, "zmq.backend.cython.context", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+ /*--- Builtin init code ---*/
+ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Constants init code ---*/
+ if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Global init code ---*/
+ /*--- Variable export code ---*/
+ /*--- Function export code ---*/
+ /*--- Type init code ---*/
+ __pyx_vtabptr_3zmq_7backend_6cython_7context_Context = &__pyx_vtable_3zmq_7backend_6cython_7context_Context;
+ __pyx_vtable_3zmq_7backend_6cython_7context_Context._term = (int (*)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *))__pyx_f_3zmq_7backend_6cython_7context_7Context__term;
+ __pyx_vtable_3zmq_7backend_6cython_7context_Context._add_socket = (void (*)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *, void *))__pyx_f_3zmq_7backend_6cython_7context_7Context__add_socket;
+ __pyx_vtable_3zmq_7backend_6cython_7context_Context._remove_socket = (void (*)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *, void *))__pyx_f_3zmq_7backend_6cython_7context_7Context__remove_socket;
+ if (PyType_Ready(&__pyx_type_3zmq_7backend_6cython_7context_Context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type_3zmq_7backend_6cython_7context_Context.tp_print = 0;
+ if (__Pyx_SetVtable(__pyx_type_3zmq_7backend_6cython_7context_Context.tp_dict, __pyx_vtabptr_3zmq_7backend_6cython_7context_Context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttrString(__pyx_m, "Context", (PyObject *)&__pyx_type_3zmq_7backend_6cython_7context_Context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_type_3zmq_7backend_6cython_7context_Context.tp_weaklistoffset == 0) __pyx_type_3zmq_7backend_6cython_7context_Context.tp_weaklistoffset = offsetof(struct __pyx_obj_3zmq_7backend_6cython_7context_Context, __weakref__);
+ __pyx_ptype_3zmq_7backend_6cython_7context_Context = &__pyx_type_3zmq_7backend_6cython_7context_Context;
+ /*--- Type import code ---*/
+ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
+ #if CYTHON_COMPILING_IN_PYPY
+ sizeof(PyTypeObject),
+ #else
+ sizeof(PyHeapTypeObject),
+ #endif
+ 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Variable import code ---*/
+ /*--- Function import code ---*/
+ /*--- Execution code ---*/
+
+ /* "zmq/backend/cython/context.pyx":14
+ * int getpid()
+ *
+ * from zmq.error import ZMQError # <<<<<<<<<<<<<<
+ * from zmq.backend.cython.checkrc cimport _check_rc
+ *
+ */
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_s_ZMQError);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ZMQError);
+ __Pyx_GIVEREF(__pyx_n_s_ZMQError);
+ __pyx_t_2 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ZMQError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ZMQError, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/context.pyx":18
+ *
+ *
+ * _instance = None # <<<<<<<<<<<<<<
+ *
+ * cdef class Context:
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_instance, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/context.pyx":114
+ *
+ * @property
+ * def underlying(self): # <<<<<<<<<<<<<<
+ * """The address of the underlying libzmq context"""
+ * return <size_t> self.handle
+ */
+ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_3zmq_7backend_6cython_7context_Context, __pyx_n_s_underlying); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+
+ /* "zmq/backend/cython/context.pyx":113
+ *
+ *
+ * @property # <<<<<<<<<<<<<<
+ * def underlying(self):
+ * """The address of the underlying libzmq context"""
+ */
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_3zmq_7backend_6cython_7context_Context->tp_dict, __pyx_n_s_underlying, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ PyType_Modified(__pyx_ptype_3zmq_7backend_6cython_7context_Context);
+
+ /* "zmq/backend/cython/context.pyx":119
+ *
+ * # backward-compat, though nobody is using it
+ * _handle = underlying # <<<<<<<<<<<<<<
+ *
+ * cdef inline int _term(self):
+ */
+ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_3zmq_7backend_6cython_7context_Context, __pyx_n_s_underlying); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_3zmq_7backend_6cython_7context_Context->tp_dict, __pyx_n_s_handle, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ PyType_Modified(__pyx_ptype_3zmq_7backend_6cython_7context_Context);
+
+ /* "zmq/backend/cython/context.pyx":243
+ * self.term()
+ *
+ * __all__ = ['Context'] # <<<<<<<<<<<<<<
+ */
+ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_n_s_Context);
+ PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Context);
+ __Pyx_GIVEREF(__pyx_n_s_Context);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/context.pyx":1
+ * """0MQ Context class.""" # <<<<<<<<<<<<<<
+ * # coding: utf-8
+ *
+ */
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/checkrc.pxd":5
+ * from libzmq cimport zmq_errno, ZMQ_ETERM
+ *
+ * cdef inline int _check_rc(int rc) except -1: # <<<<<<<<<<<<<<
+ * """internal utility for checking zmq return condition
+ *
+ */
+
+ /*--- Wrapped vars code ---*/
+
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ if (__pyx_m) {
+ if (__pyx_d) {
+ __Pyx_AddTraceback("init zmq.backend.cython.context", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ }
+ Py_DECREF(__pyx_m); __pyx_m = 0;
+ } else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ImportError, "init zmq.backend.cython.context");
+ }
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ #if PY_MAJOR_VERSION < 3
+ return;
+ #else
+ return __pyx_m;
+ #endif
+}
+
+/* Runtime support code */
+#if CYTHON_REFNANNY
+static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
+ PyObject *m = NULL, *p = NULL;
+ void *r = NULL;
+ m = PyImport_ImportModule((char *)modname);
+ if (!m) goto end;
+ p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
+ if (!p) goto end;
+ r = PyLong_AsVoidPtr(p);
+end:
+ Py_XDECREF(p);
+ Py_XDECREF(m);
+ return (__Pyx_RefNannyAPIStruct *)r;
+}
+#endif
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
+ PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
+ if (unlikely(!result)) {
+ PyErr_Format(PyExc_NameError,
+#if PY_MAJOR_VERSION >= 3
+ "name '%U' is not defined", name);
+#else
+ "name '%.200s' is not defined", PyString_AS_STRING(name));
+#endif
+ }
+ return result;
+}
+
+static void __Pyx_RaiseDoubleKeywordsError(
+ const char* func_name,
+ PyObject* kw_name)
+{
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION >= 3
+ "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
+ #else
+ "%s() got multiple values for keyword argument '%s'", func_name,
+ PyString_AsString(kw_name));
+ #endif
+}
+
+static int __Pyx_ParseOptionalKeywords(
+ PyObject *kwds,
+ PyObject **argnames[],
+ PyObject *kwds2,
+ PyObject *values[],
+ Py_ssize_t num_pos_args,
+ const char* function_name)
+{
+ PyObject *key = 0, *value = 0;
+ Py_ssize_t pos = 0;
+ PyObject*** name;
+ PyObject*** first_kw_arg = argnames + num_pos_args;
+ while (PyDict_Next(kwds, &pos, &key, &value)) {
+ name = first_kw_arg;
+ while (*name && (**name != key)) name++;
+ if (*name) {
+ values[name-argnames] = value;
+ continue;
+ }
+ name = first_kw_arg;
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
+ while (*name) {
+ if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**name, key)) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ if ((**argname == key) || (
+ (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**argname, key))) {
+ goto arg_passed_twice;
+ }
+ argname++;
+ }
+ }
+ } else
+ #endif
+ if (likely(PyUnicode_Check(key))) {
+ while (*name) {
+ int cmp = (**name == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**name, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ int cmp = (**argname == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**argname, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) goto arg_passed_twice;
+ argname++;
+ }
+ }
+ } else
+ goto invalid_keyword_type;
+ if (kwds2) {
+ if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
+ } else {
+ goto invalid_keyword;
+ }
+ }
+ return 0;
+arg_passed_twice:
+ __Pyx_RaiseDoubleKeywordsError(function_name, key);
+ goto bad;
+invalid_keyword_type:
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() keywords must be strings", function_name);
+ goto bad;
+invalid_keyword:
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION < 3
+ "%.200s() got an unexpected keyword argument '%.200s'",
+ function_name, PyString_AsString(key));
+ #else
+ "%s() got an unexpected keyword argument '%U'",
+ function_name, key);
+ #endif
+bad:
+ return -1;
+}
+
+static void __Pyx_RaiseArgtupleInvalid(
+ const char* func_name,
+ int exact,
+ Py_ssize_t num_min,
+ Py_ssize_t num_max,
+ Py_ssize_t num_found)
+{
+ Py_ssize_t num_expected;
+ const char *more_or_less;
+ if (num_found < num_min) {
+ num_expected = num_min;
+ more_or_less = "at least";
+ } else {
+ num_expected = num_max;
+ more_or_less = "at most";
+ }
+ if (exact) {
+ more_or_less = "exactly";
+ }
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+ func_name, more_or_less, num_expected,
+ (num_expected == 1) ? "" : "s", num_found);
+}
+
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
+ PyObject *result;
+#if CYTHON_COMPILING_IN_CPYTHON
+ result = PyDict_GetItem(__pyx_d, name);
+ if (likely(result)) {
+ Py_INCREF(result);
+ } else {
+#else
+ result = PyObject_GetItem(__pyx_d, name);
+ if (!result) {
+ PyErr_Clear();
+#endif
+ result = __Pyx_GetBuiltinName(name);
+ }
+ return result;
+}
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+ PyObject *result;
+ ternaryfunc call = func->ob_type->tp_call;
+ if (unlikely(!call))
+ return PyObject_Call(func, arg, kw);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = (*call)(func, arg, kw);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
+ PyObject *self, *result;
+ PyCFunction cfunc;
+ cfunc = PyCFunction_GET_FUNCTION(func);
+ self = PyCFunction_GET_SELF(func);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = cfunc(self, arg);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject *result;
+ PyObject *args = PyTuple_New(1);
+ if (unlikely(!args)) return NULL;
+ Py_INCREF(arg);
+ PyTuple_SET_ITEM(args, 0, arg);
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#ifdef __Pyx_CyFunction_USED
+ if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+ if (likely(PyCFunction_Check(func))) {
+#endif
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
+ return __Pyx_PyObject_CallMethO(func, arg);
+ }
+ }
+ return __Pyx__PyObject_CallOneArg(func, arg);
+}
+#else
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject* args = PyTuple_Pack(1, arg);
+ return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
+#ifdef __Pyx_CyFunction_USED
+ if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+ if (likely(PyCFunction_Check(func))) {
+#endif
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
+ return __Pyx_PyObject_CallMethO(func, NULL);
+ }
+ }
+ return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
+}
+#endif
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyThreadState *tstate = PyThreadState_GET();
+ tmp_type = tstate->curexc_type;
+ tmp_value = tstate->curexc_value;
+ tmp_tb = tstate->curexc_traceback;
+ tstate->curexc_type = type;
+ tstate->curexc_value = value;
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_Restore(type, value, tb);
+#endif
+}
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ *type = tstate->curexc_type;
+ *value = tstate->curexc_value;
+ *tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(type, value, tb);
+#endif
+}
+
+#if PY_MAJOR_VERSION < 3
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
+ CYTHON_UNUSED PyObject *cause) {
+ Py_XINCREF(type);
+ if (!value || value == Py_None)
+ value = NULL;
+ else
+ Py_INCREF(value);
+ if (!tb || tb == Py_None)
+ tb = NULL;
+ else {
+ Py_INCREF(tb);
+ if (!PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto raise_error;
+ }
+ }
+ if (PyType_Check(type)) {
+#if CYTHON_COMPILING_IN_PYPY
+ if (!value) {
+ Py_INCREF(Py_None);
+ value = Py_None;
+ }
+#endif
+ PyErr_NormalizeException(&type, &value, &tb);
+ } else {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto raise_error;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(type);
+ Py_INCREF(type);
+ if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto raise_error;
+ }
+ }
+ __Pyx_ErrRestore(type, value, tb);
+ return;
+raise_error:
+ Py_XDECREF(value);
+ Py_XDECREF(type);
+ Py_XDECREF(tb);
+ return;
+}
+#else
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
+ PyObject* owned_instance = NULL;
+ if (tb == Py_None) {
+ tb = 0;
+ } else if (tb && !PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto bad;
+ }
+ if (value == Py_None)
+ value = 0;
+ if (PyExceptionInstance_Check(type)) {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto bad;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(value);
+ } else if (PyExceptionClass_Check(type)) {
+ PyObject *instance_class = NULL;
+ if (value && PyExceptionInstance_Check(value)) {
+ instance_class = (PyObject*) Py_TYPE(value);
+ if (instance_class != type) {
+ if (PyObject_IsSubclass(instance_class, type)) {
+ type = instance_class;
+ } else {
+ instance_class = NULL;
+ }
+ }
+ }
+ if (!instance_class) {
+ PyObject *args;
+ if (!value)
+ args = PyTuple_New(0);
+ else if (PyTuple_Check(value)) {
+ Py_INCREF(value);
+ args = value;
+ } else
+ args = PyTuple_Pack(1, value);
+ if (!args)
+ goto bad;
+ owned_instance = PyObject_Call(type, args, NULL);
+ Py_DECREF(args);
+ if (!owned_instance)
+ goto bad;
+ value = owned_instance;
+ if (!PyExceptionInstance_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "calling %R should have returned an instance of "
+ "BaseException, not %R",
+ type, Py_TYPE(value));
+ goto bad;
+ }
+ }
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto bad;
+ }
+#if PY_VERSION_HEX >= 0x03030000
+ if (cause) {
+#else
+ if (cause && cause != Py_None) {
+#endif
+ PyObject *fixed_cause;
+ if (cause == Py_None) {
+ fixed_cause = NULL;
+ } else if (PyExceptionClass_Check(cause)) {
+ fixed_cause = PyObject_CallObject(cause, NULL);
+ if (fixed_cause == NULL)
+ goto bad;
+ } else if (PyExceptionInstance_Check(cause)) {
+ fixed_cause = cause;
+ Py_INCREF(fixed_cause);
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "exception causes must derive from "
+ "BaseException");
+ goto bad;
+ }
+ PyException_SetCause(value, fixed_cause);
+ }
+ PyErr_SetObject(type, value);
+ if (tb) {
+#if CYTHON_COMPILING_IN_PYPY
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyErr_Fetch(tmp_type, tmp_value, tmp_tb);
+ Py_INCREF(tb);
+ PyErr_Restore(tmp_type, tmp_value, tb);
+ Py_XDECREF(tmp_tb);
+#else
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject* tmp_tb = tstate->curexc_traceback;
+ if (tb != tmp_tb) {
+ Py_INCREF(tb);
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_tb);
+ }
+#endif
+ }
+bad:
+ Py_XDECREF(owned_instance);
+ return;
+}
+#endif
+
+static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
+ CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
+ int full_traceback) {
+ PyObject *old_exc, *old_val, *old_tb;
+ PyObject *ctx;
+ __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
+ if (full_traceback) {
+ Py_XINCREF(old_exc);
+ Py_XINCREF(old_val);
+ Py_XINCREF(old_tb);
+ __Pyx_ErrRestore(old_exc, old_val, old_tb);
+ PyErr_PrintEx(1);
+ }
+ #if PY_MAJOR_VERSION < 3
+ ctx = PyString_FromString(name);
+ #else
+ ctx = PyUnicode_FromString(name);
+ #endif
+ __Pyx_ErrRestore(old_exc, old_val, old_tb);
+ if (!ctx) {
+ PyErr_WriteUnraisable(Py_None);
+ } else {
+ PyErr_WriteUnraisable(ctx);
+ Py_DECREF(ctx);
+ }
+}
+
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
+ PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
+ if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Format(PyExc_ImportError,
+ #if PY_MAJOR_VERSION < 3
+ "cannot import name %.230s", PyString_AS_STRING(name));
+ #else
+ "cannot import name %S", name);
+ #endif
+ }
+ return value;
+}
+
+static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
+#if PY_VERSION_HEX >= 0x02070000
+ PyObject *ob = PyCapsule_New(vtable, 0, 0);
+#else
+ PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
+#endif
+ if (!ob)
+ goto bad;
+ if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
+ goto bad;
+ Py_DECREF(ob);
+ return 0;
+bad:
+ Py_XDECREF(ob);
+ return -1;
+}
+
+static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) {
+ PyObject *result;
+ result = __Pyx_PyObject_GetAttrStr(nmspace, name);
+ if (!result)
+ result = __Pyx_GetModuleGlobalName(name);
+ return result;
+}
+
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+ int start = 0, mid = 0, end = count - 1;
+ if (end >= 0 && code_line > entries[end].code_line) {
+ return count;
+ }
+ while (start < end) {
+ mid = (start + end) / 2;
+ if (code_line < entries[mid].code_line) {
+ end = mid;
+ } else if (code_line > entries[mid].code_line) {
+ start = mid + 1;
+ } else {
+ return mid;
+ }
+ }
+ if (code_line <= entries[mid].code_line) {
+ return mid;
+ } else {
+ return mid + 1;
+ }
+}
+static PyCodeObject *__pyx_find_code_object(int code_line) {
+ PyCodeObject* code_object;
+ int pos;
+ if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
+ return NULL;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
+ return NULL;
+ }
+ code_object = __pyx_code_cache.entries[pos].code_object;
+ Py_INCREF(code_object);
+ return code_object;
+}
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
+ int pos, i;
+ __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
+ if (unlikely(!code_line)) {
+ return;
+ }
+ if (unlikely(!entries)) {
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (likely(entries)) {
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = 64;
+ __pyx_code_cache.count = 1;
+ entries[0].code_line = code_line;
+ entries[0].code_object = code_object;
+ Py_INCREF(code_object);
+ }
+ return;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
+ PyCodeObject* tmp = entries[pos].code_object;
+ entries[pos].code_object = code_object;
+ Py_DECREF(tmp);
+ return;
+ }
+ if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
+ int new_max = __pyx_code_cache.max_count + 64;
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
+ __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (unlikely(!entries)) {
+ return;
+ }
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = new_max;
+ }
+ for (i=__pyx_code_cache.count; i>pos; i--) {
+ entries[i] = entries[i-1];
+ }
+ entries[pos].code_line = code_line;
+ entries[pos].code_object = code_object;
+ __pyx_code_cache.count++;
+ Py_INCREF(code_object);
+}
+
+#include "compile.h"
+#include "frameobject.h"
+#include "traceback.h"
+static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
+ const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyObject *py_srcfile = 0;
+ PyObject *py_funcname = 0;
+ #if PY_MAJOR_VERSION < 3
+ py_srcfile = PyString_FromString(filename);
+ #else
+ py_srcfile = PyUnicode_FromString(filename);
+ #endif
+ if (!py_srcfile) goto bad;
+ if (c_line) {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #else
+ py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #endif
+ }
+ else {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromString(funcname);
+ #else
+ py_funcname = PyUnicode_FromString(funcname);
+ #endif
+ }
+ if (!py_funcname) goto bad;
+ py_code = __Pyx_PyCode_New(
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ __pyx_empty_bytes, /*PyObject *code,*/
+ __pyx_empty_tuple, /*PyObject *consts,*/
+ __pyx_empty_tuple, /*PyObject *names,*/
+ __pyx_empty_tuple, /*PyObject *varnames,*/
+ __pyx_empty_tuple, /*PyObject *freevars,*/
+ __pyx_empty_tuple, /*PyObject *cellvars,*/
+ py_srcfile, /*PyObject *filename,*/
+ py_funcname, /*PyObject *name,*/
+ py_line,
+ __pyx_empty_bytes /*PyObject *lnotab*/
+ );
+ Py_DECREF(py_srcfile);
+ Py_DECREF(py_funcname);
+ return py_code;
+bad:
+ Py_XDECREF(py_srcfile);
+ Py_XDECREF(py_funcname);
+ return NULL;
+}
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyFrameObject *py_frame = 0;
+ py_code = __pyx_find_code_object(c_line ? c_line : py_line);
+ if (!py_code) {
+ py_code = __Pyx_CreateCodeObjectForTraceback(
+ funcname, c_line, py_line, filename);
+ if (!py_code) goto bad;
+ __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
+ }
+ py_frame = PyFrame_New(
+ PyThreadState_GET(), /*PyThreadState *tstate,*/
+ py_code, /*PyCodeObject *code,*/
+ __pyx_d, /*PyObject *globals,*/
+ 0 /*PyObject *locals*/
+ );
+ if (!py_frame) goto bad;
+ py_frame->f_lineno = py_line;
+ PyTraceBack_Here(py_frame);
+bad:
+ Py_XDECREF(py_code);
+ Py_XDECREF(py_frame);
+}
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
+ goto bad;
+ #endif
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ {
+ #if PY_MAJOR_VERSION >= 3
+ if (level == -1) {
+ if (strchr(__Pyx_MODULE_NAME, '.')) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(1);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, 1);
+ #endif
+ if (!module) {
+ if (!PyErr_ExceptionMatches(PyExc_ImportError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ level = 0;
+ }
+ #endif
+ if (!module) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(level);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, level);
+ #endif
+ }
+ }
+bad:
+ #if PY_VERSION_HEX < 0x03030000
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
+}
+
+#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value) \
+ { \
+ func_type value = func_value; \
+ if (sizeof(target_type) < sizeof(func_type)) { \
+ if (unlikely(value != (func_type) (target_type) value)) { \
+ func_type zero = 0; \
+ if (is_unsigned && unlikely(value < zero)) \
+ goto raise_neg_overflow; \
+ else \
+ goto raise_overflow; \
+ } \
+ } \
+ return (target_type) value; \
+ }
+
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ #include "longintrepr.h"
+ #endif
+#endif
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+ const int neg_one = (int) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(int) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (int) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(int) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
+ } else if (sizeof(int) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ int val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (int) -1;
+ }
+ } else {
+ int val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (int) -1;
+ val = __Pyx_PyInt_As_int(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to int");
+ return (int) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to int");
+ return (int) -1;
+}
+
+static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
+ const size_t neg_one = (size_t) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(size_t) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (size_t) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(size_t) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(size_t) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(size_t) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(size_t, long, PyLong_AsLong(x))
+ } else if (sizeof(size_t) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(size_t, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ size_t val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (size_t) -1;
+ }
+ } else {
+ size_t val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (size_t) -1;
+ val = __Pyx_PyInt_As_size_t(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to size_t");
+ return (size_t) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to size_t");
+ return (size_t) -1;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+ const int neg_one = (int) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(int) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(int) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(int),
+ little, !is_unsigned);
+ }
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+ const long neg_one = (long) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(long) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(long) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(long),
+ little, !is_unsigned);
+ }
+}
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+ const long neg_one = (long) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(long) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (long) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(long) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(long) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(long) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
+ } else if (sizeof(long) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ long val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (long) -1;
+ }
+ } else {
+ long val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (long) -1;
+ val = __Pyx_PyInt_As_long(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to long");
+ return (long) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to long");
+ return (long) -1;
+}
+
+static int __Pyx_check_binary_version(void) {
+ char ctversion[4], rtversion[4];
+ PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
+ if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
+ char message[200];
+ PyOS_snprintf(message, sizeof(message),
+ "compiletime version %s of module '%.100s' "
+ "does not match runtime version %s",
+ ctversion, __Pyx_MODULE_NAME, rtversion);
+ return PyErr_WarnEx(NULL, message, 1);
+ }
+ return 0;
+}
+
+#ifndef __PYX_HAVE_RT_ImportModule
+#define __PYX_HAVE_RT_ImportModule
+static PyObject *__Pyx_ImportModule(const char *name) {
+ PyObject *py_name = 0;
+ PyObject *py_module = 0;
+ py_name = __Pyx_PyIdentifier_FromString(name);
+ if (!py_name)
+ goto bad;
+ py_module = PyImport_Import(py_name);
+ Py_DECREF(py_name);
+ return py_module;
+bad:
+ Py_XDECREF(py_name);
+ return 0;
+}
+#endif
+
+#ifndef __PYX_HAVE_RT_ImportType
+#define __PYX_HAVE_RT_ImportType
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
+ size_t size, int strict)
+{
+ PyObject *py_module = 0;
+ PyObject *result = 0;
+ PyObject *py_name = 0;
+ char warning[200];
+ Py_ssize_t basicsize;
+#ifdef Py_LIMITED_API
+ PyObject *py_basicsize;
+#endif
+ py_module = __Pyx_ImportModule(module_name);
+ if (!py_module)
+ goto bad;
+ py_name = __Pyx_PyIdentifier_FromString(class_name);
+ if (!py_name)
+ goto bad;
+ result = PyObject_GetAttr(py_module, py_name);
+ Py_DECREF(py_name);
+ py_name = 0;
+ Py_DECREF(py_module);
+ py_module = 0;
+ if (!result)
+ goto bad;
+ if (!PyType_Check(result)) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s.%.200s is not a type object",
+ module_name, class_name);
+ goto bad;
+ }
+#ifndef Py_LIMITED_API
+ basicsize = ((PyTypeObject *)result)->tp_basicsize;
+#else
+ py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
+ if (!py_basicsize)
+ goto bad;
+ basicsize = PyLong_AsSsize_t(py_basicsize);
+ Py_DECREF(py_basicsize);
+ py_basicsize = 0;
+ if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
+ goto bad;
+#endif
+ if (!strict && (size_t)basicsize > size) {
+ PyOS_snprintf(warning, sizeof(warning),
+ "%s.%s size changed, may indicate binary incompatibility",
+ module_name, class_name);
+ if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
+ }
+ else if ((size_t)basicsize != size) {
+ PyErr_Format(PyExc_ValueError,
+ "%.200s.%.200s has the wrong size, try recompiling",
+ module_name, class_name);
+ goto bad;
+ }
+ return (PyTypeObject *)result;
+bad:
+ Py_XDECREF(py_module);
+ Py_XDECREF(result);
+ return NULL;
+}
+#endif
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+ while (t->p) {
+ #if PY_MAJOR_VERSION < 3
+ if (t->is_unicode) {
+ *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
+ } else if (t->intern) {
+ *t->p = PyString_InternFromString(t->s);
+ } else {
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+ }
+ #else
+ if (t->is_unicode | t->is_str) {
+ if (t->intern) {
+ *t->p = PyUnicode_InternFromString(t->s);
+ } else if (t->encoding) {
+ *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
+ } else {
+ *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+ }
+ } else {
+ *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
+ }
+ #endif
+ if (!*t->p)
+ return -1;
+ ++t;
+ }
+ return 0;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
+ return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
+ Py_ssize_t ignore;
+ return __Pyx_PyObject_AsStringAndSize(o, &ignore);
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+ if (
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ __Pyx_sys_getdefaultencoding_not_ascii &&
+#endif
+ PyUnicode_Check(o)) {
+#if PY_VERSION_HEX < 0x03030000
+ char* defenc_c;
+ PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
+ if (!defenc) return NULL;
+ defenc_c = PyBytes_AS_STRING(defenc);
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ {
+ char* end = defenc_c + PyBytes_GET_SIZE(defenc);
+ char* c;
+ for (c = defenc_c; c < end; c++) {
+ if ((unsigned char) (*c) >= 128) {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+ }
+ }
+#endif
+ *length = PyBytes_GET_SIZE(defenc);
+ return defenc_c;
+#else
+ if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ if (PyUnicode_IS_ASCII(o)) {
+ *length = PyUnicode_GET_LENGTH(o);
+ return PyUnicode_AsUTF8(o);
+ } else {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+#else
+ return PyUnicode_AsUTF8AndSize(o, length);
+#endif
+#endif
+ } else
+#endif
+#if !CYTHON_COMPILING_IN_PYPY
+ if (PyByteArray_Check(o)) {
+ *length = PyByteArray_GET_SIZE(o);
+ return PyByteArray_AS_STRING(o);
+ } else
+#endif
+ {
+ char* result;
+ int r = PyBytes_AsStringAndSize(o, &result, length);
+ if (unlikely(r < 0)) {
+ return NULL;
+ } else {
+ return result;
+ }
+ }
+}
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
+ int is_true = x == Py_True;
+ if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
+ else return PyObject_IsTrue(x);
+}
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
+ PyNumberMethods *m;
+ const char *name = NULL;
+ PyObject *res = NULL;
+#if PY_MAJOR_VERSION < 3
+ if (PyInt_Check(x) || PyLong_Check(x))
+#else
+ if (PyLong_Check(x))
+#endif
+ return Py_INCREF(x), x;
+ m = Py_TYPE(x)->tp_as_number;
+#if PY_MAJOR_VERSION < 3
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Int(x);
+ }
+ else if (m && m->nb_long) {
+ name = "long";
+ res = PyNumber_Long(x);
+ }
+#else
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Long(x);
+ }
+#endif
+ if (res) {
+#if PY_MAJOR_VERSION < 3
+ if (!PyInt_Check(res) && !PyLong_Check(res)) {
+#else
+ if (!PyLong_Check(res)) {
+#endif
+ PyErr_Format(PyExc_TypeError,
+ "__%.4s__ returned non-%.4s (type %.200s)",
+ name, name, Py_TYPE(res)->tp_name);
+ Py_DECREF(res);
+ return NULL;
+ }
+ }
+ else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "an integer is required");
+ }
+ return res;
+}
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+ Py_ssize_t ival;
+ PyObject *x;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(b)))
+ return PyInt_AS_LONG(b);
+#endif
+ if (likely(PyLong_CheckExact(b))) {
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(b)) {
+ case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
+ case 0: return 0;
+ case 1: return ((PyLongObject*)b)->ob_digit[0];
+ }
+ #endif
+ #endif
+ return PyLong_AsSsize_t(b);
+ }
+ x = PyNumber_Index(b);
+ if (!x) return -1;
+ ival = PyInt_AsSsize_t(x);
+ Py_DECREF(x);
+ return ival;
+}
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
+ return PyInt_FromSize_t(ival);
+}
+
+
+#endif /* Py_PYTHON_H */
diff --git a/scripts/external_libs/zmq/backend/cython/context.pxd b/scripts/external_libs/platform/cel59/zmq/backend/cython/context.pxd
index 9c9267a5..9c9267a5 100644
--- a/scripts/external_libs/zmq/backend/cython/context.pxd
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/context.pxd
diff --git a/scripts/external_libs/platform/cel59/zmq/backend/cython/context.pyx b/scripts/external_libs/platform/cel59/zmq/backend/cython/context.pyx
new file mode 100644
index 00000000..b527e5d6
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/context.pyx
@@ -0,0 +1,243 @@
+"""0MQ Context class."""
+# coding: utf-8
+
+# Copyright (c) PyZMQ Developers.
+# Distributed under the terms of the Lesser GNU Public License (LGPL).
+
+from libc.stdlib cimport free, malloc, realloc
+
+from libzmq cimport *
+
+cdef extern from "getpid_compat.h":
+ int getpid()
+
+from zmq.error import ZMQError
+from zmq.backend.cython.checkrc cimport _check_rc
+
+
+_instance = None
+
+cdef class Context:
+ """Context(io_threads=1)
+
+ Manage the lifecycle of a 0MQ context.
+
+ Parameters
+ ----------
+ io_threads : int
+ The number of IO threads.
+ """
+
+ # no-op for the signature
+ def __init__(self, io_threads=1, shadow=0):
+ pass
+
+ def __cinit__(self, int io_threads=1, size_t shadow=0, **kwargs):
+ self.handle = NULL
+ self._sockets = NULL
+ if shadow:
+ self.handle = <void *>shadow
+ self._shadow = True
+ else:
+ self._shadow = False
+ if ZMQ_VERSION_MAJOR >= 3:
+ self.handle = zmq_ctx_new()
+ else:
+ self.handle = zmq_init(io_threads)
+
+ if self.handle == NULL:
+ raise ZMQError()
+
+ cdef int rc = 0
+ if ZMQ_VERSION_MAJOR >= 3 and not self._shadow:
+ rc = zmq_ctx_set(self.handle, ZMQ_IO_THREADS, io_threads)
+ _check_rc(rc)
+
+ self.closed = False
+ self._n_sockets = 0
+ self._max_sockets = 32
+
+ self._sockets = <void **>malloc(self._max_sockets*sizeof(void *))
+ if self._sockets == NULL:
+ raise MemoryError("Could not allocate _sockets array")
+
+ self._pid = getpid()
+
+ def __dealloc__(self):
+ """don't touch members in dealloc, just cleanup allocations"""
+ cdef int rc
+ if self._sockets != NULL:
+ free(self._sockets)
+ self._sockets = NULL
+ self._n_sockets = 0
+
+ # we can't call object methods in dealloc as it
+ # might already be partially deleted
+ if not self._shadow:
+ self._term()
+
+ cdef inline void _add_socket(self, void* handle):
+ """Add a socket handle to be closed when Context terminates.
+
+ This is to be called in the Socket constructor.
+ """
+ if self._n_sockets >= self._max_sockets:
+ self._max_sockets *= 2
+ self._sockets = <void **>realloc(self._sockets, self._max_sockets*sizeof(void *))
+ if self._sockets == NULL:
+ raise MemoryError("Could not reallocate _sockets array")
+
+ self._sockets[self._n_sockets] = handle
+ self._n_sockets += 1
+
+ cdef inline void _remove_socket(self, void* handle):
+ """Remove a socket from the collected handles.
+
+ This should be called by Socket.close, to prevent trying to
+ close a socket a second time.
+ """
+ cdef bint found = False
+
+ for idx in range(self._n_sockets):
+ if self._sockets[idx] == handle:
+ found=True
+ break
+
+ if found:
+ self._n_sockets -= 1
+ if self._n_sockets:
+ # move last handle to closed socket's index
+ self._sockets[idx] = self._sockets[self._n_sockets]
+
+
+ @property
+ def underlying(self):
+ """The address of the underlying libzmq context"""
+ return <size_t> self.handle
+
+ # backward-compat, though nobody is using it
+ _handle = underlying
+
+ cdef inline int _term(self):
+ cdef int rc=0
+ if self.handle != NULL and not self.closed and getpid() == self._pid:
+ with nogil:
+ rc = zmq_ctx_destroy(self.handle)
+ self.handle = NULL
+ return rc
+
+ def term(self):
+ """ctx.term()
+
+ Close or terminate the context.
+
+ This can be called to close the context by hand. If this is not called,
+ the context will automatically be closed when it is garbage collected.
+ """
+ cdef int rc
+ rc = self._term()
+ self.closed = True
+
+ def set(self, int option, optval):
+ """ctx.set(option, optval)
+
+ Set a context option.
+
+ See the 0MQ API documentation for zmq_ctx_set
+ for details on specific options.
+
+ .. versionadded:: libzmq-3.2
+ .. versionadded:: 13.0
+
+ Parameters
+ ----------
+ option : int
+ The option to set. Available values will depend on your
+ version of libzmq. Examples include::
+
+ zmq.IO_THREADS, zmq.MAX_SOCKETS
+
+ optval : int
+ The value of the option to set.
+ """
+ cdef int optval_int_c
+ cdef int rc
+ cdef char* optval_c
+
+ if self.closed:
+ raise RuntimeError("Context has been destroyed")
+
+ if not isinstance(optval, int):
+ raise TypeError('expected int, got: %r' % optval)
+ optval_int_c = optval
+ rc = zmq_ctx_set(self.handle, option, optval_int_c)
+ _check_rc(rc)
+
+ def get(self, int option):
+ """ctx.get(option)
+
+ Get the value of a context option.
+
+ See the 0MQ API documentation for zmq_ctx_get
+ for details on specific options.
+
+ .. versionadded:: libzmq-3.2
+ .. versionadded:: 13.0
+
+ Parameters
+ ----------
+ option : int
+ The option to get. Available values will depend on your
+ version of libzmq. Examples include::
+
+ zmq.IO_THREADS, zmq.MAX_SOCKETS
+
+ Returns
+ -------
+ optval : int
+ The value of the option as an integer.
+ """
+ cdef int optval_int_c
+ cdef size_t sz
+ cdef int rc
+
+ if self.closed:
+ raise RuntimeError("Context has been destroyed")
+
+ rc = zmq_ctx_get(self.handle, option)
+ _check_rc(rc)
+
+ return rc
+
+ def destroy(self, linger=None):
+ """ctx.destroy(linger=None)
+
+ Close all sockets associated with this context, and then terminate
+ the context. If linger is specified,
+ the LINGER sockopt of the sockets will be set prior to closing.
+
+ .. warning::
+
+ destroy involves calling ``zmq_close()``, which is **NOT** threadsafe.
+ If there are active sockets in other threads, this must not be called.
+ """
+
+ cdef int linger_c
+ cdef bint setlinger=False
+
+ if linger is not None:
+ linger_c = linger
+ setlinger=True
+
+ if self.handle != NULL and not self.closed and self._n_sockets:
+ while self._n_sockets:
+ if setlinger:
+ zmq_setsockopt(self._sockets[0], ZMQ_LINGER, &linger_c, sizeof(int))
+ rc = zmq_close(self._sockets[0])
+ if rc < 0 and zmq_errno() != ZMQ_ENOTSOCK:
+ raise ZMQError()
+ self._n_sockets -= 1
+ self._sockets[0] = self._sockets[self._n_sockets]
+ self.term()
+
+__all__ = ['Context']
diff --git a/scripts/external_libs/platform/cel59/zmq/backend/cython/error.c b/scripts/external_libs/platform/cel59/zmq/backend/cython/error.c
new file mode 100644
index 00000000..925f5fd4
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/error.c
@@ -0,0 +1,1801 @@
+/* Generated by Cython 0.21.2 */
+
+#define PY_SSIZE_T_CLEAN
+#ifndef CYTHON_USE_PYLONG_INTERNALS
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#else
+#include "pyconfig.h"
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 1
+#else
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#endif
+#endif
+#endif
+#include "Python.h"
+#ifndef Py_PYTHON_H
+ #error Python headers needed to compile C extensions, please install development version of Python.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+ #error Cython requires Python 2.6+ or Python 3.2+.
+#else
+#define CYTHON_ABI "0_21_2"
+#include <stddef.h>
+#ifndef offsetof
+#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+ #ifndef __stdcall
+ #define __stdcall
+ #endif
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
+ #ifndef __fastcall
+ #define __fastcall
+ #endif
+#endif
+#ifndef DL_IMPORT
+ #define DL_IMPORT(t) t
+#endif
+#ifndef DL_EXPORT
+ #define DL_EXPORT(t) t
+#endif
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifndef Py_HUGE_VAL
+ #define Py_HUGE_VAL HUGE_VAL
+#endif
+#ifdef PYPY_VERSION
+#define CYTHON_COMPILING_IN_PYPY 1
+#define CYTHON_COMPILING_IN_CPYTHON 0
+#else
+#define CYTHON_COMPILING_IN_PYPY 0
+#define CYTHON_COMPILING_IN_CPYTHON 1
+#endif
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
+#define Py_OptimizeFlag 0
+#endif
+#define __PYX_BUILD_PY_SSIZE_T "n"
+#define CYTHON_FORMAT_SSIZE_T "z"
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyClass_Type
+#else
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyType_Type
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define Py_TPFLAGS_CHECKTYPES 0
+ #define Py_TPFLAGS_HAVE_INDEX 0
+ #define Py_TPFLAGS_HAVE_NEWBUFFER 0
+#endif
+#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+ #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
+#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
+ #define CYTHON_PEP393_ENABLED 1
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
+ 0 : _PyUnicode_Ready((PyObject *)(op)))
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
+ #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
+ #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+#else
+ #define CYTHON_PEP393_ENABLED 0
+ #define __Pyx_PyUnicode_READY(op) (0)
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
+ #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
+ #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+ #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyFrozenSet_Size(s) PyObject_Size(s)
+#else
+ #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
+ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
+ #define __Pyx_PyFrozenSet_Size(s) PySet_Size(s)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
+#else
+ #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBaseString_Type PyUnicode_Type
+ #define PyStringObject PyUnicodeObject
+ #define PyString_Type PyUnicode_Type
+ #define PyString_Check PyUnicode_Check
+ #define PyString_CheckExact PyUnicode_CheckExact
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
+ #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
+#else
+ #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+ #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
+#endif
+#ifndef PySet_CheckExact
+ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
+#endif
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#if PY_MAJOR_VERSION >= 3
+ #define PyIntObject PyLongObject
+ #define PyInt_Type PyLong_Type
+ #define PyInt_Check(op) PyLong_Check(op)
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
+ #define PyInt_FromString PyLong_FromString
+ #define PyInt_FromUnicode PyLong_FromUnicode
+ #define PyInt_FromLong PyLong_FromLong
+ #define PyInt_FromSize_t PyLong_FromSize_t
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
+ #define PyInt_AsLong PyLong_AsLong
+ #define PyInt_AS_LONG PyLong_AS_LONG
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+ #define PyNumber_Int PyNumber_Long
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBoolObject PyLongObject
+#endif
+#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
+ #ifndef PyUnicode_InternFromString
+ #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
+ #endif
+#endif
+#if PY_VERSION_HEX < 0x030200A4
+ typedef long Py_hash_t;
+ #define __Pyx_PyInt_FromHash_t PyInt_FromLong
+ #define __Pyx_PyInt_AsHash_t PyInt_AsLong
+#else
+ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
+ #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+#else
+ #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
+#endif
+#ifndef CYTHON_INLINE
+ #if defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+#ifndef CYTHON_RESTRICT
+ #if defined(__GNUC__)
+ #define CYTHON_RESTRICT __restrict__
+ #elif defined(_MSC_VER) && _MSC_VER >= 1400
+ #define CYTHON_RESTRICT __restrict
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_RESTRICT restrict
+ #else
+ #define CYTHON_RESTRICT
+ #endif
+#endif
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
+#else
+static CYTHON_INLINE float __PYX_NAN() {
+ /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
+ a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
+ a quiet NaN. */
+ float value;
+ memset(&value, 0xFF, sizeof(value));
+ return value;
+}
+#endif
+#ifdef __cplusplus
+template<typename T>
+void __Pyx_call_destructor(T* x) {
+ x->~T();
+}
+#endif
+
+
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
+#else
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
+#endif
+
+#ifndef __PYX_EXTERN_C
+ #ifdef __cplusplus
+ #define __PYX_EXTERN_C extern "C"
+ #else
+ #define __PYX_EXTERN_C extern
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+#define _USE_MATH_DEFINES
+#endif
+#include <math.h>
+#define __PYX_HAVE__zmq__backend__cython__error
+#define __PYX_HAVE_API__zmq__backend__cython__error
+#include "zmq_compat.h"
+#include "zmq.h"
+#include "zmq_utils.h"
+#ifdef _OPENMP
+#include <omp.h>
+#endif /* _OPENMP */
+
+#ifdef PYREX_WITHOUT_ASSERTIONS
+#define CYTHON_WITHOUT_ASSERTIONS
+#endif
+
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
+ const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \
+ (sizeof(type) < sizeof(Py_ssize_t)) || \
+ (sizeof(type) > sizeof(Py_ssize_t) && \
+ likely(v < (type)PY_SSIZE_T_MAX || \
+ v == (type)PY_SSIZE_T_MAX) && \
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \
+ v == (type)PY_SSIZE_T_MIN))) || \
+ (sizeof(type) == sizeof(Py_ssize_t) && \
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \
+ v == (type)PY_SSIZE_T_MAX))) )
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
+#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
+#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
+#define __Pyx_PyBytes_FromString PyBytes_FromString
+#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#else
+ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
+#endif
+#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
+#if PY_MAJOR_VERSION < 3
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
+{
+ const Py_UNICODE *u_end = u;
+ while (*u_end++) ;
+ return (size_t)(u_end - u - 1);
+}
+#else
+#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
+#endif
+#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
+#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
+#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
+#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
+#else
+#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
+#endif
+#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ PyObject* ascii_chars_u = NULL;
+ PyObject* ascii_chars_b = NULL;
+ const char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ if (strcmp(default_encoding_c, "ascii") == 0) {
+ __Pyx_sys_getdefaultencoding_not_ascii = 0;
+ } else {
+ char ascii_chars[128];
+ int c;
+ for (c = 0; c < 128; c++) {
+ ascii_chars[c] = c;
+ }
+ __Pyx_sys_getdefaultencoding_not_ascii = 1;
+ ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
+ if (!ascii_chars_u) goto bad;
+ ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
+ if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
+ PyErr_Format(
+ PyExc_ValueError,
+ "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
+ default_encoding_c);
+ goto bad;
+ }
+ Py_DECREF(ascii_chars_u);
+ Py_DECREF(ascii_chars_b);
+ }
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ Py_XDECREF(ascii_chars_u);
+ Py_XDECREF(ascii_chars_b);
+ return -1;
+}
+#endif
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
+#else
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+static char* __PYX_DEFAULT_STRING_ENCODING;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
+ if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
+ strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ return -1;
+}
+#endif
+#endif
+
+
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+ #define likely(x) __builtin_expect(!!(x), 1)
+ #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
+ #define likely(x) (x)
+ #define unlikely(x) (x)
+#endif /* __GNUC__ */
+
+static PyObject *__pyx_m;
+static PyObject *__pyx_d;
+static PyObject *__pyx_b;
+static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
+static int __pyx_lineno;
+static int __pyx_clineno = 0;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+
+
+static const char *__pyx_f[] = {
+ "zmq/backend/cython/error.pyx",
+};
+
+/*--- Type declarations ---*/
+#ifndef CYTHON_REFNANNY
+ #define CYTHON_REFNANNY 0
+#endif
+#if CYTHON_REFNANNY
+ typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*SetupContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+ } __Pyx_RefNannyAPIStruct;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
+ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
+#ifdef WITH_THREAD
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ if (acquire_gil) { \
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ PyGILState_Release(__pyx_gilstate_save); \
+ } else { \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ }
+#else
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+#endif
+ #define __Pyx_RefNannyFinishContext() \
+ __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
+ #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
+ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
+#else
+ #define __Pyx_RefNannyDeclarations
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)
+ #define __Pyx_RefNannyFinishContext()
+ #define __Pyx_INCREF(r) Py_INCREF(r)
+ #define __Pyx_DECREF(r) Py_DECREF(r)
+ #define __Pyx_GOTREF(r)
+ #define __Pyx_GIVEREF(r)
+ #define __Pyx_XINCREF(r) Py_XINCREF(r)
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
+ #define __Pyx_XGOTREF(r)
+ #define __Pyx_XGIVEREF(r)
+#endif
+#define __Pyx_XDECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_XDECREF(tmp); \
+ } while (0)
+#define __Pyx_DECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_DECREF(tmp); \
+ } while (0)
+#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
+#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_getattro))
+ return tp->tp_getattro(obj, attr_name);
+#if PY_MAJOR_VERSION < 3
+ if (likely(tp->tp_getattr))
+ return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
+#endif
+ return PyObject_GetAttr(obj, attr_name);
+}
+#else
+#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
+#endif
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+
+#include <string.h>
+
+static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+ const char* cstring, Py_ssize_t start, Py_ssize_t stop,
+ const char* encoding, const char* errors,
+ PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
+
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
+
+typedef struct {
+ int code_line;
+ PyCodeObject* code_object;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+ int count;
+ int max_count;
+ __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename);
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+
+static int __Pyx_check_binary_version(void);
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+
+
+/* Module declarations from 'zmq.backend.cython.libzmq' */
+
+/* Module declarations from 'zmq.backend.cython.error' */
+#define __Pyx_MODULE_NAME "zmq.backend.cython.error"
+int __pyx_module_is_main_zmq__backend__cython__error = 0;
+
+/* Implementation of 'zmq.backend.cython.error' */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_5error_strerror(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_errno); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_5error_2zmq_errno(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static char __pyx_k_all[] = "__all__";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_bytes[] = "bytes";
+static char __pyx_k_errno[] = "errno";
+static char __pyx_k_str_e[] = "str_e";
+static char __pyx_k_import[] = "__import__";
+static char __pyx_k_strerror[] = "strerror";
+static char __pyx_k_zmq_errno[] = "zmq_errno";
+static char __pyx_k_zmq_utils_strtypes[] = "zmq.utils.strtypes";
+static char __pyx_k_zmq_backend_cython_error[] = "zmq.backend.cython.error";
+static char __pyx_k_0MQ_Error_classes_and_functions[] = "0MQ Error classes and functions.";
+static char __pyx_k_private_tmp_pyzmq_release_zmq_b[] = "/private/tmp/pyzmq-release/zmq/backend/cython/error.pyx";
+static PyObject *__pyx_n_s_all;
+static PyObject *__pyx_n_s_bytes;
+static PyObject *__pyx_n_s_errno;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_kp_s_private_tmp_pyzmq_release_zmq_b;
+static PyObject *__pyx_n_s_str_e;
+static PyObject *__pyx_n_s_strerror;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_n_s_zmq_backend_cython_error;
+static PyObject *__pyx_n_s_zmq_errno;
+static PyObject *__pyx_n_s_zmq_utils_strtypes;
+static PyObject *__pyx_tuple_;
+static PyObject *__pyx_codeobj__2;
+static PyObject *__pyx_codeobj__3;
+
+/* "zmq/backend/cython/error.pyx":34
+ * from zmq.utils.strtypes import bytes
+ *
+ * def strerror(int errno): # <<<<<<<<<<<<<<
+ * """strerror(errno)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_5error_1strerror(PyObject *__pyx_self, PyObject *__pyx_arg_errno); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_5error_strerror[] = "strerror(errno)\n\n Return the error string given the error number.\n ";
+static PyMethodDef __pyx_mdef_3zmq_7backend_6cython_5error_1strerror = {"strerror", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_5error_1strerror, METH_O, __pyx_doc_3zmq_7backend_6cython_5error_strerror};
+static PyObject *__pyx_pw_3zmq_7backend_6cython_5error_1strerror(PyObject *__pyx_self, PyObject *__pyx_arg_errno) {
+ int __pyx_v_errno;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("strerror (wrapper)", 0);
+ assert(__pyx_arg_errno); {
+ __pyx_v_errno = __Pyx_PyInt_As_int(__pyx_arg_errno); if (unlikely((__pyx_v_errno == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("zmq.backend.cython.error.strerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_5error_strerror(__pyx_self, ((int)__pyx_v_errno));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_5error_strerror(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_errno) {
+ const char* __pyx_v_str_e;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("strerror", 0);
+
+ /* "zmq/backend/cython/error.pyx":41
+ * cdef const_char_ptr str_e
+ * # char * will be a bytes object:
+ * str_e = zmq_strerror(errno) # <<<<<<<<<<<<<<
+ * if str is bytes:
+ * # Python 2: str is bytes, so we already have the right type
+ */
+ __pyx_v_str_e = zmq_strerror(__pyx_v_errno);
+
+ /* "zmq/backend/cython/error.pyx":42
+ * # char * will be a bytes object:
+ * str_e = zmq_strerror(errno)
+ * if str is bytes: # <<<<<<<<<<<<<<
+ * # Python 2: str is bytes, so we already have the right type
+ * return str_e
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = (((PyObject*)(&PyString_Type)) == ((PyObject*)__pyx_t_1));
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+
+ /* "zmq/backend/cython/error.pyx":44
+ * if str is bytes:
+ * # Python 2: str is bytes, so we already have the right type
+ * return str_e # <<<<<<<<<<<<<<
+ * else:
+ * # Python 3: decode bytes to unicode str
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_str_e); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "zmq/backend/cython/error.pyx":47
+ * else:
+ * # Python 3: decode bytes to unicode str
+ * return str_e.decode() # <<<<<<<<<<<<<<
+ *
+ * def zmq_errno():
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_str_e, 0, strlen(__pyx_v_str_e), NULL, NULL, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/backend/cython/error.pyx":34
+ * from zmq.utils.strtypes import bytes
+ *
+ * def strerror(int errno): # <<<<<<<<<<<<<<
+ * """strerror(errno)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("zmq.backend.cython.error.strerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/error.pyx":49
+ * return str_e.decode()
+ *
+ * def zmq_errno(): # <<<<<<<<<<<<<<
+ * """zmq_errno()
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_5error_3zmq_errno(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_5error_2zmq_errno[] = "zmq_errno()\n \n Return the integer errno of the most recent zmq error.\n ";
+static PyMethodDef __pyx_mdef_3zmq_7backend_6cython_5error_3zmq_errno = {"zmq_errno", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_5error_3zmq_errno, METH_NOARGS, __pyx_doc_3zmq_7backend_6cython_5error_2zmq_errno};
+static PyObject *__pyx_pw_3zmq_7backend_6cython_5error_3zmq_errno(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("zmq_errno (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_5error_2zmq_errno(__pyx_self);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_5error_2zmq_errno(CYTHON_UNUSED PyObject *__pyx_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("zmq_errno", 0);
+
+ /* "zmq/backend/cython/error.pyx":54
+ * Return the integer errno of the most recent zmq error.
+ * """
+ * return zmq_errno_c() # <<<<<<<<<<<<<<
+ *
+ * __all__ = ['strerror', 'zmq_errno']
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_int(zmq_errno()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/error.pyx":49
+ * return str_e.decode()
+ *
+ * def zmq_errno(): # <<<<<<<<<<<<<<
+ * """zmq_errno()
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("zmq.backend.cython.error.zmq_errno", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyMethodDef __pyx_methods[] = {
+ {0, 0, 0, 0}
+};
+
+#if PY_MAJOR_VERSION >= 3
+static struct PyModuleDef __pyx_moduledef = {
+ #if PY_VERSION_HEX < 0x03020000
+ { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
+ #else
+ PyModuleDef_HEAD_INIT,
+ #endif
+ "error",
+ __pyx_k_0MQ_Error_classes_and_functions, /* m_doc */
+ -1, /* m_size */
+ __pyx_methods /* m_methods */,
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL /* m_free */
+};
+#endif
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+ {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
+ {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1},
+ {&__pyx_n_s_errno, __pyx_k_errno, sizeof(__pyx_k_errno), 0, 0, 1, 1},
+ {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+ {&__pyx_kp_s_private_tmp_pyzmq_release_zmq_b, __pyx_k_private_tmp_pyzmq_release_zmq_b, sizeof(__pyx_k_private_tmp_pyzmq_release_zmq_b), 0, 0, 1, 0},
+ {&__pyx_n_s_str_e, __pyx_k_str_e, sizeof(__pyx_k_str_e), 0, 0, 1, 1},
+ {&__pyx_n_s_strerror, __pyx_k_strerror, sizeof(__pyx_k_strerror), 0, 0, 1, 1},
+ {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq_backend_cython_error, __pyx_k_zmq_backend_cython_error, sizeof(__pyx_k_zmq_backend_cython_error), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq_errno, __pyx_k_zmq_errno, sizeof(__pyx_k_zmq_errno), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq_utils_strtypes, __pyx_k_zmq_utils_strtypes, sizeof(__pyx_k_zmq_utils_strtypes), 0, 0, 1, 1},
+ {0, 0, 0, 0, 0, 0, 0}
+};
+static int __Pyx_InitCachedBuiltins(void) {
+ return 0;
+}
+
+static int __Pyx_InitCachedConstants(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
+
+ /* "zmq/backend/cython/error.pyx":34
+ * from zmq.utils.strtypes import bytes
+ *
+ * def strerror(int errno): # <<<<<<<<<<<<<<
+ * """strerror(errno)
+ *
+ */
+ __pyx_tuple_ = PyTuple_Pack(3, __pyx_n_s_errno, __pyx_n_s_errno, __pyx_n_s_str_e); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple_);
+ __Pyx_GIVEREF(__pyx_tuple_);
+ __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_pyzmq_release_zmq_b, __pyx_n_s_strerror, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/error.pyx":49
+ * return str_e.decode()
+ *
+ * def zmq_errno(): # <<<<<<<<<<<<<<
+ * """zmq_errno()
+ *
+ */
+ __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_pyzmq_release_zmq_b, __pyx_n_s_zmq_errno, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static int __Pyx_InitGlobals(void) {
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+#if PY_MAJOR_VERSION < 3
+PyMODINIT_FUNC initerror(void); /*proto*/
+PyMODINIT_FUNC initerror(void)
+#else
+PyMODINIT_FUNC PyInit_error(void); /*proto*/
+PyMODINIT_FUNC PyInit_error(void)
+#endif
+{
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ #if CYTHON_REFNANNY
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
+ if (!__Pyx_RefNanny) {
+ PyErr_Clear();
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
+ if (!__Pyx_RefNanny)
+ Py_FatalError("failed to import 'refnanny' module");
+ }
+ #endif
+ __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_error(void)", 0);
+ if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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;}
+ __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;}
+ #ifdef __Pyx_CyFunction_USED
+ if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_FusedFunction_USED
+ if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_Generator_USED
+ if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ /*--- Library function declarations ---*/
+ /*--- Threads initialization code ---*/
+ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
+ #ifdef WITH_THREAD /* Python build with threading support? */
+ PyEval_InitThreads();
+ #endif
+ #endif
+ /*--- Module creation code ---*/
+ #if PY_MAJOR_VERSION < 3
+ __pyx_m = Py_InitModule4("error", __pyx_methods, __pyx_k_0MQ_Error_classes_and_functions, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+ #else
+ __pyx_m = PyModule_Create(&__pyx_moduledef);
+ #endif
+ if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_INCREF(__pyx_d);
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_COMPILING_IN_PYPY
+ Py_INCREF(__pyx_b);
+ #endif
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ /*--- Initialize various global constants etc. ---*/
+ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ if (__pyx_module_is_main_zmq__backend__cython__error) {
+ if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ }
+ #if PY_MAJOR_VERSION >= 3
+ {
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!PyDict_GetItemString(modules, "zmq.backend.cython.error")) {
+ if (unlikely(PyDict_SetItemString(modules, "zmq.backend.cython.error", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+ /*--- Builtin init code ---*/
+ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Constants init code ---*/
+ if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Global init code ---*/
+ /*--- Variable export code ---*/
+ /*--- Function export code ---*/
+ /*--- Type init code ---*/
+ /*--- Type import code ---*/
+ /*--- Variable import code ---*/
+ /*--- Function import code ---*/
+ /*--- Execution code ---*/
+
+ /* "zmq/backend/cython/error.pyx":32
+ * from libzmq cimport zmq_strerror, zmq_errno as zmq_errno_c
+ *
+ * from zmq.utils.strtypes import bytes # <<<<<<<<<<<<<<
+ *
+ * def strerror(int errno):
+ */
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_s_bytes);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_bytes);
+ __Pyx_GIVEREF(__pyx_n_s_bytes);
+ __pyx_t_2 = __Pyx_Import(__pyx_n_s_zmq_utils_strtypes, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/error.pyx":34
+ * from zmq.utils.strtypes import bytes
+ *
+ * def strerror(int errno): # <<<<<<<<<<<<<<
+ * """strerror(errno)
+ *
+ */
+ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3zmq_7backend_6cython_5error_1strerror, NULL, __pyx_n_s_zmq_backend_cython_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_strerror, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/error.pyx":49
+ * return str_e.decode()
+ *
+ * def zmq_errno(): # <<<<<<<<<<<<<<
+ * """zmq_errno()
+ *
+ */
+ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3zmq_7backend_6cython_5error_3zmq_errno, NULL, __pyx_n_s_zmq_backend_cython_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_zmq_errno, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/error.pyx":56
+ * return zmq_errno_c()
+ *
+ * __all__ = ['strerror', 'zmq_errno'] # <<<<<<<<<<<<<<
+ */
+ __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_n_s_strerror);
+ PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_strerror);
+ __Pyx_GIVEREF(__pyx_n_s_strerror);
+ __Pyx_INCREF(__pyx_n_s_zmq_errno);
+ PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_zmq_errno);
+ __Pyx_GIVEREF(__pyx_n_s_zmq_errno);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/error.pyx":1
+ * """0MQ Error classes and functions.""" # <<<<<<<<<<<<<<
+ *
+ * #
+ */
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /*--- Wrapped vars code ---*/
+
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ if (__pyx_m) {
+ if (__pyx_d) {
+ __Pyx_AddTraceback("init zmq.backend.cython.error", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ }
+ Py_DECREF(__pyx_m); __pyx_m = 0;
+ } else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ImportError, "init zmq.backend.cython.error");
+ }
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ #if PY_MAJOR_VERSION < 3
+ return;
+ #else
+ return __pyx_m;
+ #endif
+}
+
+/* Runtime support code */
+#if CYTHON_REFNANNY
+static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
+ PyObject *m = NULL, *p = NULL;
+ void *r = NULL;
+ m = PyImport_ImportModule((char *)modname);
+ if (!m) goto end;
+ p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
+ if (!p) goto end;
+ r = PyLong_AsVoidPtr(p);
+end:
+ Py_XDECREF(p);
+ Py_XDECREF(m);
+ return (__Pyx_RefNannyAPIStruct *)r;
+}
+#endif
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
+ PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
+ if (unlikely(!result)) {
+ PyErr_Format(PyExc_NameError,
+#if PY_MAJOR_VERSION >= 3
+ "name '%U' is not defined", name);
+#else
+ "name '%.200s' is not defined", PyString_AS_STRING(name));
+#endif
+ }
+ return result;
+}
+
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
+ PyObject *result;
+#if CYTHON_COMPILING_IN_CPYTHON
+ result = PyDict_GetItem(__pyx_d, name);
+ if (likely(result)) {
+ Py_INCREF(result);
+ } else {
+#else
+ result = PyObject_GetItem(__pyx_d, name);
+ if (!result) {
+ PyErr_Clear();
+#endif
+ result = __Pyx_GetBuiltinName(name);
+ }
+ return result;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+ const char* cstring, Py_ssize_t start, Py_ssize_t stop,
+ const char* encoding, const char* errors,
+ PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
+ Py_ssize_t length;
+ if (unlikely((start < 0) | (stop < 0))) {
+ length = strlen(cstring);
+ if (start < 0) {
+ start += length;
+ if (start < 0)
+ start = 0;
+ }
+ if (stop < 0)
+ stop += length;
+ }
+ length = stop - start;
+ if (unlikely(length <= 0))
+ return PyUnicode_FromUnicode(NULL, 0);
+ cstring += start;
+ if (decode_func) {
+ return decode_func(cstring, length, errors);
+ } else {
+ return PyUnicode_Decode(cstring, length, encoding, errors);
+ }
+}
+
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
+ PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
+ if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Format(PyExc_ImportError,
+ #if PY_MAJOR_VERSION < 3
+ "cannot import name %.230s", PyString_AS_STRING(name));
+ #else
+ "cannot import name %S", name);
+ #endif
+ }
+ return value;
+}
+
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+ int start = 0, mid = 0, end = count - 1;
+ if (end >= 0 && code_line > entries[end].code_line) {
+ return count;
+ }
+ while (start < end) {
+ mid = (start + end) / 2;
+ if (code_line < entries[mid].code_line) {
+ end = mid;
+ } else if (code_line > entries[mid].code_line) {
+ start = mid + 1;
+ } else {
+ return mid;
+ }
+ }
+ if (code_line <= entries[mid].code_line) {
+ return mid;
+ } else {
+ return mid + 1;
+ }
+}
+static PyCodeObject *__pyx_find_code_object(int code_line) {
+ PyCodeObject* code_object;
+ int pos;
+ if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
+ return NULL;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
+ return NULL;
+ }
+ code_object = __pyx_code_cache.entries[pos].code_object;
+ Py_INCREF(code_object);
+ return code_object;
+}
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
+ int pos, i;
+ __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
+ if (unlikely(!code_line)) {
+ return;
+ }
+ if (unlikely(!entries)) {
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (likely(entries)) {
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = 64;
+ __pyx_code_cache.count = 1;
+ entries[0].code_line = code_line;
+ entries[0].code_object = code_object;
+ Py_INCREF(code_object);
+ }
+ return;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
+ PyCodeObject* tmp = entries[pos].code_object;
+ entries[pos].code_object = code_object;
+ Py_DECREF(tmp);
+ return;
+ }
+ if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
+ int new_max = __pyx_code_cache.max_count + 64;
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
+ __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (unlikely(!entries)) {
+ return;
+ }
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = new_max;
+ }
+ for (i=__pyx_code_cache.count; i>pos; i--) {
+ entries[i] = entries[i-1];
+ }
+ entries[pos].code_line = code_line;
+ entries[pos].code_object = code_object;
+ __pyx_code_cache.count++;
+ Py_INCREF(code_object);
+}
+
+#include "compile.h"
+#include "frameobject.h"
+#include "traceback.h"
+static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
+ const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyObject *py_srcfile = 0;
+ PyObject *py_funcname = 0;
+ #if PY_MAJOR_VERSION < 3
+ py_srcfile = PyString_FromString(filename);
+ #else
+ py_srcfile = PyUnicode_FromString(filename);
+ #endif
+ if (!py_srcfile) goto bad;
+ if (c_line) {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #else
+ py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #endif
+ }
+ else {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromString(funcname);
+ #else
+ py_funcname = PyUnicode_FromString(funcname);
+ #endif
+ }
+ if (!py_funcname) goto bad;
+ py_code = __Pyx_PyCode_New(
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ __pyx_empty_bytes, /*PyObject *code,*/
+ __pyx_empty_tuple, /*PyObject *consts,*/
+ __pyx_empty_tuple, /*PyObject *names,*/
+ __pyx_empty_tuple, /*PyObject *varnames,*/
+ __pyx_empty_tuple, /*PyObject *freevars,*/
+ __pyx_empty_tuple, /*PyObject *cellvars,*/
+ py_srcfile, /*PyObject *filename,*/
+ py_funcname, /*PyObject *name,*/
+ py_line,
+ __pyx_empty_bytes /*PyObject *lnotab*/
+ );
+ Py_DECREF(py_srcfile);
+ Py_DECREF(py_funcname);
+ return py_code;
+bad:
+ Py_XDECREF(py_srcfile);
+ Py_XDECREF(py_funcname);
+ return NULL;
+}
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyFrameObject *py_frame = 0;
+ py_code = __pyx_find_code_object(c_line ? c_line : py_line);
+ if (!py_code) {
+ py_code = __Pyx_CreateCodeObjectForTraceback(
+ funcname, c_line, py_line, filename);
+ if (!py_code) goto bad;
+ __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
+ }
+ py_frame = PyFrame_New(
+ PyThreadState_GET(), /*PyThreadState *tstate,*/
+ py_code, /*PyCodeObject *code,*/
+ __pyx_d, /*PyObject *globals,*/
+ 0 /*PyObject *locals*/
+ );
+ if (!py_frame) goto bad;
+ py_frame->f_lineno = py_line;
+ PyTraceBack_Here(py_frame);
+bad:
+ Py_XDECREF(py_code);
+ Py_XDECREF(py_frame);
+}
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
+ goto bad;
+ #endif
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ {
+ #if PY_MAJOR_VERSION >= 3
+ if (level == -1) {
+ if (strchr(__Pyx_MODULE_NAME, '.')) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(1);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, 1);
+ #endif
+ if (!module) {
+ if (!PyErr_ExceptionMatches(PyExc_ImportError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ level = 0;
+ }
+ #endif
+ if (!module) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(level);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, level);
+ #endif
+ }
+ }
+bad:
+ #if PY_VERSION_HEX < 0x03030000
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
+}
+
+#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value) \
+ { \
+ func_type value = func_value; \
+ if (sizeof(target_type) < sizeof(func_type)) { \
+ if (unlikely(value != (func_type) (target_type) value)) { \
+ func_type zero = 0; \
+ if (is_unsigned && unlikely(value < zero)) \
+ goto raise_neg_overflow; \
+ else \
+ goto raise_overflow; \
+ } \
+ } \
+ return (target_type) value; \
+ }
+
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ #include "longintrepr.h"
+ #endif
+#endif
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+ const int neg_one = (int) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(int) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (int) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(int) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
+ } else if (sizeof(int) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ int val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (int) -1;
+ }
+ } else {
+ int val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (int) -1;
+ val = __Pyx_PyInt_As_int(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to int");
+ return (int) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to int");
+ return (int) -1;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+ const int neg_one = (int) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(int) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(int) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(int),
+ little, !is_unsigned);
+ }
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+ const long neg_one = (long) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(long) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(long) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(long),
+ little, !is_unsigned);
+ }
+}
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+ const long neg_one = (long) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(long) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (long) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(long) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(long) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(long) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
+ } else if (sizeof(long) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ long val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (long) -1;
+ }
+ } else {
+ long val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (long) -1;
+ val = __Pyx_PyInt_As_long(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to long");
+ return (long) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to long");
+ return (long) -1;
+}
+
+static int __Pyx_check_binary_version(void) {
+ char ctversion[4], rtversion[4];
+ PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
+ if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
+ char message[200];
+ PyOS_snprintf(message, sizeof(message),
+ "compiletime version %s of module '%.100s' "
+ "does not match runtime version %s",
+ ctversion, __Pyx_MODULE_NAME, rtversion);
+ return PyErr_WarnEx(NULL, message, 1);
+ }
+ return 0;
+}
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+ while (t->p) {
+ #if PY_MAJOR_VERSION < 3
+ if (t->is_unicode) {
+ *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
+ } else if (t->intern) {
+ *t->p = PyString_InternFromString(t->s);
+ } else {
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+ }
+ #else
+ if (t->is_unicode | t->is_str) {
+ if (t->intern) {
+ *t->p = PyUnicode_InternFromString(t->s);
+ } else if (t->encoding) {
+ *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
+ } else {
+ *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+ }
+ } else {
+ *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
+ }
+ #endif
+ if (!*t->p)
+ return -1;
+ ++t;
+ }
+ return 0;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
+ return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
+ Py_ssize_t ignore;
+ return __Pyx_PyObject_AsStringAndSize(o, &ignore);
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+ if (
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ __Pyx_sys_getdefaultencoding_not_ascii &&
+#endif
+ PyUnicode_Check(o)) {
+#if PY_VERSION_HEX < 0x03030000
+ char* defenc_c;
+ PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
+ if (!defenc) return NULL;
+ defenc_c = PyBytes_AS_STRING(defenc);
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ {
+ char* end = defenc_c + PyBytes_GET_SIZE(defenc);
+ char* c;
+ for (c = defenc_c; c < end; c++) {
+ if ((unsigned char) (*c) >= 128) {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+ }
+ }
+#endif
+ *length = PyBytes_GET_SIZE(defenc);
+ return defenc_c;
+#else
+ if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ if (PyUnicode_IS_ASCII(o)) {
+ *length = PyUnicode_GET_LENGTH(o);
+ return PyUnicode_AsUTF8(o);
+ } else {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+#else
+ return PyUnicode_AsUTF8AndSize(o, length);
+#endif
+#endif
+ } else
+#endif
+#if !CYTHON_COMPILING_IN_PYPY
+ if (PyByteArray_Check(o)) {
+ *length = PyByteArray_GET_SIZE(o);
+ return PyByteArray_AS_STRING(o);
+ } else
+#endif
+ {
+ char* result;
+ int r = PyBytes_AsStringAndSize(o, &result, length);
+ if (unlikely(r < 0)) {
+ return NULL;
+ } else {
+ return result;
+ }
+ }
+}
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
+ int is_true = x == Py_True;
+ if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
+ else return PyObject_IsTrue(x);
+}
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
+ PyNumberMethods *m;
+ const char *name = NULL;
+ PyObject *res = NULL;
+#if PY_MAJOR_VERSION < 3
+ if (PyInt_Check(x) || PyLong_Check(x))
+#else
+ if (PyLong_Check(x))
+#endif
+ return Py_INCREF(x), x;
+ m = Py_TYPE(x)->tp_as_number;
+#if PY_MAJOR_VERSION < 3
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Int(x);
+ }
+ else if (m && m->nb_long) {
+ name = "long";
+ res = PyNumber_Long(x);
+ }
+#else
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Long(x);
+ }
+#endif
+ if (res) {
+#if PY_MAJOR_VERSION < 3
+ if (!PyInt_Check(res) && !PyLong_Check(res)) {
+#else
+ if (!PyLong_Check(res)) {
+#endif
+ PyErr_Format(PyExc_TypeError,
+ "__%.4s__ returned non-%.4s (type %.200s)",
+ name, name, Py_TYPE(res)->tp_name);
+ Py_DECREF(res);
+ return NULL;
+ }
+ }
+ else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "an integer is required");
+ }
+ return res;
+}
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+ Py_ssize_t ival;
+ PyObject *x;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(b)))
+ return PyInt_AS_LONG(b);
+#endif
+ if (likely(PyLong_CheckExact(b))) {
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(b)) {
+ case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
+ case 0: return 0;
+ case 1: return ((PyLongObject*)b)->ob_digit[0];
+ }
+ #endif
+ #endif
+ return PyLong_AsSsize_t(b);
+ }
+ x = PyNumber_Index(b);
+ if (!x) return -1;
+ ival = PyInt_AsSsize_t(x);
+ Py_DECREF(x);
+ return ival;
+}
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
+ return PyInt_FromSize_t(ival);
+}
+
+
+#endif /* Py_PYTHON_H */
diff --git a/scripts/external_libs/platform/cel59/zmq/backend/cython/error.pyx b/scripts/external_libs/platform/cel59/zmq/backend/cython/error.pyx
new file mode 100644
index 00000000..85e785f6
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/error.pyx
@@ -0,0 +1,56 @@
+"""0MQ Error classes and functions."""
+
+#
+# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
+#
+# This file is part of pyzmq.
+#
+# pyzmq is free software; you can redistribute it and/or modify it under
+# the terms of the Lesser GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# pyzmq is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# Lesser GNU General Public License for more details.
+#
+# You should have received a copy of the Lesser GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+#-----------------------------------------------------------------------------
+# Imports
+#-----------------------------------------------------------------------------
+
+# allow const char*
+cdef extern from *:
+ ctypedef char* const_char_ptr "const char*"
+
+from libzmq cimport zmq_strerror, zmq_errno as zmq_errno_c
+
+from zmq.utils.strtypes import bytes
+
+def strerror(int errno):
+ """strerror(errno)
+
+ Return the error string given the error number.
+ """
+ cdef const_char_ptr str_e
+ # char * will be a bytes object:
+ str_e = zmq_strerror(errno)
+ if str is bytes:
+ # Python 2: str is bytes, so we already have the right type
+ return str_e
+ else:
+ # Python 3: decode bytes to unicode str
+ return str_e.decode()
+
+def zmq_errno():
+ """zmq_errno()
+
+ Return the integer errno of the most recent zmq error.
+ """
+ return zmq_errno_c()
+
+__all__ = ['strerror', 'zmq_errno']
diff --git a/scripts/external_libs/zmq/backend/cython/libzmq.pxd b/scripts/external_libs/platform/cel59/zmq/backend/cython/libzmq.pxd
index e42f6d6b..e42f6d6b 100644
--- a/scripts/external_libs/zmq/backend/cython/libzmq.pxd
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/libzmq.pxd
diff --git a/scripts/external_libs/platform/cel59/zmq/backend/cython/message.c b/scripts/external_libs/platform/cel59/zmq/backend/cython/message.c
new file mode 100644
index 00000000..bedf453f
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/message.c
@@ -0,0 +1,8145 @@
+/* Generated by Cython 0.21.2 */
+
+#define PY_SSIZE_T_CLEAN
+#ifndef CYTHON_USE_PYLONG_INTERNALS
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#else
+#include "pyconfig.h"
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 1
+#else
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#endif
+#endif
+#endif
+#include "Python.h"
+#ifndef Py_PYTHON_H
+ #error Python headers needed to compile C extensions, please install development version of Python.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+ #error Cython requires Python 2.6+ or Python 3.2+.
+#else
+#define CYTHON_ABI "0_21_2"
+#include <stddef.h>
+#ifndef offsetof
+#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+ #ifndef __stdcall
+ #define __stdcall
+ #endif
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
+ #ifndef __fastcall
+ #define __fastcall
+ #endif
+#endif
+#ifndef DL_IMPORT
+ #define DL_IMPORT(t) t
+#endif
+#ifndef DL_EXPORT
+ #define DL_EXPORT(t) t
+#endif
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifndef Py_HUGE_VAL
+ #define Py_HUGE_VAL HUGE_VAL
+#endif
+#ifdef PYPY_VERSION
+#define CYTHON_COMPILING_IN_PYPY 1
+#define CYTHON_COMPILING_IN_CPYTHON 0
+#else
+#define CYTHON_COMPILING_IN_PYPY 0
+#define CYTHON_COMPILING_IN_CPYTHON 1
+#endif
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
+#define Py_OptimizeFlag 0
+#endif
+#define __PYX_BUILD_PY_SSIZE_T "n"
+#define CYTHON_FORMAT_SSIZE_T "z"
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyClass_Type
+#else
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyType_Type
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define Py_TPFLAGS_CHECKTYPES 0
+ #define Py_TPFLAGS_HAVE_INDEX 0
+ #define Py_TPFLAGS_HAVE_NEWBUFFER 0
+#endif
+#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+ #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
+#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
+ #define CYTHON_PEP393_ENABLED 1
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
+ 0 : _PyUnicode_Ready((PyObject *)(op)))
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
+ #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
+ #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+#else
+ #define CYTHON_PEP393_ENABLED 0
+ #define __Pyx_PyUnicode_READY(op) (0)
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
+ #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
+ #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+ #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyFrozenSet_Size(s) PyObject_Size(s)
+#else
+ #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
+ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
+ #define __Pyx_PyFrozenSet_Size(s) PySet_Size(s)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
+#else
+ #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBaseString_Type PyUnicode_Type
+ #define PyStringObject PyUnicodeObject
+ #define PyString_Type PyUnicode_Type
+ #define PyString_Check PyUnicode_Check
+ #define PyString_CheckExact PyUnicode_CheckExact
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
+ #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
+#else
+ #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+ #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
+#endif
+#ifndef PySet_CheckExact
+ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
+#endif
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#if PY_MAJOR_VERSION >= 3
+ #define PyIntObject PyLongObject
+ #define PyInt_Type PyLong_Type
+ #define PyInt_Check(op) PyLong_Check(op)
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
+ #define PyInt_FromString PyLong_FromString
+ #define PyInt_FromUnicode PyLong_FromUnicode
+ #define PyInt_FromLong PyLong_FromLong
+ #define PyInt_FromSize_t PyLong_FromSize_t
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
+ #define PyInt_AsLong PyLong_AsLong
+ #define PyInt_AS_LONG PyLong_AS_LONG
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+ #define PyNumber_Int PyNumber_Long
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBoolObject PyLongObject
+#endif
+#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
+ #ifndef PyUnicode_InternFromString
+ #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
+ #endif
+#endif
+#if PY_VERSION_HEX < 0x030200A4
+ typedef long Py_hash_t;
+ #define __Pyx_PyInt_FromHash_t PyInt_FromLong
+ #define __Pyx_PyInt_AsHash_t PyInt_AsLong
+#else
+ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
+ #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+#else
+ #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
+#endif
+#ifndef CYTHON_INLINE
+ #if defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+#ifndef CYTHON_RESTRICT
+ #if defined(__GNUC__)
+ #define CYTHON_RESTRICT __restrict__
+ #elif defined(_MSC_VER) && _MSC_VER >= 1400
+ #define CYTHON_RESTRICT __restrict
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_RESTRICT restrict
+ #else
+ #define CYTHON_RESTRICT
+ #endif
+#endif
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
+#else
+static CYTHON_INLINE float __PYX_NAN() {
+ /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
+ a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
+ a quiet NaN. */
+ float value;
+ memset(&value, 0xFF, sizeof(value));
+ return value;
+}
+#endif
+#ifdef __cplusplus
+template<typename T>
+void __Pyx_call_destructor(T* x) {
+ x->~T();
+}
+#endif
+
+
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
+#else
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
+#endif
+
+#ifndef __PYX_EXTERN_C
+ #ifdef __cplusplus
+ #define __PYX_EXTERN_C extern "C"
+ #else
+ #define __PYX_EXTERN_C extern
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+#define _USE_MATH_DEFINES
+#endif
+#include <math.h>
+#define __PYX_HAVE__zmq__backend__cython__message
+#define __PYX_HAVE_API__zmq__backend__cython__message
+#include "string.h"
+#include "stdio.h"
+#include "pythread.h"
+#include "zmq_compat.h"
+#include "zmq.h"
+#include "zmq_utils.h"
+#include "pyversion_compat.h"
+#include "stdlib.h"
+#include "errno.h"
+#ifdef _OPENMP
+#include <omp.h>
+#endif /* _OPENMP */
+
+#ifdef PYREX_WITHOUT_ASSERTIONS
+#define CYTHON_WITHOUT_ASSERTIONS
+#endif
+
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
+ const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \
+ (sizeof(type) < sizeof(Py_ssize_t)) || \
+ (sizeof(type) > sizeof(Py_ssize_t) && \
+ likely(v < (type)PY_SSIZE_T_MAX || \
+ v == (type)PY_SSIZE_T_MAX) && \
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \
+ v == (type)PY_SSIZE_T_MIN))) || \
+ (sizeof(type) == sizeof(Py_ssize_t) && \
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \
+ v == (type)PY_SSIZE_T_MAX))) )
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
+#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
+#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
+#define __Pyx_PyBytes_FromString PyBytes_FromString
+#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#else
+ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
+#endif
+#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
+#if PY_MAJOR_VERSION < 3
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
+{
+ const Py_UNICODE *u_end = u;
+ while (*u_end++) ;
+ return (size_t)(u_end - u - 1);
+}
+#else
+#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
+#endif
+#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
+#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
+#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
+#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
+#else
+#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
+#endif
+#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ PyObject* ascii_chars_u = NULL;
+ PyObject* ascii_chars_b = NULL;
+ const char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ if (strcmp(default_encoding_c, "ascii") == 0) {
+ __Pyx_sys_getdefaultencoding_not_ascii = 0;
+ } else {
+ char ascii_chars[128];
+ int c;
+ for (c = 0; c < 128; c++) {
+ ascii_chars[c] = c;
+ }
+ __Pyx_sys_getdefaultencoding_not_ascii = 1;
+ ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
+ if (!ascii_chars_u) goto bad;
+ ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
+ if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
+ PyErr_Format(
+ PyExc_ValueError,
+ "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
+ default_encoding_c);
+ goto bad;
+ }
+ Py_DECREF(ascii_chars_u);
+ Py_DECREF(ascii_chars_b);
+ }
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ Py_XDECREF(ascii_chars_u);
+ Py_XDECREF(ascii_chars_b);
+ return -1;
+}
+#endif
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
+#else
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+static char* __PYX_DEFAULT_STRING_ENCODING;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
+ if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
+ strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ return -1;
+}
+#endif
+#endif
+
+
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+ #define likely(x) __builtin_expect(!!(x), 1)
+ #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
+ #define likely(x) (x)
+ #define unlikely(x) (x)
+#endif /* __GNUC__ */
+
+static PyObject *__pyx_m;
+static PyObject *__pyx_d;
+static PyObject *__pyx_b;
+static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
+static int __pyx_lineno;
+static int __pyx_clineno = 0;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+
+
+static const char *__pyx_f[] = {
+ "zmq/backend/cython/message.pyx",
+ "zmq/backend/cython/message.pxd",
+ "zmq/backend/cython/checkrc.pxd",
+ "zmq/utils/buffers.pxd",
+ "type.pxd",
+ "bool.pxd",
+ "complex.pxd",
+};
+
+/*--- Type declarations ---*/
+struct __pyx_obj_3zmq_7backend_6cython_7message_MessageTracker;
+struct __pyx_obj_3zmq_7backend_6cython_7message_Frame;
+struct __pyx_t_3zmq_7backend_6cython_7message_zhint;
+typedef struct __pyx_t_3zmq_7backend_6cython_7message_zhint __pyx_t_3zmq_7backend_6cython_7message_zhint;
+
+/* "zmq/backend/cython/message.pyx":61
+ * #-----------------------------------------------------------------------------
+ *
+ * ctypedef struct zhint: # <<<<<<<<<<<<<<
+ * void *ctx
+ * size_t id
+ */
+struct __pyx_t_3zmq_7backend_6cython_7message_zhint {
+ void *ctx;
+ size_t id;
+};
+
+/* "zmq/backend/cython/message.pxd":34
+ * #-----------------------------------------------------------------------------
+ *
+ * cdef class MessageTracker(object): # <<<<<<<<<<<<<<
+ *
+ * cdef set events # Message Event objects to track.
+ */
+struct __pyx_obj_3zmq_7backend_6cython_7message_MessageTracker {
+ PyObject_HEAD
+ PyObject *events;
+ PyObject *peers;
+};
+
+
+/* "zmq/backend/cython/message.pxd":40
+ *
+ *
+ * cdef class Frame: # <<<<<<<<<<<<<<
+ *
+ * cdef zmq_msg_t zmq_msg
+ */
+struct __pyx_obj_3zmq_7backend_6cython_7message_Frame {
+ PyObject_HEAD
+ struct __pyx_vtabstruct_3zmq_7backend_6cython_7message_Frame *__pyx_vtab;
+ zmq_msg_t zmq_msg;
+ PyObject *_data;
+ PyObject *_buffer;
+ PyObject *_bytes;
+ int _failed_init;
+ PyObject *tracker_event;
+ PyObject *tracker;
+ int more;
+};
+
+
+
+/* "zmq/backend/cython/message.pyx":111
+ * gc = None
+ *
+ * cdef class Frame: # <<<<<<<<<<<<<<
+ * """Frame(data=None, track=False)
+ *
+ */
+
+struct __pyx_vtabstruct_3zmq_7backend_6cython_7message_Frame {
+ struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *(*fast_copy)(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *);
+ PyObject *(*_getbuffer)(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *);
+};
+static struct __pyx_vtabstruct_3zmq_7backend_6cython_7message_Frame *__pyx_vtabptr_3zmq_7backend_6cython_7message_Frame;
+static PyObject *__pyx_f_3zmq_7backend_6cython_7message_5Frame__getbuffer(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *);
+#ifndef CYTHON_REFNANNY
+ #define CYTHON_REFNANNY 0
+#endif
+#if CYTHON_REFNANNY
+ typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*SetupContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+ } __Pyx_RefNannyAPIStruct;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
+ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
+#ifdef WITH_THREAD
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ if (acquire_gil) { \
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ PyGILState_Release(__pyx_gilstate_save); \
+ } else { \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ }
+#else
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+#endif
+ #define __Pyx_RefNannyFinishContext() \
+ __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
+ #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
+ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
+#else
+ #define __Pyx_RefNannyDeclarations
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)
+ #define __Pyx_RefNannyFinishContext()
+ #define __Pyx_INCREF(r) Py_INCREF(r)
+ #define __Pyx_DECREF(r) Py_DECREF(r)
+ #define __Pyx_GOTREF(r)
+ #define __Pyx_GIVEREF(r)
+ #define __Pyx_XINCREF(r) Py_XINCREF(r)
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
+ #define __Pyx_XGOTREF(r)
+ #define __Pyx_XGIVEREF(r)
+#endif
+#define __Pyx_XDECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_XDECREF(tmp); \
+ } while (0)
+#define __Pyx_DECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_DECREF(tmp); \
+ } while (0)
+#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
+#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_getattro))
+ return tp->tp_getattro(obj, attr_name);
+#if PY_MAJOR_VERSION < 3
+ if (likely(tp->tp_getattr))
+ return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
+#endif
+ return PyObject_GetAttr(obj, attr_name);
+}
+#else
+#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
+#endif
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
+
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+ const char* function_name);
+
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+ Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
+#else
+#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
+#else
+#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
+#endif
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
+
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
+
+static void __Pyx_WriteUnraisable(const char *name, int clineno,
+ int lineno, const char *filename,
+ int full_traceback);
+
+#include <string.h>
+
+static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+ const char* cstring, Py_ssize_t start, Py_ssize_t stop,
+ const char* encoding, const char* errors,
+ PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
+
+static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
+static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);
+
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+
+static int __Pyx_SetVtable(PyObject *dict, void *vtable);
+
+static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name);
+
+typedef struct {
+ int code_line;
+ PyCodeObject* code_object;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+ int count;
+ int max_count;
+ __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename);
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);
+
+#ifndef __PYX_FORCE_INIT_THREADS
+ #define __PYX_FORCE_INIT_THREADS 0
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+
+static int __Pyx_check_binary_version(void);
+
+#if !defined(__Pyx_PyIdentifier_FromString)
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
+#else
+ #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
+#endif
+#endif
+
+static PyObject *__Pyx_ImportModule(const char *name);
+
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+
+static struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_f_3zmq_7backend_6cython_7message_5Frame_fast_copy(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self); /* proto*/
+static PyObject *__pyx_f_3zmq_7backend_6cython_7message_5Frame__getbuffer(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self); /* proto*/
+
+/* Module declarations from 'cpython.version' */
+
+/* Module declarations from 'cpython.ref' */
+
+/* Module declarations from 'cpython.exc' */
+
+/* Module declarations from 'cpython.module' */
+
+/* Module declarations from 'cpython.mem' */
+
+/* Module declarations from 'cpython.tuple' */
+
+/* Module declarations from 'cpython.list' */
+
+/* Module declarations from 'libc.string' */
+
+/* Module declarations from 'libc.stdio' */
+
+/* Module declarations from 'cpython.object' */
+
+/* Module declarations from 'cpython.sequence' */
+
+/* Module declarations from 'cpython.mapping' */
+
+/* Module declarations from 'cpython.iterator' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.type' */
+static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
+
+/* Module declarations from 'cpython.number' */
+
+/* Module declarations from 'cpython.int' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.bool' */
+static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
+
+/* Module declarations from 'cpython.long' */
+
+/* Module declarations from 'cpython.float' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.complex' */
+static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
+
+/* Module declarations from 'cpython.string' */
+
+/* Module declarations from 'cpython.unicode' */
+
+/* Module declarations from 'cpython.dict' */
+
+/* Module declarations from 'cpython.instance' */
+
+/* Module declarations from 'cpython.function' */
+
+/* Module declarations from 'cpython.method' */
+
+/* Module declarations from 'cpython.weakref' */
+
+/* Module declarations from 'cpython.getargs' */
+
+/* Module declarations from 'cpython.pythread' */
+
+/* Module declarations from 'cpython.pystate' */
+
+/* Module declarations from 'cpython.cobject' */
+
+/* Module declarations from 'cpython.oldbuffer' */
+
+/* Module declarations from 'cpython.set' */
+
+/* Module declarations from 'cpython.buffer' */
+
+/* Module declarations from 'cpython.bytes' */
+
+/* Module declarations from 'cpython.pycapsule' */
+
+/* Module declarations from 'cpython' */
+
+/* Module declarations from 'zmq.backend.cython.libzmq' */
+
+/* Module declarations from 'buffers' */
+static CYTHON_INLINE int __pyx_f_7buffers_memoryview_available(void); /*proto*/
+static CYTHON_INLINE int __pyx_f_7buffers_oldstyle_available(void); /*proto*/
+static CYTHON_INLINE int __pyx_f_7buffers_check_buffer(PyObject *); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_asbuffer(PyObject *, int, int, void **, Py_ssize_t *, Py_ssize_t *); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_asbuffer_r(PyObject *, void **, Py_ssize_t *); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer_3(void *, Py_ssize_t, int); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer_2(void *, Py_ssize_t, int); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer(void *, Py_ssize_t, int); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_viewfromobject(PyObject *, int); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_viewfromobject_r(PyObject *); /*proto*/
+
+/* Module declarations from 'libc.stdlib' */
+
+/* Module declarations from 'libc.errno' */
+
+/* Module declarations from 'zmq.backend.cython.checkrc' */
+static CYTHON_INLINE int __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(int); /*proto*/
+
+/* Module declarations from 'zmq.backend.cython.message' */
+static PyTypeObject *__pyx_ptype_3zmq_7backend_6cython_7message_MessageTracker = 0;
+static PyTypeObject *__pyx_ptype_3zmq_7backend_6cython_7message_Frame = 0;
+static CYTHON_INLINE PyObject *__pyx_f_3zmq_7backend_6cython_7message_copy_zmq_msg_bytes(zmq_msg_t *); /*proto*/
+static void __pyx_f_3zmq_7backend_6cython_7message_free_python_msg(void *, void *); /*proto*/
+#define __Pyx_MODULE_NAME "zmq.backend.cython.message"
+int __pyx_module_is_main_zmq__backend__cython__message = 0;
+
+/* Implementation of 'zmq.backend.cython.message' */
+static PyObject *__pyx_builtin_ImportError;
+static PyObject *__pyx_builtin_AttributeError;
+static PyObject *__pyx_builtin_property;
+static PyObject *__pyx_builtin_TypeError;
+static PyObject *__pyx_builtin_SystemError;
+static PyObject *__pyx_builtin_NotImplementedError;
+static int __pyx_pf_3zmq_7backend_6cython_7message_5Frame___cinit__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_track, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
+static int __pyx_pf_3zmq_7backend_6cython_7message_5Frame_2__init__(CYTHON_UNUSED struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_track); /* proto */
+static void __pyx_pf_3zmq_7backend_6cython_7message_5Frame_4__dealloc__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self); /* proto */
+static int __pyx_pf_3zmq_7backend_6cython_7message_5Frame_6__getbuffer__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self, Py_buffer *__pyx_v_buffer, CYTHON_UNUSED int __pyx_v_flags); /* proto */
+#if PY_MAJOR_VERSION < 3
+static Py_ssize_t __pyx_pf_3zmq_7backend_6cython_7message_5Frame_8__getsegcount__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self, Py_ssize_t *__pyx_v_lenp); /* proto */
+#endif
+#if PY_MAJOR_VERSION < 3
+static Py_ssize_t __pyx_pf_3zmq_7backend_6cython_7message_5Frame_10__getreadbuffer__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /* proto */
+#endif
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7message_5Frame_12__copy__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self); /* proto */
+static Py_ssize_t __pyx_pf_3zmq_7backend_6cython_7message_5Frame_14__len__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7message_5Frame_16__str__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7message_5Frame_18buffer(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7message_5Frame_20bytes(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7message_5Frame_22set(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self, int __pyx_v_option, int __pyx_v_value); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7message_5Frame_24get(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self, PyObject *__pyx_v_option); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7message_5Frame_13tracker_event___get__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self); /* proto */
+static int __pyx_pf_3zmq_7backend_6cython_7message_5Frame_13tracker_event_2__set__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
+static int __pyx_pf_3zmq_7backend_6cython_7message_5Frame_13tracker_event_4__del__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7message_5Frame_7tracker___get__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self); /* proto */
+static int __pyx_pf_3zmq_7backend_6cython_7message_5Frame_7tracker_2__set__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
+static int __pyx_pf_3zmq_7backend_6cython_7message_5Frame_7tracker_4__del__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7message_5Frame_4more___get__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self); /* proto */
+static int __pyx_pf_3zmq_7backend_6cython_7message_5Frame_4more_2__set__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
+static PyObject *__pyx_tp_new_3zmq_7backend_6cython_7message_MessageTracker(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_3zmq_7backend_6cython_7message_Frame(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static char __pyx_k_B[] = "B";
+static char __pyx_k__7[] = "";
+static char __pyx_k_gc[] = "gc";
+static char __pyx_k_all[] = "__all__";
+static char __pyx_k_zmq[] = "zmq";
+static char __pyx_k_char[] = "char";
+static char __pyx_k_data[] = "data";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_time[] = "time";
+static char __pyx_k_utf8[] = "utf8";
+static char __pyx_k_Again[] = "Again";
+static char __pyx_k_Event[] = "Event";
+static char __pyx_k_Frame[] = "Frame";
+static char __pyx_k_ascii[] = "ascii";
+static char __pyx_k_bytes[] = "bytes";
+static char __pyx_k_dtype[] = "dtype";
+static char __pyx_k_store[] = "store";
+static char __pyx_k_track[] = "track";
+static char __pyx_k_value[] = "value";
+static char __pyx_k_buffer[] = "buffer";
+static char __pyx_k_decode[] = "decode";
+static char __pyx_k_encode[] = "encode";
+static char __pyx_k_import[] = "__import__";
+static char __pyx_k_option[] = "option";
+static char __pyx_k_Event_2[] = "_Event";
+static char __pyx_k_Message[] = "Message";
+static char __pyx_k_context[] = "_context";
+static char __pyx_k_unicode[] = "unicode";
+static char __pyx_k_ZMQError[] = "ZMQError";
+static char __pyx_k_itemsize[] = "itemsize";
+static char __pyx_k_property[] = "property";
+static char __pyx_k_typecode[] = "typecode";
+static char __pyx_k_TypeError[] = "TypeError";
+static char __pyx_k_threading[] = "threading";
+static char __pyx_k_zmq_error[] = "zmq.error";
+static char __pyx_k_basestring[] = "basestring";
+static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static char __pyx_k_underlying[] = "underlying";
+static char __pyx_k_ImportError[] = "ImportError";
+static char __pyx_k_SystemError[] = "SystemError";
+static char __pyx_k_check_version[] = "_check_version";
+static char __pyx_k_AttributeError[] = "AttributeError";
+static char __pyx_k_MessageTracker[] = "MessageTracker";
+static char __pyx_k_ContextTerminated[] = "ContextTerminated";
+static char __pyx_k_zmq_utils_garbage[] = "zmq.utils.garbage";
+static char __pyx_k_expected_str_got_r[] = "expected str, got: %r";
+static char __pyx_k_inproc_pyzmq_gc_01[] = "inproc://pyzmq.gc.01";
+static char __pyx_k_zmq_utils_strtypes[] = "zmq.utils.strtypes";
+static char __pyx_k_NotImplementedError[] = "NotImplementedError";
+static char __pyx_k_get_string_properties[] = "get string properties";
+static char __pyx_k_pyzmq_gc_send_failed_s[] = "pyzmq-gc send failed: %s\n";
+static char __pyx_k_pyzmq_gc_connect_failed_s[] = "pyzmq-gc connect failed: %s\n";
+static char __pyx_k_0MQ_Message_related_classes[] = "0MQ Message related classes.";
+static char __pyx_k_Old_style_buffers_not_available[] = "Old style buffers not available.";
+static char __pyx_k_r_does_not_provide_a_buffer_int[] = "%r does not provide a buffer interface.";
+static char __pyx_k_Unicode_objects_not_allowed_Only[] = "Unicode objects not allowed. Only: str/bytes, buffer interfaces.";
+static char __pyx_k_accessing_non_existent_buffer_se[] = "accessing non-existent buffer segment";
+static PyObject *__pyx_n_s_Again;
+static PyObject *__pyx_n_s_AttributeError;
+static PyObject *__pyx_n_b_B;
+static PyObject *__pyx_n_s_ContextTerminated;
+static PyObject *__pyx_n_s_Event;
+static PyObject *__pyx_n_s_Event_2;
+static PyObject *__pyx_n_s_Frame;
+static PyObject *__pyx_n_s_ImportError;
+static PyObject *__pyx_n_s_Message;
+static PyObject *__pyx_n_s_MessageTracker;
+static PyObject *__pyx_n_s_NotImplementedError;
+static PyObject *__pyx_kp_s_Old_style_buffers_not_available;
+static PyObject *__pyx_n_s_SystemError;
+static PyObject *__pyx_n_s_TypeError;
+static PyObject *__pyx_kp_s_Unicode_objects_not_allowed_Only;
+static PyObject *__pyx_n_s_ZMQError;
+static PyObject *__pyx_kp_s__7;
+static PyObject *__pyx_kp_s_accessing_non_existent_buffer_se;
+static PyObject *__pyx_n_s_all;
+static PyObject *__pyx_n_s_ascii;
+static PyObject *__pyx_n_s_basestring;
+static PyObject *__pyx_n_s_buffer;
+static PyObject *__pyx_n_s_bytes;
+static PyObject *__pyx_n_s_char;
+static PyObject *__pyx_n_s_check_version;
+static PyObject *__pyx_n_s_context;
+static PyObject *__pyx_n_s_data;
+static PyObject *__pyx_n_s_decode;
+static PyObject *__pyx_n_s_dtype;
+static PyObject *__pyx_n_s_encode;
+static PyObject *__pyx_kp_s_expected_str_got_r;
+static PyObject *__pyx_n_s_gc;
+static PyObject *__pyx_kp_s_get_string_properties;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_s_itemsize;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_option;
+static PyObject *__pyx_n_s_property;
+static PyObject *__pyx_n_s_pyx_vtable;
+static PyObject *__pyx_kp_s_r_does_not_provide_a_buffer_int;
+static PyObject *__pyx_n_s_store;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_n_s_threading;
+static PyObject *__pyx_n_s_time;
+static PyObject *__pyx_n_s_track;
+static PyObject *__pyx_n_s_typecode;
+static PyObject *__pyx_n_s_underlying;
+static PyObject *__pyx_n_s_unicode;
+static PyObject *__pyx_n_s_utf8;
+static PyObject *__pyx_n_s_value;
+static PyObject *__pyx_n_s_zmq;
+static PyObject *__pyx_n_s_zmq_error;
+static PyObject *__pyx_n_s_zmq_utils_garbage;
+static PyObject *__pyx_n_s_zmq_utils_strtypes;
+static PyObject *__pyx_int_1;
+static PyObject *__pyx_int_4;
+static PyObject *__pyx_tuple_;
+static PyObject *__pyx_tuple__2;
+static PyObject *__pyx_tuple__3;
+static PyObject *__pyx_tuple__4;
+static PyObject *__pyx_tuple__5;
+static PyObject *__pyx_tuple__6;
+static PyObject *__pyx_tuple__8;
+
+/* "zmq/backend/cython/message.pyx":65
+ * size_t id
+ *
+ * cdef void free_python_msg(void *data, void *vhint) nogil: # <<<<<<<<<<<<<<
+ * """A pure-C function for DECREF'ing Python-owned message data.
+ *
+ */
+
+static void __pyx_f_3zmq_7backend_6cython_7message_free_python_msg(CYTHON_UNUSED void *__pyx_v_data, void *__pyx_v_vhint) {
+ void *__pyx_v_push;
+ zmq_msg_t __pyx_v_msg;
+ __pyx_t_3zmq_7backend_6cython_7message_zhint *__pyx_v_hint;
+ int __pyx_v_rc;
+ int __pyx_t_1;
+
+ /* "zmq/backend/cython/message.pyx":87
+ * cdef void *push
+ * cdef zmq_msg_t msg
+ * cdef zhint *hint = <zhint *> vhint # <<<<<<<<<<<<<<
+ * if hint != NULL:
+ * zmq_msg_init_size(&msg, sizeof(size_t))
+ */
+ __pyx_v_hint = ((__pyx_t_3zmq_7backend_6cython_7message_zhint *)__pyx_v_vhint);
+
+ /* "zmq/backend/cython/message.pyx":88
+ * cdef zmq_msg_t msg
+ * cdef zhint *hint = <zhint *> vhint
+ * if hint != NULL: # <<<<<<<<<<<<<<
+ * zmq_msg_init_size(&msg, sizeof(size_t))
+ * memcpy(zmq_msg_data(&msg), &hint.id, sizeof(size_t))
+ */
+ __pyx_t_1 = ((__pyx_v_hint != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/message.pyx":89
+ * cdef zhint *hint = <zhint *> vhint
+ * if hint != NULL:
+ * zmq_msg_init_size(&msg, sizeof(size_t)) # <<<<<<<<<<<<<<
+ * memcpy(zmq_msg_data(&msg), &hint.id, sizeof(size_t))
+ *
+ */
+ zmq_msg_init_size((&__pyx_v_msg), (sizeof(size_t)));
+
+ /* "zmq/backend/cython/message.pyx":90
+ * if hint != NULL:
+ * zmq_msg_init_size(&msg, sizeof(size_t))
+ * memcpy(zmq_msg_data(&msg), &hint.id, sizeof(size_t)) # <<<<<<<<<<<<<<
+ *
+ * push = zmq_socket(hint.ctx, ZMQ_PUSH)
+ */
+ memcpy(zmq_msg_data((&__pyx_v_msg)), (&__pyx_v_hint->id), (sizeof(size_t)));
+
+ /* "zmq/backend/cython/message.pyx":92
+ * memcpy(zmq_msg_data(&msg), &hint.id, sizeof(size_t))
+ *
+ * push = zmq_socket(hint.ctx, ZMQ_PUSH) # <<<<<<<<<<<<<<
+ * if push == NULL:
+ * # this will happen if the context has been terminated
+ */
+ __pyx_v_push = zmq_socket(__pyx_v_hint->ctx, ZMQ_PUSH);
+
+ /* "zmq/backend/cython/message.pyx":93
+ *
+ * push = zmq_socket(hint.ctx, ZMQ_PUSH)
+ * if push == NULL: # <<<<<<<<<<<<<<
+ * # this will happen if the context has been terminated
+ * return
+ */
+ __pyx_t_1 = ((__pyx_v_push == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/message.pyx":95
+ * if push == NULL:
+ * # this will happen if the context has been terminated
+ * return # <<<<<<<<<<<<<<
+ * rc = zmq_connect(push, "inproc://pyzmq.gc.01")
+ * if rc < 0:
+ */
+ goto __pyx_L0;
+ }
+
+ /* "zmq/backend/cython/message.pyx":96
+ * # this will happen if the context has been terminated
+ * return
+ * rc = zmq_connect(push, "inproc://pyzmq.gc.01") # <<<<<<<<<<<<<<
+ * if rc < 0:
+ * fprintf(cstderr, "pyzmq-gc connect failed: %s\n", zmq_strerror(zmq_errno()))
+ */
+ __pyx_v_rc = zmq_connect(__pyx_v_push, __pyx_k_inproc_pyzmq_gc_01);
+
+ /* "zmq/backend/cython/message.pyx":97
+ * return
+ * rc = zmq_connect(push, "inproc://pyzmq.gc.01")
+ * if rc < 0: # <<<<<<<<<<<<<<
+ * fprintf(cstderr, "pyzmq-gc connect failed: %s\n", zmq_strerror(zmq_errno()))
+ * return
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/message.pyx":98
+ * rc = zmq_connect(push, "inproc://pyzmq.gc.01")
+ * if rc < 0:
+ * fprintf(cstderr, "pyzmq-gc connect failed: %s\n", zmq_strerror(zmq_errno())) # <<<<<<<<<<<<<<
+ * return
+ *
+ */
+ fprintf(stderr, __pyx_k_pyzmq_gc_connect_failed_s, zmq_strerror(zmq_errno()));
+
+ /* "zmq/backend/cython/message.pyx":99
+ * if rc < 0:
+ * fprintf(cstderr, "pyzmq-gc connect failed: %s\n", zmq_strerror(zmq_errno()))
+ * return # <<<<<<<<<<<<<<
+ *
+ * rc = zmq_msg_send(&msg, push, 0)
+ */
+ goto __pyx_L0;
+ }
+
+ /* "zmq/backend/cython/message.pyx":101
+ * return
+ *
+ * rc = zmq_msg_send(&msg, push, 0) # <<<<<<<<<<<<<<
+ * if rc < 0:
+ * fprintf(cstderr, "pyzmq-gc send failed: %s\n", zmq_strerror(zmq_errno()))
+ */
+ __pyx_v_rc = zmq_msg_send((&__pyx_v_msg), __pyx_v_push, 0);
+
+ /* "zmq/backend/cython/message.pyx":102
+ *
+ * rc = zmq_msg_send(&msg, push, 0)
+ * if rc < 0: # <<<<<<<<<<<<<<
+ * fprintf(cstderr, "pyzmq-gc send failed: %s\n", zmq_strerror(zmq_errno()))
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/message.pyx":103
+ * rc = zmq_msg_send(&msg, push, 0)
+ * if rc < 0:
+ * fprintf(cstderr, "pyzmq-gc send failed: %s\n", zmq_strerror(zmq_errno())) # <<<<<<<<<<<<<<
+ *
+ * zmq_msg_close(&msg)
+ */
+ fprintf(stderr, __pyx_k_pyzmq_gc_send_failed_s, zmq_strerror(zmq_errno()));
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+
+ /* "zmq/backend/cython/message.pyx":105
+ * fprintf(cstderr, "pyzmq-gc send failed: %s\n", zmq_strerror(zmq_errno()))
+ *
+ * zmq_msg_close(&msg) # <<<<<<<<<<<<<<
+ * zmq_close(push)
+ * free(hint)
+ */
+ zmq_msg_close((&__pyx_v_msg));
+
+ /* "zmq/backend/cython/message.pyx":106
+ *
+ * zmq_msg_close(&msg)
+ * zmq_close(push) # <<<<<<<<<<<<<<
+ * free(hint)
+ *
+ */
+ zmq_close(__pyx_v_push);
+
+ /* "zmq/backend/cython/message.pyx":107
+ * zmq_msg_close(&msg)
+ * zmq_close(push)
+ * free(hint) # <<<<<<<<<<<<<<
+ *
+ * gc = None
+ */
+ free(__pyx_v_hint);
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/message.pyx":65
+ * size_t id
+ *
+ * cdef void free_python_msg(void *data, void *vhint) nogil: # <<<<<<<<<<<<<<
+ * """A pure-C function for DECREF'ing Python-owned message data.
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+}
+
+/* "zmq/backend/cython/message.pyx":138
+ * """
+ *
+ * def __cinit__(self, object data=None, track=False, **kwargs): # <<<<<<<<<<<<<<
+ * cdef int rc
+ * cdef char *data_c = NULL
+ */
+
+/* Python wrapper */
+static int __pyx_pw_3zmq_7backend_6cython_7message_5Frame_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_3zmq_7backend_6cython_7message_5Frame_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_data = 0;
+ PyObject *__pyx_v_track = 0;
+ CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+ __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
+ __Pyx_GOTREF(__pyx_v_kwargs);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_track,0};
+ PyObject* values[2] = {0,0};
+ values[0] = ((PyObject *)Py_None);
+ values[1] = ((PyObject *)Py_False);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data);
+ if (value) { values[0] = value; kw_args--; }
+ }
+ case 1:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_track);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_data = values[0];
+ __pyx_v_track = values[1];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
+ __Pyx_AddTraceback("zmq.backend.cython.message.Frame.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7message_5Frame___cinit__(((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_v_self), __pyx_v_data, __pyx_v_track, __pyx_v_kwargs);
+
+ /* function exit code */
+ __Pyx_XDECREF(__pyx_v_kwargs);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_3zmq_7backend_6cython_7message_5Frame___cinit__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_track, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
+ int __pyx_v_rc;
+ char *__pyx_v_data_c;
+ Py_ssize_t __pyx_v_data_len_c;
+ __pyx_t_3zmq_7backend_6cython_7message_zhint *__pyx_v_hint;
+ PyObject *__pyx_v_evt = NULL;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_t_6;
+ int __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ size_t __pyx_t_9;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__cinit__", 0);
+
+ /* "zmq/backend/cython/message.pyx":140
+ * def __cinit__(self, object data=None, track=False, **kwargs):
+ * cdef int rc
+ * cdef char *data_c = NULL # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t data_len_c=0
+ * cdef zhint *hint
+ */
+ __pyx_v_data_c = NULL;
+
+ /* "zmq/backend/cython/message.pyx":141
+ * cdef int rc
+ * cdef char *data_c = NULL
+ * cdef Py_ssize_t data_len_c=0 # <<<<<<<<<<<<<<
+ * cdef zhint *hint
+ *
+ */
+ __pyx_v_data_len_c = 0;
+
+ /* "zmq/backend/cython/message.pyx":145
+ *
+ * # init more as False
+ * self.more = False # <<<<<<<<<<<<<<
+ *
+ * # Save the data object in case the user wants the the data as a str.
+ */
+ __pyx_v_self->more = 0;
+
+ /* "zmq/backend/cython/message.pyx":148
+ *
+ * # Save the data object in case the user wants the the data as a str.
+ * self._data = data # <<<<<<<<<<<<<<
+ * self._failed_init = True # bool switch for dealloc
+ * self._buffer = None # buffer view of data
+ */
+ __Pyx_INCREF(__pyx_v_data);
+ __Pyx_GIVEREF(__pyx_v_data);
+ __Pyx_GOTREF(__pyx_v_self->_data);
+ __Pyx_DECREF(__pyx_v_self->_data);
+ __pyx_v_self->_data = __pyx_v_data;
+
+ /* "zmq/backend/cython/message.pyx":149
+ * # Save the data object in case the user wants the the data as a str.
+ * self._data = data
+ * self._failed_init = True # bool switch for dealloc # <<<<<<<<<<<<<<
+ * self._buffer = None # buffer view of data
+ * self._bytes = None # bytes copy of data
+ */
+ __pyx_v_self->_failed_init = 1;
+
+ /* "zmq/backend/cython/message.pyx":150
+ * self._data = data
+ * self._failed_init = True # bool switch for dealloc
+ * self._buffer = None # buffer view of data # <<<<<<<<<<<<<<
+ * self._bytes = None # bytes copy of data
+ *
+ */
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_GOTREF(__pyx_v_self->_buffer);
+ __Pyx_DECREF(__pyx_v_self->_buffer);
+ __pyx_v_self->_buffer = Py_None;
+
+ /* "zmq/backend/cython/message.pyx":151
+ * self._failed_init = True # bool switch for dealloc
+ * self._buffer = None # buffer view of data
+ * self._bytes = None # bytes copy of data # <<<<<<<<<<<<<<
+ *
+ * # Event and MessageTracker for monitoring when zmq is done with data:
+ */
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_GOTREF(__pyx_v_self->_bytes);
+ __Pyx_DECREF(__pyx_v_self->_bytes);
+ __pyx_v_self->_bytes = Py_None;
+
+ /* "zmq/backend/cython/message.pyx":154
+ *
+ * # Event and MessageTracker for monitoring when zmq is done with data:
+ * if track: # <<<<<<<<<<<<<<
+ * evt = Event()
+ * self.tracker_event = evt
+ */
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_track); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/message.pyx":155
+ * # Event and MessageTracker for monitoring when zmq is done with data:
+ * if track:
+ * evt = Event() # <<<<<<<<<<<<<<
+ * self.tracker_event = evt
+ * self.tracker = zmq.MessageTracker(evt)
+ */
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Event); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ if (__pyx_t_4) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else {
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_evt = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/message.pyx":156
+ * if track:
+ * evt = Event()
+ * self.tracker_event = evt # <<<<<<<<<<<<<<
+ * self.tracker = zmq.MessageTracker(evt)
+ * else:
+ */
+ __Pyx_INCREF(__pyx_v_evt);
+ __Pyx_GIVEREF(__pyx_v_evt);
+ __Pyx_GOTREF(__pyx_v_self->tracker_event);
+ __Pyx_DECREF(__pyx_v_self->tracker_event);
+ __pyx_v_self->tracker_event = __pyx_v_evt;
+
+ /* "zmq/backend/cython/message.pyx":157
+ * evt = Event()
+ * self.tracker_event = evt
+ * self.tracker = zmq.MessageTracker(evt) # <<<<<<<<<<<<<<
+ * else:
+ * self.tracker_event = None
+ */
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_zmq); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_MessageTracker); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_3)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ }
+ }
+ if (!__pyx_t_3) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_evt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ } else {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+ __Pyx_INCREF(__pyx_v_evt);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_evt);
+ __Pyx_GIVEREF(__pyx_v_evt);
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GIVEREF(__pyx_t_2);
+ __Pyx_GOTREF(__pyx_v_self->tracker);
+ __Pyx_DECREF(__pyx_v_self->tracker);
+ __pyx_v_self->tracker = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "zmq/backend/cython/message.pyx":159
+ * self.tracker = zmq.MessageTracker(evt)
+ * else:
+ * self.tracker_event = None # <<<<<<<<<<<<<<
+ * self.tracker = None
+ *
+ */
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_GOTREF(__pyx_v_self->tracker_event);
+ __Pyx_DECREF(__pyx_v_self->tracker_event);
+ __pyx_v_self->tracker_event = Py_None;
+
+ /* "zmq/backend/cython/message.pyx":160
+ * else:
+ * self.tracker_event = None
+ * self.tracker = None # <<<<<<<<<<<<<<
+ *
+ * if isinstance(data, unicode):
+ */
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_GOTREF(__pyx_v_self->tracker);
+ __Pyx_DECREF(__pyx_v_self->tracker);
+ __pyx_v_self->tracker = Py_None;
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/message.pyx":162
+ * self.tracker = None
+ *
+ * if isinstance(data, unicode): # <<<<<<<<<<<<<<
+ * raise TypeError("Unicode objects not allowed. Only: str/bytes, buffer interfaces.")
+ *
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyObject_IsInstance(__pyx_v_data, __pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_6 = (__pyx_t_1 != 0);
+ if (__pyx_t_6) {
+
+ /* "zmq/backend/cython/message.pyx":163
+ *
+ * if isinstance(data, unicode):
+ * raise TypeError("Unicode objects not allowed. Only: str/bytes, buffer interfaces.") # <<<<<<<<<<<<<<
+ *
+ * if data is None:
+ */
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/message.pyx":165
+ * raise TypeError("Unicode objects not allowed. Only: str/bytes, buffer interfaces.")
+ *
+ * if data is None: # <<<<<<<<<<<<<<
+ * rc = zmq_msg_init(&self.zmq_msg)
+ * _check_rc(rc)
+ */
+ __pyx_t_6 = (__pyx_v_data == Py_None);
+ __pyx_t_1 = (__pyx_t_6 != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/message.pyx":166
+ *
+ * if data is None:
+ * rc = zmq_msg_init(&self.zmq_msg) # <<<<<<<<<<<<<<
+ * _check_rc(rc)
+ * self._failed_init = False
+ */
+ __pyx_v_rc = zmq_msg_init((&__pyx_v_self->zmq_msg));
+
+ /* "zmq/backend/cython/message.pyx":167
+ * if data is None:
+ * rc = zmq_msg_init(&self.zmq_msg)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ * self._failed_init = False
+ * return
+ */
+ __pyx_t_7 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/message.pyx":168
+ * rc = zmq_msg_init(&self.zmq_msg)
+ * _check_rc(rc)
+ * self._failed_init = False # <<<<<<<<<<<<<<
+ * return
+ * else:
+ */
+ __pyx_v_self->_failed_init = 0;
+
+ /* "zmq/backend/cython/message.pyx":169
+ * _check_rc(rc)
+ * self._failed_init = False
+ * return # <<<<<<<<<<<<<<
+ * else:
+ * asbuffer_r(data, <void **>&data_c, &data_len_c)
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "zmq/backend/cython/message.pyx":171
+ * return
+ * else:
+ * asbuffer_r(data, <void **>&data_c, &data_len_c) # <<<<<<<<<<<<<<
+ *
+ * # create the hint for zmq_free_fn
+ */
+ __pyx_t_2 = __pyx_f_7buffers_asbuffer_r(__pyx_v_data, ((void **)(&__pyx_v_data_c)), (&__pyx_v_data_len_c)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ }
+
+ /* "zmq/backend/cython/message.pyx":177
+ * # allows libzmq to signal to Python when it is done with Python-owned memory.
+ * global gc
+ * if gc is None: # <<<<<<<<<<<<<<
+ * from zmq.utils.garbage import gc
+ *
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = (__pyx_t_2 == Py_None);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_6 = (__pyx_t_1 != 0);
+ if (__pyx_t_6) {
+
+ /* "zmq/backend/cython/message.pyx":178
+ * global gc
+ * if gc is None:
+ * from zmq.utils.garbage import gc # <<<<<<<<<<<<<<
+ *
+ * hint = <zhint *> malloc(sizeof(zhint))
+ */
+ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_n_s_gc);
+ PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_gc);
+ __Pyx_GIVEREF(__pyx_n_s_gc);
+ __pyx_t_4 = __Pyx_Import(__pyx_n_s_zmq_utils_garbage, __pyx_t_2, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_gc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_gc, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+
+ /* "zmq/backend/cython/message.pyx":180
+ * from zmq.utils.garbage import gc
+ *
+ * hint = <zhint *> malloc(sizeof(zhint)) # <<<<<<<<<<<<<<
+ * hint.id = gc.store(data, self.tracker_event)
+ * hint.ctx = <void *> <size_t> gc._context.underlying
+ */
+ __pyx_v_hint = ((__pyx_t_3zmq_7backend_6cython_7message_zhint *)malloc((sizeof(__pyx_t_3zmq_7backend_6cython_7message_zhint))));
+
+ /* "zmq/backend/cython/message.pyx":181
+ *
+ * hint = <zhint *> malloc(sizeof(zhint))
+ * hint.id = gc.store(data, self.tracker_event) # <<<<<<<<<<<<<<
+ * hint.ctx = <void *> <size_t> gc._context.underlying
+ *
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_store); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = NULL;
+ __pyx_t_8 = 0;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_2)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_2);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ __pyx_t_8 = 1;
+ }
+ }
+ __pyx_t_3 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ if (__pyx_t_2) {
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_data);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_8, __pyx_v_data);
+ __Pyx_GIVEREF(__pyx_v_data);
+ __Pyx_INCREF(__pyx_v_self->tracker_event);
+ PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_8, __pyx_v_self->tracker_event);
+ __Pyx_GIVEREF(__pyx_v_self->tracker_event);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_v_hint->id = __pyx_t_9;
+
+ /* "zmq/backend/cython/message.pyx":182
+ * hint = <zhint *> malloc(sizeof(zhint))
+ * hint.id = gc.store(data, self.tracker_event)
+ * hint.ctx = <void *> <size_t> gc._context.underlying # <<<<<<<<<<<<<<
+ *
+ * rc = zmq_msg_init_data(
+ */
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_context); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_underlying); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_v_hint->ctx = ((void *)((size_t)__pyx_t_9));
+
+ /* "zmq/backend/cython/message.pyx":184
+ * hint.ctx = <void *> <size_t> gc._context.underlying
+ *
+ * rc = zmq_msg_init_data( # <<<<<<<<<<<<<<
+ * &self.zmq_msg, <void *>data_c, data_len_c,
+ * <zmq_free_fn *>free_python_msg, <void *>hint
+ */
+ __pyx_v_rc = zmq_msg_init_data((&__pyx_v_self->zmq_msg), ((void *)__pyx_v_data_c), __pyx_v_data_len_c, ((zmq_free_fn *)__pyx_f_3zmq_7backend_6cython_7message_free_python_msg), ((void *)__pyx_v_hint));
+
+ /* "zmq/backend/cython/message.pyx":188
+ * <zmq_free_fn *>free_python_msg, <void *>hint
+ * )
+ * if rc != 0: # <<<<<<<<<<<<<<
+ * free(hint)
+ * _check_rc(rc)
+ */
+ __pyx_t_6 = ((__pyx_v_rc != 0) != 0);
+ if (__pyx_t_6) {
+
+ /* "zmq/backend/cython/message.pyx":189
+ * )
+ * if rc != 0:
+ * free(hint) # <<<<<<<<<<<<<<
+ * _check_rc(rc)
+ * self._failed_init = False
+ */
+ free(__pyx_v_hint);
+
+ /* "zmq/backend/cython/message.pyx":190
+ * if rc != 0:
+ * free(hint)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ * self._failed_init = False
+ *
+ */
+ __pyx_t_7 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L7;
+ }
+ __pyx_L7:;
+
+ /* "zmq/backend/cython/message.pyx":191
+ * free(hint)
+ * _check_rc(rc)
+ * self._failed_init = False # <<<<<<<<<<<<<<
+ *
+ * def __init__(self, object data=None, track=False):
+ */
+ __pyx_v_self->_failed_init = 0;
+
+ /* "zmq/backend/cython/message.pyx":138
+ * """
+ *
+ * def __cinit__(self, object data=None, track=False, **kwargs): # <<<<<<<<<<<<<<
+ * cdef int rc
+ * cdef char *data_c = NULL
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("zmq.backend.cython.message.Frame.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_evt);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/message.pyx":193
+ * self._failed_init = False
+ *
+ * def __init__(self, object data=None, track=False): # <<<<<<<<<<<<<<
+ * """Enforce signature"""
+ * pass
+ */
+
+/* Python wrapper */
+static int __pyx_pw_3zmq_7backend_6cython_7message_5Frame_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_7message_5Frame_2__init__[] = "Enforce signature";
+#if CYTHON_COMPILING_IN_CPYTHON
+struct wrapperbase __pyx_wrapperbase_3zmq_7backend_6cython_7message_5Frame_2__init__;
+#endif
+static int __pyx_pw_3zmq_7backend_6cython_7message_5Frame_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ CYTHON_UNUSED PyObject *__pyx_v_data = 0;
+ CYTHON_UNUSED PyObject *__pyx_v_track = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_track,0};
+ PyObject* values[2] = {0,0};
+ values[0] = ((PyObject *)Py_None);
+ values[1] = ((PyObject *)Py_False);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data);
+ if (value) { values[0] = value; kw_args--; }
+ }
+ case 1:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_track);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_data = values[0];
+ __pyx_v_track = values[1];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("zmq.backend.cython.message.Frame.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7message_5Frame_2__init__(((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_v_self), __pyx_v_data, __pyx_v_track);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_3zmq_7backend_6cython_7message_5Frame_2__init__(CYTHON_UNUSED struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_track) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__init__", 0);
+
+ /* function exit code */
+ __pyx_r = 0;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/message.pyx":197
+ * pass
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * cdef int rc
+ * if self._failed_init:
+ */
+
+/* Python wrapper */
+static void __pyx_pw_3zmq_7backend_6cython_7message_5Frame_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_pw_3zmq_7backend_6cython_7message_5Frame_5__dealloc__(PyObject *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+ __pyx_pf_3zmq_7backend_6cython_7message_5Frame_4__dealloc__(((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_pf_3zmq_7backend_6cython_7message_5Frame_4__dealloc__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self) {
+ int __pyx_v_rc;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+ /* "zmq/backend/cython/message.pyx":199
+ * def __dealloc__(self):
+ * cdef int rc
+ * if self._failed_init: # <<<<<<<<<<<<<<
+ * return
+ * # This simply decreases the 0MQ ref-count of zmq_msg.
+ */
+ __pyx_t_1 = (__pyx_v_self->_failed_init != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/message.pyx":200
+ * cdef int rc
+ * if self._failed_init:
+ * return # <<<<<<<<<<<<<<
+ * # This simply decreases the 0MQ ref-count of zmq_msg.
+ * with nogil:
+ */
+ goto __pyx_L0;
+ }
+
+ /* "zmq/backend/cython/message.pyx":202
+ * return
+ * # This simply decreases the 0MQ ref-count of zmq_msg.
+ * with nogil: # <<<<<<<<<<<<<<
+ * rc = zmq_msg_close(&self.zmq_msg)
+ * _check_rc(rc)
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ #endif
+ /*try:*/ {
+
+ /* "zmq/backend/cython/message.pyx":203
+ * # This simply decreases the 0MQ ref-count of zmq_msg.
+ * with nogil:
+ * rc = zmq_msg_close(&self.zmq_msg) # <<<<<<<<<<<<<<
+ * _check_rc(rc)
+ *
+ */
+ __pyx_v_rc = zmq_msg_close((&__pyx_v_self->zmq_msg));
+ }
+
+ /* "zmq/backend/cython/message.pyx":202
+ * return
+ * # This simply decreases the 0MQ ref-count of zmq_msg.
+ * with nogil: # <<<<<<<<<<<<<<
+ * rc = zmq_msg_close(&self.zmq_msg)
+ * _check_rc(rc)
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+ }
+ }
+
+ /* "zmq/backend/cython/message.pyx":204
+ * with nogil:
+ * rc = zmq_msg_close(&self.zmq_msg)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ *
+ * # buffer interface code adapted from petsc4py by Lisandro Dalcin, a BSD project
+ */
+ __pyx_t_2 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/message.pyx":197
+ * pass
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * cdef int rc
+ * if self._failed_init:
+ */
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_WriteUnraisable("zmq.backend.cython.message.Frame.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "zmq/backend/cython/message.pyx":208
+ * # buffer interface code adapted from petsc4py by Lisandro Dalcin, a BSD project
+ *
+ * def __getbuffer__(self, Py_buffer* buffer, int flags): # <<<<<<<<<<<<<<
+ * # new-style (memoryview) buffer interface
+ * buffer.buf = zmq_msg_data(&self.zmq_msg)
+ */
+
+/* Python wrapper */
+static CYTHON_UNUSED int __pyx_pw_3zmq_7backend_6cython_7message_5Frame_7__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags); /*proto*/
+static CYTHON_UNUSED int __pyx_pw_3zmq_7backend_6cython_7message_5Frame_7__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7message_5Frame_6__getbuffer__(((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_v_self), ((Py_buffer *)__pyx_v_buffer), ((int)__pyx_v_flags));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_3zmq_7backend_6cython_7message_5Frame_6__getbuffer__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self, Py_buffer *__pyx_v_buffer, CYTHON_UNUSED int __pyx_v_flags) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getbuffer__", 0);
+ if (__pyx_v_buffer != NULL) {
+ __pyx_v_buffer->obj = Py_None; __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(__pyx_v_buffer->obj);
+ }
+
+ /* "zmq/backend/cython/message.pyx":210
+ * def __getbuffer__(self, Py_buffer* buffer, int flags):
+ * # new-style (memoryview) buffer interface
+ * buffer.buf = zmq_msg_data(&self.zmq_msg) # <<<<<<<<<<<<<<
+ * buffer.len = zmq_msg_size(&self.zmq_msg)
+ *
+ */
+ __pyx_v_buffer->buf = zmq_msg_data((&__pyx_v_self->zmq_msg));
+
+ /* "zmq/backend/cython/message.pyx":211
+ * # new-style (memoryview) buffer interface
+ * buffer.buf = zmq_msg_data(&self.zmq_msg)
+ * buffer.len = zmq_msg_size(&self.zmq_msg) # <<<<<<<<<<<<<<
+ *
+ * buffer.obj = self
+ */
+ __pyx_v_buffer->len = zmq_msg_size((&__pyx_v_self->zmq_msg));
+
+ /* "zmq/backend/cython/message.pyx":213
+ * buffer.len = zmq_msg_size(&self.zmq_msg)
+ *
+ * buffer.obj = self # <<<<<<<<<<<<<<
+ * buffer.readonly = 1
+ * buffer.format = "B"
+ */
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ __Pyx_GOTREF(__pyx_v_buffer->obj);
+ __Pyx_DECREF(__pyx_v_buffer->obj);
+ __pyx_v_buffer->obj = ((PyObject *)__pyx_v_self);
+
+ /* "zmq/backend/cython/message.pyx":214
+ *
+ * buffer.obj = self
+ * buffer.readonly = 1 # <<<<<<<<<<<<<<
+ * buffer.format = "B"
+ * buffer.ndim = 0
+ */
+ __pyx_v_buffer->readonly = 1;
+
+ /* "zmq/backend/cython/message.pyx":215
+ * buffer.obj = self
+ * buffer.readonly = 1
+ * buffer.format = "B" # <<<<<<<<<<<<<<
+ * buffer.ndim = 0
+ * buffer.shape = NULL
+ */
+ __pyx_v_buffer->format = __pyx_k_B;
+
+ /* "zmq/backend/cython/message.pyx":216
+ * buffer.readonly = 1
+ * buffer.format = "B"
+ * buffer.ndim = 0 # <<<<<<<<<<<<<<
+ * buffer.shape = NULL
+ * buffer.strides = NULL
+ */
+ __pyx_v_buffer->ndim = 0;
+
+ /* "zmq/backend/cython/message.pyx":217
+ * buffer.format = "B"
+ * buffer.ndim = 0
+ * buffer.shape = NULL # <<<<<<<<<<<<<<
+ * buffer.strides = NULL
+ * buffer.suboffsets = NULL
+ */
+ __pyx_v_buffer->shape = NULL;
+
+ /* "zmq/backend/cython/message.pyx":218
+ * buffer.ndim = 0
+ * buffer.shape = NULL
+ * buffer.strides = NULL # <<<<<<<<<<<<<<
+ * buffer.suboffsets = NULL
+ * buffer.itemsize = 1
+ */
+ __pyx_v_buffer->strides = NULL;
+
+ /* "zmq/backend/cython/message.pyx":219
+ * buffer.shape = NULL
+ * buffer.strides = NULL
+ * buffer.suboffsets = NULL # <<<<<<<<<<<<<<
+ * buffer.itemsize = 1
+ * buffer.internal = NULL
+ */
+ __pyx_v_buffer->suboffsets = NULL;
+
+ /* "zmq/backend/cython/message.pyx":220
+ * buffer.strides = NULL
+ * buffer.suboffsets = NULL
+ * buffer.itemsize = 1 # <<<<<<<<<<<<<<
+ * buffer.internal = NULL
+ *
+ */
+ __pyx_v_buffer->itemsize = 1;
+
+ /* "zmq/backend/cython/message.pyx":221
+ * buffer.suboffsets = NULL
+ * buffer.itemsize = 1
+ * buffer.internal = NULL # <<<<<<<<<<<<<<
+ *
+ * def __getsegcount__(self, Py_ssize_t *lenp):
+ */
+ __pyx_v_buffer->internal = NULL;
+
+ /* "zmq/backend/cython/message.pyx":208
+ * # buffer interface code adapted from petsc4py by Lisandro Dalcin, a BSD project
+ *
+ * def __getbuffer__(self, Py_buffer* buffer, int flags): # <<<<<<<<<<<<<<
+ * # new-style (memoryview) buffer interface
+ * buffer.buf = zmq_msg_data(&self.zmq_msg)
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ if (__pyx_v_buffer != NULL && __pyx_v_buffer->obj == Py_None) {
+ __Pyx_GOTREF(Py_None);
+ __Pyx_DECREF(Py_None); __pyx_v_buffer->obj = NULL;
+ }
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/message.pyx":223
+ * buffer.internal = NULL
+ *
+ * def __getsegcount__(self, Py_ssize_t *lenp): # <<<<<<<<<<<<<<
+ * # required for getreadbuffer
+ * if lenp != NULL:
+ */
+
+/* Python wrapper */
+#if PY_MAJOR_VERSION < 3
+static Py_ssize_t __pyx_pw_3zmq_7backend_6cython_7message_5Frame_9__getsegcount__(PyObject *__pyx_v_self, Py_ssize_t *__pyx_v_lenp); /*proto*/
+static Py_ssize_t __pyx_pw_3zmq_7backend_6cython_7message_5Frame_9__getsegcount__(PyObject *__pyx_v_self, Py_ssize_t *__pyx_v_lenp) {
+ Py_ssize_t __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getsegcount__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7message_5Frame_8__getsegcount__(((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_v_self), ((Py_ssize_t *)__pyx_v_lenp));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+#endif /*!(#if PY_MAJOR_VERSION < 3)*/
+
+#if PY_MAJOR_VERSION < 3
+static Py_ssize_t __pyx_pf_3zmq_7backend_6cython_7message_5Frame_8__getsegcount__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self, Py_ssize_t *__pyx_v_lenp) {
+ Py_ssize_t __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("__getsegcount__", 0);
+
+ /* "zmq/backend/cython/message.pyx":225
+ * def __getsegcount__(self, Py_ssize_t *lenp):
+ * # required for getreadbuffer
+ * if lenp != NULL: # <<<<<<<<<<<<<<
+ * lenp[0] = zmq_msg_size(&self.zmq_msg)
+ * return 1
+ */
+ __pyx_t_1 = ((__pyx_v_lenp != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/message.pyx":226
+ * # required for getreadbuffer
+ * if lenp != NULL:
+ * lenp[0] = zmq_msg_size(&self.zmq_msg) # <<<<<<<<<<<<<<
+ * return 1
+ *
+ */
+ (__pyx_v_lenp[0]) = zmq_msg_size((&__pyx_v_self->zmq_msg));
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/message.pyx":227
+ * if lenp != NULL:
+ * lenp[0] = zmq_msg_size(&self.zmq_msg)
+ * return 1 # <<<<<<<<<<<<<<
+ *
+ * def __getreadbuffer__(self, Py_ssize_t idx, void **p):
+ */
+ __pyx_r = 1;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/message.pyx":223
+ * buffer.internal = NULL
+ *
+ * def __getsegcount__(self, Py_ssize_t *lenp): # <<<<<<<<<<<<<<
+ * # required for getreadbuffer
+ * if lenp != NULL:
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+#endif /*!(#if PY_MAJOR_VERSION < 3)*/
+
+/* "zmq/backend/cython/message.pyx":229
+ * return 1
+ *
+ * def __getreadbuffer__(self, Py_ssize_t idx, void **p): # <<<<<<<<<<<<<<
+ * # old-style (buffer) interface
+ * cdef char *data_c = NULL
+ */
+
+/* Python wrapper */
+#if PY_MAJOR_VERSION < 3
+static Py_ssize_t __pyx_pw_3zmq_7backend_6cython_7message_5Frame_11__getreadbuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /*proto*/
+static Py_ssize_t __pyx_pw_3zmq_7backend_6cython_7message_5Frame_11__getreadbuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) {
+ Py_ssize_t __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getreadbuffer__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7message_5Frame_10__getreadbuffer__(((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_v_self), ((Py_ssize_t)__pyx_v_idx), ((void **)__pyx_v_p));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+#endif /*!(#if PY_MAJOR_VERSION < 3)*/
+
+#if PY_MAJOR_VERSION < 3
+static Py_ssize_t __pyx_pf_3zmq_7backend_6cython_7message_5Frame_10__getreadbuffer__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) {
+ char *__pyx_v_data_c;
+ Py_ssize_t __pyx_v_data_len_c;
+ Py_ssize_t __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__getreadbuffer__", 0);
+
+ /* "zmq/backend/cython/message.pyx":231
+ * def __getreadbuffer__(self, Py_ssize_t idx, void **p):
+ * # old-style (buffer) interface
+ * cdef char *data_c = NULL # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t data_len_c
+ * if idx != 0:
+ */
+ __pyx_v_data_c = NULL;
+
+ /* "zmq/backend/cython/message.pyx":233
+ * cdef char *data_c = NULL
+ * cdef Py_ssize_t data_len_c
+ * if idx != 0: # <<<<<<<<<<<<<<
+ * raise SystemError("accessing non-existent buffer segment")
+ * # read-only, because we don't want to allow
+ */
+ __pyx_t_1 = ((__pyx_v_idx != 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/message.pyx":234
+ * cdef Py_ssize_t data_len_c
+ * if idx != 0:
+ * raise SystemError("accessing non-existent buffer segment") # <<<<<<<<<<<<<<
+ * # read-only, because we don't want to allow
+ * # editing of the message in-place
+ */
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_SystemError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/message.pyx":237
+ * # read-only, because we don't want to allow
+ * # editing of the message in-place
+ * data_c = <char *>zmq_msg_data(&self.zmq_msg) # <<<<<<<<<<<<<<
+ * data_len_c = zmq_msg_size(&self.zmq_msg)
+ * if p != NULL:
+ */
+ __pyx_v_data_c = ((char *)zmq_msg_data((&__pyx_v_self->zmq_msg)));
+
+ /* "zmq/backend/cython/message.pyx":238
+ * # editing of the message in-place
+ * data_c = <char *>zmq_msg_data(&self.zmq_msg)
+ * data_len_c = zmq_msg_size(&self.zmq_msg) # <<<<<<<<<<<<<<
+ * if p != NULL:
+ * p[0] = <void*>data_c
+ */
+ __pyx_v_data_len_c = zmq_msg_size((&__pyx_v_self->zmq_msg));
+
+ /* "zmq/backend/cython/message.pyx":239
+ * data_c = <char *>zmq_msg_data(&self.zmq_msg)
+ * data_len_c = zmq_msg_size(&self.zmq_msg)
+ * if p != NULL: # <<<<<<<<<<<<<<
+ * p[0] = <void*>data_c
+ * return data_len_c
+ */
+ __pyx_t_1 = ((__pyx_v_p != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/message.pyx":240
+ * data_len_c = zmq_msg_size(&self.zmq_msg)
+ * if p != NULL:
+ * p[0] = <void*>data_c # <<<<<<<<<<<<<<
+ * return data_len_c
+ *
+ */
+ (__pyx_v_p[0]) = ((void *)__pyx_v_data_c);
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "zmq/backend/cython/message.pyx":241
+ * if p != NULL:
+ * p[0] = <void*>data_c
+ * return data_len_c # <<<<<<<<<<<<<<
+ *
+ * # end buffer interface
+ */
+ __pyx_r = __pyx_v_data_len_c;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/message.pyx":229
+ * return 1
+ *
+ * def __getreadbuffer__(self, Py_ssize_t idx, void **p): # <<<<<<<<<<<<<<
+ * # old-style (buffer) interface
+ * cdef char *data_c = NULL
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("zmq.backend.cython.message.Frame.__getreadbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+#endif /*!(#if PY_MAJOR_VERSION < 3)*/
+
+/* "zmq/backend/cython/message.pyx":245
+ * # end buffer interface
+ *
+ * def __copy__(self): # <<<<<<<<<<<<<<
+ * """Create a shallow copy of the message.
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7message_5Frame_13__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_7message_5Frame_12__copy__[] = "Create a shallow copy of the message.\n\n This does not copy the contents of the Frame, just the pointer.\n This will increment the 0MQ ref count of the message, but not\n the ref count of the Python object. That is only done once when\n the Python is first turned into a 0MQ message.\n ";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7message_5Frame_13__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__copy__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7message_5Frame_12__copy__(((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7message_5Frame_12__copy__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__copy__", 0);
+
+ /* "zmq/backend/cython/message.pyx":253
+ * the Python is first turned into a 0MQ message.
+ * """
+ * return self.fast_copy() # <<<<<<<<<<<<<<
+ *
+ * cdef Frame fast_copy(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_3zmq_7backend_6cython_7message_Frame *)__pyx_v_self->__pyx_vtab)->fast_copy(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/message.pyx":245
+ * # end buffer interface
+ *
+ * def __copy__(self): # <<<<<<<<<<<<<<
+ * """Create a shallow copy of the message.
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("zmq.backend.cython.message.Frame.__copy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/message.pyx":255
+ * return self.fast_copy()
+ *
+ * cdef Frame fast_copy(self): # <<<<<<<<<<<<<<
+ * """Fast, cdef'd version of shallow copy of the Frame."""
+ * cdef Frame new_msg
+ */
+
+static struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_f_3zmq_7backend_6cython_7message_5Frame_fast_copy(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self) {
+ struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_new_msg = 0;
+ struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("fast_copy", 0);
+
+ /* "zmq/backend/cython/message.pyx":258
+ * """Fast, cdef'd version of shallow copy of the Frame."""
+ * cdef Frame new_msg
+ * new_msg = Frame() # <<<<<<<<<<<<<<
+ * # This does not copy the contents, but just increases the ref-count
+ * # of the zmq_msg by one.
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3zmq_7backend_6cython_7message_Frame)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_new_msg = ((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/message.pyx":261
+ * # This does not copy the contents, but just increases the ref-count
+ * # of the zmq_msg by one.
+ * zmq_msg_copy(&new_msg.zmq_msg, &self.zmq_msg) # <<<<<<<<<<<<<<
+ * # Copy the ref to data so the copy won't create a copy when str is
+ * # called.
+ */
+ zmq_msg_copy((&__pyx_v_new_msg->zmq_msg), (&__pyx_v_self->zmq_msg));
+
+ /* "zmq/backend/cython/message.pyx":264
+ * # Copy the ref to data so the copy won't create a copy when str is
+ * # called.
+ * if self._data is not None: # <<<<<<<<<<<<<<
+ * new_msg._data = self._data
+ * if self._buffer is not None:
+ */
+ __pyx_t_2 = (__pyx_v_self->_data != Py_None);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+
+ /* "zmq/backend/cython/message.pyx":265
+ * # called.
+ * if self._data is not None:
+ * new_msg._data = self._data # <<<<<<<<<<<<<<
+ * if self._buffer is not None:
+ * new_msg._buffer = self._buffer
+ */
+ __pyx_t_1 = __pyx_v_self->_data;
+ __Pyx_INCREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v_new_msg->_data);
+ __Pyx_DECREF(__pyx_v_new_msg->_data);
+ __pyx_v_new_msg->_data = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/message.pyx":266
+ * if self._data is not None:
+ * new_msg._data = self._data
+ * if self._buffer is not None: # <<<<<<<<<<<<<<
+ * new_msg._buffer = self._buffer
+ * if self._bytes is not None:
+ */
+ __pyx_t_3 = (__pyx_v_self->_buffer != Py_None);
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/message.pyx":267
+ * new_msg._data = self._data
+ * if self._buffer is not None:
+ * new_msg._buffer = self._buffer # <<<<<<<<<<<<<<
+ * if self._bytes is not None:
+ * new_msg._bytes = self._bytes
+ */
+ __pyx_t_1 = __pyx_v_self->_buffer;
+ __Pyx_INCREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v_new_msg->_buffer);
+ __Pyx_DECREF(__pyx_v_new_msg->_buffer);
+ __pyx_v_new_msg->_buffer = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "zmq/backend/cython/message.pyx":268
+ * if self._buffer is not None:
+ * new_msg._buffer = self._buffer
+ * if self._bytes is not None: # <<<<<<<<<<<<<<
+ * new_msg._bytes = self._bytes
+ *
+ */
+ __pyx_t_2 = (__pyx_v_self->_bytes != Py_None);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+
+ /* "zmq/backend/cython/message.pyx":269
+ * new_msg._buffer = self._buffer
+ * if self._bytes is not None:
+ * new_msg._bytes = self._bytes # <<<<<<<<<<<<<<
+ *
+ * # Frame copies share the tracker and tracker_event
+ */
+ __pyx_t_1 = __pyx_v_self->_bytes;
+ __Pyx_INCREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v_new_msg->_bytes);
+ __Pyx_DECREF(__pyx_v_new_msg->_bytes);
+ __pyx_v_new_msg->_bytes = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+
+ /* "zmq/backend/cython/message.pyx":272
+ *
+ * # Frame copies share the tracker and tracker_event
+ * new_msg.tracker_event = self.tracker_event # <<<<<<<<<<<<<<
+ * new_msg.tracker = self.tracker
+ *
+ */
+ __pyx_t_1 = __pyx_v_self->tracker_event;
+ __Pyx_INCREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v_new_msg->tracker_event);
+ __Pyx_DECREF(__pyx_v_new_msg->tracker_event);
+ __pyx_v_new_msg->tracker_event = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/message.pyx":273
+ * # Frame copies share the tracker and tracker_event
+ * new_msg.tracker_event = self.tracker_event
+ * new_msg.tracker = self.tracker # <<<<<<<<<<<<<<
+ *
+ * return new_msg
+ */
+ __pyx_t_1 = __pyx_v_self->tracker;
+ __Pyx_INCREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v_new_msg->tracker);
+ __Pyx_DECREF(__pyx_v_new_msg->tracker);
+ __pyx_v_new_msg->tracker = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/message.pyx":275
+ * new_msg.tracker = self.tracker
+ *
+ * return new_msg # <<<<<<<<<<<<<<
+ *
+ * def __len__(self):
+ */
+ __Pyx_XDECREF(((PyObject *)__pyx_r));
+ __Pyx_INCREF(((PyObject *)__pyx_v_new_msg));
+ __pyx_r = __pyx_v_new_msg;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/message.pyx":255
+ * return self.fast_copy()
+ *
+ * cdef Frame fast_copy(self): # <<<<<<<<<<<<<<
+ * """Fast, cdef'd version of shallow copy of the Frame."""
+ * cdef Frame new_msg
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("zmq.backend.cython.message.Frame.fast_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_new_msg);
+ __Pyx_XGIVEREF((PyObject *)__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/message.pyx":277
+ * return new_msg
+ *
+ * def __len__(self): # <<<<<<<<<<<<<<
+ * """Return the length of the message in bytes."""
+ * cdef size_t sz
+ */
+
+/* Python wrapper */
+static Py_ssize_t __pyx_pw_3zmq_7backend_6cython_7message_5Frame_15__len__(PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_7message_5Frame_14__len__[] = "Return the length of the message in bytes.";
+#if CYTHON_COMPILING_IN_CPYTHON
+struct wrapperbase __pyx_wrapperbase_3zmq_7backend_6cython_7message_5Frame_14__len__;
+#endif
+static Py_ssize_t __pyx_pw_3zmq_7backend_6cython_7message_5Frame_15__len__(PyObject *__pyx_v_self) {
+ Py_ssize_t __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7message_5Frame_14__len__(((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static Py_ssize_t __pyx_pf_3zmq_7backend_6cython_7message_5Frame_14__len__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self) {
+ size_t __pyx_v_sz;
+ Py_ssize_t __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__len__", 0);
+
+ /* "zmq/backend/cython/message.pyx":280
+ * """Return the length of the message in bytes."""
+ * cdef size_t sz
+ * sz = zmq_msg_size(&self.zmq_msg) # <<<<<<<<<<<<<<
+ * return sz
+ * # return <int>zmq_msg_size(&self.zmq_msg)
+ */
+ __pyx_v_sz = zmq_msg_size((&__pyx_v_self->zmq_msg));
+
+ /* "zmq/backend/cython/message.pyx":281
+ * cdef size_t sz
+ * sz = zmq_msg_size(&self.zmq_msg)
+ * return sz # <<<<<<<<<<<<<<
+ * # return <int>zmq_msg_size(&self.zmq_msg)
+ *
+ */
+ __pyx_r = __pyx_v_sz;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/message.pyx":277
+ * return new_msg
+ *
+ * def __len__(self): # <<<<<<<<<<<<<<
+ * """Return the length of the message in bytes."""
+ * cdef size_t sz
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/message.pyx":284
+ * # return <int>zmq_msg_size(&self.zmq_msg)
+ *
+ * def __str__(self): # <<<<<<<<<<<<<<
+ * """Return the str form of the message."""
+ * if isinstance(self._data, bytes):
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7message_5Frame_17__str__(PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_7message_5Frame_16__str__[] = "Return the str form of the message.";
+#if CYTHON_COMPILING_IN_CPYTHON
+struct wrapperbase __pyx_wrapperbase_3zmq_7backend_6cython_7message_5Frame_16__str__;
+#endif
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7message_5Frame_17__str__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7message_5Frame_16__str__(((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7message_5Frame_16__str__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self) {
+ PyObject *__pyx_v_b = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__str__", 0);
+
+ /* "zmq/backend/cython/message.pyx":286
+ * def __str__(self):
+ * """Return the str form of the message."""
+ * if isinstance(self._data, bytes): # <<<<<<<<<<<<<<
+ * b = self._data
+ * else:
+ */
+ __pyx_t_1 = __pyx_v_self->_data;
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyObject_IsInstance(__pyx_t_1, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = (__pyx_t_3 != 0);
+ if (__pyx_t_4) {
+
+ /* "zmq/backend/cython/message.pyx":287
+ * """Return the str form of the message."""
+ * if isinstance(self._data, bytes):
+ * b = self._data # <<<<<<<<<<<<<<
+ * else:
+ * b = self.bytes
+ */
+ __pyx_t_2 = __pyx_v_self->_data;
+ __Pyx_INCREF(__pyx_t_2);
+ __pyx_v_b = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "zmq/backend/cython/message.pyx":289
+ * b = self._data
+ * else:
+ * b = self.bytes # <<<<<<<<<<<<<<
+ * if str is unicode:
+ * return b.decode()
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_v_b = __pyx_t_2;
+ __pyx_t_2 = 0;
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/message.pyx":290
+ * else:
+ * b = self.bytes
+ * if str is unicode: # <<<<<<<<<<<<<<
+ * return b.decode()
+ * else:
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = (((PyObject*)(&PyString_Type)) == ((PyObject*)__pyx_t_2));
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_3 = (__pyx_t_4 != 0);
+ if (__pyx_t_3) {
+
+ /* "zmq/backend/cython/message.pyx":291
+ * b = self.bytes
+ * if str is unicode:
+ * return b.decode() # <<<<<<<<<<<<<<
+ * else:
+ * return b
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_1, function);
+ }
+ }
+ if (__pyx_t_5) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else {
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "zmq/backend/cython/message.pyx":293
+ * return b.decode()
+ * else:
+ * return b # <<<<<<<<<<<<<<
+ *
+ * cdef inline object _getbuffer(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_b);
+ __pyx_r = __pyx_v_b;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/backend/cython/message.pyx":284
+ * # return <int>zmq_msg_size(&self.zmq_msg)
+ *
+ * def __str__(self): # <<<<<<<<<<<<<<
+ * """Return the str form of the message."""
+ * if isinstance(self._data, bytes):
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("zmq.backend.cython.message.Frame.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_b);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/message.pyx":295
+ * return b
+ *
+ * cdef inline object _getbuffer(self): # <<<<<<<<<<<<<<
+ * """Create a Python buffer/view of the message data.
+ *
+ */
+
+static PyObject *__pyx_f_3zmq_7backend_6cython_7message_5Frame__getbuffer(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_getbuffer", 0);
+
+ /* "zmq/backend/cython/message.pyx":301
+ * is accessed. Subsequent calls use a cached copy.
+ * """
+ * if self._data is None: # <<<<<<<<<<<<<<
+ * return viewfromobject_r(self)
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_self->_data == Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/message.pyx":302
+ * """
+ * if self._data is None:
+ * return viewfromobject_r(self) # <<<<<<<<<<<<<<
+ * else:
+ * return viewfromobject_r(self._data)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = __pyx_f_7buffers_viewfromobject_r(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "zmq/backend/cython/message.pyx":304
+ * return viewfromobject_r(self)
+ * else:
+ * return viewfromobject_r(self._data) # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = __pyx_v_self->_data;
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_t_4 = __pyx_f_7buffers_viewfromobject_r(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/backend/cython/message.pyx":295
+ * return b
+ *
+ * cdef inline object _getbuffer(self): # <<<<<<<<<<<<<<
+ * """Create a Python buffer/view of the message data.
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("zmq.backend.cython.message.Frame._getbuffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/message.pyx":307
+ *
+ * @property
+ * def buffer(self): # <<<<<<<<<<<<<<
+ * """A read-only buffer view of the message contents."""
+ * if self._buffer is None:
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7message_5Frame_19buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_7message_5Frame_18buffer[] = "A read-only buffer view of the message contents.";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7message_5Frame_19buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("buffer (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7message_5Frame_18buffer(((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7message_5Frame_18buffer(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("buffer", 0);
+
+ /* "zmq/backend/cython/message.pyx":309
+ * def buffer(self):
+ * """A read-only buffer view of the message contents."""
+ * if self._buffer is None: # <<<<<<<<<<<<<<
+ * self._buffer = self._getbuffer()
+ * return self._buffer
+ */
+ __pyx_t_1 = (__pyx_v_self->_buffer == Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/message.pyx":310
+ * """A read-only buffer view of the message contents."""
+ * if self._buffer is None:
+ * self._buffer = self._getbuffer() # <<<<<<<<<<<<<<
+ * return self._buffer
+ *
+ */
+ __pyx_t_3 = __pyx_f_3zmq_7backend_6cython_7message_5Frame__getbuffer(__pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __Pyx_GOTREF(__pyx_v_self->_buffer);
+ __Pyx_DECREF(__pyx_v_self->_buffer);
+ __pyx_v_self->_buffer = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/message.pyx":311
+ * if self._buffer is None:
+ * self._buffer = self._getbuffer()
+ * return self._buffer # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->_buffer);
+ __pyx_r = __pyx_v_self->_buffer;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/message.pyx":307
+ *
+ * @property
+ * def buffer(self): # <<<<<<<<<<<<<<
+ * """A read-only buffer view of the message contents."""
+ * if self._buffer is None:
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("zmq.backend.cython.message.Frame.buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/message.pyx":314
+ *
+ * @property
+ * def bytes(self): # <<<<<<<<<<<<<<
+ * """The message content as a Python bytes object.
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7message_5Frame_21bytes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_7message_5Frame_20bytes[] = "The message content as a Python bytes object.\n\n The first time this property is accessed, a copy of the message \n contents is made. From then on that same copy of the message is\n returned.\n ";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7message_5Frame_21bytes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("bytes (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7message_5Frame_20bytes(((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7message_5Frame_20bytes(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("bytes", 0);
+
+ /* "zmq/backend/cython/message.pyx":321
+ * returned.
+ * """
+ * if self._bytes is None: # <<<<<<<<<<<<<<
+ * self._bytes = copy_zmq_msg_bytes(&self.zmq_msg)
+ * return self._bytes
+ */
+ __pyx_t_1 = (__pyx_v_self->_bytes == Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/message.pyx":322
+ * """
+ * if self._bytes is None:
+ * self._bytes = copy_zmq_msg_bytes(&self.zmq_msg) # <<<<<<<<<<<<<<
+ * return self._bytes
+ *
+ */
+ __pyx_t_3 = __pyx_f_3zmq_7backend_6cython_7message_copy_zmq_msg_bytes((&__pyx_v_self->zmq_msg)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __Pyx_GOTREF(__pyx_v_self->_bytes);
+ __Pyx_DECREF(__pyx_v_self->_bytes);
+ __pyx_v_self->_bytes = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/message.pyx":323
+ * if self._bytes is None:
+ * self._bytes = copy_zmq_msg_bytes(&self.zmq_msg)
+ * return self._bytes # <<<<<<<<<<<<<<
+ *
+ * def set(self, int option, int value):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->_bytes);
+ __pyx_r = __pyx_v_self->_bytes;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/message.pyx":314
+ *
+ * @property
+ * def bytes(self): # <<<<<<<<<<<<<<
+ * """The message content as a Python bytes object.
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("zmq.backend.cython.message.Frame.bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/message.pyx":325
+ * return self._bytes
+ *
+ * def set(self, int option, int value): # <<<<<<<<<<<<<<
+ * """Frame.set(option, value)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7message_5Frame_23set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_7message_5Frame_22set[] = "Frame.set(option, value)\n \n Set a Frame option.\n \n See the 0MQ API documentation for zmq_msg_set\n for details on specific options.\n \n .. versionadded:: libzmq-3.2\n .. versionadded:: 13.0\n ";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7message_5Frame_23set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ int __pyx_v_option;
+ int __pyx_v_value;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("set (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_option,&__pyx_n_s_value,0};
+ PyObject* values[2] = {0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_option)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ }
+ __pyx_v_option = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_option == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_value = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("zmq.backend.cython.message.Frame.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7message_5Frame_22set(((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_v_self), __pyx_v_option, __pyx_v_value);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7message_5Frame_22set(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self, int __pyx_v_option, int __pyx_v_value) {
+ int __pyx_v_rc;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("set", 0);
+
+ /* "zmq/backend/cython/message.pyx":336
+ * .. versionadded:: 13.0
+ * """
+ * cdef int rc = zmq_msg_set(&self.zmq_msg, option, value) # <<<<<<<<<<<<<<
+ * _check_rc(rc)
+ *
+ */
+ __pyx_v_rc = zmq_msg_set((&__pyx_v_self->zmq_msg), __pyx_v_option, __pyx_v_value);
+
+ /* "zmq/backend/cython/message.pyx":337
+ * """
+ * cdef int rc = zmq_msg_set(&self.zmq_msg, option, value)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ *
+ * def get(self, option):
+ */
+ __pyx_t_1 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/message.pyx":325
+ * return self._bytes
+ *
+ * def set(self, int option, int value): # <<<<<<<<<<<<<<
+ * """Frame.set(option, value)
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_AddTraceback("zmq.backend.cython.message.Frame.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/message.pyx":339
+ * _check_rc(rc)
+ *
+ * def get(self, option): # <<<<<<<<<<<<<<
+ * """Frame.get(option)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7message_5Frame_25get(PyObject *__pyx_v_self, PyObject *__pyx_v_option); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_7message_5Frame_24get[] = "Frame.get(option)\n\n Get a Frame option or property.\n\n See the 0MQ API documentation for zmq_msg_get and zmq_msg_gets\n for details on specific options.\n\n .. versionadded:: libzmq-3.2\n .. versionadded:: 13.0\n \n .. versionchanged:: 14.3\n add support for zmq_msg_gets (requires libzmq-4.1)\n ";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7message_5Frame_25get(PyObject *__pyx_v_self, PyObject *__pyx_v_option) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("get (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7message_5Frame_24get(((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_v_self), ((PyObject *)__pyx_v_option));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7message_5Frame_24get(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self, PyObject *__pyx_v_option) {
+ int __pyx_v_rc;
+ char *__pyx_v_property_c;
+ CYTHON_UNUSED Py_ssize_t __pyx_v_property_len_c;
+ char const *__pyx_v_result;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ char *__pyx_t_6;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("get", 0);
+ __Pyx_INCREF(__pyx_v_option);
+
+ /* "zmq/backend/cython/message.pyx":353
+ * add support for zmq_msg_gets (requires libzmq-4.1)
+ * """
+ * cdef int rc = 0 # <<<<<<<<<<<<<<
+ * cdef char *property_c = NULL
+ * cdef Py_ssize_t property_len_c = 0
+ */
+ __pyx_v_rc = 0;
+
+ /* "zmq/backend/cython/message.pyx":354
+ * """
+ * cdef int rc = 0
+ * cdef char *property_c = NULL # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t property_len_c = 0
+ *
+ */
+ __pyx_v_property_c = NULL;
+
+ /* "zmq/backend/cython/message.pyx":355
+ * cdef int rc = 0
+ * cdef char *property_c = NULL
+ * cdef Py_ssize_t property_len_c = 0 # <<<<<<<<<<<<<<
+ *
+ * # zmq_msg_get
+ */
+ __pyx_v_property_len_c = 0;
+
+ /* "zmq/backend/cython/message.pyx":358
+ *
+ * # zmq_msg_get
+ * if isinstance(option, int): # <<<<<<<<<<<<<<
+ * rc = zmq_msg_get(&self.zmq_msg, option)
+ * _check_rc(rc)
+ */
+ __pyx_t_1 = PyInt_Check(__pyx_v_option);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/message.pyx":359
+ * # zmq_msg_get
+ * if isinstance(option, int):
+ * rc = zmq_msg_get(&self.zmq_msg, option) # <<<<<<<<<<<<<<
+ * _check_rc(rc)
+ * return rc
+ */
+ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_option); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_rc = zmq_msg_get((&__pyx_v_self->zmq_msg), __pyx_t_3);
+
+ /* "zmq/backend/cython/message.pyx":360
+ * if isinstance(option, int):
+ * rc = zmq_msg_get(&self.zmq_msg, option)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ * return rc
+ *
+ */
+ __pyx_t_3 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/message.pyx":361
+ * rc = zmq_msg_get(&self.zmq_msg, option)
+ * _check_rc(rc)
+ * return rc # <<<<<<<<<<<<<<
+ *
+ * # zmq_msg_gets
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/backend/cython/message.pyx":364
+ *
+ * # zmq_msg_gets
+ * _check_version((4,1), "get string properties") # <<<<<<<<<<<<<<
+ * if isinstance(option, unicode):
+ * option = option.encode('utf8')
+ */
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_version); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+ /* "zmq/backend/cython/message.pyx":365
+ * # zmq_msg_gets
+ * _check_version((4,1), "get string properties")
+ * if isinstance(option, unicode): # <<<<<<<<<<<<<<
+ * option = option.encode('utf8')
+ *
+ */
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_2 = PyObject_IsInstance(__pyx_v_option, __pyx_t_5); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_1 = (__pyx_t_2 != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/message.pyx":366
+ * _check_version((4,1), "get string properties")
+ * if isinstance(option, unicode):
+ * option = option.encode('utf8') # <<<<<<<<<<<<<<
+ *
+ * if not isinstance(option, bytes):
+ */
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_option, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF_SET(__pyx_v_option, __pyx_t_4);
+ __pyx_t_4 = 0;
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "zmq/backend/cython/message.pyx":368
+ * option = option.encode('utf8')
+ *
+ * if not isinstance(option, bytes): # <<<<<<<<<<<<<<
+ * raise TypeError("expected str, got: %r" % option)
+ *
+ */
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = PyObject_IsInstance(__pyx_v_option, __pyx_t_4); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/message.pyx":369
+ *
+ * if not isinstance(option, bytes):
+ * raise TypeError("expected str, got: %r" % option) # <<<<<<<<<<<<<<
+ *
+ * property_c = option
+ */
+ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_expected_str_got_r, __pyx_v_option); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/message.pyx":371
+ * raise TypeError("expected str, got: %r" % option)
+ *
+ * property_c = option # <<<<<<<<<<<<<<
+ *
+ * cdef const char *result = <char *>zmq_msg_gets(&self.zmq_msg, property_c)
+ */
+ __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_option); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_property_c = __pyx_t_6;
+
+ /* "zmq/backend/cython/message.pyx":373
+ * property_c = option
+ *
+ * cdef const char *result = <char *>zmq_msg_gets(&self.zmq_msg, property_c) # <<<<<<<<<<<<<<
+ * if result == NULL:
+ * _check_rc(-1)
+ */
+ __pyx_v_result = ((char *)zmq_msg_gets((&__pyx_v_self->zmq_msg), __pyx_v_property_c));
+
+ /* "zmq/backend/cython/message.pyx":374
+ *
+ * cdef const char *result = <char *>zmq_msg_gets(&self.zmq_msg, property_c)
+ * if result == NULL: # <<<<<<<<<<<<<<
+ * _check_rc(-1)
+ * return result.decode('utf8')
+ */
+ __pyx_t_2 = ((__pyx_v_result == NULL) != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/message.pyx":375
+ * cdef const char *result = <char *>zmq_msg_gets(&self.zmq_msg, property_c)
+ * if result == NULL:
+ * _check_rc(-1) # <<<<<<<<<<<<<<
+ * return result.decode('utf8')
+ *
+ */
+ __pyx_t_3 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(-1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+
+ /* "zmq/backend/cython/message.pyx":376
+ * if result == NULL:
+ * _check_rc(-1)
+ * return result.decode('utf8') # <<<<<<<<<<<<<<
+ *
+ * # legacy Message name
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_result, 0, strlen(__pyx_v_result), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/message.pyx":339
+ * _check_rc(rc)
+ *
+ * def get(self, option): # <<<<<<<<<<<<<<
+ * """Frame.get(option)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("zmq.backend.cython.message.Frame.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_option);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/message.pxd":47
+ * cdef object _bytes # A bytes/str copy of the message.
+ * cdef bint _failed_init # Flag to handle failed zmq_msg_init
+ * cdef public object tracker_event # Event for use with zmq_free_fn. # <<<<<<<<<<<<<<
+ * cdef public object tracker # MessageTracker object.
+ * cdef public bint more # whether RCVMORE was set
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7message_5Frame_13tracker_event_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7message_5Frame_13tracker_event_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7message_5Frame_13tracker_event___get__(((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7message_5Frame_13tracker_event___get__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->tracker_event);
+ __pyx_r = __pyx_v_self->tracker_event;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_3zmq_7backend_6cython_7message_5Frame_13tracker_event_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_3zmq_7backend_6cython_7message_5Frame_13tracker_event_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7message_5Frame_13tracker_event_2__set__(((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_3zmq_7backend_6cython_7message_5Frame_13tracker_event_2__set__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__set__", 0);
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ __Pyx_GOTREF(__pyx_v_self->tracker_event);
+ __Pyx_DECREF(__pyx_v_self->tracker_event);
+ __pyx_v_self->tracker_event = __pyx_v_value;
+
+ /* function exit code */
+ __pyx_r = 0;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_3zmq_7backend_6cython_7message_5Frame_13tracker_event_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_3zmq_7backend_6cython_7message_5Frame_13tracker_event_5__del__(PyObject *__pyx_v_self) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7message_5Frame_13tracker_event_4__del__(((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_3zmq_7backend_6cython_7message_5Frame_13tracker_event_4__del__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__del__", 0);
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_GOTREF(__pyx_v_self->tracker_event);
+ __Pyx_DECREF(__pyx_v_self->tracker_event);
+ __pyx_v_self->tracker_event = Py_None;
+
+ /* function exit code */
+ __pyx_r = 0;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/message.pxd":48
+ * cdef bint _failed_init # Flag to handle failed zmq_msg_init
+ * cdef public object tracker_event # Event for use with zmq_free_fn.
+ * cdef public object tracker # MessageTracker object. # <<<<<<<<<<<<<<
+ * cdef public bint more # whether RCVMORE was set
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7message_5Frame_7tracker_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7message_5Frame_7tracker_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7message_5Frame_7tracker___get__(((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7message_5Frame_7tracker___get__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->tracker);
+ __pyx_r = __pyx_v_self->tracker;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_3zmq_7backend_6cython_7message_5Frame_7tracker_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_3zmq_7backend_6cython_7message_5Frame_7tracker_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7message_5Frame_7tracker_2__set__(((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_3zmq_7backend_6cython_7message_5Frame_7tracker_2__set__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__set__", 0);
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ __Pyx_GOTREF(__pyx_v_self->tracker);
+ __Pyx_DECREF(__pyx_v_self->tracker);
+ __pyx_v_self->tracker = __pyx_v_value;
+
+ /* function exit code */
+ __pyx_r = 0;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_3zmq_7backend_6cython_7message_5Frame_7tracker_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_3zmq_7backend_6cython_7message_5Frame_7tracker_5__del__(PyObject *__pyx_v_self) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7message_5Frame_7tracker_4__del__(((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_3zmq_7backend_6cython_7message_5Frame_7tracker_4__del__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__del__", 0);
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_GOTREF(__pyx_v_self->tracker);
+ __Pyx_DECREF(__pyx_v_self->tracker);
+ __pyx_v_self->tracker = Py_None;
+
+ /* function exit code */
+ __pyx_r = 0;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/message.pxd":49
+ * cdef public object tracker_event # Event for use with zmq_free_fn.
+ * cdef public object tracker # MessageTracker object.
+ * cdef public bint more # whether RCVMORE was set # <<<<<<<<<<<<<<
+ *
+ * cdef Frame fast_copy(self) # Create shallow copy of Message object.
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7message_5Frame_4more_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_3zmq_7backend_6cython_7message_5Frame_4more_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7message_5Frame_4more___get__(((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_7message_5Frame_4more___get__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->more); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("zmq.backend.cython.message.Frame.more.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_3zmq_7backend_6cython_7message_5Frame_4more_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_3zmq_7backend_6cython_7message_5Frame_4more_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_7message_5Frame_4more_2__set__(((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_3zmq_7backend_6cython_7message_5Frame_4more_2__set__(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_self, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__set__", 0);
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_self->more = __pyx_t_1;
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_AddTraceback("zmq.backend.cython.message.Frame.more.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/checkrc.pxd":5
+ * from libzmq cimport zmq_errno, ZMQ_ETERM
+ *
+ * cdef inline int _check_rc(int rc) except -1: # <<<<<<<<<<<<<<
+ * """internal utility for checking zmq return condition
+ *
+ */
+
+static CYTHON_INLINE int __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(int __pyx_v_rc) {
+ int __pyx_v_errno;
+ PyObject *__pyx_v_Again = NULL;
+ PyObject *__pyx_v_ContextTerminated = NULL;
+ PyObject *__pyx_v_ZMQError = NULL;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_check_rc", 0);
+
+ /* "zmq/backend/cython/checkrc.pxd":10
+ * and raising the appropriate Exception class
+ * """
+ * cdef int errno = zmq_errno() # <<<<<<<<<<<<<<
+ * PyErr_CheckSignals()
+ * if rc < 0:
+ */
+ __pyx_v_errno = zmq_errno();
+
+ /* "zmq/backend/cython/checkrc.pxd":11
+ * """
+ * cdef int errno = zmq_errno()
+ * PyErr_CheckSignals() # <<<<<<<<<<<<<<
+ * if rc < 0:
+ * if errno == EAGAIN:
+ */
+ __pyx_t_1 = PyErr_CheckSignals(); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/checkrc.pxd":12
+ * cdef int errno = zmq_errno()
+ * PyErr_CheckSignals()
+ * if rc < 0: # <<<<<<<<<<<<<<
+ * if errno == EAGAIN:
+ * from zmq.error import Again
+ */
+ __pyx_t_2 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/checkrc.pxd":16
+ * from zmq.error import Again
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM: # <<<<<<<<<<<<<<
+ * from zmq.error import ContextTerminated
+ * raise ContextTerminated(errno)
+ */
+ switch (__pyx_v_errno) {
+
+ /* "zmq/backend/cython/checkrc.pxd":13
+ * PyErr_CheckSignals()
+ * if rc < 0:
+ * if errno == EAGAIN: # <<<<<<<<<<<<<<
+ * from zmq.error import Again
+ * raise Again(errno)
+ */
+ case EAGAIN:
+
+ /* "zmq/backend/cython/checkrc.pxd":14
+ * if rc < 0:
+ * if errno == EAGAIN:
+ * from zmq.error import Again # <<<<<<<<<<<<<<
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM:
+ */
+ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_n_s_Again);
+ PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Again);
+ __Pyx_GIVEREF(__pyx_n_s_Again);
+ __pyx_t_4 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Again); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_Again = __pyx_t_3;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "zmq/backend/cython/checkrc.pxd":15
+ * if errno == EAGAIN:
+ * from zmq.error import Again
+ * raise Again(errno) # <<<<<<<<<<<<<<
+ * elif errno == ZMQ_ETERM:
+ * from zmq.error import ContextTerminated
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_Again);
+ __pyx_t_5 = __pyx_v_Again; __pyx_t_6 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ }
+ }
+ if (!__pyx_t_6) {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ } else {
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ break;
+
+ /* "zmq/backend/cython/checkrc.pxd":16
+ * from zmq.error import Again
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM: # <<<<<<<<<<<<<<
+ * from zmq.error import ContextTerminated
+ * raise ContextTerminated(errno)
+ */
+ case ETERM:
+
+ /* "zmq/backend/cython/checkrc.pxd":17
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM:
+ * from zmq.error import ContextTerminated # <<<<<<<<<<<<<<
+ * raise ContextTerminated(errno)
+ * else:
+ */
+ __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_n_s_ContextTerminated);
+ PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_ContextTerminated);
+ __Pyx_GIVEREF(__pyx_n_s_ContextTerminated);
+ __pyx_t_5 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_ContextTerminated); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_4);
+ __pyx_v_ContextTerminated = __pyx_t_4;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+ /* "zmq/backend/cython/checkrc.pxd":18
+ * elif errno == ZMQ_ETERM:
+ * from zmq.error import ContextTerminated
+ * raise ContextTerminated(errno) # <<<<<<<<<<<<<<
+ * else:
+ * from zmq.error import ZMQError
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_v_ContextTerminated);
+ __pyx_t_7 = __pyx_v_ContextTerminated; __pyx_t_3 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
+ if (likely(__pyx_t_3)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_7, function);
+ }
+ }
+ if (!__pyx_t_3) {
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ } else {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ break;
+ default:
+
+ /* "zmq/backend/cython/checkrc.pxd":20
+ * raise ContextTerminated(errno)
+ * else:
+ * from zmq.error import ZMQError # <<<<<<<<<<<<<<
+ * raise ZMQError(errno)
+ * # return -1
+ */
+ __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_n_s_ZMQError);
+ PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_ZMQError);
+ __Pyx_GIVEREF(__pyx_n_s_ZMQError);
+ __pyx_t_7 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_5, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_ZMQError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_5);
+ __pyx_v_ZMQError = __pyx_t_5;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "zmq/backend/cython/checkrc.pxd":21
+ * else:
+ * from zmq.error import ZMQError
+ * raise ZMQError(errno) # <<<<<<<<<<<<<<
+ * # return -1
+ * return 0
+ */
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_v_ZMQError);
+ __pyx_t_6 = __pyx_v_ZMQError; __pyx_t_4 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
+ }
+ }
+ if (!__pyx_t_4) {
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ } else {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_Raise(__pyx_t_7, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ break;
+ }
+ }
+
+ /* "zmq/backend/cython/checkrc.pxd":23
+ * raise ZMQError(errno)
+ * # return -1
+ * return 0 # <<<<<<<<<<<<<<
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/checkrc.pxd":5
+ * from libzmq cimport zmq_errno, ZMQ_ETERM
+ *
+ * cdef inline int _check_rc(int rc) except -1: # <<<<<<<<<<<<<<
+ * """internal utility for checking zmq return condition
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_AddTraceback("zmq.backend.cython.checkrc._check_rc", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_Again);
+ __Pyx_XDECREF(__pyx_v_ContextTerminated);
+ __Pyx_XDECREF(__pyx_v_ZMQError);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/message.pxd":55
+ *
+ *
+ * cdef inline object copy_zmq_msg_bytes(zmq_msg_t *zmq_msg): # <<<<<<<<<<<<<<
+ * """ Copy the data from a zmq_msg_t """
+ * cdef char *data_c = NULL
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_3zmq_7backend_6cython_7message_copy_zmq_msg_bytes(zmq_msg_t *__pyx_v_zmq_msg) {
+ char *__pyx_v_data_c;
+ Py_ssize_t __pyx_v_data_len_c;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("copy_zmq_msg_bytes", 0);
+
+ /* "zmq/backend/cython/message.pxd":57
+ * cdef inline object copy_zmq_msg_bytes(zmq_msg_t *zmq_msg):
+ * """ Copy the data from a zmq_msg_t """
+ * cdef char *data_c = NULL # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t data_len_c
+ * data_c = <char *>zmq_msg_data(zmq_msg)
+ */
+ __pyx_v_data_c = NULL;
+
+ /* "zmq/backend/cython/message.pxd":59
+ * cdef char *data_c = NULL
+ * cdef Py_ssize_t data_len_c
+ * data_c = <char *>zmq_msg_data(zmq_msg) # <<<<<<<<<<<<<<
+ * data_len_c = zmq_msg_size(zmq_msg)
+ * return PyBytes_FromStringAndSize(data_c, data_len_c)
+ */
+ __pyx_v_data_c = ((char *)zmq_msg_data(__pyx_v_zmq_msg));
+
+ /* "zmq/backend/cython/message.pxd":60
+ * cdef Py_ssize_t data_len_c
+ * data_c = <char *>zmq_msg_data(zmq_msg)
+ * data_len_c = zmq_msg_size(zmq_msg) # <<<<<<<<<<<<<<
+ * return PyBytes_FromStringAndSize(data_c, data_len_c)
+ *
+ */
+ __pyx_v_data_len_c = zmq_msg_size(__pyx_v_zmq_msg);
+
+ /* "zmq/backend/cython/message.pxd":61
+ * data_c = <char *>zmq_msg_data(zmq_msg)
+ * data_len_c = zmq_msg_size(zmq_msg)
+ * return PyBytes_FromStringAndSize(data_c, data_len_c) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyBytes_FromStringAndSize(__pyx_v_data_c, __pyx_v_data_len_c); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/message.pxd":55
+ *
+ *
+ * cdef inline object copy_zmq_msg_bytes(zmq_msg_t *zmq_msg): # <<<<<<<<<<<<<<
+ * """ Copy the data from a zmq_msg_t """
+ * cdef char *data_c = NULL
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("zmq.backend.cython.message.copy_zmq_msg_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":88
+ *
+ *
+ * cdef inline int memoryview_available(): # <<<<<<<<<<<<<<
+ * return PY_MAJOR_VERSION >= 3 or (PY_MAJOR_VERSION >=2 and PY_MINOR_VERSION >= 7)
+ *
+ */
+
+static CYTHON_INLINE int __pyx_f_7buffers_memoryview_available(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ __Pyx_RefNannySetupContext("memoryview_available", 0);
+
+ /* "buffers.pxd":89
+ *
+ * cdef inline int memoryview_available():
+ * return PY_MAJOR_VERSION >= 3 or (PY_MAJOR_VERSION >=2 and PY_MINOR_VERSION >= 7) # <<<<<<<<<<<<<<
+ *
+ * cdef inline int oldstyle_available():
+ */
+ __pyx_t_2 = (PY_MAJOR_VERSION >= 3);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L3_bool_binop_done;
+ }
+ __pyx_t_2 = (PY_MAJOR_VERSION >= 2);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L3_bool_binop_done;
+ }
+ __pyx_t_2 = (PY_MINOR_VERSION >= 7);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L3_bool_binop_done:;
+ __pyx_r = __pyx_t_1;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":88
+ *
+ *
+ * cdef inline int memoryview_available(): # <<<<<<<<<<<<<<
+ * return PY_MAJOR_VERSION >= 3 or (PY_MAJOR_VERSION >=2 and PY_MINOR_VERSION >= 7)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":91
+ * return PY_MAJOR_VERSION >= 3 or (PY_MAJOR_VERSION >=2 and PY_MINOR_VERSION >= 7)
+ *
+ * cdef inline int oldstyle_available(): # <<<<<<<<<<<<<<
+ * return PY_MAJOR_VERSION < 3
+ *
+ */
+
+static CYTHON_INLINE int __pyx_f_7buffers_oldstyle_available(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("oldstyle_available", 0);
+
+ /* "buffers.pxd":92
+ *
+ * cdef inline int oldstyle_available():
+ * return PY_MAJOR_VERSION < 3 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = (PY_MAJOR_VERSION < 3);
+ goto __pyx_L0;
+
+ /* "buffers.pxd":91
+ * return PY_MAJOR_VERSION >= 3 or (PY_MAJOR_VERSION >=2 and PY_MINOR_VERSION >= 7)
+ *
+ * cdef inline int oldstyle_available(): # <<<<<<<<<<<<<<
+ * return PY_MAJOR_VERSION < 3
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":95
+ *
+ *
+ * cdef inline int check_buffer(object ob): # <<<<<<<<<<<<<<
+ * """Version independent check for whether an object is a buffer.
+ *
+ */
+
+static CYTHON_INLINE int __pyx_f_7buffers_check_buffer(PyObject *__pyx_v_ob) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ __Pyx_RefNannySetupContext("check_buffer", 0);
+
+ /* "buffers.pxd":107
+ * int : 0 if no buffer interface, 3 if newstyle buffer interface, 2 if oldstyle.
+ * """
+ * if PyObject_CheckBuffer(ob): # <<<<<<<<<<<<<<
+ * return 3
+ * if oldstyle_available():
+ */
+ __pyx_t_1 = (PyObject_CheckBuffer(__pyx_v_ob) != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":108
+ * """
+ * if PyObject_CheckBuffer(ob):
+ * return 3 # <<<<<<<<<<<<<<
+ * if oldstyle_available():
+ * return PyObject_CheckReadBuffer(ob) and 2
+ */
+ __pyx_r = 3;
+ goto __pyx_L0;
+ }
+
+ /* "buffers.pxd":109
+ * if PyObject_CheckBuffer(ob):
+ * return 3
+ * if oldstyle_available(): # <<<<<<<<<<<<<<
+ * return PyObject_CheckReadBuffer(ob) and 2
+ * return 0
+ */
+ __pyx_t_1 = (__pyx_f_7buffers_oldstyle_available() != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":110
+ * return 3
+ * if oldstyle_available():
+ * return PyObject_CheckReadBuffer(ob) and 2 # <<<<<<<<<<<<<<
+ * return 0
+ *
+ */
+ __pyx_t_3 = PyObject_CheckReadBuffer(__pyx_v_ob);
+ if (__pyx_t_3) {
+ } else {
+ __pyx_t_2 = __pyx_t_3;
+ goto __pyx_L5_bool_binop_done;
+ }
+ __pyx_t_2 = 2;
+ __pyx_L5_bool_binop_done:;
+ __pyx_r = __pyx_t_2;
+ goto __pyx_L0;
+ }
+
+ /* "buffers.pxd":111
+ * if oldstyle_available():
+ * return PyObject_CheckReadBuffer(ob) and 2
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":95
+ *
+ *
+ * cdef inline int check_buffer(object ob): # <<<<<<<<<<<<<<
+ * """Version independent check for whether an object is a buffer.
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":114
+ *
+ *
+ * cdef inline object asbuffer(object ob, int writable, int format, # <<<<<<<<<<<<<<
+ * void **base, Py_ssize_t *size,
+ * Py_ssize_t *itemsize):
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_asbuffer(PyObject *__pyx_v_ob, int __pyx_v_writable, int __pyx_v_format, void **__pyx_v_base, Py_ssize_t *__pyx_v_size, Py_ssize_t *__pyx_v_itemsize) {
+ void *__pyx_v_bptr;
+ Py_ssize_t __pyx_v_blen;
+ Py_ssize_t __pyx_v_bitemlen;
+ Py_buffer __pyx_v_view;
+ int __pyx_v_flags;
+ int __pyx_v_mode;
+ PyObject *__pyx_v_bfmt = NULL;
+ PyObject *__pyx_v_dtype = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ void *__pyx_t_5;
+ Py_ssize_t __pyx_t_6;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *__pyx_t_10 = NULL;
+ PyObject *__pyx_t_11 = NULL;
+ PyObject *__pyx_t_12 = NULL;
+ PyObject *__pyx_t_13 = NULL;
+ PyObject *__pyx_t_14 = NULL;
+ PyObject *__pyx_t_15 = NULL;
+ PyObject *__pyx_t_16 = NULL;
+ int __pyx_t_17;
+ int __pyx_t_18;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("asbuffer", 0);
+
+ /* "buffers.pxd":141
+ * """
+ *
+ * cdef void *bptr = NULL # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t blen = 0, bitemlen = 0
+ * cdef Py_buffer view
+ */
+ __pyx_v_bptr = NULL;
+
+ /* "buffers.pxd":142
+ *
+ * cdef void *bptr = NULL
+ * cdef Py_ssize_t blen = 0, bitemlen = 0 # <<<<<<<<<<<<<<
+ * cdef Py_buffer view
+ * cdef int flags = PyBUF_SIMPLE
+ */
+ __pyx_v_blen = 0;
+ __pyx_v_bitemlen = 0;
+
+ /* "buffers.pxd":144
+ * cdef Py_ssize_t blen = 0, bitemlen = 0
+ * cdef Py_buffer view
+ * cdef int flags = PyBUF_SIMPLE # <<<<<<<<<<<<<<
+ * cdef int mode = 0
+ *
+ */
+ __pyx_v_flags = PyBUF_SIMPLE;
+
+ /* "buffers.pxd":145
+ * cdef Py_buffer view
+ * cdef int flags = PyBUF_SIMPLE
+ * cdef int mode = 0 # <<<<<<<<<<<<<<
+ *
+ * bfmt = None
+ */
+ __pyx_v_mode = 0;
+
+ /* "buffers.pxd":147
+ * cdef int mode = 0
+ *
+ * bfmt = None # <<<<<<<<<<<<<<
+ *
+ * mode = check_buffer(ob)
+ */
+ __Pyx_INCREF(Py_None);
+ __pyx_v_bfmt = Py_None;
+
+ /* "buffers.pxd":149
+ * bfmt = None
+ *
+ * mode = check_buffer(ob) # <<<<<<<<<<<<<<
+ * if mode == 0:
+ * raise TypeError("%r does not provide a buffer interface."%ob)
+ */
+ __pyx_v_mode = __pyx_f_7buffers_check_buffer(__pyx_v_ob);
+
+ /* "buffers.pxd":150
+ *
+ * mode = check_buffer(ob)
+ * if mode == 0: # <<<<<<<<<<<<<<
+ * raise TypeError("%r does not provide a buffer interface."%ob)
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_mode == 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":151
+ * mode = check_buffer(ob)
+ * if mode == 0:
+ * raise TypeError("%r does not provide a buffer interface."%ob) # <<<<<<<<<<<<<<
+ *
+ * if mode == 3:
+ */
+ __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_r_does_not_provide_a_buffer_int, __pyx_v_ob); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "buffers.pxd":153
+ * raise TypeError("%r does not provide a buffer interface."%ob)
+ *
+ * if mode == 3: # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS
+ * if writable:
+ */
+ __pyx_t_1 = ((__pyx_v_mode == 3) != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":154
+ *
+ * if mode == 3:
+ * flags = PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
+ * if writable:
+ * flags |= PyBUF_WRITABLE
+ */
+ __pyx_v_flags = PyBUF_ANY_CONTIGUOUS;
+
+ /* "buffers.pxd":155
+ * if mode == 3:
+ * flags = PyBUF_ANY_CONTIGUOUS
+ * if writable: # <<<<<<<<<<<<<<
+ * flags |= PyBUF_WRITABLE
+ * if format:
+ */
+ __pyx_t_1 = (__pyx_v_writable != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":156
+ * flags = PyBUF_ANY_CONTIGUOUS
+ * if writable:
+ * flags |= PyBUF_WRITABLE # <<<<<<<<<<<<<<
+ * if format:
+ * flags |= PyBUF_FORMAT
+ */
+ __pyx_v_flags = (__pyx_v_flags | PyBUF_WRITABLE);
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+
+ /* "buffers.pxd":157
+ * if writable:
+ * flags |= PyBUF_WRITABLE
+ * if format: # <<<<<<<<<<<<<<
+ * flags |= PyBUF_FORMAT
+ * PyObject_GetBuffer(ob, &view, flags)
+ */
+ __pyx_t_1 = (__pyx_v_format != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":158
+ * flags |= PyBUF_WRITABLE
+ * if format:
+ * flags |= PyBUF_FORMAT # <<<<<<<<<<<<<<
+ * PyObject_GetBuffer(ob, &view, flags)
+ * bptr = view.buf
+ */
+ __pyx_v_flags = (__pyx_v_flags | PyBUF_FORMAT);
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+
+ /* "buffers.pxd":159
+ * if format:
+ * flags |= PyBUF_FORMAT
+ * PyObject_GetBuffer(ob, &view, flags) # <<<<<<<<<<<<<<
+ * bptr = view.buf
+ * blen = view.len
+ */
+ __pyx_t_4 = PyObject_GetBuffer(__pyx_v_ob, (&__pyx_v_view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "buffers.pxd":160
+ * flags |= PyBUF_FORMAT
+ * PyObject_GetBuffer(ob, &view, flags)
+ * bptr = view.buf # <<<<<<<<<<<<<<
+ * blen = view.len
+ * if format:
+ */
+ __pyx_t_5 = __pyx_v_view.buf;
+ __pyx_v_bptr = __pyx_t_5;
+
+ /* "buffers.pxd":161
+ * PyObject_GetBuffer(ob, &view, flags)
+ * bptr = view.buf
+ * blen = view.len # <<<<<<<<<<<<<<
+ * if format:
+ * if view.format != NULL:
+ */
+ __pyx_t_6 = __pyx_v_view.len;
+ __pyx_v_blen = __pyx_t_6;
+
+ /* "buffers.pxd":162
+ * bptr = view.buf
+ * blen = view.len
+ * if format: # <<<<<<<<<<<<<<
+ * if view.format != NULL:
+ * bfmt = view.format
+ */
+ __pyx_t_1 = (__pyx_v_format != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":163
+ * blen = view.len
+ * if format:
+ * if view.format != NULL: # <<<<<<<<<<<<<<
+ * bfmt = view.format
+ * bitemlen = view.itemsize
+ */
+ __pyx_t_1 = ((__pyx_v_view.format != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":164
+ * if format:
+ * if view.format != NULL:
+ * bfmt = view.format # <<<<<<<<<<<<<<
+ * bitemlen = view.itemsize
+ * PyBuffer_Release(&view)
+ */
+ __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_view.format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF_SET(__pyx_v_bfmt, __pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "buffers.pxd":165
+ * if view.format != NULL:
+ * bfmt = view.format
+ * bitemlen = view.itemsize # <<<<<<<<<<<<<<
+ * PyBuffer_Release(&view)
+ * else: # oldstyle
+ */
+ __pyx_t_6 = __pyx_v_view.itemsize;
+ __pyx_v_bitemlen = __pyx_t_6;
+ goto __pyx_L8;
+ }
+ __pyx_L8:;
+ goto __pyx_L7;
+ }
+ __pyx_L7:;
+
+ /* "buffers.pxd":166
+ * bfmt = view.format
+ * bitemlen = view.itemsize
+ * PyBuffer_Release(&view) # <<<<<<<<<<<<<<
+ * else: # oldstyle
+ * if writable:
+ */
+ PyBuffer_Release((&__pyx_v_view));
+ goto __pyx_L4;
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":168
+ * PyBuffer_Release(&view)
+ * else: # oldstyle
+ * if writable: # <<<<<<<<<<<<<<
+ * PyObject_AsWriteBuffer(ob, &bptr, &blen)
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_writable != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":169
+ * else: # oldstyle
+ * if writable:
+ * PyObject_AsWriteBuffer(ob, &bptr, &blen) # <<<<<<<<<<<<<<
+ * else:
+ * PyObject_AsReadBuffer(ob, <const_void **>&bptr, &blen)
+ */
+ __pyx_t_4 = PyObject_AsWriteBuffer(__pyx_v_ob, (&__pyx_v_bptr), (&__pyx_v_blen)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L9;
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":171
+ * PyObject_AsWriteBuffer(ob, &bptr, &blen)
+ * else:
+ * PyObject_AsReadBuffer(ob, <const_void **>&bptr, &blen) # <<<<<<<<<<<<<<
+ * if format:
+ * try: # numpy.ndarray
+ */
+ __pyx_t_4 = PyObject_AsReadBuffer(__pyx_v_ob, ((const void **)(&__pyx_v_bptr)), (&__pyx_v_blen)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_L9:;
+
+ /* "buffers.pxd":172
+ * else:
+ * PyObject_AsReadBuffer(ob, <const_void **>&bptr, &blen)
+ * if format: # <<<<<<<<<<<<<<
+ * try: # numpy.ndarray
+ * dtype = ob.dtype
+ */
+ __pyx_t_1 = (__pyx_v_format != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":173
+ * PyObject_AsReadBuffer(ob, <const_void **>&bptr, &blen)
+ * if format:
+ * try: # numpy.ndarray # <<<<<<<<<<<<<<
+ * dtype = ob.dtype
+ * bfmt = dtype.char
+ */
+ {
+ __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
+ __Pyx_XGOTREF(__pyx_t_7);
+ __Pyx_XGOTREF(__pyx_t_8);
+ __Pyx_XGOTREF(__pyx_t_9);
+ /*try:*/ {
+
+ /* "buffers.pxd":174
+ * if format:
+ * try: # numpy.ndarray
+ * dtype = ob.dtype # <<<<<<<<<<<<<<
+ * bfmt = dtype.char
+ * bitemlen = dtype.itemsize
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ob, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_v_dtype = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "buffers.pxd":175
+ * try: # numpy.ndarray
+ * dtype = ob.dtype
+ * bfmt = dtype.char # <<<<<<<<<<<<<<
+ * bitemlen = dtype.itemsize
+ * except AttributeError:
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_char); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF_SET(__pyx_v_bfmt, __pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "buffers.pxd":176
+ * dtype = ob.dtype
+ * bfmt = dtype.char
+ * bitemlen = dtype.itemsize # <<<<<<<<<<<<<<
+ * except AttributeError:
+ * try: # array.array
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_bitemlen = __pyx_t_6;
+ }
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+ goto __pyx_L18_try_end;
+ __pyx_L11_error:;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "buffers.pxd":177
+ * bfmt = dtype.char
+ * bitemlen = dtype.itemsize
+ * except AttributeError: # <<<<<<<<<<<<<<
+ * try: # array.array
+ * bfmt = ob.typecode
+ */
+ __pyx_t_4 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("buffers.asbuffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GOTREF(__pyx_t_10);
+
+ /* "buffers.pxd":178
+ * bitemlen = dtype.itemsize
+ * except AttributeError:
+ * try: # array.array # <<<<<<<<<<<<<<
+ * bfmt = ob.typecode
+ * bitemlen = ob.itemsize
+ */
+ {
+ __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
+ __Pyx_XGOTREF(__pyx_t_11);
+ __Pyx_XGOTREF(__pyx_t_12);
+ __Pyx_XGOTREF(__pyx_t_13);
+ /*try:*/ {
+
+ /* "buffers.pxd":179
+ * except AttributeError:
+ * try: # array.array
+ * bfmt = ob.typecode # <<<<<<<<<<<<<<
+ * bitemlen = ob.itemsize
+ * except AttributeError:
+ */
+ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_ob, __pyx_n_s_typecode); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __Pyx_DECREF_SET(__pyx_v_bfmt, __pyx_t_14);
+ __pyx_t_14 = 0;
+
+ /* "buffers.pxd":180
+ * try: # array.array
+ * bfmt = ob.typecode
+ * bitemlen = ob.itemsize # <<<<<<<<<<<<<<
+ * except AttributeError:
+ * if isinstance(ob, bytes):
+ */
+ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_ob, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __pyx_v_bitemlen = __pyx_t_6;
+ }
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+ goto __pyx_L28_try_end;
+ __pyx_L21_error:;
+ __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+
+ /* "buffers.pxd":181
+ * bfmt = ob.typecode
+ * bitemlen = ob.itemsize
+ * except AttributeError: # <<<<<<<<<<<<<<
+ * if isinstance(ob, bytes):
+ * bfmt = b"B"
+ */
+ __pyx_t_4 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("buffers.asbuffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GOTREF(__pyx_t_16);
+
+ /* "buffers.pxd":182
+ * bitemlen = ob.itemsize
+ * except AttributeError:
+ * if isinstance(ob, bytes): # <<<<<<<<<<<<<<
+ * bfmt = b"B"
+ * bitemlen = 1
+ */
+ __pyx_t_1 = PyBytes_Check(__pyx_v_ob);
+ __pyx_t_17 = (__pyx_t_1 != 0);
+ if (__pyx_t_17) {
+
+ /* "buffers.pxd":183
+ * except AttributeError:
+ * if isinstance(ob, bytes):
+ * bfmt = b"B" # <<<<<<<<<<<<<<
+ * bitemlen = 1
+ * else:
+ */
+ __Pyx_INCREF(__pyx_n_b_B);
+ __Pyx_DECREF_SET(__pyx_v_bfmt, __pyx_n_b_B);
+
+ /* "buffers.pxd":184
+ * if isinstance(ob, bytes):
+ * bfmt = b"B"
+ * bitemlen = 1 # <<<<<<<<<<<<<<
+ * else:
+ * # nothing found
+ */
+ __pyx_v_bitemlen = 1;
+ goto __pyx_L31;
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":187
+ * else:
+ * # nothing found
+ * bfmt = None # <<<<<<<<<<<<<<
+ * bitemlen = 0
+ * if base: base[0] = <void *>bptr
+ */
+ __Pyx_INCREF(Py_None);
+ __Pyx_DECREF_SET(__pyx_v_bfmt, Py_None);
+
+ /* "buffers.pxd":188
+ * # nothing found
+ * bfmt = None
+ * bitemlen = 0 # <<<<<<<<<<<<<<
+ * if base: base[0] = <void *>bptr
+ * if size: size[0] = <Py_ssize_t>blen
+ */
+ __pyx_v_bitemlen = 0;
+ }
+ __pyx_L31:;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ goto __pyx_L22_exception_handled;
+ }
+ goto __pyx_L23_except_error;
+ __pyx_L23_except_error:;
+ __Pyx_XGIVEREF(__pyx_t_11);
+ __Pyx_XGIVEREF(__pyx_t_12);
+ __Pyx_XGIVEREF(__pyx_t_13);
+ __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
+ goto __pyx_L13_except_error;
+ __pyx_L22_exception_handled:;
+ __Pyx_XGIVEREF(__pyx_t_11);
+ __Pyx_XGIVEREF(__pyx_t_12);
+ __Pyx_XGIVEREF(__pyx_t_13);
+ __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
+ __pyx_L28_try_end:;
+ }
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ goto __pyx_L12_exception_handled;
+ }
+ goto __pyx_L13_except_error;
+ __pyx_L13_except_error:;
+ __Pyx_XGIVEREF(__pyx_t_7);
+ __Pyx_XGIVEREF(__pyx_t_8);
+ __Pyx_XGIVEREF(__pyx_t_9);
+ __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
+ goto __pyx_L1_error;
+ __pyx_L12_exception_handled:;
+ __Pyx_XGIVEREF(__pyx_t_7);
+ __Pyx_XGIVEREF(__pyx_t_8);
+ __Pyx_XGIVEREF(__pyx_t_9);
+ __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
+ __pyx_L18_try_end:;
+ }
+ goto __pyx_L10;
+ }
+ __pyx_L10:;
+ }
+ __pyx_L4:;
+
+ /* "buffers.pxd":189
+ * bfmt = None
+ * bitemlen = 0
+ * if base: base[0] = <void *>bptr # <<<<<<<<<<<<<<
+ * if size: size[0] = <Py_ssize_t>blen
+ * if itemsize: itemsize[0] = <Py_ssize_t>bitemlen
+ */
+ __pyx_t_17 = (__pyx_v_base != 0);
+ if (__pyx_t_17) {
+ (__pyx_v_base[0]) = ((void *)__pyx_v_bptr);
+ goto __pyx_L32;
+ }
+ __pyx_L32:;
+
+ /* "buffers.pxd":190
+ * bitemlen = 0
+ * if base: base[0] = <void *>bptr
+ * if size: size[0] = <Py_ssize_t>blen # <<<<<<<<<<<<<<
+ * if itemsize: itemsize[0] = <Py_ssize_t>bitemlen
+ *
+ */
+ __pyx_t_17 = (__pyx_v_size != 0);
+ if (__pyx_t_17) {
+ (__pyx_v_size[0]) = ((Py_ssize_t)__pyx_v_blen);
+ goto __pyx_L33;
+ }
+ __pyx_L33:;
+
+ /* "buffers.pxd":191
+ * if base: base[0] = <void *>bptr
+ * if size: size[0] = <Py_ssize_t>blen
+ * if itemsize: itemsize[0] = <Py_ssize_t>bitemlen # <<<<<<<<<<<<<<
+ *
+ * if PY_MAJOR_VERSION >= 3 and bfmt is not None:
+ */
+ __pyx_t_17 = (__pyx_v_itemsize != 0);
+ if (__pyx_t_17) {
+ (__pyx_v_itemsize[0]) = ((Py_ssize_t)__pyx_v_bitemlen);
+ goto __pyx_L34;
+ }
+ __pyx_L34:;
+
+ /* "buffers.pxd":193
+ * if itemsize: itemsize[0] = <Py_ssize_t>bitemlen
+ *
+ * if PY_MAJOR_VERSION >= 3 and bfmt is not None: # <<<<<<<<<<<<<<
+ * return bfmt.decode('ascii')
+ * return bfmt
+ */
+ __pyx_t_1 = ((PY_MAJOR_VERSION >= 3) != 0);
+ if (__pyx_t_1) {
+ } else {
+ __pyx_t_17 = __pyx_t_1;
+ goto __pyx_L36_bool_binop_done;
+ }
+ __pyx_t_1 = (__pyx_v_bfmt != Py_None);
+ __pyx_t_18 = (__pyx_t_1 != 0);
+ __pyx_t_17 = __pyx_t_18;
+ __pyx_L36_bool_binop_done:;
+ if (__pyx_t_17) {
+
+ /* "buffers.pxd":194
+ *
+ * if PY_MAJOR_VERSION >= 3 and bfmt is not None:
+ * return bfmt.decode('ascii') # <<<<<<<<<<<<<<
+ * return bfmt
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_bfmt, __pyx_n_s_decode); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "buffers.pxd":195
+ * if PY_MAJOR_VERSION >= 3 and bfmt is not None:
+ * return bfmt.decode('ascii')
+ * return bfmt # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_bfmt);
+ __pyx_r = __pyx_v_bfmt;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":114
+ *
+ *
+ * cdef inline object asbuffer(object ob, int writable, int format, # <<<<<<<<<<<<<<
+ * void **base, Py_ssize_t *size,
+ * Py_ssize_t *itemsize):
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_10);
+ __Pyx_XDECREF(__pyx_t_14);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_XDECREF(__pyx_t_16);
+ __Pyx_AddTraceback("buffers.asbuffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_bfmt);
+ __Pyx_XDECREF(__pyx_v_dtype);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":198
+ *
+ *
+ * cdef inline object asbuffer_r(object ob, void **base, Py_ssize_t *size): # <<<<<<<<<<<<<<
+ * """Wrapper for standard calls to asbuffer with a readonly buffer."""
+ * asbuffer(ob, 0, 0, base, size, NULL)
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_asbuffer_r(PyObject *__pyx_v_ob, void **__pyx_v_base, Py_ssize_t *__pyx_v_size) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("asbuffer_r", 0);
+
+ /* "buffers.pxd":200
+ * cdef inline object asbuffer_r(object ob, void **base, Py_ssize_t *size):
+ * """Wrapper for standard calls to asbuffer with a readonly buffer."""
+ * asbuffer(ob, 0, 0, base, size, NULL) # <<<<<<<<<<<<<<
+ * return ob
+ *
+ */
+ __pyx_t_1 = __pyx_f_7buffers_asbuffer(__pyx_v_ob, 0, 0, __pyx_v_base, __pyx_v_size, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "buffers.pxd":201
+ * """Wrapper for standard calls to asbuffer with a readonly buffer."""
+ * asbuffer(ob, 0, 0, base, size, NULL)
+ * return ob # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_ob);
+ __pyx_r = __pyx_v_ob;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":198
+ *
+ *
+ * cdef inline object asbuffer_r(object ob, void **base, Py_ssize_t *size): # <<<<<<<<<<<<<<
+ * """Wrapper for standard calls to asbuffer with a readonly buffer."""
+ * asbuffer(ob, 0, 0, base, size, NULL)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("buffers.asbuffer_r", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":204
+ *
+ *
+ * cdef inline object asbuffer_w(object ob, void **base, Py_ssize_t *size): # <<<<<<<<<<<<<<
+ * """Wrapper for standard calls to asbuffer with a writable buffer."""
+ * asbuffer(ob, 1, 0, base, size, NULL)
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_asbuffer_w(PyObject *__pyx_v_ob, void **__pyx_v_base, Py_ssize_t *__pyx_v_size) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("asbuffer_w", 0);
+
+ /* "buffers.pxd":206
+ * cdef inline object asbuffer_w(object ob, void **base, Py_ssize_t *size):
+ * """Wrapper for standard calls to asbuffer with a writable buffer."""
+ * asbuffer(ob, 1, 0, base, size, NULL) # <<<<<<<<<<<<<<
+ * return ob
+ *
+ */
+ __pyx_t_1 = __pyx_f_7buffers_asbuffer(__pyx_v_ob, 1, 0, __pyx_v_base, __pyx_v_size, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "buffers.pxd":207
+ * """Wrapper for standard calls to asbuffer with a writable buffer."""
+ * asbuffer(ob, 1, 0, base, size, NULL)
+ * return ob # <<<<<<<<<<<<<<
+ *
+ * #------------------------------------------------------------------------------
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_ob);
+ __pyx_r = __pyx_v_ob;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":204
+ *
+ *
+ * cdef inline object asbuffer_w(object ob, void **base, Py_ssize_t *size): # <<<<<<<<<<<<<<
+ * """Wrapper for standard calls to asbuffer with a writable buffer."""
+ * asbuffer(ob, 1, 0, base, size, NULL)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("buffers.asbuffer_w", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":214
+ *
+ *
+ * cdef inline object frombuffer_3(void *ptr, Py_ssize_t s, int readonly): # <<<<<<<<<<<<<<
+ * """Python 3 version of frombuffer.
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer_3(void *__pyx_v_ptr, Py_ssize_t __pyx_v_s, int __pyx_v_readonly) {
+ Py_buffer __pyx_v_pybuf;
+ Py_ssize_t *__pyx_v_shape;
+ PyObject *__pyx_v_astr = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1[1];
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("frombuffer_3", 0);
+
+ /* "buffers.pxd":221
+ * """
+ * cdef Py_buffer pybuf
+ * cdef Py_ssize_t *shape = [s] # <<<<<<<<<<<<<<
+ * cdef str astr=""
+ * PyBuffer_FillInfo(&pybuf, astr, ptr, s, readonly, PyBUF_SIMPLE)
+ */
+ __pyx_t_1[0] = __pyx_v_s;
+ __pyx_v_shape = __pyx_t_1;
+
+ /* "buffers.pxd":222
+ * cdef Py_buffer pybuf
+ * cdef Py_ssize_t *shape = [s]
+ * cdef str astr="" # <<<<<<<<<<<<<<
+ * PyBuffer_FillInfo(&pybuf, astr, ptr, s, readonly, PyBUF_SIMPLE)
+ * pybuf.format = "B"
+ */
+ __Pyx_INCREF(__pyx_kp_s__7);
+ __pyx_v_astr = __pyx_kp_s__7;
+
+ /* "buffers.pxd":223
+ * cdef Py_ssize_t *shape = [s]
+ * cdef str astr=""
+ * PyBuffer_FillInfo(&pybuf, astr, ptr, s, readonly, PyBUF_SIMPLE) # <<<<<<<<<<<<<<
+ * pybuf.format = "B"
+ * pybuf.shape = shape
+ */
+ __pyx_t_2 = PyBuffer_FillInfo((&__pyx_v_pybuf), __pyx_v_astr, __pyx_v_ptr, __pyx_v_s, __pyx_v_readonly, PyBUF_SIMPLE); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "buffers.pxd":224
+ * cdef str astr=""
+ * PyBuffer_FillInfo(&pybuf, astr, ptr, s, readonly, PyBUF_SIMPLE)
+ * pybuf.format = "B" # <<<<<<<<<<<<<<
+ * pybuf.shape = shape
+ * return PyMemoryView_FromBuffer(&pybuf)
+ */
+ __pyx_v_pybuf.format = __pyx_k_B;
+
+ /* "buffers.pxd":225
+ * PyBuffer_FillInfo(&pybuf, astr, ptr, s, readonly, PyBUF_SIMPLE)
+ * pybuf.format = "B"
+ * pybuf.shape = shape # <<<<<<<<<<<<<<
+ * return PyMemoryView_FromBuffer(&pybuf)
+ *
+ */
+ __pyx_v_pybuf.shape = __pyx_v_shape;
+
+ /* "buffers.pxd":226
+ * pybuf.format = "B"
+ * pybuf.shape = shape
+ * return PyMemoryView_FromBuffer(&pybuf) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = PyMemoryView_FromBuffer((&__pyx_v_pybuf)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":214
+ *
+ *
+ * cdef inline object frombuffer_3(void *ptr, Py_ssize_t s, int readonly): # <<<<<<<<<<<<<<
+ * """Python 3 version of frombuffer.
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("buffers.frombuffer_3", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_astr);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":229
+ *
+ *
+ * cdef inline object frombuffer_2(void *ptr, Py_ssize_t s, int readonly): # <<<<<<<<<<<<<<
+ * """Python 2 version of frombuffer.
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer_2(void *__pyx_v_ptr, Py_ssize_t __pyx_v_s, int __pyx_v_readonly) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("frombuffer_2", 0);
+
+ /* "buffers.pxd":235
+ * """
+ *
+ * if oldstyle_available(): # <<<<<<<<<<<<<<
+ * if readonly:
+ * return PyBuffer_FromMemory(ptr, s)
+ */
+ __pyx_t_1 = (__pyx_f_7buffers_oldstyle_available() != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":236
+ *
+ * if oldstyle_available():
+ * if readonly: # <<<<<<<<<<<<<<
+ * return PyBuffer_FromMemory(ptr, s)
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_readonly != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":237
+ * if oldstyle_available():
+ * if readonly:
+ * return PyBuffer_FromMemory(ptr, s) # <<<<<<<<<<<<<<
+ * else:
+ * return PyBuffer_FromReadWriteMemory(ptr, s)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyBuffer_FromMemory(__pyx_v_ptr, __pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":239
+ * return PyBuffer_FromMemory(ptr, s)
+ * else:
+ * return PyBuffer_FromReadWriteMemory(ptr, s) # <<<<<<<<<<<<<<
+ * else:
+ * raise NotImplementedError("Old style buffers not available.")
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyBuffer_FromReadWriteMemory(__pyx_v_ptr, __pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":241
+ * return PyBuffer_FromReadWriteMemory(ptr, s)
+ * else:
+ * raise NotImplementedError("Old style buffers not available.") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ {__pyx_filename = __pyx_f[3]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "buffers.pxd":229
+ *
+ *
+ * cdef inline object frombuffer_2(void *ptr, Py_ssize_t s, int readonly): # <<<<<<<<<<<<<<
+ * """Python 2 version of frombuffer.
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("buffers.frombuffer_2", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":244
+ *
+ *
+ * cdef inline object frombuffer(void *ptr, Py_ssize_t s, int readonly): # <<<<<<<<<<<<<<
+ * """Create a Python Buffer/View of a C array.
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer(void *__pyx_v_ptr, Py_ssize_t __pyx_v_s, int __pyx_v_readonly) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("frombuffer", 0);
+
+ /* "buffers.pxd":261
+ * """
+ * # oldstyle first priority for now
+ * if oldstyle_available(): # <<<<<<<<<<<<<<
+ * return frombuffer_2(ptr, s, readonly)
+ * else:
+ */
+ __pyx_t_1 = (__pyx_f_7buffers_oldstyle_available() != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":262
+ * # oldstyle first priority for now
+ * if oldstyle_available():
+ * return frombuffer_2(ptr, s, readonly) # <<<<<<<<<<<<<<
+ * else:
+ * return frombuffer_3(ptr, s, readonly)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_f_7buffers_frombuffer_2(__pyx_v_ptr, __pyx_v_s, __pyx_v_readonly); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":264
+ * return frombuffer_2(ptr, s, readonly)
+ * else:
+ * return frombuffer_3(ptr, s, readonly) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_f_7buffers_frombuffer_3(__pyx_v_ptr, __pyx_v_s, __pyx_v_readonly); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "buffers.pxd":244
+ *
+ *
+ * cdef inline object frombuffer(void *ptr, Py_ssize_t s, int readonly): # <<<<<<<<<<<<<<
+ * """Create a Python Buffer/View of a C array.
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("buffers.frombuffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":267
+ *
+ *
+ * cdef inline object frombuffer_r(void *ptr, Py_ssize_t s): # <<<<<<<<<<<<<<
+ * """Wrapper for readonly view frombuffer."""
+ * return frombuffer(ptr, s, 1)
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer_r(void *__pyx_v_ptr, Py_ssize_t __pyx_v_s) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("frombuffer_r", 0);
+
+ /* "buffers.pxd":269
+ * cdef inline object frombuffer_r(void *ptr, Py_ssize_t s):
+ * """Wrapper for readonly view frombuffer."""
+ * return frombuffer(ptr, s, 1) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_f_7buffers_frombuffer(__pyx_v_ptr, __pyx_v_s, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":267
+ *
+ *
+ * cdef inline object frombuffer_r(void *ptr, Py_ssize_t s): # <<<<<<<<<<<<<<
+ * """Wrapper for readonly view frombuffer."""
+ * return frombuffer(ptr, s, 1)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("buffers.frombuffer_r", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":272
+ *
+ *
+ * cdef inline object frombuffer_w(void *ptr, Py_ssize_t s): # <<<<<<<<<<<<<<
+ * """Wrapper for writable view frombuffer."""
+ * return frombuffer(ptr, s, 0)
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer_w(void *__pyx_v_ptr, Py_ssize_t __pyx_v_s) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("frombuffer_w", 0);
+
+ /* "buffers.pxd":274
+ * cdef inline object frombuffer_w(void *ptr, Py_ssize_t s):
+ * """Wrapper for writable view frombuffer."""
+ * return frombuffer(ptr, s, 0) # <<<<<<<<<<<<<<
+ *
+ * #------------------------------------------------------------------------------
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_f_7buffers_frombuffer(__pyx_v_ptr, __pyx_v_s, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":272
+ *
+ *
+ * cdef inline object frombuffer_w(void *ptr, Py_ssize_t s): # <<<<<<<<<<<<<<
+ * """Wrapper for writable view frombuffer."""
+ * return frombuffer(ptr, s, 0)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("buffers.frombuffer_w", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":281
+ * #------------------------------------------------------------------------------
+ *
+ * cdef inline object viewfromobject(object obj, int readonly): # <<<<<<<<<<<<<<
+ * """Construct a Python Buffer/View object from another Python object.
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_viewfromobject(PyObject *__pyx_v_obj, int __pyx_v_readonly) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("viewfromobject", 0);
+
+ /* "buffers.pxd":297
+ * Buffer/View of the original object.
+ * """
+ * if not memoryview_available(): # <<<<<<<<<<<<<<
+ * if readonly:
+ * return PyBuffer_FromObject(obj, 0, Py_END_OF_BUFFER)
+ */
+ __pyx_t_1 = ((!(__pyx_f_7buffers_memoryview_available() != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":298
+ * """
+ * if not memoryview_available():
+ * if readonly: # <<<<<<<<<<<<<<
+ * return PyBuffer_FromObject(obj, 0, Py_END_OF_BUFFER)
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_readonly != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":299
+ * if not memoryview_available():
+ * if readonly:
+ * return PyBuffer_FromObject(obj, 0, Py_END_OF_BUFFER) # <<<<<<<<<<<<<<
+ * else:
+ * return PyBuffer_FromReadWriteObject(obj, 0, Py_END_OF_BUFFER)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyBuffer_FromObject(__pyx_v_obj, 0, Py_END_OF_BUFFER); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":301
+ * return PyBuffer_FromObject(obj, 0, Py_END_OF_BUFFER)
+ * else:
+ * return PyBuffer_FromReadWriteObject(obj, 0, Py_END_OF_BUFFER) # <<<<<<<<<<<<<<
+ * else:
+ * return PyMemoryView_FromObject(obj)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyBuffer_FromReadWriteObject(__pyx_v_obj, 0, Py_END_OF_BUFFER); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":303
+ * return PyBuffer_FromReadWriteObject(obj, 0, Py_END_OF_BUFFER)
+ * else:
+ * return PyMemoryView_FromObject(obj) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyMemoryView_FromObject(__pyx_v_obj); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "buffers.pxd":281
+ * #------------------------------------------------------------------------------
+ *
+ * cdef inline object viewfromobject(object obj, int readonly): # <<<<<<<<<<<<<<
+ * """Construct a Python Buffer/View object from another Python object.
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("buffers.viewfromobject", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":306
+ *
+ *
+ * cdef inline object viewfromobject_r(object obj): # <<<<<<<<<<<<<<
+ * """Wrapper for readonly viewfromobject."""
+ * return viewfromobject(obj, 1)
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_viewfromobject_r(PyObject *__pyx_v_obj) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("viewfromobject_r", 0);
+
+ /* "buffers.pxd":308
+ * cdef inline object viewfromobject_r(object obj):
+ * """Wrapper for readonly viewfromobject."""
+ * return viewfromobject(obj, 1) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_f_7buffers_viewfromobject(__pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":306
+ *
+ *
+ * cdef inline object viewfromobject_r(object obj): # <<<<<<<<<<<<<<
+ * """Wrapper for readonly viewfromobject."""
+ * return viewfromobject(obj, 1)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("buffers.viewfromobject_r", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":311
+ *
+ *
+ * cdef inline object viewfromobject_w(object obj): # <<<<<<<<<<<<<<
+ * """Wrapper for writable viewfromobject."""
+ * return viewfromobject(obj, 0)
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_viewfromobject_w(PyObject *__pyx_v_obj) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("viewfromobject_w", 0);
+
+ /* "buffers.pxd":313
+ * cdef inline object viewfromobject_w(object obj):
+ * """Wrapper for writable viewfromobject."""
+ * return viewfromobject(obj, 0) # <<<<<<<<<<<<<<
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_f_7buffers_viewfromobject(__pyx_v_obj, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":311
+ *
+ *
+ * cdef inline object viewfromobject_w(object obj): # <<<<<<<<<<<<<<
+ * """Wrapper for writable viewfromobject."""
+ * return viewfromobject(obj, 0)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("buffers.viewfromobject_w", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_tp_new_3zmq_7backend_6cython_7message_MessageTracker(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_3zmq_7backend_6cython_7message_MessageTracker *p;
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_obj_3zmq_7backend_6cython_7message_MessageTracker *)o);
+ p->events = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ p->peers = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ return o;
+}
+
+static void __pyx_tp_dealloc_3zmq_7backend_6cython_7message_MessageTracker(PyObject *o) {
+ struct __pyx_obj_3zmq_7backend_6cython_7message_MessageTracker *p = (struct __pyx_obj_3zmq_7backend_6cython_7message_MessageTracker *)o;
+ #if PY_VERSION_HEX >= 0x030400a1
+ if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->events);
+ Py_CLEAR(p->peers);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+
+static int __pyx_tp_traverse_3zmq_7backend_6cython_7message_MessageTracker(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_obj_3zmq_7backend_6cython_7message_MessageTracker *p = (struct __pyx_obj_3zmq_7backend_6cython_7message_MessageTracker *)o;
+ if (p->events) {
+ e = (*v)(p->events, a); if (e) return e;
+ }
+ if (p->peers) {
+ e = (*v)(p->peers, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_3zmq_7backend_6cython_7message_MessageTracker(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_obj_3zmq_7backend_6cython_7message_MessageTracker *p = (struct __pyx_obj_3zmq_7backend_6cython_7message_MessageTracker *)o;
+ tmp = ((PyObject*)p->events);
+ p->events = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->peers);
+ p->peers = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ return 0;
+}
+
+static PyTypeObject __pyx_type_3zmq_7backend_6cython_7message_MessageTracker = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "zmq.backend.cython.message.MessageTracker", /*tp_name*/
+ sizeof(struct __pyx_obj_3zmq_7backend_6cython_7message_MessageTracker), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_3zmq_7backend_6cython_7message_MessageTracker, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_3zmq_7backend_6cython_7message_MessageTracker, /*tp_traverse*/
+ __pyx_tp_clear_3zmq_7backend_6cython_7message_MessageTracker, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ 0, /*tp_methods*/
+ 0, /*tp_members*/
+ 0, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_3zmq_7backend_6cython_7message_MessageTracker, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+static struct __pyx_vtabstruct_3zmq_7backend_6cython_7message_Frame __pyx_vtable_3zmq_7backend_6cython_7message_Frame;
+
+static PyObject *__pyx_tp_new_3zmq_7backend_6cython_7message_Frame(PyTypeObject *t, PyObject *a, PyObject *k) {
+ struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *p;
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)o);
+ p->__pyx_vtab = __pyx_vtabptr_3zmq_7backend_6cython_7message_Frame;
+ p->_data = Py_None; Py_INCREF(Py_None);
+ p->_buffer = Py_None; Py_INCREF(Py_None);
+ p->_bytes = Py_None; Py_INCREF(Py_None);
+ p->tracker_event = Py_None; Py_INCREF(Py_None);
+ p->tracker = Py_None; Py_INCREF(Py_None);
+ if (unlikely(__pyx_pw_3zmq_7backend_6cython_7message_5Frame_1__cinit__(o, a, k) < 0)) {
+ Py_DECREF(o); o = 0;
+ }
+ return o;
+}
+
+static void __pyx_tp_dealloc_3zmq_7backend_6cython_7message_Frame(PyObject *o) {
+ struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *p = (struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)o;
+ #if PY_VERSION_HEX >= 0x030400a1
+ if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ PyObject_GC_UnTrack(o);
+ {
+ PyObject *etype, *eval, *etb;
+ PyErr_Fetch(&etype, &eval, &etb);
+ ++Py_REFCNT(o);
+ __pyx_pw_3zmq_7backend_6cython_7message_5Frame_5__dealloc__(o);
+ --Py_REFCNT(o);
+ PyErr_Restore(etype, eval, etb);
+ }
+ Py_CLEAR(p->_data);
+ Py_CLEAR(p->_buffer);
+ Py_CLEAR(p->_bytes);
+ Py_CLEAR(p->tracker_event);
+ Py_CLEAR(p->tracker);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+
+static int __pyx_tp_traverse_3zmq_7backend_6cython_7message_Frame(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *p = (struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)o;
+ if (p->_data) {
+ e = (*v)(p->_data, a); if (e) return e;
+ }
+ if (p->_buffer) {
+ e = (*v)(p->_buffer, a); if (e) return e;
+ }
+ if (p->_bytes) {
+ e = (*v)(p->_bytes, a); if (e) return e;
+ }
+ if (p->tracker_event) {
+ e = (*v)(p->tracker_event, a); if (e) return e;
+ }
+ if (p->tracker) {
+ e = (*v)(p->tracker, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_3zmq_7backend_6cython_7message_Frame(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *p = (struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)o;
+ tmp = ((PyObject*)p->_data);
+ p->_data = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->_buffer);
+ p->_buffer = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->_bytes);
+ p->_bytes = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->tracker_event);
+ p->tracker_event = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->tracker);
+ p->tracker = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ return 0;
+}
+
+static PyObject *__pyx_getprop_3zmq_7backend_6cython_7message_5Frame_tracker_event(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_3zmq_7backend_6cython_7message_5Frame_13tracker_event_1__get__(o);
+}
+
+static int __pyx_setprop_3zmq_7backend_6cython_7message_5Frame_tracker_event(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
+ if (v) {
+ return __pyx_pw_3zmq_7backend_6cython_7message_5Frame_13tracker_event_3__set__(o, v);
+ }
+ else {
+ return __pyx_pw_3zmq_7backend_6cython_7message_5Frame_13tracker_event_5__del__(o);
+ }
+}
+
+static PyObject *__pyx_getprop_3zmq_7backend_6cython_7message_5Frame_tracker(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_3zmq_7backend_6cython_7message_5Frame_7tracker_1__get__(o);
+}
+
+static int __pyx_setprop_3zmq_7backend_6cython_7message_5Frame_tracker(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
+ if (v) {
+ return __pyx_pw_3zmq_7backend_6cython_7message_5Frame_7tracker_3__set__(o, v);
+ }
+ else {
+ return __pyx_pw_3zmq_7backend_6cython_7message_5Frame_7tracker_5__del__(o);
+ }
+}
+
+static PyObject *__pyx_getprop_3zmq_7backend_6cython_7message_5Frame_more(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_3zmq_7backend_6cython_7message_5Frame_4more_1__get__(o);
+}
+
+static int __pyx_setprop_3zmq_7backend_6cython_7message_5Frame_more(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
+ if (v) {
+ return __pyx_pw_3zmq_7backend_6cython_7message_5Frame_4more_3__set__(o, v);
+ }
+ else {
+ PyErr_SetString(PyExc_NotImplementedError, "__del__");
+ return -1;
+ }
+}
+
+static PyMethodDef __pyx_methods_3zmq_7backend_6cython_7message_Frame[] = {
+ {"__copy__", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_7message_5Frame_13__copy__, METH_NOARGS, __pyx_doc_3zmq_7backend_6cython_7message_5Frame_12__copy__},
+ {"buffer", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_7message_5Frame_19buffer, METH_NOARGS, __pyx_doc_3zmq_7backend_6cython_7message_5Frame_18buffer},
+ {"bytes", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_7message_5Frame_21bytes, METH_NOARGS, __pyx_doc_3zmq_7backend_6cython_7message_5Frame_20bytes},
+ {"set", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_7message_5Frame_23set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3zmq_7backend_6cython_7message_5Frame_22set},
+ {"get", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_7message_5Frame_25get, METH_O, __pyx_doc_3zmq_7backend_6cython_7message_5Frame_24get},
+ {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets_3zmq_7backend_6cython_7message_Frame[] = {
+ {(char *)"tracker_event", __pyx_getprop_3zmq_7backend_6cython_7message_5Frame_tracker_event, __pyx_setprop_3zmq_7backend_6cython_7message_5Frame_tracker_event, 0, 0},
+ {(char *)"tracker", __pyx_getprop_3zmq_7backend_6cython_7message_5Frame_tracker, __pyx_setprop_3zmq_7backend_6cython_7message_5Frame_tracker, 0, 0},
+ {(char *)"more", __pyx_getprop_3zmq_7backend_6cython_7message_5Frame_more, __pyx_setprop_3zmq_7backend_6cython_7message_5Frame_more, 0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static PySequenceMethods __pyx_tp_as_sequence_Frame = {
+ __pyx_pw_3zmq_7backend_6cython_7message_5Frame_15__len__, /*sq_length*/
+ 0, /*sq_concat*/
+ 0, /*sq_repeat*/
+ 0, /*sq_item*/
+ 0, /*sq_slice*/
+ 0, /*sq_ass_item*/
+ 0, /*sq_ass_slice*/
+ 0, /*sq_contains*/
+ 0, /*sq_inplace_concat*/
+ 0, /*sq_inplace_repeat*/
+};
+
+static PyMappingMethods __pyx_tp_as_mapping_Frame = {
+ __pyx_pw_3zmq_7backend_6cython_7message_5Frame_15__len__, /*mp_length*/
+ 0, /*mp_subscript*/
+ 0, /*mp_ass_subscript*/
+};
+
+static PyBufferProcs __pyx_tp_as_buffer_Frame = {
+ #if PY_MAJOR_VERSION < 3
+ __pyx_pw_3zmq_7backend_6cython_7message_5Frame_11__getreadbuffer__, /*bf_getreadbuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getwritebuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ __pyx_pw_3zmq_7backend_6cython_7message_5Frame_9__getsegcount__, /*bf_getsegcount*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getcharbuffer*/
+ #endif
+ __pyx_pw_3zmq_7backend_6cython_7message_5Frame_7__getbuffer__, /*bf_getbuffer*/
+ 0, /*bf_releasebuffer*/
+};
+
+static PyTypeObject __pyx_type_3zmq_7backend_6cython_7message_Frame = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "zmq.backend.cython.message.Frame", /*tp_name*/
+ sizeof(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_3zmq_7backend_6cython_7message_Frame, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ &__pyx_tp_as_sequence_Frame, /*tp_as_sequence*/
+ &__pyx_tp_as_mapping_Frame, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ __pyx_pw_3zmq_7backend_6cython_7message_5Frame_17__str__, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ &__pyx_tp_as_buffer_Frame, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ "Frame(data=None, track=False)\n\n A zmq message Frame class for non-copy send/recvs.\n\n This class is only needed if you want to do non-copying send and recvs.\n When you pass a string to this class, like ``Frame(s)``, the \n ref-count of `s` is increased by two: once because the Frame saves `s` as \n an instance attribute and another because a ZMQ message is created that\n points to the buffer of `s`. This second ref-count increase makes sure\n that `s` lives until all messages that use it have been sent. Once 0MQ\n sends all the messages and it doesn't need the buffer of s, 0MQ will call\n ``Py_DECREF(s)``.\n\n Parameters\n ----------\n\n data : object, optional\n any object that provides the buffer interface will be used to\n construct the 0MQ message data.\n track : bool [default: False]\n whether a MessageTracker_ should be created to track this object.\n Tracking a message has a cost at creation, because it creates a threadsafe\n Event object.\n \n ", /*tp_doc*/
+ __pyx_tp_traverse_3zmq_7backend_6cython_7message_Frame, /*tp_traverse*/
+ __pyx_tp_clear_3zmq_7backend_6cython_7message_Frame, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_3zmq_7backend_6cython_7message_Frame, /*tp_methods*/
+ 0, /*tp_members*/
+ __pyx_getsets_3zmq_7backend_6cython_7message_Frame, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ __pyx_pw_3zmq_7backend_6cython_7message_5Frame_3__init__, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_3zmq_7backend_6cython_7message_Frame, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+
+static PyMethodDef __pyx_methods[] = {
+ {0, 0, 0, 0}
+};
+
+#if PY_MAJOR_VERSION >= 3
+static struct PyModuleDef __pyx_moduledef = {
+ #if PY_VERSION_HEX < 0x03020000
+ { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
+ #else
+ PyModuleDef_HEAD_INIT,
+ #endif
+ "message",
+ __pyx_k_0MQ_Message_related_classes, /* m_doc */
+ -1, /* m_size */
+ __pyx_methods /* m_methods */,
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL /* m_free */
+};
+#endif
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+ {&__pyx_n_s_Again, __pyx_k_Again, sizeof(__pyx_k_Again), 0, 0, 1, 1},
+ {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
+ {&__pyx_n_b_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 0, 1},
+ {&__pyx_n_s_ContextTerminated, __pyx_k_ContextTerminated, sizeof(__pyx_k_ContextTerminated), 0, 0, 1, 1},
+ {&__pyx_n_s_Event, __pyx_k_Event, sizeof(__pyx_k_Event), 0, 0, 1, 1},
+ {&__pyx_n_s_Event_2, __pyx_k_Event_2, sizeof(__pyx_k_Event_2), 0, 0, 1, 1},
+ {&__pyx_n_s_Frame, __pyx_k_Frame, sizeof(__pyx_k_Frame), 0, 0, 1, 1},
+ {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
+ {&__pyx_n_s_Message, __pyx_k_Message, sizeof(__pyx_k_Message), 0, 0, 1, 1},
+ {&__pyx_n_s_MessageTracker, __pyx_k_MessageTracker, sizeof(__pyx_k_MessageTracker), 0, 0, 1, 1},
+ {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
+ {&__pyx_kp_s_Old_style_buffers_not_available, __pyx_k_Old_style_buffers_not_available, sizeof(__pyx_k_Old_style_buffers_not_available), 0, 0, 1, 0},
+ {&__pyx_n_s_SystemError, __pyx_k_SystemError, sizeof(__pyx_k_SystemError), 0, 0, 1, 1},
+ {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
+ {&__pyx_kp_s_Unicode_objects_not_allowed_Only, __pyx_k_Unicode_objects_not_allowed_Only, sizeof(__pyx_k_Unicode_objects_not_allowed_Only), 0, 0, 1, 0},
+ {&__pyx_n_s_ZMQError, __pyx_k_ZMQError, sizeof(__pyx_k_ZMQError), 0, 0, 1, 1},
+ {&__pyx_kp_s__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 0, 1, 0},
+ {&__pyx_kp_s_accessing_non_existent_buffer_se, __pyx_k_accessing_non_existent_buffer_se, sizeof(__pyx_k_accessing_non_existent_buffer_se), 0, 0, 1, 0},
+ {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
+ {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1},
+ {&__pyx_n_s_basestring, __pyx_k_basestring, sizeof(__pyx_k_basestring), 0, 0, 1, 1},
+ {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1},
+ {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1},
+ {&__pyx_n_s_char, __pyx_k_char, sizeof(__pyx_k_char), 0, 0, 1, 1},
+ {&__pyx_n_s_check_version, __pyx_k_check_version, sizeof(__pyx_k_check_version), 0, 0, 1, 1},
+ {&__pyx_n_s_context, __pyx_k_context, sizeof(__pyx_k_context), 0, 0, 1, 1},
+ {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
+ {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
+ {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
+ {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
+ {&__pyx_kp_s_expected_str_got_r, __pyx_k_expected_str_got_r, sizeof(__pyx_k_expected_str_got_r), 0, 0, 1, 0},
+ {&__pyx_n_s_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 0, 1, 1},
+ {&__pyx_kp_s_get_string_properties, __pyx_k_get_string_properties, sizeof(__pyx_k_get_string_properties), 0, 0, 1, 0},
+ {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+ {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
+ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+ {&__pyx_n_s_option, __pyx_k_option, sizeof(__pyx_k_option), 0, 0, 1, 1},
+ {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
+ {&__pyx_kp_s_r_does_not_provide_a_buffer_int, __pyx_k_r_does_not_provide_a_buffer_int, sizeof(__pyx_k_r_does_not_provide_a_buffer_int), 0, 0, 1, 0},
+ {&__pyx_n_s_store, __pyx_k_store, sizeof(__pyx_k_store), 0, 0, 1, 1},
+ {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+ {&__pyx_n_s_threading, __pyx_k_threading, sizeof(__pyx_k_threading), 0, 0, 1, 1},
+ {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
+ {&__pyx_n_s_track, __pyx_k_track, sizeof(__pyx_k_track), 0, 0, 1, 1},
+ {&__pyx_n_s_typecode, __pyx_k_typecode, sizeof(__pyx_k_typecode), 0, 0, 1, 1},
+ {&__pyx_n_s_underlying, __pyx_k_underlying, sizeof(__pyx_k_underlying), 0, 0, 1, 1},
+ {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1},
+ {&__pyx_n_s_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 0, 1, 1},
+ {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq, __pyx_k_zmq, sizeof(__pyx_k_zmq), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq_error, __pyx_k_zmq_error, sizeof(__pyx_k_zmq_error), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq_utils_garbage, __pyx_k_zmq_utils_garbage, sizeof(__pyx_k_zmq_utils_garbage), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq_utils_strtypes, __pyx_k_zmq_utils_strtypes, sizeof(__pyx_k_zmq_utils_strtypes), 0, 0, 1, 1},
+ {0, 0, 0, 0, 0, 0, 0}
+};
+static int __Pyx_InitCachedBuiltins(void) {
+ __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_SystemError = __Pyx_GetBuiltinName(__pyx_n_s_SystemError); if (!__pyx_builtin_SystemError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+static int __Pyx_InitCachedConstants(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
+
+ /* "zmq/backend/cython/message.pyx":163
+ *
+ * if isinstance(data, unicode):
+ * raise TypeError("Unicode objects not allowed. Only: str/bytes, buffer interfaces.") # <<<<<<<<<<<<<<
+ *
+ * if data is None:
+ */
+ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Unicode_objects_not_allowed_Only); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple_);
+ __Pyx_GIVEREF(__pyx_tuple_);
+
+ /* "zmq/backend/cython/message.pyx":234
+ * cdef Py_ssize_t data_len_c
+ * if idx != 0:
+ * raise SystemError("accessing non-existent buffer segment") # <<<<<<<<<<<<<<
+ * # read-only, because we don't want to allow
+ * # editing of the message in-place
+ */
+ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_accessing_non_existent_buffer_se); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__2);
+ __Pyx_GIVEREF(__pyx_tuple__2);
+
+ /* "zmq/backend/cython/message.pyx":364
+ *
+ * # zmq_msg_gets
+ * _check_version((4,1), "get string properties") # <<<<<<<<<<<<<<
+ * if isinstance(option, unicode):
+ * option = option.encode('utf8')
+ */
+ __pyx_tuple__3 = PyTuple_Pack(2, __pyx_int_4, __pyx_int_1); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__3);
+ __Pyx_GIVEREF(__pyx_tuple__3);
+ __pyx_tuple__4 = PyTuple_Pack(2, __pyx_tuple__3, __pyx_kp_s_get_string_properties); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__4);
+ __Pyx_GIVEREF(__pyx_tuple__4);
+
+ /* "zmq/backend/cython/message.pyx":366
+ * _check_version((4,1), "get string properties")
+ * if isinstance(option, unicode):
+ * option = option.encode('utf8') # <<<<<<<<<<<<<<
+ *
+ * if not isinstance(option, bytes):
+ */
+ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__5);
+ __Pyx_GIVEREF(__pyx_tuple__5);
+
+ /* "buffers.pxd":194
+ *
+ * if PY_MAJOR_VERSION >= 3 and bfmt is not None:
+ * return bfmt.decode('ascii') # <<<<<<<<<<<<<<
+ * return bfmt
+ *
+ */
+ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__6);
+ __Pyx_GIVEREF(__pyx_tuple__6);
+
+ /* "buffers.pxd":241
+ * return PyBuffer_FromReadWriteMemory(ptr, s)
+ * else:
+ * raise NotImplementedError("Old style buffers not available.") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Old_style_buffers_not_available); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__8);
+ __Pyx_GIVEREF(__pyx_tuple__8);
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static int __Pyx_InitGlobals(void) {
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+#if PY_MAJOR_VERSION < 3
+PyMODINIT_FUNC initmessage(void); /*proto*/
+PyMODINIT_FUNC initmessage(void)
+#else
+PyMODINIT_FUNC PyInit_message(void); /*proto*/
+PyMODINIT_FUNC PyInit_message(void)
+#endif
+{
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_t_6;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ #if CYTHON_REFNANNY
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
+ if (!__Pyx_RefNanny) {
+ PyErr_Clear();
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
+ if (!__Pyx_RefNanny)
+ Py_FatalError("failed to import 'refnanny' module");
+ }
+ #endif
+ __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_message(void)", 0);
+ if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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;}
+ __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;}
+ #ifdef __Pyx_CyFunction_USED
+ if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_FusedFunction_USED
+ if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_Generator_USED
+ if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ /*--- Library function declarations ---*/
+ /*--- Threads initialization code ---*/
+ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
+ #ifdef WITH_THREAD /* Python build with threading support? */
+ PyEval_InitThreads();
+ #endif
+ #endif
+ /*--- Module creation code ---*/
+ #if PY_MAJOR_VERSION < 3
+ __pyx_m = Py_InitModule4("message", __pyx_methods, __pyx_k_0MQ_Message_related_classes, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+ #else
+ __pyx_m = PyModule_Create(&__pyx_moduledef);
+ #endif
+ if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_INCREF(__pyx_d);
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_COMPILING_IN_PYPY
+ Py_INCREF(__pyx_b);
+ #endif
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ /*--- Initialize various global constants etc. ---*/
+ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ if (__pyx_module_is_main_zmq__backend__cython__message) {
+ if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ }
+ #if PY_MAJOR_VERSION >= 3
+ {
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!PyDict_GetItemString(modules, "zmq.backend.cython.message")) {
+ if (unlikely(PyDict_SetItemString(modules, "zmq.backend.cython.message", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+ /*--- Builtin init code ---*/
+ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Constants init code ---*/
+ if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Global init code ---*/
+ /*--- Variable export code ---*/
+ /*--- Function export code ---*/
+ /*--- Type init code ---*/
+ if (PyType_Ready(&__pyx_type_3zmq_7backend_6cython_7message_MessageTracker) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type_3zmq_7backend_6cython_7message_MessageTracker.tp_print = 0;
+ if (PyObject_SetAttrString(__pyx_m, "MessageTracker", (PyObject *)&__pyx_type_3zmq_7backend_6cython_7message_MessageTracker) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_3zmq_7backend_6cython_7message_MessageTracker = &__pyx_type_3zmq_7backend_6cython_7message_MessageTracker;
+ __pyx_vtabptr_3zmq_7backend_6cython_7message_Frame = &__pyx_vtable_3zmq_7backend_6cython_7message_Frame;
+ __pyx_vtable_3zmq_7backend_6cython_7message_Frame.fast_copy = (struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *(*)(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *))__pyx_f_3zmq_7backend_6cython_7message_5Frame_fast_copy;
+ __pyx_vtable_3zmq_7backend_6cython_7message_Frame._getbuffer = (PyObject *(*)(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *))__pyx_f_3zmq_7backend_6cython_7message_5Frame__getbuffer;
+ if (PyType_Ready(&__pyx_type_3zmq_7backend_6cython_7message_Frame) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type_3zmq_7backend_6cython_7message_Frame.tp_print = 0;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ {
+ PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_3zmq_7backend_6cython_7message_Frame, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
+ __pyx_wrapperbase_3zmq_7backend_6cython_7message_5Frame_2__init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
+ __pyx_wrapperbase_3zmq_7backend_6cython_7message_5Frame_2__init__.doc = __pyx_doc_3zmq_7backend_6cython_7message_5Frame_2__init__;
+ ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_3zmq_7backend_6cython_7message_5Frame_2__init__;
+ }
+ }
+ #endif
+ #if CYTHON_COMPILING_IN_CPYTHON
+ {
+ PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_3zmq_7backend_6cython_7message_Frame, "__len__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
+ __pyx_wrapperbase_3zmq_7backend_6cython_7message_5Frame_14__len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
+ __pyx_wrapperbase_3zmq_7backend_6cython_7message_5Frame_14__len__.doc = __pyx_doc_3zmq_7backend_6cython_7message_5Frame_14__len__;
+ ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_3zmq_7backend_6cython_7message_5Frame_14__len__;
+ }
+ }
+ #endif
+ #if CYTHON_COMPILING_IN_CPYTHON
+ {
+ PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_3zmq_7backend_6cython_7message_Frame, "__str__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
+ __pyx_wrapperbase_3zmq_7backend_6cython_7message_5Frame_16__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
+ __pyx_wrapperbase_3zmq_7backend_6cython_7message_5Frame_16__str__.doc = __pyx_doc_3zmq_7backend_6cython_7message_5Frame_16__str__;
+ ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_3zmq_7backend_6cython_7message_5Frame_16__str__;
+ }
+ }
+ #endif
+ if (__Pyx_SetVtable(__pyx_type_3zmq_7backend_6cython_7message_Frame.tp_dict, __pyx_vtabptr_3zmq_7backend_6cython_7message_Frame) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttrString(__pyx_m, "Frame", (PyObject *)&__pyx_type_3zmq_7backend_6cython_7message_Frame) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_3zmq_7backend_6cython_7message_Frame = &__pyx_type_3zmq_7backend_6cython_7message_Frame;
+ /*--- Type import code ---*/
+ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
+ #if CYTHON_COMPILING_IN_PYPY
+ sizeof(PyTypeObject),
+ #else
+ sizeof(PyHeapTypeObject),
+ #endif
+ 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Variable import code ---*/
+ /*--- Function import code ---*/
+ /*--- Execution code ---*/
+
+ /* "zmq/backend/cython/message.pyx":43
+ * from libc.string cimport memcpy
+ *
+ * import time # <<<<<<<<<<<<<<
+ *
+ * try:
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/message.pyx":45
+ * import time
+ *
+ * try: # <<<<<<<<<<<<<<
+ * # below 3.3
+ * from threading import _Event as Event
+ */
+ {
+ __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_4);
+ /*try:*/ {
+
+ /* "zmq/backend/cython/message.pyx":47
+ * try:
+ * # below 3.3
+ * from threading import _Event as Event # <<<<<<<<<<<<<<
+ * except (ImportError, AttributeError):
+ * # python throws ImportError, cython throws AttributeError
+ */
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_s_Event_2);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Event_2);
+ __Pyx_GIVEREF(__pyx_n_s_Event_2);
+ __pyx_t_5 = __Pyx_Import(__pyx_n_s_threading, __pyx_t_1, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_Event_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_Event, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ goto __pyx_L9_try_end;
+ __pyx_L2_error:;
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+ /* "zmq/backend/cython/message.pyx":48
+ * # below 3.3
+ * from threading import _Event as Event
+ * except (ImportError, AttributeError): # <<<<<<<<<<<<<<
+ * # python throws ImportError, cython throws AttributeError
+ * from threading import Event
+ */
+ __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_ImportError) || PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
+ if (__pyx_t_6) {
+ __Pyx_AddTraceback("zmq.backend.cython.message", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "zmq/backend/cython/message.pyx":50
+ * except (ImportError, AttributeError):
+ * # python throws ImportError, cython throws AttributeError
+ * from threading import Event # <<<<<<<<<<<<<<
+ *
+ * import zmq
+ */
+ __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_INCREF(__pyx_n_s_Event);
+ PyList_SET_ITEM(__pyx_t_8, 0, __pyx_n_s_Event);
+ __Pyx_GIVEREF(__pyx_n_s_Event);
+ __pyx_t_9 = __Pyx_Import(__pyx_n_s_threading, __pyx_t_8, -1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_Event); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_Event, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ goto __pyx_L3_exception_handled;
+ }
+ goto __pyx_L4_except_error;
+ __pyx_L4_except_error:;
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L1_error;
+ __pyx_L3_exception_handled:;
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ __pyx_L9_try_end:;
+ }
+
+ /* "zmq/backend/cython/message.pyx":52
+ * from threading import Event
+ *
+ * import zmq # <<<<<<<<<<<<<<
+ * from zmq.error import _check_version
+ * from zmq.backend.cython.checkrc cimport _check_rc
+ */
+ __pyx_t_7 = __Pyx_Import(__pyx_n_s_zmq, 0, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_zmq, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "zmq/backend/cython/message.pyx":53
+ *
+ * import zmq
+ * from zmq.error import _check_version # <<<<<<<<<<<<<<
+ * from zmq.backend.cython.checkrc cimport _check_rc
+ * from zmq.utils.strtypes import bytes,unicode,basestring
+ */
+ __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_INCREF(__pyx_n_s_check_version);
+ PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_check_version);
+ __Pyx_GIVEREF(__pyx_n_s_check_version);
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_7, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_check_version); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_version, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/message.pyx":55
+ * from zmq.error import _check_version
+ * from zmq.backend.cython.checkrc cimport _check_rc
+ * from zmq.utils.strtypes import bytes,unicode,basestring # <<<<<<<<<<<<<<
+ *
+ * #-----------------------------------------------------------------------------
+ */
+ __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_s_bytes);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_bytes);
+ __Pyx_GIVEREF(__pyx_n_s_bytes);
+ __Pyx_INCREF(__pyx_n_s_unicode);
+ PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_unicode);
+ __Pyx_GIVEREF(__pyx_n_s_unicode);
+ __Pyx_INCREF(__pyx_n_s_basestring);
+ PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_basestring);
+ __Pyx_GIVEREF(__pyx_n_s_basestring);
+ __pyx_t_7 = __Pyx_Import(__pyx_n_s_zmq_utils_strtypes, __pyx_t_1, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_unicode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_unicode, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_basestring); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "zmq/backend/cython/message.pyx":109
+ * free(hint)
+ *
+ * gc = None # <<<<<<<<<<<<<<
+ *
+ * cdef class Frame:
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_gc, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/message.pyx":307
+ *
+ * @property
+ * def buffer(self): # <<<<<<<<<<<<<<
+ * """A read-only buffer view of the message contents."""
+ * if self._buffer is None:
+ */
+ __pyx_t_7 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_3zmq_7backend_6cython_7message_Frame, __pyx_n_s_buffer); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "zmq/backend/cython/message.pyx":306
+ * return viewfromobject_r(self._data)
+ *
+ * @property # <<<<<<<<<<<<<<
+ * def buffer(self):
+ * """A read-only buffer view of the message contents."""
+ */
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_3zmq_7backend_6cython_7message_Frame->tp_dict, __pyx_n_s_buffer, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ PyType_Modified(__pyx_ptype_3zmq_7backend_6cython_7message_Frame);
+
+ /* "zmq/backend/cython/message.pyx":314
+ *
+ * @property
+ * def bytes(self): # <<<<<<<<<<<<<<
+ * """The message content as a Python bytes object.
+ *
+ */
+ __pyx_t_7 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_3zmq_7backend_6cython_7message_Frame, __pyx_n_s_bytes); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "zmq/backend/cython/message.pyx":313
+ * return self._buffer
+ *
+ * @property # <<<<<<<<<<<<<<
+ * def bytes(self):
+ * """The message content as a Python bytes object.
+ */
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_3zmq_7backend_6cython_7message_Frame->tp_dict, __pyx_n_s_bytes, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ PyType_Modified(__pyx_ptype_3zmq_7backend_6cython_7message_Frame);
+
+ /* "zmq/backend/cython/message.pyx":379
+ *
+ * # legacy Message name
+ * Message = Frame # <<<<<<<<<<<<<<
+ *
+ * __all__ = ['Frame', 'Message']
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_Message, ((PyObject *)((PyObject*)__pyx_ptype_3zmq_7backend_6cython_7message_Frame))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/message.pyx":381
+ * Message = Frame
+ *
+ * __all__ = ['Frame', 'Message'] # <<<<<<<<<<<<<<
+ */
+ __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_INCREF(__pyx_n_s_Frame);
+ PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_Frame);
+ __Pyx_GIVEREF(__pyx_n_s_Frame);
+ __Pyx_INCREF(__pyx_n_s_Message);
+ PyList_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_Message);
+ __Pyx_GIVEREF(__pyx_n_s_Message);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "zmq/backend/cython/message.pyx":1
+ * """0MQ Message related classes.""" # <<<<<<<<<<<<<<
+ *
+ * #
+ */
+ __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "buffers.pxd":311
+ *
+ *
+ * cdef inline object viewfromobject_w(object obj): # <<<<<<<<<<<<<<
+ * """Wrapper for writable viewfromobject."""
+ * return viewfromobject(obj, 0)
+ */
+
+ /*--- Wrapped vars code ---*/
+
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_9);
+ if (__pyx_m) {
+ if (__pyx_d) {
+ __Pyx_AddTraceback("init zmq.backend.cython.message", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ }
+ Py_DECREF(__pyx_m); __pyx_m = 0;
+ } else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ImportError, "init zmq.backend.cython.message");
+ }
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ #if PY_MAJOR_VERSION < 3
+ return;
+ #else
+ return __pyx_m;
+ #endif
+}
+
+/* Runtime support code */
+#if CYTHON_REFNANNY
+static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
+ PyObject *m = NULL, *p = NULL;
+ void *r = NULL;
+ m = PyImport_ImportModule((char *)modname);
+ if (!m) goto end;
+ p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
+ if (!p) goto end;
+ r = PyLong_AsVoidPtr(p);
+end:
+ Py_XDECREF(p);
+ Py_XDECREF(m);
+ return (__Pyx_RefNannyAPIStruct *)r;
+}
+#endif
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
+ PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
+ if (unlikely(!result)) {
+ PyErr_Format(PyExc_NameError,
+#if PY_MAJOR_VERSION >= 3
+ "name '%U' is not defined", name);
+#else
+ "name '%.200s' is not defined", PyString_AS_STRING(name));
+#endif
+ }
+ return result;
+}
+
+static void __Pyx_RaiseDoubleKeywordsError(
+ const char* func_name,
+ PyObject* kw_name)
+{
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION >= 3
+ "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
+ #else
+ "%s() got multiple values for keyword argument '%s'", func_name,
+ PyString_AsString(kw_name));
+ #endif
+}
+
+static int __Pyx_ParseOptionalKeywords(
+ PyObject *kwds,
+ PyObject **argnames[],
+ PyObject *kwds2,
+ PyObject *values[],
+ Py_ssize_t num_pos_args,
+ const char* function_name)
+{
+ PyObject *key = 0, *value = 0;
+ Py_ssize_t pos = 0;
+ PyObject*** name;
+ PyObject*** first_kw_arg = argnames + num_pos_args;
+ while (PyDict_Next(kwds, &pos, &key, &value)) {
+ name = first_kw_arg;
+ while (*name && (**name != key)) name++;
+ if (*name) {
+ values[name-argnames] = value;
+ continue;
+ }
+ name = first_kw_arg;
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
+ while (*name) {
+ if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**name, key)) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ if ((**argname == key) || (
+ (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**argname, key))) {
+ goto arg_passed_twice;
+ }
+ argname++;
+ }
+ }
+ } else
+ #endif
+ if (likely(PyUnicode_Check(key))) {
+ while (*name) {
+ int cmp = (**name == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**name, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ int cmp = (**argname == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**argname, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) goto arg_passed_twice;
+ argname++;
+ }
+ }
+ } else
+ goto invalid_keyword_type;
+ if (kwds2) {
+ if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
+ } else {
+ goto invalid_keyword;
+ }
+ }
+ return 0;
+arg_passed_twice:
+ __Pyx_RaiseDoubleKeywordsError(function_name, key);
+ goto bad;
+invalid_keyword_type:
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() keywords must be strings", function_name);
+ goto bad;
+invalid_keyword:
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION < 3
+ "%.200s() got an unexpected keyword argument '%.200s'",
+ function_name, PyString_AsString(key));
+ #else
+ "%s() got an unexpected keyword argument '%U'",
+ function_name, key);
+ #endif
+bad:
+ return -1;
+}
+
+static void __Pyx_RaiseArgtupleInvalid(
+ const char* func_name,
+ int exact,
+ Py_ssize_t num_min,
+ Py_ssize_t num_max,
+ Py_ssize_t num_found)
+{
+ Py_ssize_t num_expected;
+ const char *more_or_less;
+ if (num_found < num_min) {
+ num_expected = num_min;
+ more_or_less = "at least";
+ } else {
+ num_expected = num_max;
+ more_or_less = "at most";
+ }
+ if (exact) {
+ more_or_less = "exactly";
+ }
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+ func_name, more_or_less, num_expected,
+ (num_expected == 1) ? "" : "s", num_found);
+}
+
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
+ PyObject *result;
+#if CYTHON_COMPILING_IN_CPYTHON
+ result = PyDict_GetItem(__pyx_d, name);
+ if (likely(result)) {
+ Py_INCREF(result);
+ } else {
+#else
+ result = PyObject_GetItem(__pyx_d, name);
+ if (!result) {
+ PyErr_Clear();
+#endif
+ result = __Pyx_GetBuiltinName(name);
+ }
+ return result;
+}
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+ PyObject *result;
+ ternaryfunc call = func->ob_type->tp_call;
+ if (unlikely(!call))
+ return PyObject_Call(func, arg, kw);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = (*call)(func, arg, kw);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
+ PyObject *self, *result;
+ PyCFunction cfunc;
+ cfunc = PyCFunction_GET_FUNCTION(func);
+ self = PyCFunction_GET_SELF(func);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = cfunc(self, arg);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject *result;
+ PyObject *args = PyTuple_New(1);
+ if (unlikely(!args)) return NULL;
+ Py_INCREF(arg);
+ PyTuple_SET_ITEM(args, 0, arg);
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#ifdef __Pyx_CyFunction_USED
+ if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+ if (likely(PyCFunction_Check(func))) {
+#endif
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
+ return __Pyx_PyObject_CallMethO(func, arg);
+ }
+ }
+ return __Pyx__PyObject_CallOneArg(func, arg);
+}
+#else
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject* args = PyTuple_Pack(1, arg);
+ return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
+#ifdef __Pyx_CyFunction_USED
+ if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+ if (likely(PyCFunction_Check(func))) {
+#endif
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
+ return __Pyx_PyObject_CallMethO(func, NULL);
+ }
+ }
+ return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
+}
+#endif
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyThreadState *tstate = PyThreadState_GET();
+ tmp_type = tstate->curexc_type;
+ tmp_value = tstate->curexc_value;
+ tmp_tb = tstate->curexc_traceback;
+ tstate->curexc_type = type;
+ tstate->curexc_value = value;
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_Restore(type, value, tb);
+#endif
+}
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ *type = tstate->curexc_type;
+ *value = tstate->curexc_value;
+ *tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(type, value, tb);
+#endif
+}
+
+#if PY_MAJOR_VERSION < 3
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
+ CYTHON_UNUSED PyObject *cause) {
+ Py_XINCREF(type);
+ if (!value || value == Py_None)
+ value = NULL;
+ else
+ Py_INCREF(value);
+ if (!tb || tb == Py_None)
+ tb = NULL;
+ else {
+ Py_INCREF(tb);
+ if (!PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto raise_error;
+ }
+ }
+ if (PyType_Check(type)) {
+#if CYTHON_COMPILING_IN_PYPY
+ if (!value) {
+ Py_INCREF(Py_None);
+ value = Py_None;
+ }
+#endif
+ PyErr_NormalizeException(&type, &value, &tb);
+ } else {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto raise_error;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(type);
+ Py_INCREF(type);
+ if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto raise_error;
+ }
+ }
+ __Pyx_ErrRestore(type, value, tb);
+ return;
+raise_error:
+ Py_XDECREF(value);
+ Py_XDECREF(type);
+ Py_XDECREF(tb);
+ return;
+}
+#else
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
+ PyObject* owned_instance = NULL;
+ if (tb == Py_None) {
+ tb = 0;
+ } else if (tb && !PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto bad;
+ }
+ if (value == Py_None)
+ value = 0;
+ if (PyExceptionInstance_Check(type)) {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto bad;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(value);
+ } else if (PyExceptionClass_Check(type)) {
+ PyObject *instance_class = NULL;
+ if (value && PyExceptionInstance_Check(value)) {
+ instance_class = (PyObject*) Py_TYPE(value);
+ if (instance_class != type) {
+ if (PyObject_IsSubclass(instance_class, type)) {
+ type = instance_class;
+ } else {
+ instance_class = NULL;
+ }
+ }
+ }
+ if (!instance_class) {
+ PyObject *args;
+ if (!value)
+ args = PyTuple_New(0);
+ else if (PyTuple_Check(value)) {
+ Py_INCREF(value);
+ args = value;
+ } else
+ args = PyTuple_Pack(1, value);
+ if (!args)
+ goto bad;
+ owned_instance = PyObject_Call(type, args, NULL);
+ Py_DECREF(args);
+ if (!owned_instance)
+ goto bad;
+ value = owned_instance;
+ if (!PyExceptionInstance_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "calling %R should have returned an instance of "
+ "BaseException, not %R",
+ type, Py_TYPE(value));
+ goto bad;
+ }
+ }
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto bad;
+ }
+#if PY_VERSION_HEX >= 0x03030000
+ if (cause) {
+#else
+ if (cause && cause != Py_None) {
+#endif
+ PyObject *fixed_cause;
+ if (cause == Py_None) {
+ fixed_cause = NULL;
+ } else if (PyExceptionClass_Check(cause)) {
+ fixed_cause = PyObject_CallObject(cause, NULL);
+ if (fixed_cause == NULL)
+ goto bad;
+ } else if (PyExceptionInstance_Check(cause)) {
+ fixed_cause = cause;
+ Py_INCREF(fixed_cause);
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "exception causes must derive from "
+ "BaseException");
+ goto bad;
+ }
+ PyException_SetCause(value, fixed_cause);
+ }
+ PyErr_SetObject(type, value);
+ if (tb) {
+#if CYTHON_COMPILING_IN_PYPY
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyErr_Fetch(tmp_type, tmp_value, tmp_tb);
+ Py_INCREF(tb);
+ PyErr_Restore(tmp_type, tmp_value, tb);
+ Py_XDECREF(tmp_tb);
+#else
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject* tmp_tb = tstate->curexc_traceback;
+ if (tb != tmp_tb) {
+ Py_INCREF(tb);
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_tb);
+ }
+#endif
+ }
+bad:
+ Py_XDECREF(owned_instance);
+ return;
+}
+#endif
+
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
+ PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
+ if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Format(PyExc_ImportError,
+ #if PY_MAJOR_VERSION < 3
+ "cannot import name %.230s", PyString_AS_STRING(name));
+ #else
+ "cannot import name %S", name);
+ #endif
+ }
+ return value;
+}
+
+static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
+ CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
+ int full_traceback) {
+ PyObject *old_exc, *old_val, *old_tb;
+ PyObject *ctx;
+ __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
+ if (full_traceback) {
+ Py_XINCREF(old_exc);
+ Py_XINCREF(old_val);
+ Py_XINCREF(old_tb);
+ __Pyx_ErrRestore(old_exc, old_val, old_tb);
+ PyErr_PrintEx(1);
+ }
+ #if PY_MAJOR_VERSION < 3
+ ctx = PyString_FromString(name);
+ #else
+ ctx = PyUnicode_FromString(name);
+ #endif
+ __Pyx_ErrRestore(old_exc, old_val, old_tb);
+ if (!ctx) {
+ PyErr_WriteUnraisable(Py_None);
+ } else {
+ PyErr_WriteUnraisable(ctx);
+ Py_DECREF(ctx);
+ }
+}
+
+static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+ const char* cstring, Py_ssize_t start, Py_ssize_t stop,
+ const char* encoding, const char* errors,
+ PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
+ Py_ssize_t length;
+ if (unlikely((start < 0) | (stop < 0))) {
+ length = strlen(cstring);
+ if (start < 0) {
+ start += length;
+ if (start < 0)
+ start = 0;
+ }
+ if (stop < 0)
+ stop += length;
+ }
+ length = stop - start;
+ if (unlikely(length <= 0))
+ return PyUnicode_FromUnicode(NULL, 0);
+ cstring += start;
+ if (decode_func) {
+ return decode_func(cstring, length, errors);
+ } else {
+ return PyUnicode_Decode(cstring, length, encoding, errors);
+ }
+}
+
+static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ *type = tstate->exc_type;
+ *value = tstate->exc_value;
+ *tb = tstate->exc_traceback;
+ Py_XINCREF(*type);
+ Py_XINCREF(*value);
+ Py_XINCREF(*tb);
+#else
+ PyErr_GetExcInfo(type, value, tb);
+#endif
+}
+static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyThreadState *tstate = PyThreadState_GET();
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = type;
+ tstate->exc_value = value;
+ tstate->exc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_SetExcInfo(type, value, tb);
+#endif
+}
+
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *local_type, *local_value, *local_tb;
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyThreadState *tstate = PyThreadState_GET();
+ local_type = tstate->curexc_type;
+ local_value = tstate->curexc_value;
+ local_tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(&local_type, &local_value, &local_tb);
+#endif
+ PyErr_NormalizeException(&local_type, &local_value, &local_tb);
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(tstate->curexc_type))
+#else
+ if (unlikely(PyErr_Occurred()))
+#endif
+ goto bad;
+ #if PY_MAJOR_VERSION >= 3
+ if (local_tb) {
+ if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
+ goto bad;
+ }
+ #endif
+ Py_XINCREF(local_tb);
+ Py_XINCREF(local_type);
+ Py_XINCREF(local_value);
+ *type = local_type;
+ *value = local_value;
+ *tb = local_tb;
+#if CYTHON_COMPILING_IN_CPYTHON
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = local_type;
+ tstate->exc_value = local_value;
+ tstate->exc_traceback = local_tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_SetExcInfo(local_type, local_value, local_tb);
+#endif
+ return 0;
+bad:
+ *type = 0;
+ *value = 0;
+ *tb = 0;
+ Py_XDECREF(local_type);
+ Py_XDECREF(local_value);
+ Py_XDECREF(local_tb);
+ return -1;
+}
+
+static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
+#if PY_VERSION_HEX >= 0x02070000
+ PyObject *ob = PyCapsule_New(vtable, 0, 0);
+#else
+ PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
+#endif
+ if (!ob)
+ goto bad;
+ if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
+ goto bad;
+ Py_DECREF(ob);
+ return 0;
+bad:
+ Py_XDECREF(ob);
+ return -1;
+}
+
+static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) {
+ PyObject *result;
+ result = __Pyx_PyObject_GetAttrStr(nmspace, name);
+ if (!result)
+ result = __Pyx_GetModuleGlobalName(name);
+ return result;
+}
+
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+ int start = 0, mid = 0, end = count - 1;
+ if (end >= 0 && code_line > entries[end].code_line) {
+ return count;
+ }
+ while (start < end) {
+ mid = (start + end) / 2;
+ if (code_line < entries[mid].code_line) {
+ end = mid;
+ } else if (code_line > entries[mid].code_line) {
+ start = mid + 1;
+ } else {
+ return mid;
+ }
+ }
+ if (code_line <= entries[mid].code_line) {
+ return mid;
+ } else {
+ return mid + 1;
+ }
+}
+static PyCodeObject *__pyx_find_code_object(int code_line) {
+ PyCodeObject* code_object;
+ int pos;
+ if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
+ return NULL;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
+ return NULL;
+ }
+ code_object = __pyx_code_cache.entries[pos].code_object;
+ Py_INCREF(code_object);
+ return code_object;
+}
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
+ int pos, i;
+ __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
+ if (unlikely(!code_line)) {
+ return;
+ }
+ if (unlikely(!entries)) {
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (likely(entries)) {
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = 64;
+ __pyx_code_cache.count = 1;
+ entries[0].code_line = code_line;
+ entries[0].code_object = code_object;
+ Py_INCREF(code_object);
+ }
+ return;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
+ PyCodeObject* tmp = entries[pos].code_object;
+ entries[pos].code_object = code_object;
+ Py_DECREF(tmp);
+ return;
+ }
+ if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
+ int new_max = __pyx_code_cache.max_count + 64;
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
+ __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (unlikely(!entries)) {
+ return;
+ }
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = new_max;
+ }
+ for (i=__pyx_code_cache.count; i>pos; i--) {
+ entries[i] = entries[i-1];
+ }
+ entries[pos].code_line = code_line;
+ entries[pos].code_object = code_object;
+ __pyx_code_cache.count++;
+ Py_INCREF(code_object);
+}
+
+#include "compile.h"
+#include "frameobject.h"
+#include "traceback.h"
+static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
+ const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyObject *py_srcfile = 0;
+ PyObject *py_funcname = 0;
+ #if PY_MAJOR_VERSION < 3
+ py_srcfile = PyString_FromString(filename);
+ #else
+ py_srcfile = PyUnicode_FromString(filename);
+ #endif
+ if (!py_srcfile) goto bad;
+ if (c_line) {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #else
+ py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #endif
+ }
+ else {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromString(funcname);
+ #else
+ py_funcname = PyUnicode_FromString(funcname);
+ #endif
+ }
+ if (!py_funcname) goto bad;
+ py_code = __Pyx_PyCode_New(
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ __pyx_empty_bytes, /*PyObject *code,*/
+ __pyx_empty_tuple, /*PyObject *consts,*/
+ __pyx_empty_tuple, /*PyObject *names,*/
+ __pyx_empty_tuple, /*PyObject *varnames,*/
+ __pyx_empty_tuple, /*PyObject *freevars,*/
+ __pyx_empty_tuple, /*PyObject *cellvars,*/
+ py_srcfile, /*PyObject *filename,*/
+ py_funcname, /*PyObject *name,*/
+ py_line,
+ __pyx_empty_bytes /*PyObject *lnotab*/
+ );
+ Py_DECREF(py_srcfile);
+ Py_DECREF(py_funcname);
+ return py_code;
+bad:
+ Py_XDECREF(py_srcfile);
+ Py_XDECREF(py_funcname);
+ return NULL;
+}
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyFrameObject *py_frame = 0;
+ py_code = __pyx_find_code_object(c_line ? c_line : py_line);
+ if (!py_code) {
+ py_code = __Pyx_CreateCodeObjectForTraceback(
+ funcname, c_line, py_line, filename);
+ if (!py_code) goto bad;
+ __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
+ }
+ py_frame = PyFrame_New(
+ PyThreadState_GET(), /*PyThreadState *tstate,*/
+ py_code, /*PyCodeObject *code,*/
+ __pyx_d, /*PyObject *globals,*/
+ 0 /*PyObject *locals*/
+ );
+ if (!py_frame) goto bad;
+ py_frame->f_lineno = py_line;
+ PyTraceBack_Here(py_frame);
+bad:
+ Py_XDECREF(py_code);
+ Py_XDECREF(py_frame);
+}
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
+ goto bad;
+ #endif
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ {
+ #if PY_MAJOR_VERSION >= 3
+ if (level == -1) {
+ if (strchr(__Pyx_MODULE_NAME, '.')) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(1);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, 1);
+ #endif
+ if (!module) {
+ if (!PyErr_ExceptionMatches(PyExc_ImportError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ level = 0;
+ }
+ #endif
+ if (!module) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(level);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, level);
+ #endif
+ }
+ }
+bad:
+ #if PY_VERSION_HEX < 0x03030000
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
+}
+
+#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value) \
+ { \
+ func_type value = func_value; \
+ if (sizeof(target_type) < sizeof(func_type)) { \
+ if (unlikely(value != (func_type) (target_type) value)) { \
+ func_type zero = 0; \
+ if (is_unsigned && unlikely(value < zero)) \
+ goto raise_neg_overflow; \
+ else \
+ goto raise_overflow; \
+ } \
+ } \
+ return (target_type) value; \
+ }
+
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ #include "longintrepr.h"
+ #endif
+#endif
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+ const int neg_one = (int) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(int) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (int) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(int) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
+ } else if (sizeof(int) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ int val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (int) -1;
+ }
+ } else {
+ int val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (int) -1;
+ val = __Pyx_PyInt_As_int(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to int");
+ return (int) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to int");
+ return (int) -1;
+}
+
+static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
+ const size_t neg_one = (size_t) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(size_t) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (size_t) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(size_t) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(size_t) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(size_t) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(size_t, long, PyLong_AsLong(x))
+ } else if (sizeof(size_t) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(size_t, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ size_t val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (size_t) -1;
+ }
+ } else {
+ size_t val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (size_t) -1;
+ val = __Pyx_PyInt_As_size_t(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to size_t");
+ return (size_t) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to size_t");
+ return (size_t) -1;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+ const int neg_one = (int) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(int) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(int) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(int),
+ little, !is_unsigned);
+ }
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+ const long neg_one = (long) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(long) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(long) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(long),
+ little, !is_unsigned);
+ }
+}
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+ const long neg_one = (long) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(long) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (long) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(long) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(long) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(long) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
+ } else if (sizeof(long) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ long val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (long) -1;
+ }
+ } else {
+ long val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (long) -1;
+ val = __Pyx_PyInt_As_long(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to long");
+ return (long) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to long");
+ return (long) -1;
+}
+
+static int __Pyx_check_binary_version(void) {
+ char ctversion[4], rtversion[4];
+ PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
+ if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
+ char message[200];
+ PyOS_snprintf(message, sizeof(message),
+ "compiletime version %s of module '%.100s' "
+ "does not match runtime version %s",
+ ctversion, __Pyx_MODULE_NAME, rtversion);
+ return PyErr_WarnEx(NULL, message, 1);
+ }
+ return 0;
+}
+
+#ifndef __PYX_HAVE_RT_ImportModule
+#define __PYX_HAVE_RT_ImportModule
+static PyObject *__Pyx_ImportModule(const char *name) {
+ PyObject *py_name = 0;
+ PyObject *py_module = 0;
+ py_name = __Pyx_PyIdentifier_FromString(name);
+ if (!py_name)
+ goto bad;
+ py_module = PyImport_Import(py_name);
+ Py_DECREF(py_name);
+ return py_module;
+bad:
+ Py_XDECREF(py_name);
+ return 0;
+}
+#endif
+
+#ifndef __PYX_HAVE_RT_ImportType
+#define __PYX_HAVE_RT_ImportType
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
+ size_t size, int strict)
+{
+ PyObject *py_module = 0;
+ PyObject *result = 0;
+ PyObject *py_name = 0;
+ char warning[200];
+ Py_ssize_t basicsize;
+#ifdef Py_LIMITED_API
+ PyObject *py_basicsize;
+#endif
+ py_module = __Pyx_ImportModule(module_name);
+ if (!py_module)
+ goto bad;
+ py_name = __Pyx_PyIdentifier_FromString(class_name);
+ if (!py_name)
+ goto bad;
+ result = PyObject_GetAttr(py_module, py_name);
+ Py_DECREF(py_name);
+ py_name = 0;
+ Py_DECREF(py_module);
+ py_module = 0;
+ if (!result)
+ goto bad;
+ if (!PyType_Check(result)) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s.%.200s is not a type object",
+ module_name, class_name);
+ goto bad;
+ }
+#ifndef Py_LIMITED_API
+ basicsize = ((PyTypeObject *)result)->tp_basicsize;
+#else
+ py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
+ if (!py_basicsize)
+ goto bad;
+ basicsize = PyLong_AsSsize_t(py_basicsize);
+ Py_DECREF(py_basicsize);
+ py_basicsize = 0;
+ if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
+ goto bad;
+#endif
+ if (!strict && (size_t)basicsize > size) {
+ PyOS_snprintf(warning, sizeof(warning),
+ "%s.%s size changed, may indicate binary incompatibility",
+ module_name, class_name);
+ if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
+ }
+ else if ((size_t)basicsize != size) {
+ PyErr_Format(PyExc_ValueError,
+ "%.200s.%.200s has the wrong size, try recompiling",
+ module_name, class_name);
+ goto bad;
+ }
+ return (PyTypeObject *)result;
+bad:
+ Py_XDECREF(py_module);
+ Py_XDECREF(result);
+ return NULL;
+}
+#endif
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+ while (t->p) {
+ #if PY_MAJOR_VERSION < 3
+ if (t->is_unicode) {
+ *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
+ } else if (t->intern) {
+ *t->p = PyString_InternFromString(t->s);
+ } else {
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+ }
+ #else
+ if (t->is_unicode | t->is_str) {
+ if (t->intern) {
+ *t->p = PyUnicode_InternFromString(t->s);
+ } else if (t->encoding) {
+ *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
+ } else {
+ *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+ }
+ } else {
+ *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
+ }
+ #endif
+ if (!*t->p)
+ return -1;
+ ++t;
+ }
+ return 0;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
+ return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
+ Py_ssize_t ignore;
+ return __Pyx_PyObject_AsStringAndSize(o, &ignore);
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+ if (
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ __Pyx_sys_getdefaultencoding_not_ascii &&
+#endif
+ PyUnicode_Check(o)) {
+#if PY_VERSION_HEX < 0x03030000
+ char* defenc_c;
+ PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
+ if (!defenc) return NULL;
+ defenc_c = PyBytes_AS_STRING(defenc);
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ {
+ char* end = defenc_c + PyBytes_GET_SIZE(defenc);
+ char* c;
+ for (c = defenc_c; c < end; c++) {
+ if ((unsigned char) (*c) >= 128) {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+ }
+ }
+#endif
+ *length = PyBytes_GET_SIZE(defenc);
+ return defenc_c;
+#else
+ if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ if (PyUnicode_IS_ASCII(o)) {
+ *length = PyUnicode_GET_LENGTH(o);
+ return PyUnicode_AsUTF8(o);
+ } else {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+#else
+ return PyUnicode_AsUTF8AndSize(o, length);
+#endif
+#endif
+ } else
+#endif
+#if !CYTHON_COMPILING_IN_PYPY
+ if (PyByteArray_Check(o)) {
+ *length = PyByteArray_GET_SIZE(o);
+ return PyByteArray_AS_STRING(o);
+ } else
+#endif
+ {
+ char* result;
+ int r = PyBytes_AsStringAndSize(o, &result, length);
+ if (unlikely(r < 0)) {
+ return NULL;
+ } else {
+ return result;
+ }
+ }
+}
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
+ int is_true = x == Py_True;
+ if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
+ else return PyObject_IsTrue(x);
+}
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
+ PyNumberMethods *m;
+ const char *name = NULL;
+ PyObject *res = NULL;
+#if PY_MAJOR_VERSION < 3
+ if (PyInt_Check(x) || PyLong_Check(x))
+#else
+ if (PyLong_Check(x))
+#endif
+ return Py_INCREF(x), x;
+ m = Py_TYPE(x)->tp_as_number;
+#if PY_MAJOR_VERSION < 3
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Int(x);
+ }
+ else if (m && m->nb_long) {
+ name = "long";
+ res = PyNumber_Long(x);
+ }
+#else
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Long(x);
+ }
+#endif
+ if (res) {
+#if PY_MAJOR_VERSION < 3
+ if (!PyInt_Check(res) && !PyLong_Check(res)) {
+#else
+ if (!PyLong_Check(res)) {
+#endif
+ PyErr_Format(PyExc_TypeError,
+ "__%.4s__ returned non-%.4s (type %.200s)",
+ name, name, Py_TYPE(res)->tp_name);
+ Py_DECREF(res);
+ return NULL;
+ }
+ }
+ else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "an integer is required");
+ }
+ return res;
+}
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+ Py_ssize_t ival;
+ PyObject *x;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(b)))
+ return PyInt_AS_LONG(b);
+#endif
+ if (likely(PyLong_CheckExact(b))) {
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(b)) {
+ case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
+ case 0: return 0;
+ case 1: return ((PyLongObject*)b)->ob_digit[0];
+ }
+ #endif
+ #endif
+ return PyLong_AsSsize_t(b);
+ }
+ x = PyNumber_Index(b);
+ if (!x) return -1;
+ ival = PyInt_AsSsize_t(x);
+ Py_DECREF(x);
+ return ival;
+}
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
+ return PyInt_FromSize_t(ival);
+}
+
+
+#endif /* Py_PYTHON_H */
diff --git a/scripts/external_libs/zmq/backend/cython/message.pxd b/scripts/external_libs/platform/cel59/zmq/backend/cython/message.pxd
index 4781195f..4781195f 100644
--- a/scripts/external_libs/zmq/backend/cython/message.pxd
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/message.pxd
diff --git a/scripts/external_libs/platform/cel59/zmq/backend/cython/message.pyx b/scripts/external_libs/platform/cel59/zmq/backend/cython/message.pyx
new file mode 100644
index 00000000..312ae120
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/message.pyx
@@ -0,0 +1,381 @@
+"""0MQ Message related classes."""
+
+#
+# Copyright (c) 2013 Brian E. Granger & Min Ragan-Kelley
+#
+# This file is part of pyzmq.
+#
+# pyzmq is free software; you can redistribute it and/or modify it under
+# the terms of the Lesser GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# pyzmq is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# Lesser GNU General Public License for more details.
+#
+# You should have received a copy of the Lesser GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+#-----------------------------------------------------------------------------
+# Imports
+#-----------------------------------------------------------------------------
+
+# get version-independent aliases:
+cdef extern from "pyversion_compat.h":
+ pass
+
+from cpython cimport Py_DECREF, Py_INCREF
+
+from buffers cimport asbuffer_r, viewfromobject_r
+
+cdef extern from "Python.h":
+ ctypedef int Py_ssize_t
+
+from libzmq cimport *
+
+from libc.stdio cimport fprintf, stderr as cstderr
+from libc.stdlib cimport malloc, free
+from libc.string cimport memcpy
+
+import time
+
+try:
+ # below 3.3
+ from threading import _Event as Event
+except (ImportError, AttributeError):
+ # python throws ImportError, cython throws AttributeError
+ from threading import Event
+
+import zmq
+from zmq.error import _check_version
+from zmq.backend.cython.checkrc cimport _check_rc
+from zmq.utils.strtypes import bytes,unicode,basestring
+
+#-----------------------------------------------------------------------------
+# Code
+#-----------------------------------------------------------------------------
+
+ctypedef struct zhint:
+ void *ctx
+ size_t id
+
+cdef void free_python_msg(void *data, void *vhint) nogil:
+ """A pure-C function for DECREF'ing Python-owned message data.
+
+ Sends a message on a PUSH socket
+
+ The hint is a `zhint` struct with two values:
+
+ ctx (void *): pointer to the Garbage Collector's context
+ id (size_t): the id to be used to construct a zmq_msg_t that should be sent on a PUSH socket,
+ signaling the Garbage Collector to remove its reference to the object.
+
+ - A PUSH socket is created in the context,
+ - it is connected to the garbage collector inproc channel,
+ - it sends the gc message
+ - the PUSH socket is closed
+
+ When the Garbage Collector's PULL socket receives the message,
+ it deletes its reference to the object,
+ allowing Python to free the memory.
+ """
+ cdef void *push
+ cdef zmq_msg_t msg
+ cdef zhint *hint = <zhint *> vhint
+ if hint != NULL:
+ zmq_msg_init_size(&msg, sizeof(size_t))
+ memcpy(zmq_msg_data(&msg), &hint.id, sizeof(size_t))
+
+ push = zmq_socket(hint.ctx, ZMQ_PUSH)
+ if push == NULL:
+ # this will happen if the context has been terminated
+ return
+ rc = zmq_connect(push, "inproc://pyzmq.gc.01")
+ if rc < 0:
+ fprintf(cstderr, "pyzmq-gc connect failed: %s\n", zmq_strerror(zmq_errno()))
+ return
+
+ rc = zmq_msg_send(&msg, push, 0)
+ if rc < 0:
+ fprintf(cstderr, "pyzmq-gc send failed: %s\n", zmq_strerror(zmq_errno()))
+
+ zmq_msg_close(&msg)
+ zmq_close(push)
+ free(hint)
+
+gc = None
+
+cdef class Frame:
+ """Frame(data=None, track=False)
+
+ A zmq message Frame class for non-copy send/recvs.
+
+ This class is only needed if you want to do non-copying send and recvs.
+ When you pass a string to this class, like ``Frame(s)``, the
+ ref-count of `s` is increased by two: once because the Frame saves `s` as
+ an instance attribute and another because a ZMQ message is created that
+ points to the buffer of `s`. This second ref-count increase makes sure
+ that `s` lives until all messages that use it have been sent. Once 0MQ
+ sends all the messages and it doesn't need the buffer of s, 0MQ will call
+ ``Py_DECREF(s)``.
+
+ Parameters
+ ----------
+
+ data : object, optional
+ any object that provides the buffer interface will be used to
+ construct the 0MQ message data.
+ track : bool [default: False]
+ whether a MessageTracker_ should be created to track this object.
+ Tracking a message has a cost at creation, because it creates a threadsafe
+ Event object.
+
+ """
+
+ def __cinit__(self, object data=None, track=False, **kwargs):
+ cdef int rc
+ cdef char *data_c = NULL
+ cdef Py_ssize_t data_len_c=0
+ cdef zhint *hint
+
+ # init more as False
+ self.more = False
+
+ # Save the data object in case the user wants the the data as a str.
+ self._data = data
+ self._failed_init = True # bool switch for dealloc
+ self._buffer = None # buffer view of data
+ self._bytes = None # bytes copy of data
+
+ # Event and MessageTracker for monitoring when zmq is done with data:
+ if track:
+ evt = Event()
+ self.tracker_event = evt
+ self.tracker = zmq.MessageTracker(evt)
+ else:
+ self.tracker_event = None
+ self.tracker = None
+
+ if isinstance(data, unicode):
+ raise TypeError("Unicode objects not allowed. Only: str/bytes, buffer interfaces.")
+
+ if data is None:
+ rc = zmq_msg_init(&self.zmq_msg)
+ _check_rc(rc)
+ self._failed_init = False
+ return
+ else:
+ asbuffer_r(data, <void **>&data_c, &data_len_c)
+
+ # create the hint for zmq_free_fn
+ # two pointers: the gc context and a message to be sent to the gc PULL socket
+ # allows libzmq to signal to Python when it is done with Python-owned memory.
+ global gc
+ if gc is None:
+ from zmq.utils.garbage import gc
+
+ hint = <zhint *> malloc(sizeof(zhint))
+ hint.id = gc.store(data, self.tracker_event)
+ hint.ctx = <void *> <size_t> gc._context.underlying
+
+ rc = zmq_msg_init_data(
+ &self.zmq_msg, <void *>data_c, data_len_c,
+ <zmq_free_fn *>free_python_msg, <void *>hint
+ )
+ if rc != 0:
+ free(hint)
+ _check_rc(rc)
+ self._failed_init = False
+
+ def __init__(self, object data=None, track=False):
+ """Enforce signature"""
+ pass
+
+ def __dealloc__(self):
+ cdef int rc
+ if self._failed_init:
+ return
+ # This simply decreases the 0MQ ref-count of zmq_msg.
+ with nogil:
+ rc = zmq_msg_close(&self.zmq_msg)
+ _check_rc(rc)
+
+ # buffer interface code adapted from petsc4py by Lisandro Dalcin, a BSD project
+
+ def __getbuffer__(self, Py_buffer* buffer, int flags):
+ # new-style (memoryview) buffer interface
+ buffer.buf = zmq_msg_data(&self.zmq_msg)
+ buffer.len = zmq_msg_size(&self.zmq_msg)
+
+ buffer.obj = self
+ buffer.readonly = 1
+ buffer.format = "B"
+ buffer.ndim = 0
+ buffer.shape = NULL
+ buffer.strides = NULL
+ buffer.suboffsets = NULL
+ buffer.itemsize = 1
+ buffer.internal = NULL
+
+ def __getsegcount__(self, Py_ssize_t *lenp):
+ # required for getreadbuffer
+ if lenp != NULL:
+ lenp[0] = zmq_msg_size(&self.zmq_msg)
+ return 1
+
+ def __getreadbuffer__(self, Py_ssize_t idx, void **p):
+ # old-style (buffer) interface
+ cdef char *data_c = NULL
+ cdef Py_ssize_t data_len_c
+ if idx != 0:
+ raise SystemError("accessing non-existent buffer segment")
+ # read-only, because we don't want to allow
+ # editing of the message in-place
+ data_c = <char *>zmq_msg_data(&self.zmq_msg)
+ data_len_c = zmq_msg_size(&self.zmq_msg)
+ if p != NULL:
+ p[0] = <void*>data_c
+ return data_len_c
+
+ # end buffer interface
+
+ def __copy__(self):
+ """Create a shallow copy of the message.
+
+ This does not copy the contents of the Frame, just the pointer.
+ This will increment the 0MQ ref count of the message, but not
+ the ref count of the Python object. That is only done once when
+ the Python is first turned into a 0MQ message.
+ """
+ return self.fast_copy()
+
+ cdef Frame fast_copy(self):
+ """Fast, cdef'd version of shallow copy of the Frame."""
+ cdef Frame new_msg
+ new_msg = Frame()
+ # This does not copy the contents, but just increases the ref-count
+ # of the zmq_msg by one.
+ zmq_msg_copy(&new_msg.zmq_msg, &self.zmq_msg)
+ # Copy the ref to data so the copy won't create a copy when str is
+ # called.
+ if self._data is not None:
+ new_msg._data = self._data
+ if self._buffer is not None:
+ new_msg._buffer = self._buffer
+ if self._bytes is not None:
+ new_msg._bytes = self._bytes
+
+ # Frame copies share the tracker and tracker_event
+ new_msg.tracker_event = self.tracker_event
+ new_msg.tracker = self.tracker
+
+ return new_msg
+
+ def __len__(self):
+ """Return the length of the message in bytes."""
+ cdef size_t sz
+ sz = zmq_msg_size(&self.zmq_msg)
+ return sz
+ # return <int>zmq_msg_size(&self.zmq_msg)
+
+ def __str__(self):
+ """Return the str form of the message."""
+ if isinstance(self._data, bytes):
+ b = self._data
+ else:
+ b = self.bytes
+ if str is unicode:
+ return b.decode()
+ else:
+ return b
+
+ cdef inline object _getbuffer(self):
+ """Create a Python buffer/view of the message data.
+
+ This will be called only once, the first time the `buffer` property
+ is accessed. Subsequent calls use a cached copy.
+ """
+ if self._data is None:
+ return viewfromobject_r(self)
+ else:
+ return viewfromobject_r(self._data)
+
+ @property
+ def buffer(self):
+ """A read-only buffer view of the message contents."""
+ if self._buffer is None:
+ self._buffer = self._getbuffer()
+ return self._buffer
+
+ @property
+ def bytes(self):
+ """The message content as a Python bytes object.
+
+ The first time this property is accessed, a copy of the message
+ contents is made. From then on that same copy of the message is
+ returned.
+ """
+ if self._bytes is None:
+ self._bytes = copy_zmq_msg_bytes(&self.zmq_msg)
+ return self._bytes
+
+ def set(self, int option, int value):
+ """Frame.set(option, value)
+
+ Set a Frame option.
+
+ See the 0MQ API documentation for zmq_msg_set
+ for details on specific options.
+
+ .. versionadded:: libzmq-3.2
+ .. versionadded:: 13.0
+ """
+ cdef int rc = zmq_msg_set(&self.zmq_msg, option, value)
+ _check_rc(rc)
+
+ def get(self, option):
+ """Frame.get(option)
+
+ Get a Frame option or property.
+
+ See the 0MQ API documentation for zmq_msg_get and zmq_msg_gets
+ for details on specific options.
+
+ .. versionadded:: libzmq-3.2
+ .. versionadded:: 13.0
+
+ .. versionchanged:: 14.3
+ add support for zmq_msg_gets (requires libzmq-4.1)
+ """
+ cdef int rc = 0
+ cdef char *property_c = NULL
+ cdef Py_ssize_t property_len_c = 0
+
+ # zmq_msg_get
+ if isinstance(option, int):
+ rc = zmq_msg_get(&self.zmq_msg, option)
+ _check_rc(rc)
+ return rc
+
+ # zmq_msg_gets
+ _check_version((4,1), "get string properties")
+ if isinstance(option, unicode):
+ option = option.encode('utf8')
+
+ if not isinstance(option, bytes):
+ raise TypeError("expected str, got: %r" % option)
+
+ property_c = option
+
+ cdef const char *result = <char *>zmq_msg_gets(&self.zmq_msg, property_c)
+ if result == NULL:
+ _check_rc(-1)
+ return result.decode('utf8')
+
+# legacy Message name
+Message = Frame
+
+__all__ = ['Frame', 'Message']
diff --git a/scripts/external_libs/platform/cel59/zmq/backend/cython/rebuffer.pyx b/scripts/external_libs/platform/cel59/zmq/backend/cython/rebuffer.pyx
new file mode 100644
index 00000000..402e3b6e
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/rebuffer.pyx
@@ -0,0 +1,104 @@
+"""
+Utility for changing itemsize of memoryviews, and getting
+numpy arrays from byte-arrays that should be interpreted with a different
+itemsize.
+
+Authors
+-------
+* MinRK
+"""
+
+#-----------------------------------------------------------------------------
+# Copyright (c) 2010-2012 Brian Granger, Min Ragan-Kelley
+#
+# This file is part of pyzmq
+#
+# Distributed under the terms of the New BSD License. The full license is in
+# the file COPYING.BSD, distributed as part of this software.
+#-----------------------------------------------------------------------------
+
+from libc.stdlib cimport malloc
+from buffers cimport *
+
+cdef inline object _rebuffer(object obj, char * format, int itemsize):
+ """clobber the format & itemsize of a 1-D
+
+ This is the Python 3 model, but will work on Python >= 2.6. Currently,
+ we use it only on >= 3.0.
+ """
+ cdef Py_buffer view
+ cdef int flags = PyBUF_SIMPLE
+ cdef int mode = 0
+ # cdef Py_ssize_t *shape, *strides, *suboffsets
+
+ mode = check_buffer(obj)
+ if mode == 0:
+ raise TypeError("%r does not provide a buffer interface."%obj)
+
+ if mode == 3:
+ flags = PyBUF_ANY_CONTIGUOUS
+ if format:
+ flags |= PyBUF_FORMAT
+ PyObject_GetBuffer(obj, &view, flags)
+ assert view.ndim <= 1, "Can only reinterpret 1-D memoryviews"
+ assert view.len % itemsize == 0, "Buffer of length %i not divisible into items of size %i"%(view.len, itemsize)
+ # hack the format
+ view.ndim = 1
+ view.format = format
+ view.itemsize = itemsize
+ view.strides = <Py_ssize_t *>malloc(sizeof(Py_ssize_t))
+ view.strides[0] = itemsize
+ view.shape = <Py_ssize_t *>malloc(sizeof(Py_ssize_t))
+ view.shape[0] = view.len/itemsize
+ view.suboffsets = <Py_ssize_t *>malloc(sizeof(Py_ssize_t))
+ view.suboffsets[0] = 0
+ # for debug: make buffer writable, for zero-copy testing
+ # view.readonly = 0
+
+ return PyMemoryView_FromBuffer(&view)
+ else:
+ raise TypeError("This funciton is only for new-style buffer objects.")
+
+def rebuffer(obj, format, itemsize):
+ """Change the itemsize of a memoryview.
+
+ Only for 1D contiguous buffers.
+ """
+ return _rebuffer(obj, format, itemsize)
+
+def array_from_buffer(view, dtype, shape):
+ """Get a numpy array from a memoryview, regardless of the itemsize of the original
+ memoryview. This is important, because pyzmq does not send memoryview shape data
+ over the wire, so we need to change the memoryview itemsize before calling
+ asarray.
+ """
+ import numpy
+ A = numpy.array([],dtype=dtype)
+ ref = viewfromobject(A,0)
+ fmt = ref.format.encode()
+ buf = viewfromobject(view, 0)
+ buf = _rebuffer(view, fmt, ref.itemsize)
+ return numpy.asarray(buf, dtype=dtype).reshape(shape)
+
+def print_view_info(obj):
+ """simple utility for printing info on a new-style buffer object"""
+ cdef Py_buffer view
+ cdef int flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT
+ cdef int mode = 0
+
+ mode = check_buffer(obj)
+ if mode == 0:
+ raise TypeError("%r does not provide a buffer interface."%obj)
+
+ if mode == 3:
+ PyObject_GetBuffer(obj, &view, flags)
+ print <size_t>view.buf, view.len, view.format, view.ndim,
+ if view.ndim:
+ if view.shape:
+ print view.shape[0],
+ if view.strides:
+ print view.strides[0],
+ if view.suboffsets:
+ print view.suboffsets[0],
+ print
+ \ No newline at end of file
diff --git a/scripts/external_libs/platform/cel59/zmq/backend/cython/socket.c b/scripts/external_libs/platform/cel59/zmq/backend/cython/socket.c
new file mode 100644
index 00000000..c52e2e31
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/socket.c
@@ -0,0 +1,10913 @@
+/* Generated by Cython 0.21.2 */
+
+#define PY_SSIZE_T_CLEAN
+#ifndef CYTHON_USE_PYLONG_INTERNALS
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#else
+#include "pyconfig.h"
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 1
+#else
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#endif
+#endif
+#endif
+#include "Python.h"
+#ifndef Py_PYTHON_H
+ #error Python headers needed to compile C extensions, please install development version of Python.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+ #error Cython requires Python 2.6+ or Python 3.2+.
+#else
+#define CYTHON_ABI "0_21_2"
+#include <stddef.h>
+#ifndef offsetof
+#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+ #ifndef __stdcall
+ #define __stdcall
+ #endif
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
+ #ifndef __fastcall
+ #define __fastcall
+ #endif
+#endif
+#ifndef DL_IMPORT
+ #define DL_IMPORT(t) t
+#endif
+#ifndef DL_EXPORT
+ #define DL_EXPORT(t) t
+#endif
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifndef Py_HUGE_VAL
+ #define Py_HUGE_VAL HUGE_VAL
+#endif
+#ifdef PYPY_VERSION
+#define CYTHON_COMPILING_IN_PYPY 1
+#define CYTHON_COMPILING_IN_CPYTHON 0
+#else
+#define CYTHON_COMPILING_IN_PYPY 0
+#define CYTHON_COMPILING_IN_CPYTHON 1
+#endif
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
+#define Py_OptimizeFlag 0
+#endif
+#define __PYX_BUILD_PY_SSIZE_T "n"
+#define CYTHON_FORMAT_SSIZE_T "z"
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyClass_Type
+#else
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyType_Type
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define Py_TPFLAGS_CHECKTYPES 0
+ #define Py_TPFLAGS_HAVE_INDEX 0
+ #define Py_TPFLAGS_HAVE_NEWBUFFER 0
+#endif
+#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+ #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
+#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
+ #define CYTHON_PEP393_ENABLED 1
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
+ 0 : _PyUnicode_Ready((PyObject *)(op)))
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
+ #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
+ #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+#else
+ #define CYTHON_PEP393_ENABLED 0
+ #define __Pyx_PyUnicode_READY(op) (0)
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
+ #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
+ #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+ #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyFrozenSet_Size(s) PyObject_Size(s)
+#else
+ #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
+ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
+ #define __Pyx_PyFrozenSet_Size(s) PySet_Size(s)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
+#else
+ #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBaseString_Type PyUnicode_Type
+ #define PyStringObject PyUnicodeObject
+ #define PyString_Type PyUnicode_Type
+ #define PyString_Check PyUnicode_Check
+ #define PyString_CheckExact PyUnicode_CheckExact
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
+ #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
+#else
+ #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+ #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
+#endif
+#ifndef PySet_CheckExact
+ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
+#endif
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#if PY_MAJOR_VERSION >= 3
+ #define PyIntObject PyLongObject
+ #define PyInt_Type PyLong_Type
+ #define PyInt_Check(op) PyLong_Check(op)
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
+ #define PyInt_FromString PyLong_FromString
+ #define PyInt_FromUnicode PyLong_FromUnicode
+ #define PyInt_FromLong PyLong_FromLong
+ #define PyInt_FromSize_t PyLong_FromSize_t
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
+ #define PyInt_AsLong PyLong_AsLong
+ #define PyInt_AS_LONG PyLong_AS_LONG
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+ #define PyNumber_Int PyNumber_Long
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBoolObject PyLongObject
+#endif
+#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
+ #ifndef PyUnicode_InternFromString
+ #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
+ #endif
+#endif
+#if PY_VERSION_HEX < 0x030200A4
+ typedef long Py_hash_t;
+ #define __Pyx_PyInt_FromHash_t PyInt_FromLong
+ #define __Pyx_PyInt_AsHash_t PyInt_AsLong
+#else
+ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
+ #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+#else
+ #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
+#endif
+#ifndef CYTHON_INLINE
+ #if defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+#ifndef CYTHON_RESTRICT
+ #if defined(__GNUC__)
+ #define CYTHON_RESTRICT __restrict__
+ #elif defined(_MSC_VER) && _MSC_VER >= 1400
+ #define CYTHON_RESTRICT __restrict
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_RESTRICT restrict
+ #else
+ #define CYTHON_RESTRICT
+ #endif
+#endif
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
+#else
+static CYTHON_INLINE float __PYX_NAN() {
+ /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
+ a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
+ a quiet NaN. */
+ float value;
+ memset(&value, 0xFF, sizeof(value));
+ return value;
+}
+#endif
+#ifdef __cplusplus
+template<typename T>
+void __Pyx_call_destructor(T* x) {
+ x->~T();
+}
+#endif
+
+
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
+#else
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
+#endif
+
+#ifndef __PYX_EXTERN_C
+ #ifdef __cplusplus
+ #define __PYX_EXTERN_C extern "C"
+ #else
+ #define __PYX_EXTERN_C extern
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+#define _USE_MATH_DEFINES
+#endif
+#include <math.h>
+#define __PYX_HAVE__zmq__backend__cython__socket
+#define __PYX_HAVE_API__zmq__backend__cython__socket
+#include "pyversion_compat.h"
+#include "errno.h"
+#include "string.h"
+#include "stdio.h"
+#include "pythread.h"
+#include "zmq_compat.h"
+#include "zmq.h"
+#include "zmq_utils.h"
+#include "ipcmaxlen.h"
+#include "getpid_compat.h"
+#ifdef _OPENMP
+#include <omp.h>
+#endif /* _OPENMP */
+
+#ifdef PYREX_WITHOUT_ASSERTIONS
+#define CYTHON_WITHOUT_ASSERTIONS
+#endif
+
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
+ const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \
+ (sizeof(type) < sizeof(Py_ssize_t)) || \
+ (sizeof(type) > sizeof(Py_ssize_t) && \
+ likely(v < (type)PY_SSIZE_T_MAX || \
+ v == (type)PY_SSIZE_T_MAX) && \
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \
+ v == (type)PY_SSIZE_T_MIN))) || \
+ (sizeof(type) == sizeof(Py_ssize_t) && \
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \
+ v == (type)PY_SSIZE_T_MAX))) )
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
+#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
+#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
+#define __Pyx_PyBytes_FromString PyBytes_FromString
+#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#else
+ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
+#endif
+#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
+#if PY_MAJOR_VERSION < 3
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
+{
+ const Py_UNICODE *u_end = u;
+ while (*u_end++) ;
+ return (size_t)(u_end - u - 1);
+}
+#else
+#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
+#endif
+#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
+#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
+#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
+#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
+#else
+#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
+#endif
+#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ PyObject* ascii_chars_u = NULL;
+ PyObject* ascii_chars_b = NULL;
+ const char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ if (strcmp(default_encoding_c, "ascii") == 0) {
+ __Pyx_sys_getdefaultencoding_not_ascii = 0;
+ } else {
+ char ascii_chars[128];
+ int c;
+ for (c = 0; c < 128; c++) {
+ ascii_chars[c] = c;
+ }
+ __Pyx_sys_getdefaultencoding_not_ascii = 1;
+ ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
+ if (!ascii_chars_u) goto bad;
+ ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
+ if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
+ PyErr_Format(
+ PyExc_ValueError,
+ "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
+ default_encoding_c);
+ goto bad;
+ }
+ Py_DECREF(ascii_chars_u);
+ Py_DECREF(ascii_chars_b);
+ }
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ Py_XDECREF(ascii_chars_u);
+ Py_XDECREF(ascii_chars_b);
+ return -1;
+}
+#endif
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
+#else
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+static char* __PYX_DEFAULT_STRING_ENCODING;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
+ if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
+ strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ return -1;
+}
+#endif
+#endif
+
+
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+ #define likely(x) __builtin_expect(!!(x), 1)
+ #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
+ #define likely(x) (x)
+ #define unlikely(x) (x)
+#endif /* __GNUC__ */
+
+static PyObject *__pyx_m;
+static PyObject *__pyx_d;
+static PyObject *__pyx_b;
+static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
+static int __pyx_lineno;
+static int __pyx_clineno = 0;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+
+
+static const char *__pyx_f[] = {
+ "zmq/backend/cython/socket.pyx",
+ "zmq/backend/cython/socket.pxd",
+ "zmq/backend/cython/checkrc.pxd",
+ "zmq/backend/cython/message.pxd",
+ "zmq/utils/buffers.pxd",
+ "zmq/backend/cython/context.pxd",
+ "type.pxd",
+ "bool.pxd",
+ "complex.pxd",
+};
+
+/*--- Type declarations ---*/
+struct __pyx_obj_3zmq_7backend_6cython_7context_Context;
+struct __pyx_obj_3zmq_7backend_6cython_7message_MessageTracker;
+struct __pyx_obj_3zmq_7backend_6cython_7message_Frame;
+struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket;
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_send;
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_recv;
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket__recv_frame;
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket__recv_copy;
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket__send_frame;
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket__send_copy;
+
+/* "zmq/backend/cython/socket.pxd":45
+ *
+ * # cpdef methods for direct-cython access:
+ * cpdef object send(self, object data, int flags=*, copy=*, track=*) # <<<<<<<<<<<<<<
+ * cpdef object recv(self, int flags=*, copy=*, track=*)
+ *
+ */
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_send {
+ int __pyx_n;
+ int flags;
+ PyObject *copy;
+ PyObject *track;
+};
+
+/* "zmq/backend/cython/socket.pxd":46
+ * # cpdef methods for direct-cython access:
+ * cpdef object send(self, object data, int flags=*, copy=*, track=*)
+ * cpdef object recv(self, int flags=*, copy=*, track=*) # <<<<<<<<<<<<<<
+ *
+ */
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_recv {
+ int __pyx_n;
+ int flags;
+ PyObject *copy;
+ PyObject *track;
+};
+
+/* "zmq/backend/cython/socket.pyx":121
+ * return False
+ *
+ * cdef inline Frame _recv_frame(void *handle, int flags=0, track=False): # <<<<<<<<<<<<<<
+ * """Receive a message in a non-copying manner and return a Frame."""
+ * cdef int rc
+ */
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket__recv_frame {
+ int __pyx_n;
+ int flags;
+ PyObject *track;
+};
+
+/* "zmq/backend/cython/socket.pyx":133
+ * return msg
+ *
+ * cdef inline object _recv_copy(void *handle, int flags=0): # <<<<<<<<<<<<<<
+ * """Receive a message and return a copy"""
+ * cdef zmq_msg_t zmq_msg
+ */
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket__recv_copy {
+ int __pyx_n;
+ int flags;
+};
+
+/* "zmq/backend/cython/socket.pyx":144
+ * return msg_bytes
+ *
+ * cdef inline object _send_frame(void *handle, Frame msg, int flags=0): # <<<<<<<<<<<<<<
+ * """Send a Frame on this socket in a non-copy manner."""
+ * cdef int rc
+ */
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket__send_frame {
+ int __pyx_n;
+ int flags;
+};
+
+/* "zmq/backend/cython/socket.pyx":160
+ *
+ *
+ * cdef inline object _send_copy(void *handle, object msg, int flags=0): # <<<<<<<<<<<<<<
+ * """Send a message on this socket by copying its content."""
+ * cdef int rc, rc2
+ */
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket__send_copy {
+ int __pyx_n;
+ int flags;
+};
+
+/* "context.pxd":26
+ * #-----------------------------------------------------------------------------
+ *
+ * cdef class Context: # <<<<<<<<<<<<<<
+ *
+ * cdef object __weakref__ # enable weakref
+ */
+struct __pyx_obj_3zmq_7backend_6cython_7context_Context {
+ PyObject_HEAD
+ struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context *__pyx_vtab;
+ PyObject *__weakref__;
+ void *handle;
+ int _shadow;
+ void **_sockets;
+ size_t _n_sockets;
+ size_t _max_sockets;
+ int _pid;
+ int closed;
+};
+
+
+/* "message.pxd":34
+ * #-----------------------------------------------------------------------------
+ *
+ * cdef class MessageTracker(object): # <<<<<<<<<<<<<<
+ *
+ * cdef set events # Message Event objects to track.
+ */
+struct __pyx_obj_3zmq_7backend_6cython_7message_MessageTracker {
+ PyObject_HEAD
+ PyObject *events;
+ PyObject *peers;
+};
+
+
+/* "message.pxd":40
+ *
+ *
+ * cdef class Frame: # <<<<<<<<<<<<<<
+ *
+ * cdef zmq_msg_t zmq_msg
+ */
+struct __pyx_obj_3zmq_7backend_6cython_7message_Frame {
+ PyObject_HEAD
+ struct __pyx_vtabstruct_3zmq_7backend_6cython_7message_Frame *__pyx_vtab;
+ zmq_msg_t zmq_msg;
+ PyObject *_data;
+ PyObject *_buffer;
+ PyObject *_bytes;
+ int _failed_init;
+ PyObject *tracker_event;
+ PyObject *tracker;
+ int more;
+};
+
+
+/* "zmq/backend/cython/socket.pxd":33
+ *
+ *
+ * cdef class Socket: # <<<<<<<<<<<<<<
+ *
+ * cdef object __weakref__ # enable weakref
+ */
+struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket {
+ PyObject_HEAD
+ struct __pyx_vtabstruct_3zmq_7backend_6cython_6socket_Socket *__pyx_vtab;
+ PyObject *__weakref__;
+ void *handle;
+ int _shadow;
+ struct __pyx_obj_3zmq_7backend_6cython_7context_Context *context;
+ int _closed;
+ int _pid;
+};
+
+
+
+/* "context.pxd":26
+ * #-----------------------------------------------------------------------------
+ *
+ * cdef class Context: # <<<<<<<<<<<<<<
+ *
+ * cdef object __weakref__ # enable weakref
+ */
+
+struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context {
+ int (*_term)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *);
+ void (*_add_socket)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *, void *);
+ void (*_remove_socket)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *, void *);
+};
+static struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context *__pyx_vtabptr_3zmq_7backend_6cython_7context_Context;
+
+
+/* "message.pxd":40
+ *
+ *
+ * cdef class Frame: # <<<<<<<<<<<<<<
+ *
+ * cdef zmq_msg_t zmq_msg
+ */
+
+struct __pyx_vtabstruct_3zmq_7backend_6cython_7message_Frame {
+ struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *(*fast_copy)(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *);
+ PyObject *(*_getbuffer)(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *);
+};
+static struct __pyx_vtabstruct_3zmq_7backend_6cython_7message_Frame *__pyx_vtabptr_3zmq_7backend_6cython_7message_Frame;
+
+
+/* "zmq/backend/cython/socket.pyx":185
+ *
+ *
+ * cdef class Socket: # <<<<<<<<<<<<<<
+ * """Socket(context, socket_type)
+ *
+ */
+
+struct __pyx_vtabstruct_3zmq_7backend_6cython_6socket_Socket {
+ PyObject *(*send)(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_send *__pyx_optional_args);
+ PyObject *(*recv)(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *, int __pyx_skip_dispatch, struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_recv *__pyx_optional_args);
+};
+static struct __pyx_vtabstruct_3zmq_7backend_6cython_6socket_Socket *__pyx_vtabptr_3zmq_7backend_6cython_6socket_Socket;
+#ifndef CYTHON_REFNANNY
+ #define CYTHON_REFNANNY 0
+#endif
+#if CYTHON_REFNANNY
+ typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*SetupContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+ } __Pyx_RefNannyAPIStruct;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
+ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
+#ifdef WITH_THREAD
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ if (acquire_gil) { \
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ PyGILState_Release(__pyx_gilstate_save); \
+ } else { \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ }
+#else
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+#endif
+ #define __Pyx_RefNannyFinishContext() \
+ __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
+ #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
+ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
+#else
+ #define __Pyx_RefNannyDeclarations
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)
+ #define __Pyx_RefNannyFinishContext()
+ #define __Pyx_INCREF(r) Py_INCREF(r)
+ #define __Pyx_DECREF(r) Py_DECREF(r)
+ #define __Pyx_GOTREF(r)
+ #define __Pyx_GIVEREF(r)
+ #define __Pyx_XINCREF(r) Py_XINCREF(r)
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
+ #define __Pyx_XGOTREF(r)
+ #define __Pyx_XGIVEREF(r)
+#endif
+#define __Pyx_XDECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_XDECREF(tmp); \
+ } while (0)
+#define __Pyx_DECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_DECREF(tmp); \
+ } while (0)
+#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
+#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_getattro))
+ return tp->tp_getattro(obj, attr_name);
+#if PY_MAJOR_VERSION < 3
+ if (likely(tp->tp_getattr))
+ return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
+#endif
+ return PyObject_GetAttr(obj, attr_name);
+}
+#else
+#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
+#endif
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
+#else
+#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
+
+static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
+
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
+
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+ const char* function_name);
+
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+ Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+ const char *name, int exact);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
+#else
+#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
+#endif
+
+static void __Pyx_WriteUnraisable(const char *name, int clineno,
+ int lineno, const char *filename,
+ int full_traceback);
+
+static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) {
+ int result = PySequence_Contains(seq, item);
+ return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
+}
+
+#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
+ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
+ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \
+ __Pyx_GetItemInt_Generic(o, to_py_func(i))))
+#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
+ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
+ int wraparound, int boundscheck);
+#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
+ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
+ int wraparound, int boundscheck);
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
+ int is_list, int wraparound, int boundscheck);
+
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
+
+static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
+static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);
+
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+
+static int __Pyx_SetVtable(PyObject *dict, void *vtable);
+
+static void* __Pyx_GetVtable(PyObject *dict);
+
+static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name);
+
+typedef struct {
+ int code_line;
+ PyCodeObject* code_object;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+ int count;
+ int max_count;
+ __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename);
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);
+
+#ifndef __PYX_FORCE_INIT_THREADS
+ #define __PYX_FORCE_INIT_THREADS 0
+#endif
+
+static CYTHON_INLINE pyzmq_int64_t __Pyx_PyInt_As_pyzmq_int64_t(PyObject *);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_pyzmq_int64_t(pyzmq_int64_t value);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ZMQ_FD_T(ZMQ_FD_T value);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+
+static CYTHON_INLINE int __Pyx_StrEq(const char *, const char *); /*proto*/
+
+static int __Pyx_check_binary_version(void);
+
+#if !defined(__Pyx_PyIdentifier_FromString)
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
+#else
+ #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
+#endif
+#endif
+
+static PyObject *__Pyx_ImportModule(const char *name);
+
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+
+static PyObject *__pyx_f_3zmq_7backend_6cython_6socket_6Socket_send(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_skip_dispatch, struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_send *__pyx_optional_args); /* proto*/
+static PyObject *__pyx_f_3zmq_7backend_6cython_6socket_6Socket_recv(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_recv *__pyx_optional_args); /* proto*/
+
+/* Module declarations from 'zmq.backend.cython.context' */
+static PyTypeObject *__pyx_ptype_3zmq_7backend_6cython_7context_Context = 0;
+
+/* Module declarations from 'libc.errno' */
+
+/* Module declarations from 'libc.string' */
+
+/* Module declarations from 'cpython.version' */
+
+/* Module declarations from 'cpython.ref' */
+
+/* Module declarations from 'cpython.exc' */
+
+/* Module declarations from 'cpython.module' */
+
+/* Module declarations from 'cpython.mem' */
+
+/* Module declarations from 'cpython.tuple' */
+
+/* Module declarations from 'cpython.list' */
+
+/* Module declarations from 'libc.stdio' */
+
+/* Module declarations from 'cpython.object' */
+
+/* Module declarations from 'cpython.sequence' */
+
+/* Module declarations from 'cpython.mapping' */
+
+/* Module declarations from 'cpython.iterator' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.type' */
+static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
+
+/* Module declarations from 'cpython.number' */
+
+/* Module declarations from 'cpython.int' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.bool' */
+static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
+
+/* Module declarations from 'cpython.long' */
+
+/* Module declarations from 'cpython.float' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.complex' */
+static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
+
+/* Module declarations from 'cpython.string' */
+
+/* Module declarations from 'cpython.unicode' */
+
+/* Module declarations from 'cpython.dict' */
+
+/* Module declarations from 'cpython.instance' */
+
+/* Module declarations from 'cpython.function' */
+
+/* Module declarations from 'cpython.method' */
+
+/* Module declarations from 'cpython.weakref' */
+
+/* Module declarations from 'cpython.getargs' */
+
+/* Module declarations from 'cpython.pythread' */
+
+/* Module declarations from 'cpython.pystate' */
+
+/* Module declarations from 'cpython.cobject' */
+
+/* Module declarations from 'cpython.oldbuffer' */
+
+/* Module declarations from 'cpython.set' */
+
+/* Module declarations from 'cpython.buffer' */
+
+/* Module declarations from 'cpython.bytes' */
+
+/* Module declarations from 'cpython.pycapsule' */
+
+/* Module declarations from 'cpython' */
+
+/* Module declarations from 'buffers' */
+static CYTHON_INLINE int __pyx_f_7buffers_memoryview_available(void); /*proto*/
+static CYTHON_INLINE int __pyx_f_7buffers_oldstyle_available(void); /*proto*/
+static CYTHON_INLINE int __pyx_f_7buffers_check_buffer(PyObject *); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_asbuffer(PyObject *, int, int, void **, Py_ssize_t *, Py_ssize_t *); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_asbuffer_r(PyObject *, void **, Py_ssize_t *); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer_3(void *, Py_ssize_t, int); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer_2(void *, Py_ssize_t, int); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer(void *, Py_ssize_t, int); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_viewfromobject(PyObject *, int); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_viewfromobject_r(PyObject *); /*proto*/
+
+/* Module declarations from 'zmq.backend.cython.libzmq' */
+
+/* Module declarations from 'zmq.backend.cython.message' */
+static PyTypeObject *__pyx_ptype_3zmq_7backend_6cython_7message_MessageTracker = 0;
+static PyTypeObject *__pyx_ptype_3zmq_7backend_6cython_7message_Frame = 0;
+static CYTHON_INLINE PyObject *__pyx_f_3zmq_7backend_6cython_7message_copy_zmq_msg_bytes(zmq_msg_t *); /*proto*/
+
+/* Module declarations from 'zmq.backend.cython.checkrc' */
+static CYTHON_INLINE int __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(int); /*proto*/
+
+/* Module declarations from 'zmq.backend.cython.socket' */
+static PyTypeObject *__pyx_ptype_3zmq_7backend_6cython_6socket_Socket = 0;
+static CYTHON_INLINE PyObject *__pyx_f_3zmq_7backend_6cython_6socket__check_closed(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_3zmq_7backend_6cython_6socket__check_closed_deep(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *); /*proto*/
+static CYTHON_INLINE struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_f_3zmq_7backend_6cython_6socket__recv_frame(void *, struct __pyx_opt_args_3zmq_7backend_6cython_6socket__recv_frame *__pyx_optional_args); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_3zmq_7backend_6cython_6socket__recv_copy(void *, struct __pyx_opt_args_3zmq_7backend_6cython_6socket__recv_copy *__pyx_optional_args); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_3zmq_7backend_6cython_6socket__send_frame(void *, struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *, struct __pyx_opt_args_3zmq_7backend_6cython_6socket__send_frame *__pyx_optional_args); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_3zmq_7backend_6cython_6socket__send_copy(void *, PyObject *, struct __pyx_opt_args_3zmq_7backend_6cython_6socket__send_copy *__pyx_optional_args); /*proto*/
+#define __Pyx_MODULE_NAME "zmq.backend.cython.socket"
+int __pyx_module_is_main_zmq__backend__cython__socket = 0;
+
+/* Implementation of 'zmq.backend.cython.socket' */
+static PyObject *__pyx_builtin_property;
+static PyObject *__pyx_builtin_TypeError;
+static PyObject *__pyx_builtin_ValueError;
+static PyObject *__pyx_builtin_AttributeError;
+static PyObject *__pyx_builtin_NotImplementedError;
+static int __pyx_pf_3zmq_7backend_6cython_6socket_6Socket___init__(CYTHON_UNUSED struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_socket_type, CYTHON_UNUSED PyObject *__pyx_v_shadow); /* proto */
+static int __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_2__cinit__(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_context, int __pyx_v_socket_type, size_t __pyx_v_shadow, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
+static void __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_4__dealloc__(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_6underlying(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_8closed(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_10close(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, PyObject *__pyx_v_linger); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_12set(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, int __pyx_v_option, PyObject *__pyx_v_optval); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_14get(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, int __pyx_v_option); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_16bind(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, PyObject *__pyx_v_addr); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_18connect(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, PyObject *__pyx_v_addr); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_20unbind(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, PyObject *__pyx_v_addr); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_22disconnect(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, PyObject *__pyx_v_addr); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_24monitor(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, PyObject *__pyx_v_addr, int __pyx_v_events); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_26send(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_v_flags, PyObject *__pyx_v_copy, PyObject *__pyx_v_track); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_28recv(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, int __pyx_v_flags, PyObject *__pyx_v_copy, PyObject *__pyx_v_track); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_7context___get__(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self); /* proto */
+static int __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_7context_2__set__(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
+static int __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_7context_4__del__(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_7_closed___get__(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self); /* proto */
+static int __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_7_closed_2__set__(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
+static PyObject *__pyx_tp_new_3zmq_7backend_6cython_6socket_Socket(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static char __pyx_k_B[] = "B";
+static char __pyx_k__6[] = "://";
+static char __pyx_k__22[] = "";
+static char __pyx_k__24[] = "*";
+static char __pyx_k_all[] = "__all__";
+static char __pyx_k_msg[] = "msg";
+static char __pyx_k_sys[] = "sys";
+static char __pyx_k_zmq[] = "zmq";
+static char __pyx_k_addr[] = "addr";
+static char __pyx_k_char[] = "char";
+static char __pyx_k_copy[] = "copy";
+static char __pyx_k_data[] = "data";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_recv[] = "recv";
+static char __pyx_k_send[] = "send";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_time[] = "time";
+static char __pyx_k_Again[] = "Again";
+static char __pyx_k_Frame[] = "Frame";
+static char __pyx_k_ascii[] = "ascii";
+static char __pyx_k_bytes[] = "bytes";
+static char __pyx_k_dtype[] = "dtype";
+static char __pyx_k_flags[] = "flags";
+static char __pyx_k_split[] = "split";
+static char __pyx_k_track[] = "track";
+static char __pyx_k_utf_8[] = "utf-8";
+static char __pyx_k_Socket[] = "Socket";
+static char __pyx_k_buffer[] = "buffer";
+static char __pyx_k_closed[] = "closed";
+static char __pyx_k_codecs[] = "codecs";
+static char __pyx_k_decode[] = "decode";
+static char __pyx_k_encode[] = "encode";
+static char __pyx_k_events[] = "events";
+static char __pyx_k_format[] = "format";
+static char __pyx_k_import[] = "__import__";
+static char __pyx_k_linger[] = "linger";
+static char __pyx_k_option[] = "option";
+static char __pyx_k_optval[] = "optval";
+static char __pyx_k_pickle[] = "pickle";
+static char __pyx_k_random[] = "random";
+static char __pyx_k_shadow[] = "shadow";
+static char __pyx_k_struct[] = "struct";
+static char __pyx_k_unbind[] = "unbind";
+static char __pyx_k_RCVMORE[] = "RCVMORE";
+static char __pyx_k_cPickle[] = "cPickle";
+static char __pyx_k_context[] = "context";
+static char __pyx_k_jsonapi[] = "jsonapi";
+static char __pyx_k_monitor[] = "monitor";
+static char __pyx_k_replace[] = "replace";
+static char __pyx_k_tracker[] = "tracker";
+static char __pyx_k_unicode[] = "unicode";
+static char __pyx_k_ENOTSOCK[] = "ENOTSOCK";
+static char __pyx_k_ZMQError[] = "ZMQError";
+static char __pyx_k_copy_mod[] = "copy_mod";
+static char __pyx_k_itemsize[] = "itemsize";
+static char __pyx_k_property[] = "property";
+static char __pyx_k_typecode[] = "typecode";
+static char __pyx_k_TypeError[] = "TypeError";
+static char __pyx_k_constants[] = "constants";
+static char __pyx_k_zmq_error[] = "zmq.error";
+static char __pyx_k_zmq_utils[] = "zmq.utils";
+static char __pyx_k_ValueError[] = "ValueError";
+static char __pyx_k_basestring[] = "basestring";
+static char __pyx_k_disconnect[] = "disconnect";
+static char __pyx_k_getsockopt[] = "getsockopt";
+static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static char __pyx_k_underlying[] = "underlying";
+static char __pyx_k_fd_sockopts[] = "fd_sockopts";
+static char __pyx_k_socket_type[] = "socket_type";
+static char __pyx_k_ZMQBindError[] = "ZMQBindError";
+static char __pyx_k_check_version[] = "_check_version";
+static char __pyx_k_AttributeError[] = "AttributeError";
+static char __pyx_k_bytes_sockopts[] = "bytes_sockopts";
+static char __pyx_k_int64_sockopts[] = "int64_sockopts";
+static char __pyx_k_0MQ_Socket_class[] = "0MQ Socket class.";
+static char __pyx_k_IPC_PATH_MAX_LEN[] = "IPC_PATH_MAX_LEN";
+static char __pyx_k_ContextTerminated[] = "ContextTerminated";
+static char __pyx_k_expected_int_got_r[] = "expected int, got: %r";
+static char __pyx_k_expected_str_got_r[] = "expected str, got: %r";
+static char __pyx_k_zmq_backend_cython[] = "zmq.backend.cython";
+static char __pyx_k_zmq_utils_strtypes[] = "zmq.utils.strtypes";
+static char __pyx_k_NotImplementedError[] = "NotImplementedError";
+static char __pyx_k_expected_bytes_got_r[] = "expected bytes, got: %r";
+static char __pyx_k_Not_a_tracked_message[] = "Not a tracked message";
+static char __pyx_k_context_must_be_specified[] = "context must be specified";
+static char __pyx_k_zmq_backend_cython_constants[] = "zmq.backend.cython.constants";
+static char __pyx_k_socket_type_must_be_specified[] = "socket_type must be specified";
+static char __pyx_k_Old_style_buffers_not_available[] = "Old style buffers not available.";
+static char __pyx_k_r_does_not_provide_a_buffer_int[] = "%r does not provide a buffer interface.";
+static char __pyx_k_ipc_path_0_is_longer_than_1_char[] = "ipc path \"{0}\" is longer than {1} characters (sizeof(sockaddr_un.sun_path)). zmq.IPC_PATH_MAX_LEN constant can be used to check addr length (if it is defined).";
+static char __pyx_k_unicode_not_allowed_use_send_str[] = "unicode not allowed, use send_string";
+static char __pyx_k_unicode_not_allowed_use_setsocko[] = "unicode not allowed, use setsockopt_string";
+static PyObject *__pyx_n_s_Again;
+static PyObject *__pyx_n_s_AttributeError;
+static PyObject *__pyx_n_b_B;
+static PyObject *__pyx_n_s_ContextTerminated;
+static PyObject *__pyx_n_s_ENOTSOCK;
+static PyObject *__pyx_n_s_Frame;
+static PyObject *__pyx_n_s_IPC_PATH_MAX_LEN;
+static PyObject *__pyx_n_s_NotImplementedError;
+static PyObject *__pyx_kp_s_Not_a_tracked_message;
+static PyObject *__pyx_kp_s_Old_style_buffers_not_available;
+static PyObject *__pyx_n_s_RCVMORE;
+static PyObject *__pyx_n_s_Socket;
+static PyObject *__pyx_n_s_TypeError;
+static PyObject *__pyx_n_s_ValueError;
+static PyObject *__pyx_n_s_ZMQBindError;
+static PyObject *__pyx_n_s_ZMQError;
+static PyObject *__pyx_kp_s__22;
+static PyObject *__pyx_n_s__24;
+static PyObject *__pyx_kp_s__6;
+static PyObject *__pyx_n_s_addr;
+static PyObject *__pyx_n_s_all;
+static PyObject *__pyx_n_s_ascii;
+static PyObject *__pyx_n_s_basestring;
+static PyObject *__pyx_n_s_buffer;
+static PyObject *__pyx_n_s_bytes;
+static PyObject *__pyx_n_s_bytes_sockopts;
+static PyObject *__pyx_n_s_cPickle;
+static PyObject *__pyx_n_s_char;
+static PyObject *__pyx_n_s_check_version;
+static PyObject *__pyx_n_s_closed;
+static PyObject *__pyx_n_s_codecs;
+static PyObject *__pyx_n_s_constants;
+static PyObject *__pyx_n_s_context;
+static PyObject *__pyx_kp_s_context_must_be_specified;
+static PyObject *__pyx_n_s_copy;
+static PyObject *__pyx_n_s_copy_mod;
+static PyObject *__pyx_n_s_data;
+static PyObject *__pyx_n_s_decode;
+static PyObject *__pyx_n_s_disconnect;
+static PyObject *__pyx_n_s_dtype;
+static PyObject *__pyx_n_s_encode;
+static PyObject *__pyx_n_s_events;
+static PyObject *__pyx_kp_s_expected_bytes_got_r;
+static PyObject *__pyx_kp_s_expected_int_got_r;
+static PyObject *__pyx_kp_s_expected_str_got_r;
+static PyObject *__pyx_n_s_fd_sockopts;
+static PyObject *__pyx_n_s_flags;
+static PyObject *__pyx_n_s_format;
+static PyObject *__pyx_n_s_getsockopt;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_s_int64_sockopts;
+static PyObject *__pyx_kp_s_ipc_path_0_is_longer_than_1_char;
+static PyObject *__pyx_n_s_itemsize;
+static PyObject *__pyx_n_s_jsonapi;
+static PyObject *__pyx_n_s_linger;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_monitor;
+static PyObject *__pyx_n_s_msg;
+static PyObject *__pyx_n_s_option;
+static PyObject *__pyx_n_s_optval;
+static PyObject *__pyx_n_s_pickle;
+static PyObject *__pyx_n_s_property;
+static PyObject *__pyx_n_s_pyx_vtable;
+static PyObject *__pyx_kp_s_r_does_not_provide_a_buffer_int;
+static PyObject *__pyx_n_s_random;
+static PyObject *__pyx_n_s_recv;
+static PyObject *__pyx_n_s_replace;
+static PyObject *__pyx_n_s_send;
+static PyObject *__pyx_n_s_shadow;
+static PyObject *__pyx_n_s_socket_type;
+static PyObject *__pyx_kp_s_socket_type_must_be_specified;
+static PyObject *__pyx_n_s_split;
+static PyObject *__pyx_n_s_struct;
+static PyObject *__pyx_n_s_sys;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_n_s_time;
+static PyObject *__pyx_n_s_track;
+static PyObject *__pyx_n_s_tracker;
+static PyObject *__pyx_n_s_typecode;
+static PyObject *__pyx_n_s_unbind;
+static PyObject *__pyx_n_s_underlying;
+static PyObject *__pyx_n_s_unicode;
+static PyObject *__pyx_kp_s_unicode_not_allowed_use_send_str;
+static PyObject *__pyx_kp_s_unicode_not_allowed_use_setsocko;
+static PyObject *__pyx_kp_s_utf_8;
+static PyObject *__pyx_n_s_zmq;
+static PyObject *__pyx_n_s_zmq_backend_cython;
+static PyObject *__pyx_n_s_zmq_backend_cython_constants;
+static PyObject *__pyx_n_s_zmq_error;
+static PyObject *__pyx_n_s_zmq_utils;
+static PyObject *__pyx_n_s_zmq_utils_strtypes;
+static PyObject *__pyx_int_0;
+static PyObject *__pyx_int_1;
+static PyObject *__pyx_int_2;
+static PyObject *__pyx_int_3;
+static PyObject *__pyx_int_neg_1;
+static int __pyx_k__15;
+static PyObject *__pyx_tuple_;
+static PyObject *__pyx_tuple__2;
+static PyObject *__pyx_tuple__3;
+static PyObject *__pyx_tuple__4;
+static PyObject *__pyx_tuple__5;
+static PyObject *__pyx_tuple__7;
+static PyObject *__pyx_tuple__8;
+static PyObject *__pyx_tuple__9;
+static PyObject *__pyx_tuple__10;
+static PyObject *__pyx_tuple__11;
+static PyObject *__pyx_tuple__12;
+static PyObject *__pyx_tuple__13;
+static PyObject *__pyx_tuple__14;
+static PyObject *__pyx_tuple__16;
+static PyObject *__pyx_tuple__17;
+static PyObject *__pyx_tuple__18;
+static PyObject *__pyx_tuple__19;
+static PyObject *__pyx_tuple__20;
+static PyObject *__pyx_tuple__21;
+static PyObject *__pyx_tuple__23;
+
+/* "zmq/backend/cython/socket.pyx":90
+ * # true methods frequently cannot be inlined, acc. Cython docs
+ *
+ * cdef inline _check_closed(Socket s): # <<<<<<<<<<<<<<
+ * """raise ENOTSUP if socket is closed
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_3zmq_7backend_6cython_6socket__check_closed(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_s) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_check_closed", 0);
+
+ /* "zmq/backend/cython/socket.pyx":95
+ * Does not do a deep check
+ * """
+ * if s._closed: # <<<<<<<<<<<<<<
+ * raise ZMQError(ENOTSOCK)
+ *
+ */
+ __pyx_t_1 = (__pyx_v_s->_closed != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/socket.pyx":96
+ * """
+ * if s._closed:
+ * raise ZMQError(ENOTSOCK) # <<<<<<<<<<<<<<
+ *
+ * cdef inline _check_closed_deep(Socket s):
+ */
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_ZMQError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ENOTSOCK); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ if (!__pyx_t_5) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ } else {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/socket.pyx":90
+ * # true methods frequently cannot be inlined, acc. Cython docs
+ *
+ * cdef inline _check_closed(Socket s): # <<<<<<<<<<<<<<
+ * """raise ENOTSUP if socket is closed
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("zmq.backend.cython.socket._check_closed", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/socket.pyx":98
+ * raise ZMQError(ENOTSOCK)
+ *
+ * cdef inline _check_closed_deep(Socket s): # <<<<<<<<<<<<<<
+ * """thorough check of whether the socket has been closed,
+ * even if by another entity (e.g. ctx.destroy).
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_3zmq_7backend_6cython_6socket__check_closed_deep(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_s) {
+ int __pyx_v_rc;
+ int __pyx_v_stype;
+ size_t __pyx_v_sz;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_t_6;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_check_closed_deep", 0);
+
+ /* "zmq/backend/cython/socket.pyx":109
+ * cdef int errno
+ * cdef int stype
+ * cdef size_t sz=sizeof(int) # <<<<<<<<<<<<<<
+ * if s._closed:
+ * return True
+ */
+ __pyx_v_sz = (sizeof(int));
+
+ /* "zmq/backend/cython/socket.pyx":110
+ * cdef int stype
+ * cdef size_t sz=sizeof(int)
+ * if s._closed: # <<<<<<<<<<<<<<
+ * return True
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_s->_closed != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/socket.pyx":111
+ * cdef size_t sz=sizeof(int)
+ * if s._closed:
+ * return True # <<<<<<<<<<<<<<
+ * else:
+ * rc = zmq_getsockopt(s.handle, ZMQ_TYPE, <void *>&stype, &sz)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(Py_True);
+ __pyx_r = Py_True;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "zmq/backend/cython/socket.pyx":113
+ * return True
+ * else:
+ * rc = zmq_getsockopt(s.handle, ZMQ_TYPE, <void *>&stype, &sz) # <<<<<<<<<<<<<<
+ * if rc < 0 and zmq_errno() == ENOTSOCK:
+ * s._closed = True
+ */
+ __pyx_v_rc = zmq_getsockopt(__pyx_v_s->handle, ZMQ_TYPE, ((void *)(&__pyx_v_stype)), (&__pyx_v_sz));
+
+ /* "zmq/backend/cython/socket.pyx":114
+ * else:
+ * rc = zmq_getsockopt(s.handle, ZMQ_TYPE, <void *>&stype, &sz)
+ * if rc < 0 and zmq_errno() == ENOTSOCK: # <<<<<<<<<<<<<<
+ * s._closed = True
+ * return True
+ */
+ __pyx_t_2 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L5_bool_binop_done;
+ }
+ __pyx_t_3 = __Pyx_PyInt_From_int(zmq_errno()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ENOTSOCK); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L5_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/socket.pyx":115
+ * rc = zmq_getsockopt(s.handle, ZMQ_TYPE, <void *>&stype, &sz)
+ * if rc < 0 and zmq_errno() == ENOTSOCK:
+ * s._closed = True # <<<<<<<<<<<<<<
+ * return True
+ * else:
+ */
+ __pyx_v_s->_closed = 1;
+
+ /* "zmq/backend/cython/socket.pyx":116
+ * if rc < 0 and zmq_errno() == ENOTSOCK:
+ * s._closed = True
+ * return True # <<<<<<<<<<<<<<
+ * else:
+ * _check_rc(rc)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(Py_True);
+ __pyx_r = Py_True;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "zmq/backend/cython/socket.pyx":118
+ * return True
+ * else:
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ * return False
+ *
+ */
+ __pyx_t_6 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+
+ /* "zmq/backend/cython/socket.pyx":119
+ * else:
+ * _check_rc(rc)
+ * return False # <<<<<<<<<<<<<<
+ *
+ * cdef inline Frame _recv_frame(void *handle, int flags=0, track=False):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(Py_False);
+ __pyx_r = Py_False;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/socket.pyx":98
+ * raise ZMQError(ENOTSOCK)
+ *
+ * cdef inline _check_closed_deep(Socket s): # <<<<<<<<<<<<<<
+ * """thorough check of whether the socket has been closed,
+ * even if by another entity (e.g. ctx.destroy).
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("zmq.backend.cython.socket._check_closed_deep", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/socket.pyx":121
+ * return False
+ *
+ * cdef inline Frame _recv_frame(void *handle, int flags=0, track=False): # <<<<<<<<<<<<<<
+ * """Receive a message in a non-copying manner and return a Frame."""
+ * cdef int rc
+ */
+
+static CYTHON_INLINE struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_f_3zmq_7backend_6cython_6socket__recv_frame(void *__pyx_v_handle, struct __pyx_opt_args_3zmq_7backend_6cython_6socket__recv_frame *__pyx_optional_args) {
+ int __pyx_v_flags = ((int)0);
+ PyObject *__pyx_v_track = ((PyObject *)Py_False);
+ int __pyx_v_rc;
+ PyObject *__pyx_v_msg = NULL;
+ struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_cmsg = 0;
+ struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_recv_frame", 0);
+ if (__pyx_optional_args) {
+ if (__pyx_optional_args->__pyx_n > 0) {
+ __pyx_v_flags = __pyx_optional_args->flags;
+ if (__pyx_optional_args->__pyx_n > 1) {
+ __pyx_v_track = __pyx_optional_args->track;
+ }
+ }
+ }
+
+ /* "zmq/backend/cython/socket.pyx":124
+ * """Receive a message in a non-copying manner and return a Frame."""
+ * cdef int rc
+ * msg = zmq.Frame(track=track) # <<<<<<<<<<<<<<
+ * cdef Frame cmsg = msg
+ *
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_zmq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Frame); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_track, __pyx_v_track) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_msg = __pyx_t_3;
+ __pyx_t_3 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":125
+ * cdef int rc
+ * msg = zmq.Frame(track=track)
+ * cdef Frame cmsg = msg # <<<<<<<<<<<<<<
+ *
+ * with nogil:
+ */
+ if (!(likely(((__pyx_v_msg) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_msg, __pyx_ptype_3zmq_7backend_6cython_7message_Frame))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_v_msg;
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_cmsg = ((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":127
+ * cdef Frame cmsg = msg
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * rc = zmq_msg_recv(&cmsg.zmq_msg, handle, flags)
+ *
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ #endif
+ /*try:*/ {
+
+ /* "zmq/backend/cython/socket.pyx":128
+ *
+ * with nogil:
+ * rc = zmq_msg_recv(&cmsg.zmq_msg, handle, flags) # <<<<<<<<<<<<<<
+ *
+ * _check_rc(rc)
+ */
+ __pyx_v_rc = zmq_msg_recv((&__pyx_v_cmsg->zmq_msg), __pyx_v_handle, __pyx_v_flags);
+ }
+
+ /* "zmq/backend/cython/socket.pyx":127
+ * cdef Frame cmsg = msg
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * rc = zmq_msg_recv(&cmsg.zmq_msg, handle, flags)
+ *
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+ }
+ }
+
+ /* "zmq/backend/cython/socket.pyx":130
+ * rc = zmq_msg_recv(&cmsg.zmq_msg, handle, flags)
+ *
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ * return msg
+ *
+ */
+ __pyx_t_4 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/socket.pyx":131
+ *
+ * _check_rc(rc)
+ * return msg # <<<<<<<<<<<<<<
+ *
+ * cdef inline object _recv_copy(void *handle, int flags=0):
+ */
+ __Pyx_XDECREF(((PyObject *)__pyx_r));
+ if (!(likely(((__pyx_v_msg) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_msg, __pyx_ptype_3zmq_7backend_6cython_7message_Frame))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_INCREF(__pyx_v_msg);
+ __pyx_r = ((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_v_msg);
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/socket.pyx":121
+ * return False
+ *
+ * cdef inline Frame _recv_frame(void *handle, int flags=0, track=False): # <<<<<<<<<<<<<<
+ * """Receive a message in a non-copying manner and return a Frame."""
+ * cdef int rc
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("zmq.backend.cython.socket._recv_frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_msg);
+ __Pyx_XDECREF((PyObject *)__pyx_v_cmsg);
+ __Pyx_XGIVEREF((PyObject *)__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/socket.pyx":133
+ * return msg
+ *
+ * cdef inline object _recv_copy(void *handle, int flags=0): # <<<<<<<<<<<<<<
+ * """Receive a message and return a copy"""
+ * cdef zmq_msg_t zmq_msg
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_3zmq_7backend_6cython_6socket__recv_copy(void *__pyx_v_handle, struct __pyx_opt_args_3zmq_7backend_6cython_6socket__recv_copy *__pyx_optional_args) {
+ int __pyx_v_flags = ((int)0);
+ zmq_msg_t __pyx_v_zmq_msg;
+ int __pyx_v_rc;
+ PyObject *__pyx_v_msg_bytes = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_recv_copy", 0);
+ if (__pyx_optional_args) {
+ if (__pyx_optional_args->__pyx_n > 0) {
+ __pyx_v_flags = __pyx_optional_args->flags;
+ }
+ }
+
+ /* "zmq/backend/cython/socket.pyx":136
+ * """Receive a message and return a copy"""
+ * cdef zmq_msg_t zmq_msg
+ * with nogil: # <<<<<<<<<<<<<<
+ * zmq_msg_init (&zmq_msg)
+ * rc = zmq_msg_recv(&zmq_msg, handle, flags)
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ #endif
+ /*try:*/ {
+
+ /* "zmq/backend/cython/socket.pyx":137
+ * cdef zmq_msg_t zmq_msg
+ * with nogil:
+ * zmq_msg_init (&zmq_msg) # <<<<<<<<<<<<<<
+ * rc = zmq_msg_recv(&zmq_msg, handle, flags)
+ * _check_rc(rc)
+ */
+ zmq_msg_init((&__pyx_v_zmq_msg));
+
+ /* "zmq/backend/cython/socket.pyx":138
+ * with nogil:
+ * zmq_msg_init (&zmq_msg)
+ * rc = zmq_msg_recv(&zmq_msg, handle, flags) # <<<<<<<<<<<<<<
+ * _check_rc(rc)
+ * msg_bytes = copy_zmq_msg_bytes(&zmq_msg)
+ */
+ __pyx_v_rc = zmq_msg_recv((&__pyx_v_zmq_msg), __pyx_v_handle, __pyx_v_flags);
+ }
+
+ /* "zmq/backend/cython/socket.pyx":136
+ * """Receive a message and return a copy"""
+ * cdef zmq_msg_t zmq_msg
+ * with nogil: # <<<<<<<<<<<<<<
+ * zmq_msg_init (&zmq_msg)
+ * rc = zmq_msg_recv(&zmq_msg, handle, flags)
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+ }
+ }
+
+ /* "zmq/backend/cython/socket.pyx":139
+ * zmq_msg_init (&zmq_msg)
+ * rc = zmq_msg_recv(&zmq_msg, handle, flags)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ * msg_bytes = copy_zmq_msg_bytes(&zmq_msg)
+ * zmq_msg_close(&zmq_msg)
+ */
+ __pyx_t_1 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/socket.pyx":140
+ * rc = zmq_msg_recv(&zmq_msg, handle, flags)
+ * _check_rc(rc)
+ * msg_bytes = copy_zmq_msg_bytes(&zmq_msg) # <<<<<<<<<<<<<<
+ * zmq_msg_close(&zmq_msg)
+ * return msg_bytes
+ */
+ __pyx_t_2 = __pyx_f_3zmq_7backend_6cython_7message_copy_zmq_msg_bytes((&__pyx_v_zmq_msg)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_v_msg_bytes = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":141
+ * _check_rc(rc)
+ * msg_bytes = copy_zmq_msg_bytes(&zmq_msg)
+ * zmq_msg_close(&zmq_msg) # <<<<<<<<<<<<<<
+ * return msg_bytes
+ *
+ */
+ zmq_msg_close((&__pyx_v_zmq_msg));
+
+ /* "zmq/backend/cython/socket.pyx":142
+ * msg_bytes = copy_zmq_msg_bytes(&zmq_msg)
+ * zmq_msg_close(&zmq_msg)
+ * return msg_bytes # <<<<<<<<<<<<<<
+ *
+ * cdef inline object _send_frame(void *handle, Frame msg, int flags=0):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_msg_bytes);
+ __pyx_r = __pyx_v_msg_bytes;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/socket.pyx":133
+ * return msg
+ *
+ * cdef inline object _recv_copy(void *handle, int flags=0): # <<<<<<<<<<<<<<
+ * """Receive a message and return a copy"""
+ * cdef zmq_msg_t zmq_msg
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("zmq.backend.cython.socket._recv_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_msg_bytes);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/socket.pyx":144
+ * return msg_bytes
+ *
+ * cdef inline object _send_frame(void *handle, Frame msg, int flags=0): # <<<<<<<<<<<<<<
+ * """Send a Frame on this socket in a non-copy manner."""
+ * cdef int rc
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_3zmq_7backend_6cython_6socket__send_frame(void *__pyx_v_handle, struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_msg, struct __pyx_opt_args_3zmq_7backend_6cython_6socket__send_frame *__pyx_optional_args) {
+ int __pyx_v_flags = ((int)0);
+ int __pyx_v_rc;
+ struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_msg_copy = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_send_frame", 0);
+ if (__pyx_optional_args) {
+ if (__pyx_optional_args->__pyx_n > 0) {
+ __pyx_v_flags = __pyx_optional_args->flags;
+ }
+ }
+
+ /* "zmq/backend/cython/socket.pyx":151
+ * # Always copy so the original message isn't garbage collected.
+ * # This doesn't do a real copy, just a reference.
+ * msg_copy = msg.fast_copy() # <<<<<<<<<<<<<<
+ *
+ * with nogil:
+ */
+ __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_3zmq_7backend_6cython_7message_Frame *)__pyx_v_msg->__pyx_vtab)->fast_copy(__pyx_v_msg)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_msg_copy = ((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":153
+ * msg_copy = msg.fast_copy()
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * rc = zmq_msg_send(&msg_copy.zmq_msg, handle, flags)
+ *
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ #endif
+ /*try:*/ {
+
+ /* "zmq/backend/cython/socket.pyx":154
+ *
+ * with nogil:
+ * rc = zmq_msg_send(&msg_copy.zmq_msg, handle, flags) # <<<<<<<<<<<<<<
+ *
+ * _check_rc(rc)
+ */
+ __pyx_v_rc = zmq_msg_send((&__pyx_v_msg_copy->zmq_msg), __pyx_v_handle, __pyx_v_flags);
+ }
+
+ /* "zmq/backend/cython/socket.pyx":153
+ * msg_copy = msg.fast_copy()
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * rc = zmq_msg_send(&msg_copy.zmq_msg, handle, flags)
+ *
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+ }
+ }
+
+ /* "zmq/backend/cython/socket.pyx":156
+ * rc = zmq_msg_send(&msg_copy.zmq_msg, handle, flags)
+ *
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ * return msg.tracker
+ *
+ */
+ __pyx_t_2 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/socket.pyx":157
+ *
+ * _check_rc(rc)
+ * return msg.tracker # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_msg->tracker);
+ __pyx_r = __pyx_v_msg->tracker;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/socket.pyx":144
+ * return msg_bytes
+ *
+ * cdef inline object _send_frame(void *handle, Frame msg, int flags=0): # <<<<<<<<<<<<<<
+ * """Send a Frame on this socket in a non-copy manner."""
+ * cdef int rc
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("zmq.backend.cython.socket._send_frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_msg_copy);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/socket.pyx":160
+ *
+ *
+ * cdef inline object _send_copy(void *handle, object msg, int flags=0): # <<<<<<<<<<<<<<
+ * """Send a message on this socket by copying its content."""
+ * cdef int rc, rc2
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_3zmq_7backend_6cython_6socket__send_copy(void *__pyx_v_handle, PyObject *__pyx_v_msg, struct __pyx_opt_args_3zmq_7backend_6cython_6socket__send_copy *__pyx_optional_args) {
+ int __pyx_v_flags = ((int)0);
+ int __pyx_v_rc;
+ int __pyx_v_rc2;
+ zmq_msg_t __pyx_v_data;
+ char *__pyx_v_msg_c;
+ Py_ssize_t __pyx_v_msg_c_len;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_send_copy", 0);
+ if (__pyx_optional_args) {
+ if (__pyx_optional_args->__pyx_n > 0) {
+ __pyx_v_flags = __pyx_optional_args->flags;
+ }
+ }
+
+ /* "zmq/backend/cython/socket.pyx":165
+ * cdef zmq_msg_t data
+ * cdef char *msg_c
+ * cdef Py_ssize_t msg_c_len=0 # <<<<<<<<<<<<<<
+ *
+ * # copy to c array:
+ */
+ __pyx_v_msg_c_len = 0;
+
+ /* "zmq/backend/cython/socket.pyx":168
+ *
+ * # copy to c array:
+ * asbuffer_r(msg, <void **>&msg_c, &msg_c_len) # <<<<<<<<<<<<<<
+ *
+ * # Copy the msg before sending. This avoids any complications with
+ */
+ __pyx_t_1 = __pyx_f_7buffers_asbuffer_r(__pyx_v_msg, ((void **)(&__pyx_v_msg_c)), (&__pyx_v_msg_c_len)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":173
+ * # the GIL, etc.
+ * # If zmq_msg_init_* fails we must not call zmq_msg_close (Bus Error)
+ * rc = zmq_msg_init_size(&data, msg_c_len) # <<<<<<<<<<<<<<
+ *
+ * _check_rc(rc)
+ */
+ __pyx_v_rc = zmq_msg_init_size((&__pyx_v_data), __pyx_v_msg_c_len);
+
+ /* "zmq/backend/cython/socket.pyx":175
+ * rc = zmq_msg_init_size(&data, msg_c_len)
+ *
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ *
+ * with nogil:
+ */
+ __pyx_t_2 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/socket.pyx":177
+ * _check_rc(rc)
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * memcpy(zmq_msg_data(&data), msg_c, zmq_msg_size(&data))
+ * rc = zmq_msg_send(&data, handle, flags)
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ #endif
+ /*try:*/ {
+
+ /* "zmq/backend/cython/socket.pyx":178
+ *
+ * with nogil:
+ * memcpy(zmq_msg_data(&data), msg_c, zmq_msg_size(&data)) # <<<<<<<<<<<<<<
+ * rc = zmq_msg_send(&data, handle, flags)
+ * rc2 = zmq_msg_close(&data)
+ */
+ memcpy(zmq_msg_data((&__pyx_v_data)), __pyx_v_msg_c, zmq_msg_size((&__pyx_v_data)));
+
+ /* "zmq/backend/cython/socket.pyx":179
+ * with nogil:
+ * memcpy(zmq_msg_data(&data), msg_c, zmq_msg_size(&data))
+ * rc = zmq_msg_send(&data, handle, flags) # <<<<<<<<<<<<<<
+ * rc2 = zmq_msg_close(&data)
+ * _check_rc(rc)
+ */
+ __pyx_v_rc = zmq_msg_send((&__pyx_v_data), __pyx_v_handle, __pyx_v_flags);
+
+ /* "zmq/backend/cython/socket.pyx":180
+ * memcpy(zmq_msg_data(&data), msg_c, zmq_msg_size(&data))
+ * rc = zmq_msg_send(&data, handle, flags)
+ * rc2 = zmq_msg_close(&data) # <<<<<<<<<<<<<<
+ * _check_rc(rc)
+ * _check_rc(rc2)
+ */
+ __pyx_v_rc2 = zmq_msg_close((&__pyx_v_data));
+ }
+
+ /* "zmq/backend/cython/socket.pyx":177
+ * _check_rc(rc)
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * memcpy(zmq_msg_data(&data), msg_c, zmq_msg_size(&data))
+ * rc = zmq_msg_send(&data, handle, flags)
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+ }
+ }
+
+ /* "zmq/backend/cython/socket.pyx":181
+ * rc = zmq_msg_send(&data, handle, flags)
+ * rc2 = zmq_msg_close(&data)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ * _check_rc(rc2)
+ *
+ */
+ __pyx_t_2 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/socket.pyx":182
+ * rc2 = zmq_msg_close(&data)
+ * _check_rc(rc)
+ * _check_rc(rc2) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc2); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/socket.pyx":160
+ *
+ *
+ * cdef inline object _send_copy(void *handle, object msg, int flags=0): # <<<<<<<<<<<<<<
+ * """Send a message on this socket by copying its content."""
+ * cdef int rc, rc2
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("zmq.backend.cython.socket._send_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/socket.pyx":208
+ *
+ * # no-op for the signature
+ * def __init__(self, context=None, socket_type=-1, shadow=0): # <<<<<<<<<<<<<<
+ * pass
+ *
+ */
+
+/* Python wrapper */
+static int __pyx_pw_3zmq_7backend_6cython_6socket_6Socket_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_3zmq_7backend_6cython_6socket_6Socket_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ CYTHON_UNUSED PyObject *__pyx_v_context = 0;
+ CYTHON_UNUSED PyObject *__pyx_v_socket_type = 0;
+ CYTHON_UNUSED PyObject *__pyx_v_shadow = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_socket_type,&__pyx_n_s_shadow,0};
+ PyObject* values[3] = {0,0,0};
+ values[0] = ((PyObject *)Py_None);
+ values[1] = ((PyObject *)__pyx_int_neg_1);
+ values[2] = ((PyObject *)__pyx_int_0);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context);
+ if (value) { values[0] = value; kw_args--; }
+ }
+ case 1:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_socket_type);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ case 2:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shadow);
+ if (value) { values[2] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_context = values[0];
+ __pyx_v_socket_type = values[1];
+ __pyx_v_shadow = values[2];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_6socket_6Socket___init__(((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)__pyx_v_self), __pyx_v_context, __pyx_v_socket_type, __pyx_v_shadow);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_3zmq_7backend_6cython_6socket_6Socket___init__(CYTHON_UNUSED struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_socket_type, CYTHON_UNUSED PyObject *__pyx_v_shadow) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__init__", 0);
+
+ /* function exit code */
+ __pyx_r = 0;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/socket.pyx":211
+ * pass
+ *
+ * def __cinit__(self, Context context=None, int socket_type=-1, size_t shadow=0, *args, **kwargs): # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t c_handle
+ *
+ */
+
+/* Python wrapper */
+static int __pyx_pw_3zmq_7backend_6cython_6socket_6Socket_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_3zmq_7backend_6cython_6socket_6Socket_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_context = 0;
+ int __pyx_v_socket_type;
+ size_t __pyx_v_shadow;
+ CYTHON_UNUSED PyObject *__pyx_v_args = 0;
+ CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+ __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
+ __Pyx_GOTREF(__pyx_v_kwargs);
+ if (PyTuple_GET_SIZE(__pyx_args) > 3) {
+ __pyx_v_args = PyTuple_GetSlice(__pyx_args, 3, PyTuple_GET_SIZE(__pyx_args));
+ if (unlikely(!__pyx_v_args)) {
+ __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ }
+ __Pyx_GOTREF(__pyx_v_args);
+ } else {
+ __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
+ }
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_socket_type,&__pyx_n_s_shadow,0};
+ PyObject* values[3] = {0,0,0};
+ values[0] = (PyObject *)((struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)Py_None);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ default:
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context);
+ if (value) { values[0] = value; kw_args--; }
+ }
+ case 1:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_socket_type);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ case 2:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shadow);
+ if (value) { values[2] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ const Py_ssize_t used_pos_args = (pos_args < 3) ? pos_args : 3;
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ default:
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ }
+ }
+ __pyx_v_context = ((struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)values[0]);
+ if (values[1]) {
+ __pyx_v_socket_type = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_socket_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ } else {
+ __pyx_v_socket_type = ((int)-1);
+ }
+ if (values[2]) {
+ __pyx_v_shadow = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_shadow == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ } else {
+ __pyx_v_shadow = ((size_t)0);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L3_error:;
+ __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
+ __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_3zmq_7backend_6cython_7context_Context, 1, "context", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_2__cinit__(((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)__pyx_v_self), __pyx_v_context, __pyx_v_socket_type, __pyx_v_shadow, __pyx_v_args, __pyx_v_kwargs);
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_args);
+ __Pyx_XDECREF(__pyx_v_kwargs);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_2__cinit__(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, struct __pyx_obj_3zmq_7backend_6cython_7context_Context *__pyx_v_context, int __pyx_v_socket_type, size_t __pyx_v_shadow, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__cinit__", 0);
+
+ /* "zmq/backend/cython/socket.pyx":214
+ * cdef Py_ssize_t c_handle
+ *
+ * self.handle = NULL # <<<<<<<<<<<<<<
+ * self.context = context
+ * if shadow:
+ */
+ __pyx_v_self->handle = NULL;
+
+ /* "zmq/backend/cython/socket.pyx":215
+ *
+ * self.handle = NULL
+ * self.context = context # <<<<<<<<<<<<<<
+ * if shadow:
+ * self._shadow = True
+ */
+ __Pyx_INCREF(((PyObject *)__pyx_v_context));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_context));
+ __Pyx_GOTREF(__pyx_v_self->context);
+ __Pyx_DECREF(((PyObject *)__pyx_v_self->context));
+ __pyx_v_self->context = __pyx_v_context;
+
+ /* "zmq/backend/cython/socket.pyx":216
+ * self.handle = NULL
+ * self.context = context
+ * if shadow: # <<<<<<<<<<<<<<
+ * self._shadow = True
+ * self.handle = <void *>shadow
+ */
+ __pyx_t_1 = (__pyx_v_shadow != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/socket.pyx":217
+ * self.context = context
+ * if shadow:
+ * self._shadow = True # <<<<<<<<<<<<<<
+ * self.handle = <void *>shadow
+ * else:
+ */
+ __pyx_v_self->_shadow = 1;
+
+ /* "zmq/backend/cython/socket.pyx":218
+ * if shadow:
+ * self._shadow = True
+ * self.handle = <void *>shadow # <<<<<<<<<<<<<<
+ * else:
+ * if context is None:
+ */
+ __pyx_v_self->handle = ((void *)__pyx_v_shadow);
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "zmq/backend/cython/socket.pyx":220
+ * self.handle = <void *>shadow
+ * else:
+ * if context is None: # <<<<<<<<<<<<<<
+ * raise TypeError("context must be specified")
+ * if socket_type < 0:
+ */
+ __pyx_t_1 = (((PyObject *)__pyx_v_context) == Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/socket.pyx":221
+ * else:
+ * if context is None:
+ * raise TypeError("context must be specified") # <<<<<<<<<<<<<<
+ * if socket_type < 0:
+ * raise TypeError("socket_type must be specified")
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/socket.pyx":222
+ * if context is None:
+ * raise TypeError("context must be specified")
+ * if socket_type < 0: # <<<<<<<<<<<<<<
+ * raise TypeError("socket_type must be specified")
+ * self._shadow = False
+ */
+ __pyx_t_2 = ((__pyx_v_socket_type < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/socket.pyx":223
+ * raise TypeError("context must be specified")
+ * if socket_type < 0:
+ * raise TypeError("socket_type must be specified") # <<<<<<<<<<<<<<
+ * self._shadow = False
+ * self.handle = zmq_socket(context.handle, socket_type)
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/socket.pyx":224
+ * if socket_type < 0:
+ * raise TypeError("socket_type must be specified")
+ * self._shadow = False # <<<<<<<<<<<<<<
+ * self.handle = zmq_socket(context.handle, socket_type)
+ * if self.handle == NULL:
+ */
+ __pyx_v_self->_shadow = 0;
+
+ /* "zmq/backend/cython/socket.pyx":225
+ * raise TypeError("socket_type must be specified")
+ * self._shadow = False
+ * self.handle = zmq_socket(context.handle, socket_type) # <<<<<<<<<<<<<<
+ * if self.handle == NULL:
+ * raise ZMQError()
+ */
+ __pyx_v_self->handle = zmq_socket(__pyx_v_context->handle, __pyx_v_socket_type);
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/socket.pyx":226
+ * self._shadow = False
+ * self.handle = zmq_socket(context.handle, socket_type)
+ * if self.handle == NULL: # <<<<<<<<<<<<<<
+ * raise ZMQError()
+ * self._closed = False
+ */
+ __pyx_t_2 = ((__pyx_v_self->handle == NULL) != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/socket.pyx":227
+ * self.handle = zmq_socket(context.handle, socket_type)
+ * if self.handle == NULL:
+ * raise ZMQError() # <<<<<<<<<<<<<<
+ * self._closed = False
+ * self._pid = getpid()
+ */
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ZMQError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ }
+ }
+ if (__pyx_t_5) {
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else {
+ __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/socket.pyx":228
+ * if self.handle == NULL:
+ * raise ZMQError()
+ * self._closed = False # <<<<<<<<<<<<<<
+ * self._pid = getpid()
+ * if context:
+ */
+ __pyx_v_self->_closed = 0;
+
+ /* "zmq/backend/cython/socket.pyx":229
+ * raise ZMQError()
+ * self._closed = False
+ * self._pid = getpid() # <<<<<<<<<<<<<<
+ * if context:
+ * context._add_socket(self.handle)
+ */
+ __pyx_v_self->_pid = getpid();
+
+ /* "zmq/backend/cython/socket.pyx":230
+ * self._closed = False
+ * self._pid = getpid()
+ * if context: # <<<<<<<<<<<<<<
+ * context._add_socket(self.handle)
+ *
+ */
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_context)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/socket.pyx":231
+ * self._pid = getpid()
+ * if context:
+ * context._add_socket(self.handle) # <<<<<<<<<<<<<<
+ *
+ * def __dealloc__(self):
+ */
+ ((struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context *)__pyx_v_context->__pyx_vtab)->_add_socket(__pyx_v_context, __pyx_v_self->handle);
+ goto __pyx_L7;
+ }
+ __pyx_L7:;
+
+ /* "zmq/backend/cython/socket.pyx":211
+ * pass
+ *
+ * def __cinit__(self, Context context=None, int socket_type=-1, size_t shadow=0, *args, **kwargs): # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t c_handle
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/socket.pyx":233
+ * context._add_socket(self.handle)
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * """remove from context's list
+ *
+ */
+
+/* Python wrapper */
+static void __pyx_pw_3zmq_7backend_6cython_6socket_6Socket_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_pw_3zmq_7backend_6cython_6socket_6Socket_5__dealloc__(PyObject *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+ __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_4__dealloc__(((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_4__dealloc__(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+ /* "zmq/backend/cython/socket.pyx":238
+ * But be careful that context might not exist if called during gc
+ * """
+ * if self.handle != NULL and not self._shadow and getpid() == self._pid: # <<<<<<<<<<<<<<
+ * # during gc, self.context might be NULL
+ * if self.context and not self.context.closed:
+ */
+ __pyx_t_2 = ((__pyx_v_self->handle != NULL) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_2 = ((!(__pyx_v_self->_shadow != 0)) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_2 = ((getpid() == __pyx_v_self->_pid) != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L4_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/socket.pyx":240
+ * if self.handle != NULL and not self._shadow and getpid() == self._pid:
+ * # during gc, self.context might be NULL
+ * if self.context and not self.context.closed: # <<<<<<<<<<<<<<
+ * self.context._remove_socket(self.handle)
+ *
+ */
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->context)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L8_bool_binop_done;
+ }
+ __pyx_t_2 = ((!(__pyx_v_self->context->closed != 0)) != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L8_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/socket.pyx":241
+ * # during gc, self.context might be NULL
+ * if self.context and not self.context.closed:
+ * self.context._remove_socket(self.handle) # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ ((struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context *)__pyx_v_self->context->__pyx_vtab)->_remove_socket(__pyx_v_self->context, __pyx_v_self->handle);
+ goto __pyx_L7;
+ }
+ __pyx_L7:;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/socket.pyx":233
+ * context._add_socket(self.handle)
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * """remove from context's list
+ *
+ */
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_WriteUnraisable("zmq.backend.cython.socket.Socket.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "zmq/backend/cython/socket.pyx":244
+ *
+ * @property
+ * def underlying(self): # <<<<<<<<<<<<<<
+ * """The address of the underlying libzmq socket"""
+ * return <size_t> self.handle
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_7underlying(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_6socket_6Socket_6underlying[] = "The address of the underlying libzmq socket";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_7underlying(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("underlying (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_6underlying(((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_6underlying(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("underlying", 0);
+
+ /* "zmq/backend/cython/socket.pyx":246
+ * def underlying(self):
+ * """The address of the underlying libzmq socket"""
+ * return <size_t> self.handle # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_self->handle)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/socket.pyx":244
+ *
+ * @property
+ * def underlying(self): # <<<<<<<<<<<<<<
+ * """The address of the underlying libzmq socket"""
+ * return <size_t> self.handle
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.underlying", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/socket.pyx":249
+ *
+ * @property
+ * def closed(self): # <<<<<<<<<<<<<<
+ * return _check_closed_deep(self)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_9closed(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_9closed(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("closed (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_8closed(((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_8closed(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("closed", 0);
+
+ /* "zmq/backend/cython/socket.pyx":250
+ * @property
+ * def closed(self):
+ * return _check_closed_deep(self) # <<<<<<<<<<<<<<
+ *
+ * def close(self, linger=None):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_f_3zmq_7backend_6cython_6socket__check_closed_deep(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/socket.pyx":249
+ *
+ * @property
+ * def closed(self): # <<<<<<<<<<<<<<
+ * return _check_closed_deep(self)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.closed", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/socket.pyx":252
+ * return _check_closed_deep(self)
+ *
+ * def close(self, linger=None): # <<<<<<<<<<<<<<
+ * """s.close(linger=None)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_11close(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_6socket_6Socket_10close[] = "s.close(linger=None)\n\n Close the socket.\n \n If linger is specified, LINGER sockopt will be set prior to closing.\n\n This can be called to close the socket by hand. If this is not\n called, the socket will automatically be closed when it is\n garbage collected.\n ";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_11close(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_linger = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("close (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_linger,0};
+ PyObject* values[1] = {0};
+ values[0] = ((PyObject *)Py_None);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_linger);
+ if (value) { values[0] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "close") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_linger = values[0];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("close", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_10close(((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)__pyx_v_self), __pyx_v_linger);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_10close(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, PyObject *__pyx_v_linger) {
+ int __pyx_v_rc;
+ int __pyx_v_linger_c;
+ int __pyx_v_setlinger;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("close", 0);
+
+ /* "zmq/backend/cython/socket.pyx":263
+ * garbage collected.
+ * """
+ * cdef int rc=0 # <<<<<<<<<<<<<<
+ * cdef int linger_c
+ * cdef bint setlinger=False
+ */
+ __pyx_v_rc = 0;
+
+ /* "zmq/backend/cython/socket.pyx":265
+ * cdef int rc=0
+ * cdef int linger_c
+ * cdef bint setlinger=False # <<<<<<<<<<<<<<
+ *
+ * if linger is not None:
+ */
+ __pyx_v_setlinger = 0;
+
+ /* "zmq/backend/cython/socket.pyx":267
+ * cdef bint setlinger=False
+ *
+ * if linger is not None: # <<<<<<<<<<<<<<
+ * linger_c = linger
+ * setlinger=True
+ */
+ __pyx_t_1 = (__pyx_v_linger != Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/socket.pyx":268
+ *
+ * if linger is not None:
+ * linger_c = linger # <<<<<<<<<<<<<<
+ * setlinger=True
+ *
+ */
+ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_linger); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_linger_c = __pyx_t_3;
+
+ /* "zmq/backend/cython/socket.pyx":269
+ * if linger is not None:
+ * linger_c = linger
+ * setlinger=True # <<<<<<<<<<<<<<
+ *
+ * if self.handle != NULL and not self._closed and getpid() == self._pid:
+ */
+ __pyx_v_setlinger = 1;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/socket.pyx":271
+ * setlinger=True
+ *
+ * if self.handle != NULL and not self._closed and getpid() == self._pid: # <<<<<<<<<<<<<<
+ * if setlinger:
+ * zmq_setsockopt(self.handle, ZMQ_LINGER, &linger_c, sizeof(int))
+ */
+ __pyx_t_1 = ((__pyx_v_self->handle != NULL) != 0);
+ if (__pyx_t_1) {
+ } else {
+ __pyx_t_2 = __pyx_t_1;
+ goto __pyx_L5_bool_binop_done;
+ }
+ __pyx_t_1 = ((!(__pyx_v_self->_closed != 0)) != 0);
+ if (__pyx_t_1) {
+ } else {
+ __pyx_t_2 = __pyx_t_1;
+ goto __pyx_L5_bool_binop_done;
+ }
+ __pyx_t_1 = ((getpid() == __pyx_v_self->_pid) != 0);
+ __pyx_t_2 = __pyx_t_1;
+ __pyx_L5_bool_binop_done:;
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/socket.pyx":272
+ *
+ * if self.handle != NULL and not self._closed and getpid() == self._pid:
+ * if setlinger: # <<<<<<<<<<<<<<
+ * zmq_setsockopt(self.handle, ZMQ_LINGER, &linger_c, sizeof(int))
+ * rc = zmq_close(self.handle)
+ */
+ __pyx_t_2 = (__pyx_v_setlinger != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/socket.pyx":273
+ * if self.handle != NULL and not self._closed and getpid() == self._pid:
+ * if setlinger:
+ * zmq_setsockopt(self.handle, ZMQ_LINGER, &linger_c, sizeof(int)) # <<<<<<<<<<<<<<
+ * rc = zmq_close(self.handle)
+ * if rc != 0 and zmq_errno() != ENOTSOCK:
+ */
+ zmq_setsockopt(__pyx_v_self->handle, ZMQ_LINGER, (&__pyx_v_linger_c), (sizeof(int)));
+ goto __pyx_L8;
+ }
+ __pyx_L8:;
+
+ /* "zmq/backend/cython/socket.pyx":274
+ * if setlinger:
+ * zmq_setsockopt(self.handle, ZMQ_LINGER, &linger_c, sizeof(int))
+ * rc = zmq_close(self.handle) # <<<<<<<<<<<<<<
+ * if rc != 0 and zmq_errno() != ENOTSOCK:
+ * # ignore ENOTSOCK (closed by Context)
+ */
+ __pyx_v_rc = zmq_close(__pyx_v_self->handle);
+
+ /* "zmq/backend/cython/socket.pyx":275
+ * zmq_setsockopt(self.handle, ZMQ_LINGER, &linger_c, sizeof(int))
+ * rc = zmq_close(self.handle)
+ * if rc != 0 and zmq_errno() != ENOTSOCK: # <<<<<<<<<<<<<<
+ * # ignore ENOTSOCK (closed by Context)
+ * _check_rc(rc)
+ */
+ __pyx_t_1 = ((__pyx_v_rc != 0) != 0);
+ if (__pyx_t_1) {
+ } else {
+ __pyx_t_2 = __pyx_t_1;
+ goto __pyx_L10_bool_binop_done;
+ }
+ __pyx_t_4 = __Pyx_PyInt_From_int(zmq_errno()); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_ENOTSOCK); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_2 = __pyx_t_1;
+ __pyx_L10_bool_binop_done:;
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/socket.pyx":277
+ * if rc != 0 and zmq_errno() != ENOTSOCK:
+ * # ignore ENOTSOCK (closed by Context)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ * self._closed = True
+ * # during gc, self.context might be NULL
+ */
+ __pyx_t_3 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L9;
+ }
+ __pyx_L9:;
+
+ /* "zmq/backend/cython/socket.pyx":278
+ * # ignore ENOTSOCK (closed by Context)
+ * _check_rc(rc)
+ * self._closed = True # <<<<<<<<<<<<<<
+ * # during gc, self.context might be NULL
+ * if self.context:
+ */
+ __pyx_v_self->_closed = 1;
+
+ /* "zmq/backend/cython/socket.pyx":280
+ * self._closed = True
+ * # during gc, self.context might be NULL
+ * if self.context: # <<<<<<<<<<<<<<
+ * self.context._remove_socket(self.handle)
+ * self.handle = NULL
+ */
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->context)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/socket.pyx":281
+ * # during gc, self.context might be NULL
+ * if self.context:
+ * self.context._remove_socket(self.handle) # <<<<<<<<<<<<<<
+ * self.handle = NULL
+ *
+ */
+ ((struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context *)__pyx_v_self->context->__pyx_vtab)->_remove_socket(__pyx_v_self->context, __pyx_v_self->handle);
+ goto __pyx_L12;
+ }
+ __pyx_L12:;
+
+ /* "zmq/backend/cython/socket.pyx":282
+ * if self.context:
+ * self.context._remove_socket(self.handle)
+ * self.handle = NULL # <<<<<<<<<<<<<<
+ *
+ * def set(self, int option, optval):
+ */
+ __pyx_v_self->handle = NULL;
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "zmq/backend/cython/socket.pyx":252
+ * return _check_closed_deep(self)
+ *
+ * def close(self, linger=None): # <<<<<<<<<<<<<<
+ * """s.close(linger=None)
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/socket.pyx":284
+ * self.handle = NULL
+ *
+ * def set(self, int option, optval): # <<<<<<<<<<<<<<
+ * """s.set(option, optval)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_13set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_6socket_6Socket_12set[] = "s.set(option, optval)\n\n Set socket options.\n\n See the 0MQ API documentation for details on specific options.\n\n Parameters\n ----------\n option : int\n The option to set. Available values will depend on your\n version of libzmq. Examples include::\n \n zmq.SUBSCRIBE, UNSUBSCRIBE, IDENTITY, HWM, LINGER, FD\n \n optval : int or bytes\n The value of the option to set.\n ";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_13set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ int __pyx_v_option;
+ PyObject *__pyx_v_optval = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("set (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_option,&__pyx_n_s_optval,0};
+ PyObject* values[2] = {0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_option)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_optval)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ }
+ __pyx_v_option = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_option == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_optval = values[1];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_12set(((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)__pyx_v_self), __pyx_v_option, __pyx_v_optval);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_12set(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, int __pyx_v_option, PyObject *__pyx_v_optval) {
+ pyzmq_int64_t __pyx_v_optval_int64_c;
+ int __pyx_v_optval_int_c;
+ int __pyx_v_rc;
+ char *__pyx_v_optval_c;
+ Py_ssize_t __pyx_v_sz;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ char *__pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ pyzmq_int64_t __pyx_t_8;
+ int __pyx_t_9;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("set", 0);
+
+ /* "zmq/backend/cython/socket.pyx":308
+ * cdef Py_ssize_t sz
+ *
+ * _check_closed(self) # <<<<<<<<<<<<<<
+ * if isinstance(optval, unicode):
+ * raise TypeError("unicode not allowed, use setsockopt_string")
+ */
+ __pyx_t_1 = __pyx_f_3zmq_7backend_6cython_6socket__check_closed(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":309
+ *
+ * _check_closed(self)
+ * if isinstance(optval, unicode): # <<<<<<<<<<<<<<
+ * raise TypeError("unicode not allowed, use setsockopt_string")
+ *
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyObject_IsInstance(__pyx_v_optval, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+
+ /* "zmq/backend/cython/socket.pyx":310
+ * _check_closed(self)
+ * if isinstance(optval, unicode):
+ * raise TypeError("unicode not allowed, use setsockopt_string") # <<<<<<<<<<<<<<
+ *
+ * if option in zmq.constants.bytes_sockopts:
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/socket.pyx":312
+ * raise TypeError("unicode not allowed, use setsockopt_string")
+ *
+ * if option in zmq.constants.bytes_sockopts: # <<<<<<<<<<<<<<
+ * if not isinstance(optval, bytes):
+ * raise TypeError('expected bytes, got: %r' % optval)
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_option); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_zmq); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_constants); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_bytes_sockopts); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_t_1, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/socket.pyx":313
+ *
+ * if option in zmq.constants.bytes_sockopts:
+ * if not isinstance(optval, bytes): # <<<<<<<<<<<<<<
+ * raise TypeError('expected bytes, got: %r' % optval)
+ * optval_c = PyBytes_AsString(optval)
+ */
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_2 = PyObject_IsInstance(__pyx_v_optval, __pyx_t_4); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
+ if (__pyx_t_3) {
+
+ /* "zmq/backend/cython/socket.pyx":314
+ * if option in zmq.constants.bytes_sockopts:
+ * if not isinstance(optval, bytes):
+ * raise TypeError('expected bytes, got: %r' % optval) # <<<<<<<<<<<<<<
+ * optval_c = PyBytes_AsString(optval)
+ * sz = PyBytes_Size(optval)
+ */
+ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_expected_bytes_got_r, __pyx_v_optval); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/socket.pyx":315
+ * if not isinstance(optval, bytes):
+ * raise TypeError('expected bytes, got: %r' % optval)
+ * optval_c = PyBytes_AsString(optval) # <<<<<<<<<<<<<<
+ * sz = PyBytes_Size(optval)
+ * rc = zmq_setsockopt(
+ */
+ __pyx_t_6 = PyBytes_AsString(__pyx_v_optval); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_optval_c = __pyx_t_6;
+
+ /* "zmq/backend/cython/socket.pyx":316
+ * raise TypeError('expected bytes, got: %r' % optval)
+ * optval_c = PyBytes_AsString(optval)
+ * sz = PyBytes_Size(optval) # <<<<<<<<<<<<<<
+ * rc = zmq_setsockopt(
+ * self.handle, option,
+ */
+ __pyx_t_7 = PyBytes_Size(__pyx_v_optval); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_sz = __pyx_t_7;
+
+ /* "zmq/backend/cython/socket.pyx":317
+ * optval_c = PyBytes_AsString(optval)
+ * sz = PyBytes_Size(optval)
+ * rc = zmq_setsockopt( # <<<<<<<<<<<<<<
+ * self.handle, option,
+ * optval_c, sz
+ */
+ __pyx_v_rc = zmq_setsockopt(__pyx_v_self->handle, __pyx_v_option, __pyx_v_optval_c, __pyx_v_sz);
+ goto __pyx_L4;
+ }
+
+ /* "zmq/backend/cython/socket.pyx":321
+ * optval_c, sz
+ * )
+ * elif option in zmq.constants.int64_sockopts: # <<<<<<<<<<<<<<
+ * if not isinstance(optval, int):
+ * raise TypeError('expected int, got: %r' % optval)
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_option); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_zmq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_constants); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64_sockopts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_t_4, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/socket.pyx":322
+ * )
+ * elif option in zmq.constants.int64_sockopts:
+ * if not isinstance(optval, int): # <<<<<<<<<<<<<<
+ * raise TypeError('expected int, got: %r' % optval)
+ * optval_int64_c = optval
+ */
+ __pyx_t_2 = PyInt_Check(__pyx_v_optval);
+ __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
+ if (__pyx_t_3) {
+
+ /* "zmq/backend/cython/socket.pyx":323
+ * elif option in zmq.constants.int64_sockopts:
+ * if not isinstance(optval, int):
+ * raise TypeError('expected int, got: %r' % optval) # <<<<<<<<<<<<<<
+ * optval_int64_c = optval
+ * rc = zmq_setsockopt(
+ */
+ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_expected_int_got_r, __pyx_v_optval); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/socket.pyx":324
+ * if not isinstance(optval, int):
+ * raise TypeError('expected int, got: %r' % optval)
+ * optval_int64_c = optval # <<<<<<<<<<<<<<
+ * rc = zmq_setsockopt(
+ * self.handle, option,
+ */
+ __pyx_t_8 = __Pyx_PyInt_As_pyzmq_int64_t(__pyx_v_optval); if (unlikely((__pyx_t_8 == (pyzmq_int64_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_optval_int64_c = __pyx_t_8;
+
+ /* "zmq/backend/cython/socket.pyx":325
+ * raise TypeError('expected int, got: %r' % optval)
+ * optval_int64_c = optval
+ * rc = zmq_setsockopt( # <<<<<<<<<<<<<<
+ * self.handle, option,
+ * &optval_int64_c, sizeof(int64_t)
+ */
+ __pyx_v_rc = zmq_setsockopt(__pyx_v_self->handle, __pyx_v_option, (&__pyx_v_optval_int64_c), (sizeof(pyzmq_int64_t)));
+ goto __pyx_L4;
+ }
+ /*else*/ {
+
+ /* "zmq/backend/cython/socket.pyx":335
+ * # sockopts will still raise just the same, but it will be libzmq doing
+ * # the raising.
+ * if not isinstance(optval, int): # <<<<<<<<<<<<<<
+ * raise TypeError('expected int, got: %r' % optval)
+ * optval_int_c = optval
+ */
+ __pyx_t_3 = PyInt_Check(__pyx_v_optval);
+ __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/socket.pyx":336
+ * # the raising.
+ * if not isinstance(optval, int):
+ * raise TypeError('expected int, got: %r' % optval) # <<<<<<<<<<<<<<
+ * optval_int_c = optval
+ * rc = zmq_setsockopt(
+ */
+ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_expected_int_got_r, __pyx_v_optval); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/socket.pyx":337
+ * if not isinstance(optval, int):
+ * raise TypeError('expected int, got: %r' % optval)
+ * optval_int_c = optval # <<<<<<<<<<<<<<
+ * rc = zmq_setsockopt(
+ * self.handle, option,
+ */
+ __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_optval); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_optval_int_c = __pyx_t_9;
+
+ /* "zmq/backend/cython/socket.pyx":338
+ * raise TypeError('expected int, got: %r' % optval)
+ * optval_int_c = optval
+ * rc = zmq_setsockopt( # <<<<<<<<<<<<<<
+ * self.handle, option,
+ * &optval_int_c, sizeof(int)
+ */
+ __pyx_v_rc = zmq_setsockopt(__pyx_v_self->handle, __pyx_v_option, (&__pyx_v_optval_int_c), (sizeof(int)));
+ }
+ __pyx_L4:;
+
+ /* "zmq/backend/cython/socket.pyx":343
+ * )
+ *
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ *
+ * def get(self, int option):
+ */
+ __pyx_t_9 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/socket.pyx":284
+ * self.handle = NULL
+ *
+ * def set(self, int option, optval): # <<<<<<<<<<<<<<
+ * """s.set(option, optval)
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/socket.pyx":345
+ * _check_rc(rc)
+ *
+ * def get(self, int option): # <<<<<<<<<<<<<<
+ * """s.get(option)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_15get(PyObject *__pyx_v_self, PyObject *__pyx_arg_option); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_6socket_6Socket_14get[] = "s.get(option)\n\n Get the value of a socket option.\n\n See the 0MQ API documentation for details on specific options.\n\n Parameters\n ----------\n option : int\n The option to get. Available values will depend on your\n version of libzmq. Examples include::\n \n zmq.IDENTITY, HWM, LINGER, FD, EVENTS\n\n Returns\n -------\n optval : int or bytes\n The value of the option as a bytestring or int.\n ";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_15get(PyObject *__pyx_v_self, PyObject *__pyx_arg_option) {
+ int __pyx_v_option;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("get (wrapper)", 0);
+ assert(__pyx_arg_option); {
+ __pyx_v_option = __Pyx_PyInt_As_int(__pyx_arg_option); if (unlikely((__pyx_v_option == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_14get(((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)__pyx_v_self), ((int)__pyx_v_option));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_14get(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, int __pyx_v_option) {
+ pyzmq_int64_t __pyx_v_optval_int64_c;
+ int __pyx_v_optval_int_c;
+ ZMQ_FD_T __pyx_v_optval_fd_c;
+ char __pyx_v_identity_str_c[255];
+ size_t __pyx_v_sz;
+ int __pyx_v_rc;
+ PyObject *__pyx_v_result = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ int __pyx_t_6;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("get", 0);
+
+ /* "zmq/backend/cython/socket.pyx":372
+ * cdef int rc
+ *
+ * _check_closed(self) # <<<<<<<<<<<<<<
+ *
+ * if option in zmq.constants.bytes_sockopts:
+ */
+ __pyx_t_1 = __pyx_f_3zmq_7backend_6cython_6socket__check_closed(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":374
+ * _check_closed(self)
+ *
+ * if option in zmq.constants.bytes_sockopts: # <<<<<<<<<<<<<<
+ * sz = 255
+ * rc = zmq_getsockopt(self.handle, option, <void *>identity_str_c, &sz)
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_option); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_zmq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_constants); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_bytes_sockopts); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_5 = (__pyx_t_4 != 0);
+ if (__pyx_t_5) {
+
+ /* "zmq/backend/cython/socket.pyx":375
+ *
+ * if option in zmq.constants.bytes_sockopts:
+ * sz = 255 # <<<<<<<<<<<<<<
+ * rc = zmq_getsockopt(self.handle, option, <void *>identity_str_c, &sz)
+ * _check_rc(rc)
+ */
+ __pyx_v_sz = 255;
+
+ /* "zmq/backend/cython/socket.pyx":376
+ * if option in zmq.constants.bytes_sockopts:
+ * sz = 255
+ * rc = zmq_getsockopt(self.handle, option, <void *>identity_str_c, &sz) # <<<<<<<<<<<<<<
+ * _check_rc(rc)
+ * # strip null-terminated strings *except* identity
+ */
+ __pyx_v_rc = zmq_getsockopt(__pyx_v_self->handle, __pyx_v_option, ((void *)__pyx_v_identity_str_c), (&__pyx_v_sz));
+
+ /* "zmq/backend/cython/socket.pyx":377
+ * sz = 255
+ * rc = zmq_getsockopt(self.handle, option, <void *>identity_str_c, &sz)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ * # strip null-terminated strings *except* identity
+ * if option != ZMQ_IDENTITY and sz > 0 and (<char *>identity_str_c)[sz-1] == b'\0':
+ */
+ __pyx_t_6 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/socket.pyx":379
+ * _check_rc(rc)
+ * # strip null-terminated strings *except* identity
+ * if option != ZMQ_IDENTITY and sz > 0 and (<char *>identity_str_c)[sz-1] == b'\0': # <<<<<<<<<<<<<<
+ * sz -= 1
+ * result = PyBytes_FromStringAndSize(<char *>identity_str_c, sz)
+ */
+ __pyx_t_4 = ((__pyx_v_option != ZMQ_IDENTITY) != 0);
+ if (__pyx_t_4) {
+ } else {
+ __pyx_t_5 = __pyx_t_4;
+ goto __pyx_L5_bool_binop_done;
+ }
+ __pyx_t_4 = ((__pyx_v_sz > 0) != 0);
+ if (__pyx_t_4) {
+ } else {
+ __pyx_t_5 = __pyx_t_4;
+ goto __pyx_L5_bool_binop_done;
+ }
+ __pyx_t_4 = (((((char *)__pyx_v_identity_str_c)[(__pyx_v_sz - 1)]) == '\x00') != 0);
+ __pyx_t_5 = __pyx_t_4;
+ __pyx_L5_bool_binop_done:;
+ if (__pyx_t_5) {
+
+ /* "zmq/backend/cython/socket.pyx":380
+ * # strip null-terminated strings *except* identity
+ * if option != ZMQ_IDENTITY and sz > 0 and (<char *>identity_str_c)[sz-1] == b'\0':
+ * sz -= 1 # <<<<<<<<<<<<<<
+ * result = PyBytes_FromStringAndSize(<char *>identity_str_c, sz)
+ * elif option in zmq.constants.int64_sockopts:
+ */
+ __pyx_v_sz = (__pyx_v_sz - 1);
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "zmq/backend/cython/socket.pyx":381
+ * if option != ZMQ_IDENTITY and sz > 0 and (<char *>identity_str_c)[sz-1] == b'\0':
+ * sz -= 1
+ * result = PyBytes_FromStringAndSize(<char *>identity_str_c, sz) # <<<<<<<<<<<<<<
+ * elif option in zmq.constants.int64_sockopts:
+ * sz = sizeof(int64_t)
+ */
+ __pyx_t_2 = PyBytes_FromStringAndSize(((char *)__pyx_v_identity_str_c), __pyx_v_sz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_v_result = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L3;
+ }
+
+ /* "zmq/backend/cython/socket.pyx":382
+ * sz -= 1
+ * result = PyBytes_FromStringAndSize(<char *>identity_str_c, sz)
+ * elif option in zmq.constants.int64_sockopts: # <<<<<<<<<<<<<<
+ * sz = sizeof(int64_t)
+ * rc = zmq_getsockopt(self.handle, option, <void *>&optval_int64_c, &sz)
+ */
+ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_option); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_zmq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_constants); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64_sockopts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_4 = (__pyx_t_5 != 0);
+ if (__pyx_t_4) {
+
+ /* "zmq/backend/cython/socket.pyx":383
+ * result = PyBytes_FromStringAndSize(<char *>identity_str_c, sz)
+ * elif option in zmq.constants.int64_sockopts:
+ * sz = sizeof(int64_t) # <<<<<<<<<<<<<<
+ * rc = zmq_getsockopt(self.handle, option, <void *>&optval_int64_c, &sz)
+ * _check_rc(rc)
+ */
+ __pyx_v_sz = (sizeof(pyzmq_int64_t));
+
+ /* "zmq/backend/cython/socket.pyx":384
+ * elif option in zmq.constants.int64_sockopts:
+ * sz = sizeof(int64_t)
+ * rc = zmq_getsockopt(self.handle, option, <void *>&optval_int64_c, &sz) # <<<<<<<<<<<<<<
+ * _check_rc(rc)
+ * result = optval_int64_c
+ */
+ __pyx_v_rc = zmq_getsockopt(__pyx_v_self->handle, __pyx_v_option, ((void *)(&__pyx_v_optval_int64_c)), (&__pyx_v_sz));
+
+ /* "zmq/backend/cython/socket.pyx":385
+ * sz = sizeof(int64_t)
+ * rc = zmq_getsockopt(self.handle, option, <void *>&optval_int64_c, &sz)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ * result = optval_int64_c
+ * elif option in zmq.constants.fd_sockopts:
+ */
+ __pyx_t_6 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/socket.pyx":386
+ * rc = zmq_getsockopt(self.handle, option, <void *>&optval_int64_c, &sz)
+ * _check_rc(rc)
+ * result = optval_int64_c # <<<<<<<<<<<<<<
+ * elif option in zmq.constants.fd_sockopts:
+ * sz = sizeof(fd_t)
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_pyzmq_int64_t(__pyx_v_optval_int64_c); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_result = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L3;
+ }
+
+ /* "zmq/backend/cython/socket.pyx":387
+ * _check_rc(rc)
+ * result = optval_int64_c
+ * elif option in zmq.constants.fd_sockopts: # <<<<<<<<<<<<<<
+ * sz = sizeof(fd_t)
+ * rc = zmq_getsockopt(self.handle, option, <void *>&optval_fd_c, &sz)
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_option); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_zmq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_constants); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fd_sockopts); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_5 = (__pyx_t_4 != 0);
+ if (__pyx_t_5) {
+
+ /* "zmq/backend/cython/socket.pyx":388
+ * result = optval_int64_c
+ * elif option in zmq.constants.fd_sockopts:
+ * sz = sizeof(fd_t) # <<<<<<<<<<<<<<
+ * rc = zmq_getsockopt(self.handle, option, <void *>&optval_fd_c, &sz)
+ * _check_rc(rc)
+ */
+ __pyx_v_sz = (sizeof(ZMQ_FD_T));
+
+ /* "zmq/backend/cython/socket.pyx":389
+ * elif option in zmq.constants.fd_sockopts:
+ * sz = sizeof(fd_t)
+ * rc = zmq_getsockopt(self.handle, option, <void *>&optval_fd_c, &sz) # <<<<<<<<<<<<<<
+ * _check_rc(rc)
+ * result = optval_fd_c
+ */
+ __pyx_v_rc = zmq_getsockopt(__pyx_v_self->handle, __pyx_v_option, ((void *)(&__pyx_v_optval_fd_c)), (&__pyx_v_sz));
+
+ /* "zmq/backend/cython/socket.pyx":390
+ * sz = sizeof(fd_t)
+ * rc = zmq_getsockopt(self.handle, option, <void *>&optval_fd_c, &sz)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ * result = optval_fd_c
+ * else:
+ */
+ __pyx_t_6 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/socket.pyx":391
+ * rc = zmq_getsockopt(self.handle, option, <void *>&optval_fd_c, &sz)
+ * _check_rc(rc)
+ * result = optval_fd_c # <<<<<<<<<<<<<<
+ * else:
+ * # default is to assume int, which is what most new sockopts will be
+ */
+ __pyx_t_2 = __Pyx_PyInt_From_ZMQ_FD_T(__pyx_v_optval_fd_c); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_v_result = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "zmq/backend/cython/socket.pyx":398
+ * # sockopts will still raise just the same, but it will be libzmq doing
+ * # the raising.
+ * sz = sizeof(int) # <<<<<<<<<<<<<<
+ * rc = zmq_getsockopt(self.handle, option, <void *>&optval_int_c, &sz)
+ * _check_rc(rc)
+ */
+ __pyx_v_sz = (sizeof(int));
+
+ /* "zmq/backend/cython/socket.pyx":399
+ * # the raising.
+ * sz = sizeof(int)
+ * rc = zmq_getsockopt(self.handle, option, <void *>&optval_int_c, &sz) # <<<<<<<<<<<<<<
+ * _check_rc(rc)
+ * result = optval_int_c
+ */
+ __pyx_v_rc = zmq_getsockopt(__pyx_v_self->handle, __pyx_v_option, ((void *)(&__pyx_v_optval_int_c)), (&__pyx_v_sz));
+
+ /* "zmq/backend/cython/socket.pyx":400
+ * sz = sizeof(int)
+ * rc = zmq_getsockopt(self.handle, option, <void *>&optval_int_c, &sz)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ * result = optval_int_c
+ *
+ */
+ __pyx_t_6 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/socket.pyx":401
+ * rc = zmq_getsockopt(self.handle, option, <void *>&optval_int_c, &sz)
+ * _check_rc(rc)
+ * result = optval_int_c # <<<<<<<<<<<<<<
+ *
+ * return result
+ */
+ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_optval_int_c); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_v_result = __pyx_t_2;
+ __pyx_t_2 = 0;
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/socket.pyx":403
+ * result = optval_int_c
+ *
+ * return result # <<<<<<<<<<<<<<
+ *
+ * def bind(self, addr):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_result);
+ __pyx_r = __pyx_v_result;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/socket.pyx":345
+ * _check_rc(rc)
+ *
+ * def get(self, int option): # <<<<<<<<<<<<<<
+ * """s.get(option)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/socket.pyx":405
+ * return result
+ *
+ * def bind(self, addr): # <<<<<<<<<<<<<<
+ * """s.bind(addr)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_17bind(PyObject *__pyx_v_self, PyObject *__pyx_v_addr); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_6socket_6Socket_16bind[] = "s.bind(addr)\n\n Bind the socket to an address.\n\n This causes the socket to listen on a network port. Sockets on the\n other side of this connection will use ``Socket.connect(addr)`` to\n connect to this socket.\n\n Parameters\n ----------\n addr : str\n The address string. This has the form 'protocol://interface:port',\n for example 'tcp://127.0.0.1:5555'. Protocols supported include\n tcp, udp, pgm, epgm, inproc and ipc. If the address is unicode, it is\n encoded to utf-8 first.\n ";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_17bind(PyObject *__pyx_v_self, PyObject *__pyx_v_addr) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("bind (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_16bind(((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)__pyx_v_self), ((PyObject *)__pyx_v_addr));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_16bind(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, PyObject *__pyx_v_addr) {
+ int __pyx_v_rc;
+ char *__pyx_v_c_addr;
+ PyObject *__pyx_v_path = NULL;
+ PyObject *__pyx_v_msg = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ char *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ Py_ssize_t __pyx_t_8;
+ PyObject *__pyx_t_9 = NULL;
+ int __pyx_t_10;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("bind", 0);
+ __Pyx_INCREF(__pyx_v_addr);
+
+ /* "zmq/backend/cython/socket.pyx":425
+ * cdef char* c_addr
+ *
+ * _check_closed(self) # <<<<<<<<<<<<<<
+ * if isinstance(addr, unicode):
+ * addr = addr.encode('utf-8')
+ */
+ __pyx_t_1 = __pyx_f_3zmq_7backend_6cython_6socket__check_closed(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":426
+ *
+ * _check_closed(self)
+ * if isinstance(addr, unicode): # <<<<<<<<<<<<<<
+ * addr = addr.encode('utf-8')
+ * if not isinstance(addr, bytes):
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyObject_IsInstance(__pyx_v_addr, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+
+ /* "zmq/backend/cython/socket.pyx":427
+ * _check_closed(self)
+ * if isinstance(addr, unicode):
+ * addr = addr.encode('utf-8') # <<<<<<<<<<<<<<
+ * if not isinstance(addr, bytes):
+ * raise TypeError('expected str, got: %r' % addr)
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_addr, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF_SET(__pyx_v_addr, __pyx_t_4);
+ __pyx_t_4 = 0;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/socket.pyx":428
+ * if isinstance(addr, unicode):
+ * addr = addr.encode('utf-8')
+ * if not isinstance(addr, bytes): # <<<<<<<<<<<<<<
+ * raise TypeError('expected str, got: %r' % addr)
+ * c_addr = addr
+ */
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = PyObject_IsInstance(__pyx_v_addr, __pyx_t_4); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/socket.pyx":429
+ * addr = addr.encode('utf-8')
+ * if not isinstance(addr, bytes):
+ * raise TypeError('expected str, got: %r' % addr) # <<<<<<<<<<<<<<
+ * c_addr = addr
+ * rc = zmq_bind(self.handle, c_addr)
+ */
+ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_expected_str_got_r, __pyx_v_addr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/socket.pyx":430
+ * if not isinstance(addr, bytes):
+ * raise TypeError('expected str, got: %r' % addr)
+ * c_addr = addr # <<<<<<<<<<<<<<
+ * rc = zmq_bind(self.handle, c_addr)
+ * if rc != 0:
+ */
+ __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_addr); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_c_addr = __pyx_t_5;
+
+ /* "zmq/backend/cython/socket.pyx":431
+ * raise TypeError('expected str, got: %r' % addr)
+ * c_addr = addr
+ * rc = zmq_bind(self.handle, c_addr) # <<<<<<<<<<<<<<
+ * if rc != 0:
+ * if IPC_PATH_MAX_LEN and zmq_errno() == ENAMETOOLONG:
+ */
+ __pyx_v_rc = zmq_bind(__pyx_v_self->handle, __pyx_v_c_addr);
+
+ /* "zmq/backend/cython/socket.pyx":432
+ * c_addr = addr
+ * rc = zmq_bind(self.handle, c_addr)
+ * if rc != 0: # <<<<<<<<<<<<<<
+ * if IPC_PATH_MAX_LEN and zmq_errno() == ENAMETOOLONG:
+ * # py3compat: addr is bytes, but msg wants str
+ */
+ __pyx_t_2 = ((__pyx_v_rc != 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/socket.pyx":433
+ * rc = zmq_bind(self.handle, c_addr)
+ * if rc != 0:
+ * if IPC_PATH_MAX_LEN and zmq_errno() == ENAMETOOLONG: # <<<<<<<<<<<<<<
+ * # py3compat: addr is bytes, but msg wants str
+ * if str is unicode:
+ */
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_IPC_PATH_MAX_LEN); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (__pyx_t_3) {
+ } else {
+ __pyx_t_2 = __pyx_t_3;
+ goto __pyx_L7_bool_binop_done;
+ }
+ __pyx_t_3 = ((zmq_errno() == ENAMETOOLONG) != 0);
+ __pyx_t_2 = __pyx_t_3;
+ __pyx_L7_bool_binop_done:;
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/socket.pyx":435
+ * if IPC_PATH_MAX_LEN and zmq_errno() == ENAMETOOLONG:
+ * # py3compat: addr is bytes, but msg wants str
+ * if str is unicode: # <<<<<<<<<<<<<<
+ * addr = addr.decode('utf-8', 'replace')
+ * path = addr.split('://', 1)[-1]
+ */
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_2 = (((PyObject*)(&PyString_Type)) == ((PyObject*)__pyx_t_4));
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+
+ /* "zmq/backend/cython/socket.pyx":436
+ * # py3compat: addr is bytes, but msg wants str
+ * if str is unicode:
+ * addr = addr.decode('utf-8', 'replace') # <<<<<<<<<<<<<<
+ * path = addr.split('://', 1)[-1]
+ * msg = ('ipc path "{0}" is longer than {1} '
+ */
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_addr, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF_SET(__pyx_v_addr, __pyx_t_1);
+ __pyx_t_1 = 0;
+ goto __pyx_L9;
+ }
+ __pyx_L9:;
+
+ /* "zmq/backend/cython/socket.pyx":437
+ * if str is unicode:
+ * addr = addr.decode('utf-8', 'replace')
+ * path = addr.split('://', 1)[-1] # <<<<<<<<<<<<<<
+ * msg = ('ipc path "{0}" is longer than {1} '
+ * 'characters (sizeof(sockaddr_un.sun_path)). '
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_addr, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_v_path = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":442
+ * 'zmq.IPC_PATH_MAX_LEN constant can be used '
+ * 'to check addr length (if it is defined).'
+ * .format(path, IPC_PATH_MAX_LEN)) # <<<<<<<<<<<<<<
+ * raise ZMQError(msg=msg)
+ * _check_rc(rc)
+ */
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_ipc_path_0_is_longer_than_1_char, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_IPC_PATH_MAX_LEN); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_7 = NULL;
+ __pyx_t_8 = 0;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_7)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_7);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ __pyx_t_8 = 1;
+ }
+ }
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__pyx_t_7) {
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_path);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_path);
+ __Pyx_GIVEREF(__pyx_v_path);
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_v_msg = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":443
+ * 'to check addr length (if it is defined).'
+ * .format(path, IPC_PATH_MAX_LEN))
+ * raise ZMQError(msg=msg) # <<<<<<<<<<<<<<
+ * _check_rc(rc)
+ *
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ZMQError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_msg, __pyx_v_msg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_Raise(__pyx_t_9, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+
+ /* "zmq/backend/cython/socket.pyx":444
+ * .format(path, IPC_PATH_MAX_LEN))
+ * raise ZMQError(msg=msg)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ *
+ * def connect(self, addr):
+ */
+ __pyx_t_10 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/socket.pyx":405
+ * return result
+ *
+ * def bind(self, addr): # <<<<<<<<<<<<<<
+ * """s.bind(addr)
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.bind", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_path);
+ __Pyx_XDECREF(__pyx_v_msg);
+ __Pyx_XDECREF(__pyx_v_addr);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/socket.pyx":446
+ * _check_rc(rc)
+ *
+ * def connect(self, addr): # <<<<<<<<<<<<<<
+ * """s.connect(addr)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_19connect(PyObject *__pyx_v_self, PyObject *__pyx_v_addr); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_6socket_6Socket_18connect[] = "s.connect(addr)\n\n Connect to a remote 0MQ socket.\n\n Parameters\n ----------\n addr : str\n The address string. This has the form 'protocol://interface:port',\n for example 'tcp://127.0.0.1:5555'. Protocols supported are\n tcp, upd, pgm, inproc and ipc. If the address is unicode, it is\n encoded to utf-8 first.\n ";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_19connect(PyObject *__pyx_v_self, PyObject *__pyx_v_addr) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("connect (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_18connect(((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)__pyx_v_self), ((PyObject *)__pyx_v_addr));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_18connect(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, PyObject *__pyx_v_addr) {
+ int __pyx_v_rc;
+ char *__pyx_v_c_addr;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ char *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("connect", 0);
+ __Pyx_INCREF(__pyx_v_addr);
+
+ /* "zmq/backend/cython/socket.pyx":462
+ * cdef char* c_addr
+ *
+ * _check_closed(self) # <<<<<<<<<<<<<<
+ * if isinstance(addr, unicode):
+ * addr = addr.encode('utf-8')
+ */
+ __pyx_t_1 = __pyx_f_3zmq_7backend_6cython_6socket__check_closed(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":463
+ *
+ * _check_closed(self)
+ * if isinstance(addr, unicode): # <<<<<<<<<<<<<<
+ * addr = addr.encode('utf-8')
+ * if not isinstance(addr, bytes):
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyObject_IsInstance(__pyx_v_addr, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+
+ /* "zmq/backend/cython/socket.pyx":464
+ * _check_closed(self)
+ * if isinstance(addr, unicode):
+ * addr = addr.encode('utf-8') # <<<<<<<<<<<<<<
+ * if not isinstance(addr, bytes):
+ * raise TypeError('expected str, got: %r' % addr)
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_addr, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF_SET(__pyx_v_addr, __pyx_t_4);
+ __pyx_t_4 = 0;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/socket.pyx":465
+ * if isinstance(addr, unicode):
+ * addr = addr.encode('utf-8')
+ * if not isinstance(addr, bytes): # <<<<<<<<<<<<<<
+ * raise TypeError('expected str, got: %r' % addr)
+ * c_addr = addr
+ */
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = PyObject_IsInstance(__pyx_v_addr, __pyx_t_4); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/socket.pyx":466
+ * addr = addr.encode('utf-8')
+ * if not isinstance(addr, bytes):
+ * raise TypeError('expected str, got: %r' % addr) # <<<<<<<<<<<<<<
+ * c_addr = addr
+ *
+ */
+ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_expected_str_got_r, __pyx_v_addr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/socket.pyx":467
+ * if not isinstance(addr, bytes):
+ * raise TypeError('expected str, got: %r' % addr)
+ * c_addr = addr # <<<<<<<<<<<<<<
+ *
+ * rc = zmq_connect(self.handle, c_addr)
+ */
+ __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_addr); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_c_addr = __pyx_t_5;
+
+ /* "zmq/backend/cython/socket.pyx":469
+ * c_addr = addr
+ *
+ * rc = zmq_connect(self.handle, c_addr) # <<<<<<<<<<<<<<
+ * if rc != 0:
+ * raise ZMQError()
+ */
+ __pyx_v_rc = zmq_connect(__pyx_v_self->handle, __pyx_v_c_addr);
+
+ /* "zmq/backend/cython/socket.pyx":470
+ *
+ * rc = zmq_connect(self.handle, c_addr)
+ * if rc != 0: # <<<<<<<<<<<<<<
+ * raise ZMQError()
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_rc != 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/socket.pyx":471
+ * rc = zmq_connect(self.handle, c_addr)
+ * if rc != 0:
+ * raise ZMQError() # <<<<<<<<<<<<<<
+ *
+ * def unbind(self, addr):
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ZMQError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_6 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_1, function);
+ }
+ }
+ if (__pyx_t_6) {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else {
+ __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/socket.pyx":446
+ * _check_rc(rc)
+ *
+ * def connect(self, addr): # <<<<<<<<<<<<<<
+ * """s.connect(addr)
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_addr);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/socket.pyx":473
+ * raise ZMQError()
+ *
+ * def unbind(self, addr): # <<<<<<<<<<<<<<
+ * """s.unbind(addr)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_21unbind(PyObject *__pyx_v_self, PyObject *__pyx_v_addr); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_6socket_6Socket_20unbind[] = "s.unbind(addr)\n \n Unbind from an address (undoes a call to bind).\n \n .. versionadded:: libzmq-3.2\n .. versionadded:: 13.0\n\n Parameters\n ----------\n addr : str\n The address string. This has the form 'protocol://interface:port',\n for example 'tcp://127.0.0.1:5555'. Protocols supported are\n tcp, upd, pgm, inproc and ipc. If the address is unicode, it is\n encoded to utf-8 first.\n ";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_21unbind(PyObject *__pyx_v_self, PyObject *__pyx_v_addr) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("unbind (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_20unbind(((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)__pyx_v_self), ((PyObject *)__pyx_v_addr));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_20unbind(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, PyObject *__pyx_v_addr) {
+ int __pyx_v_rc;
+ char *__pyx_v_c_addr;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ char *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("unbind", 0);
+ __Pyx_INCREF(__pyx_v_addr);
+
+ /* "zmq/backend/cython/socket.pyx":492
+ * cdef char* c_addr
+ *
+ * _check_version((3,2), "unbind") # <<<<<<<<<<<<<<
+ * _check_closed(self)
+ * if isinstance(addr, unicode):
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":493
+ *
+ * _check_version((3,2), "unbind")
+ * _check_closed(self) # <<<<<<<<<<<<<<
+ * if isinstance(addr, unicode):
+ * addr = addr.encode('utf-8')
+ */
+ __pyx_t_2 = __pyx_f_3zmq_7backend_6cython_6socket__check_closed(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":494
+ * _check_version((3,2), "unbind")
+ * _check_closed(self)
+ * if isinstance(addr, unicode): # <<<<<<<<<<<<<<
+ * addr = addr.encode('utf-8')
+ * if not isinstance(addr, bytes):
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyObject_IsInstance(__pyx_v_addr, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = (__pyx_t_3 != 0);
+ if (__pyx_t_4) {
+
+ /* "zmq/backend/cython/socket.pyx":495
+ * _check_closed(self)
+ * if isinstance(addr, unicode):
+ * addr = addr.encode('utf-8') # <<<<<<<<<<<<<<
+ * if not isinstance(addr, bytes):
+ * raise TypeError('expected str, got: %r' % addr)
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_addr, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF_SET(__pyx_v_addr, __pyx_t_1);
+ __pyx_t_1 = 0;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/socket.pyx":496
+ * if isinstance(addr, unicode):
+ * addr = addr.encode('utf-8')
+ * if not isinstance(addr, bytes): # <<<<<<<<<<<<<<
+ * raise TypeError('expected str, got: %r' % addr)
+ * c_addr = addr
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = PyObject_IsInstance(__pyx_v_addr, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0);
+ if (__pyx_t_3) {
+
+ /* "zmq/backend/cython/socket.pyx":497
+ * addr = addr.encode('utf-8')
+ * if not isinstance(addr, bytes):
+ * raise TypeError('expected str, got: %r' % addr) # <<<<<<<<<<<<<<
+ * c_addr = addr
+ *
+ */
+ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_expected_str_got_r, __pyx_v_addr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/socket.pyx":498
+ * if not isinstance(addr, bytes):
+ * raise TypeError('expected str, got: %r' % addr)
+ * c_addr = addr # <<<<<<<<<<<<<<
+ *
+ * rc = zmq_unbind(self.handle, c_addr)
+ */
+ __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_addr); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_c_addr = __pyx_t_5;
+
+ /* "zmq/backend/cython/socket.pyx":500
+ * c_addr = addr
+ *
+ * rc = zmq_unbind(self.handle, c_addr) # <<<<<<<<<<<<<<
+ * if rc != 0:
+ * raise ZMQError()
+ */
+ __pyx_v_rc = zmq_unbind(__pyx_v_self->handle, __pyx_v_c_addr);
+
+ /* "zmq/backend/cython/socket.pyx":501
+ *
+ * rc = zmq_unbind(self.handle, c_addr)
+ * if rc != 0: # <<<<<<<<<<<<<<
+ * raise ZMQError()
+ *
+ */
+ __pyx_t_3 = ((__pyx_v_rc != 0) != 0);
+ if (__pyx_t_3) {
+
+ /* "zmq/backend/cython/socket.pyx":502
+ * rc = zmq_unbind(self.handle, c_addr)
+ * if rc != 0:
+ * raise ZMQError() # <<<<<<<<<<<<<<
+ *
+ * def disconnect(self, addr):
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ZMQError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_6 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_2, function);
+ }
+ }
+ if (__pyx_t_6) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else {
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/socket.pyx":473
+ * raise ZMQError()
+ *
+ * def unbind(self, addr): # <<<<<<<<<<<<<<
+ * """s.unbind(addr)
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.unbind", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_addr);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/socket.pyx":504
+ * raise ZMQError()
+ *
+ * def disconnect(self, addr): # <<<<<<<<<<<<<<
+ * """s.disconnect(addr)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_23disconnect(PyObject *__pyx_v_self, PyObject *__pyx_v_addr); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_6socket_6Socket_22disconnect[] = "s.disconnect(addr)\n\n Disconnect from a remote 0MQ socket (undoes a call to connect).\n \n .. versionadded:: libzmq-3.2\n .. versionadded:: 13.0\n\n Parameters\n ----------\n addr : str\n The address string. This has the form 'protocol://interface:port',\n for example 'tcp://127.0.0.1:5555'. Protocols supported are\n tcp, upd, pgm, inproc and ipc. If the address is unicode, it is\n encoded to utf-8 first.\n ";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_23disconnect(PyObject *__pyx_v_self, PyObject *__pyx_v_addr) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("disconnect (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_22disconnect(((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)__pyx_v_self), ((PyObject *)__pyx_v_addr));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_22disconnect(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, PyObject *__pyx_v_addr) {
+ int __pyx_v_rc;
+ char *__pyx_v_c_addr;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ char *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("disconnect", 0);
+ __Pyx_INCREF(__pyx_v_addr);
+
+ /* "zmq/backend/cython/socket.pyx":523
+ * cdef char* c_addr
+ *
+ * _check_version((3,2), "disconnect") # <<<<<<<<<<<<<<
+ * _check_closed(self)
+ * if isinstance(addr, unicode):
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":524
+ *
+ * _check_version((3,2), "disconnect")
+ * _check_closed(self) # <<<<<<<<<<<<<<
+ * if isinstance(addr, unicode):
+ * addr = addr.encode('utf-8')
+ */
+ __pyx_t_2 = __pyx_f_3zmq_7backend_6cython_6socket__check_closed(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":525
+ * _check_version((3,2), "disconnect")
+ * _check_closed(self)
+ * if isinstance(addr, unicode): # <<<<<<<<<<<<<<
+ * addr = addr.encode('utf-8')
+ * if not isinstance(addr, bytes):
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyObject_IsInstance(__pyx_v_addr, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = (__pyx_t_3 != 0);
+ if (__pyx_t_4) {
+
+ /* "zmq/backend/cython/socket.pyx":526
+ * _check_closed(self)
+ * if isinstance(addr, unicode):
+ * addr = addr.encode('utf-8') # <<<<<<<<<<<<<<
+ * if not isinstance(addr, bytes):
+ * raise TypeError('expected str, got: %r' % addr)
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_addr, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF_SET(__pyx_v_addr, __pyx_t_1);
+ __pyx_t_1 = 0;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/socket.pyx":527
+ * if isinstance(addr, unicode):
+ * addr = addr.encode('utf-8')
+ * if not isinstance(addr, bytes): # <<<<<<<<<<<<<<
+ * raise TypeError('expected str, got: %r' % addr)
+ * c_addr = addr
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = PyObject_IsInstance(__pyx_v_addr, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0);
+ if (__pyx_t_3) {
+
+ /* "zmq/backend/cython/socket.pyx":528
+ * addr = addr.encode('utf-8')
+ * if not isinstance(addr, bytes):
+ * raise TypeError('expected str, got: %r' % addr) # <<<<<<<<<<<<<<
+ * c_addr = addr
+ *
+ */
+ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_expected_str_got_r, __pyx_v_addr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/socket.pyx":529
+ * if not isinstance(addr, bytes):
+ * raise TypeError('expected str, got: %r' % addr)
+ * c_addr = addr # <<<<<<<<<<<<<<
+ *
+ * rc = zmq_disconnect(self.handle, c_addr)
+ */
+ __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_addr); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_c_addr = __pyx_t_5;
+
+ /* "zmq/backend/cython/socket.pyx":531
+ * c_addr = addr
+ *
+ * rc = zmq_disconnect(self.handle, c_addr) # <<<<<<<<<<<<<<
+ * if rc != 0:
+ * raise ZMQError()
+ */
+ __pyx_v_rc = zmq_disconnect(__pyx_v_self->handle, __pyx_v_c_addr);
+
+ /* "zmq/backend/cython/socket.pyx":532
+ *
+ * rc = zmq_disconnect(self.handle, c_addr)
+ * if rc != 0: # <<<<<<<<<<<<<<
+ * raise ZMQError()
+ *
+ */
+ __pyx_t_3 = ((__pyx_v_rc != 0) != 0);
+ if (__pyx_t_3) {
+
+ /* "zmq/backend/cython/socket.pyx":533
+ * rc = zmq_disconnect(self.handle, c_addr)
+ * if rc != 0:
+ * raise ZMQError() # <<<<<<<<<<<<<<
+ *
+ * def monitor(self, addr, int events=ZMQ_EVENT_ALL):
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ZMQError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_6 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_2, function);
+ }
+ }
+ if (__pyx_t_6) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else {
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/socket.pyx":504
+ * raise ZMQError()
+ *
+ * def disconnect(self, addr): # <<<<<<<<<<<<<<
+ * """s.disconnect(addr)
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.disconnect", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_addr);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/socket.pyx":535
+ * raise ZMQError()
+ *
+ * def monitor(self, addr, int events=ZMQ_EVENT_ALL): # <<<<<<<<<<<<<<
+ * """s.monitor(addr, flags)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_25monitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_6socket_6Socket_24monitor[] = "s.monitor(addr, flags)\n\n Start publishing socket events on inproc.\n See libzmq docs for zmq_monitor for details.\n \n While this function is available from libzmq 3.2,\n pyzmq cannot parse monitor messages from libzmq prior to 4.0.\n \n .. versionadded: libzmq-3.2\n .. versionadded: 14.0\n \n Parameters\n ----------\n addr : str\n The inproc url used for monitoring. Passing None as\n the addr will cause an existing socket monitor to be\n deregistered.\n events : int [default: zmq.EVENT_ALL]\n The zmq event bitmask for which events will be sent to the monitor.\n ";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_25monitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_addr = 0;
+ int __pyx_v_events;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("monitor (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_addr,&__pyx_n_s_events,0};
+ PyObject* values[2] = {0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_addr)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_events);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "monitor") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_addr = values[0];
+ if (values[1]) {
+ __pyx_v_events = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ } else {
+ __pyx_v_events = __pyx_k__15;
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("monitor", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.monitor", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_24monitor(((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)__pyx_v_self), __pyx_v_addr, __pyx_v_events);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_24monitor(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, PyObject *__pyx_v_addr, int __pyx_v_events) {
+ int __pyx_v_rc;
+ int __pyx_v_c_flags;
+ char *__pyx_v_c_addr;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ char *__pyx_t_5;
+ int __pyx_t_6;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("monitor", 0);
+ __Pyx_INCREF(__pyx_v_addr);
+
+ /* "zmq/backend/cython/socket.pyx":557
+ * """
+ * cdef int rc, c_flags
+ * cdef char* c_addr = NULL # <<<<<<<<<<<<<<
+ *
+ * _check_version((3,2), "monitor")
+ */
+ __pyx_v_c_addr = NULL;
+
+ /* "zmq/backend/cython/socket.pyx":559
+ * cdef char* c_addr = NULL
+ *
+ * _check_version((3,2), "monitor") # <<<<<<<<<<<<<<
+ * if addr is not None:
+ * if isinstance(addr, unicode):
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":560
+ *
+ * _check_version((3,2), "monitor")
+ * if addr is not None: # <<<<<<<<<<<<<<
+ * if isinstance(addr, unicode):
+ * addr = addr.encode('utf-8')
+ */
+ __pyx_t_3 = (__pyx_v_addr != Py_None);
+ __pyx_t_4 = (__pyx_t_3 != 0);
+ if (__pyx_t_4) {
+
+ /* "zmq/backend/cython/socket.pyx":561
+ * _check_version((3,2), "monitor")
+ * if addr is not None:
+ * if isinstance(addr, unicode): # <<<<<<<<<<<<<<
+ * addr = addr.encode('utf-8')
+ * if not isinstance(addr, bytes):
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = PyObject_IsInstance(__pyx_v_addr, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_3 = (__pyx_t_4 != 0);
+ if (__pyx_t_3) {
+
+ /* "zmq/backend/cython/socket.pyx":562
+ * if addr is not None:
+ * if isinstance(addr, unicode):
+ * addr = addr.encode('utf-8') # <<<<<<<<<<<<<<
+ * if not isinstance(addr, bytes):
+ * raise TypeError('expected str, got: %r' % addr)
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_addr, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF_SET(__pyx_v_addr, __pyx_t_1);
+ __pyx_t_1 = 0;
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "zmq/backend/cython/socket.pyx":563
+ * if isinstance(addr, unicode):
+ * addr = addr.encode('utf-8')
+ * if not isinstance(addr, bytes): # <<<<<<<<<<<<<<
+ * raise TypeError('expected str, got: %r' % addr)
+ * c_addr = addr
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = PyObject_IsInstance(__pyx_v_addr, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
+ if (__pyx_t_4) {
+
+ /* "zmq/backend/cython/socket.pyx":564
+ * addr = addr.encode('utf-8')
+ * if not isinstance(addr, bytes):
+ * raise TypeError('expected str, got: %r' % addr) # <<<<<<<<<<<<<<
+ * c_addr = addr
+ * c_flags = events
+ */
+ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_expected_str_got_r, __pyx_v_addr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/socket.pyx":565
+ * if not isinstance(addr, bytes):
+ * raise TypeError('expected str, got: %r' % addr)
+ * c_addr = addr # <<<<<<<<<<<<<<
+ * c_flags = events
+ * rc = zmq_socket_monitor(self.handle, c_addr, c_flags)
+ */
+ __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_addr); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_c_addr = __pyx_t_5;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/socket.pyx":566
+ * raise TypeError('expected str, got: %r' % addr)
+ * c_addr = addr
+ * c_flags = events # <<<<<<<<<<<<<<
+ * rc = zmq_socket_monitor(self.handle, c_addr, c_flags)
+ * _check_rc(rc)
+ */
+ __pyx_v_c_flags = __pyx_v_events;
+
+ /* "zmq/backend/cython/socket.pyx":567
+ * c_addr = addr
+ * c_flags = events
+ * rc = zmq_socket_monitor(self.handle, c_addr, c_flags) # <<<<<<<<<<<<<<
+ * _check_rc(rc)
+ *
+ */
+ __pyx_v_rc = zmq_socket_monitor(__pyx_v_self->handle, __pyx_v_c_addr, __pyx_v_c_flags);
+
+ /* "zmq/backend/cython/socket.pyx":568
+ * c_flags = events
+ * rc = zmq_socket_monitor(self.handle, c_addr, c_flags)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ *
+ * #-------------------------------------------------------------------------
+ */
+ __pyx_t_6 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/socket.pyx":535
+ * raise ZMQError()
+ *
+ * def monitor(self, addr, int events=ZMQ_EVENT_ALL): # <<<<<<<<<<<<<<
+ * """s.monitor(addr, flags)
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.monitor", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_addr);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/socket.pyx":574
+ * #-------------------------------------------------------------------------
+ *
+ * cpdef object send(self, object data, int flags=0, copy=True, track=False): # <<<<<<<<<<<<<<
+ * """s.send(data, flags=0, copy=True, track=False)
+ *
+ */
+
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_27send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_3zmq_7backend_6cython_6socket_6Socket_send(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_skip_dispatch, struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_send *__pyx_optional_args) {
+ int __pyx_v_flags = ((int)0);
+ PyObject *__pyx_v_copy = ((PyObject *)Py_True);
+ PyObject *__pyx_v_track = ((PyObject *)Py_False);
+ PyObject *__pyx_v_msg = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ Py_ssize_t __pyx_t_6;
+ PyObject *__pyx_t_7 = NULL;
+ int __pyx_t_8;
+ int __pyx_t_9;
+ struct __pyx_opt_args_3zmq_7backend_6cython_6socket__send_copy __pyx_t_10;
+ int __pyx_t_11;
+ struct __pyx_opt_args_3zmq_7backend_6cython_6socket__send_frame __pyx_t_12;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("send", 0);
+ if (__pyx_optional_args) {
+ if (__pyx_optional_args->__pyx_n > 0) {
+ __pyx_v_flags = __pyx_optional_args->flags;
+ if (__pyx_optional_args->__pyx_n > 1) {
+ __pyx_v_copy = __pyx_optional_args->copy;
+ if (__pyx_optional_args->__pyx_n > 2) {
+ __pyx_v_track = __pyx_optional_args->track;
+ }
+ }
+ }
+ }
+ __Pyx_INCREF(__pyx_v_data);
+ /* Check if called by wrapper */
+ if (unlikely(__pyx_skip_dispatch)) ;
+ /* Check if overridden in Python */
+ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_send); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_27send)) {
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
+ __pyx_t_6 = 0;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ __pyx_t_6 = 1;
+ }
+ }
+ __pyx_t_7 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ if (__pyx_t_5) {
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_data);
+ PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_data);
+ __Pyx_GIVEREF(__pyx_v_data);
+ PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_copy);
+ PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_copy);
+ __Pyx_GIVEREF(__pyx_v_copy);
+ __Pyx_INCREF(__pyx_v_track);
+ PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_v_track);
+ __Pyx_GIVEREF(__pyx_v_track);
+ __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ goto __pyx_L0;
+ }
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ }
+
+ /* "zmq/backend/cython/socket.pyx":611
+ *
+ * """
+ * _check_closed(self) # <<<<<<<<<<<<<<
+ *
+ * if isinstance(data, unicode):
+ */
+ __pyx_t_1 = __pyx_f_3zmq_7backend_6cython_6socket__check_closed(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":613
+ * _check_closed(self)
+ *
+ * if isinstance(data, unicode): # <<<<<<<<<<<<<<
+ * raise TypeError("unicode not allowed, use send_string")
+ *
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_8 = PyObject_IsInstance(__pyx_v_data, __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_9 = (__pyx_t_8 != 0);
+ if (__pyx_t_9) {
+
+ /* "zmq/backend/cython/socket.pyx":614
+ *
+ * if isinstance(data, unicode):
+ * raise TypeError("unicode not allowed, use send_string") # <<<<<<<<<<<<<<
+ *
+ * if copy:
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/socket.pyx":616
+ * raise TypeError("unicode not allowed, use send_string")
+ *
+ * if copy: # <<<<<<<<<<<<<<
+ * # msg.bytes never returns the input data object
+ * # it is always a copy, but always the same copy
+ */
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_copy); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_9) {
+
+ /* "zmq/backend/cython/socket.pyx":619
+ * # msg.bytes never returns the input data object
+ * # it is always a copy, but always the same copy
+ * if isinstance(data, Frame): # <<<<<<<<<<<<<<
+ * data = data.buffer
+ * return _send_copy(self.handle, data, flags)
+ */
+ __pyx_t_9 = __Pyx_TypeCheck(__pyx_v_data, ((PyObject*)__pyx_ptype_3zmq_7backend_6cython_7message_Frame));
+ __pyx_t_8 = (__pyx_t_9 != 0);
+ if (__pyx_t_8) {
+
+ /* "zmq/backend/cython/socket.pyx":620
+ * # it is always a copy, but always the same copy
+ * if isinstance(data, Frame):
+ * data = data.buffer # <<<<<<<<<<<<<<
+ * return _send_copy(self.handle, data, flags)
+ * else:
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_buffer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_1);
+ __pyx_t_1 = 0;
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+
+ /* "zmq/backend/cython/socket.pyx":621
+ * if isinstance(data, Frame):
+ * data = data.buffer
+ * return _send_copy(self.handle, data, flags) # <<<<<<<<<<<<<<
+ * else:
+ * if isinstance(data, Frame):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_10.__pyx_n = 1;
+ __pyx_t_10.flags = __pyx_v_flags;
+ __pyx_t_1 = __pyx_f_3zmq_7backend_6cython_6socket__send_copy(__pyx_v_self->handle, __pyx_v_data, &__pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "zmq/backend/cython/socket.pyx":623
+ * return _send_copy(self.handle, data, flags)
+ * else:
+ * if isinstance(data, Frame): # <<<<<<<<<<<<<<
+ * if track and not data.tracker:
+ * raise ValueError('Not a tracked message')
+ */
+ __pyx_t_8 = __Pyx_TypeCheck(__pyx_v_data, ((PyObject*)__pyx_ptype_3zmq_7backend_6cython_7message_Frame));
+ __pyx_t_9 = (__pyx_t_8 != 0);
+ if (__pyx_t_9) {
+
+ /* "zmq/backend/cython/socket.pyx":624
+ * else:
+ * if isinstance(data, Frame):
+ * if track and not data.tracker: # <<<<<<<<<<<<<<
+ * raise ValueError('Not a tracked message')
+ * msg = data
+ */
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_track); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_8) {
+ } else {
+ __pyx_t_9 = __pyx_t_8;
+ goto __pyx_L8_bool_binop_done;
+ }
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_tracker); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_11 = ((!__pyx_t_8) != 0);
+ __pyx_t_9 = __pyx_t_11;
+ __pyx_L8_bool_binop_done:;
+ if (__pyx_t_9) {
+
+ /* "zmq/backend/cython/socket.pyx":625
+ * if isinstance(data, Frame):
+ * if track and not data.tracker:
+ * raise ValueError('Not a tracked message') # <<<<<<<<<<<<<<
+ * msg = data
+ * else:
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "zmq/backend/cython/socket.pyx":626
+ * if track and not data.tracker:
+ * raise ValueError('Not a tracked message')
+ * msg = data # <<<<<<<<<<<<<<
+ * else:
+ * msg = Frame(data, track=track)
+ */
+ __Pyx_INCREF(__pyx_v_data);
+ __pyx_v_msg = __pyx_v_data;
+ goto __pyx_L6;
+ }
+ /*else*/ {
+
+ /* "zmq/backend/cython/socket.pyx":628
+ * msg = data
+ * else:
+ * msg = Frame(data, track=track) # <<<<<<<<<<<<<<
+ * return _send_frame(self.handle, msg, flags)
+ *
+ */
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_data);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data);
+ __Pyx_GIVEREF(__pyx_v_data);
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_track, __pyx_v_track) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3zmq_7backend_6cython_7message_Frame)), __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_msg = __pyx_t_4;
+ __pyx_t_4 = 0;
+ }
+ __pyx_L6:;
+
+ /* "zmq/backend/cython/socket.pyx":629
+ * else:
+ * msg = Frame(data, track=track)
+ * return _send_frame(self.handle, msg, flags) # <<<<<<<<<<<<<<
+ *
+ * cpdef object recv(self, int flags=0, copy=True, track=False):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ if (!(likely(((__pyx_v_msg) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_msg, __pyx_ptype_3zmq_7backend_6cython_7message_Frame))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12.__pyx_n = 1;
+ __pyx_t_12.flags = __pyx_v_flags;
+ __pyx_t_4 = __pyx_f_3zmq_7backend_6cython_6socket__send_frame(__pyx_v_self->handle, ((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_v_msg), &__pyx_t_12); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/backend/cython/socket.pyx":574
+ * #-------------------------------------------------------------------------
+ *
+ * cpdef object send(self, object data, int flags=0, copy=True, track=False): # <<<<<<<<<<<<<<
+ * """s.send(data, flags=0, copy=True, track=False)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.send", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_msg);
+ __Pyx_XDECREF(__pyx_v_data);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_27send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_6socket_6Socket_26send[] = "s.send(data, flags=0, copy=True, track=False)\n\n Send a message on this socket.\n\n This queues the message to be sent by the IO thread at a later time.\n\n Parameters\n ----------\n data : object, str, Frame\n The content of the message.\n flags : int\n Any supported flag: NOBLOCK, SNDMORE.\n copy : bool\n Should the message be sent in a copying or non-copying manner.\n track : bool\n Should the message be tracked for notification that ZMQ has\n finished with it? (ignored if copy=True)\n\n Returns\n -------\n None : if `copy` or not track\n None if message was sent, raises an exception otherwise.\n MessageTracker : if track and not copy\n a MessageTracker object, whose `pending` property will\n be True until the send is completed.\n \n Raises\n ------\n TypeError\n If a unicode object is passed\n ValueError\n If `track=True`, but an untracked Frame is passed.\n ZMQError\n If the send does not succeed for any reason.\n \n ";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_27send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_data = 0;
+ int __pyx_v_flags;
+ PyObject *__pyx_v_copy = 0;
+ PyObject *__pyx_v_track = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("send (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_flags,&__pyx_n_s_copy,&__pyx_n_s_track,0};
+ PyObject* values[4] = {0,0,0,0};
+ values[2] = ((PyObject *)Py_True);
+ values[3] = ((PyObject *)Py_False);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ case 2:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_copy);
+ if (value) { values[2] = value; kw_args--; }
+ }
+ case 3:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_track);
+ if (value) { values[3] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "send") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_data = values[0];
+ if (values[1]) {
+ __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ } else {
+ __pyx_v_flags = ((int)0);
+ }
+ __pyx_v_copy = values[2];
+ __pyx_v_track = values[3];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("send", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.send", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_26send(((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)__pyx_v_self), __pyx_v_data, __pyx_v_flags, __pyx_v_copy, __pyx_v_track);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_26send(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_v_flags, PyObject *__pyx_v_copy, PyObject *__pyx_v_track) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_send __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("send", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2.__pyx_n = 3;
+ __pyx_t_2.flags = __pyx_v_flags;
+ __pyx_t_2.copy = __pyx_v_copy;
+ __pyx_t_2.track = __pyx_v_track;
+ __pyx_t_1 = __pyx_vtabptr_3zmq_7backend_6cython_6socket_Socket->send(__pyx_v_self, __pyx_v_data, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.send", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/socket.pyx":631
+ * return _send_frame(self.handle, msg, flags)
+ *
+ * cpdef object recv(self, int flags=0, copy=True, track=False): # <<<<<<<<<<<<<<
+ * """s.recv(flags=0, copy=True, track=False)
+ *
+ */
+
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_29recv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_3zmq_7backend_6cython_6socket_6Socket_recv(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_recv *__pyx_optional_args) {
+ int __pyx_v_flags = ((int)0);
+ PyObject *__pyx_v_copy = ((PyObject *)Py_True);
+ PyObject *__pyx_v_track = ((PyObject *)Py_False);
+ struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *__pyx_v_frame = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ Py_ssize_t __pyx_t_6;
+ PyObject *__pyx_t_7 = NULL;
+ int __pyx_t_8;
+ struct __pyx_opt_args_3zmq_7backend_6cython_6socket__recv_copy __pyx_t_9;
+ struct __pyx_opt_args_3zmq_7backend_6cython_6socket__recv_frame __pyx_t_10;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("recv", 0);
+ if (__pyx_optional_args) {
+ if (__pyx_optional_args->__pyx_n > 0) {
+ __pyx_v_flags = __pyx_optional_args->flags;
+ if (__pyx_optional_args->__pyx_n > 1) {
+ __pyx_v_copy = __pyx_optional_args->copy;
+ if (__pyx_optional_args->__pyx_n > 2) {
+ __pyx_v_track = __pyx_optional_args->track;
+ }
+ }
+ }
+ }
+ /* Check if called by wrapper */
+ if (unlikely(__pyx_skip_dispatch)) ;
+ /* Check if overridden in Python */
+ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_recv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_29recv)) {
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
+ __pyx_t_6 = 0;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ __pyx_t_6 = 1;
+ }
+ }
+ __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ if (__pyx_t_5) {
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+ }
+ PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_copy);
+ PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_copy);
+ __Pyx_GIVEREF(__pyx_v_copy);
+ __Pyx_INCREF(__pyx_v_track);
+ PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_track);
+ __Pyx_GIVEREF(__pyx_v_track);
+ __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ goto __pyx_L0;
+ }
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ }
+
+ /* "zmq/backend/cython/socket.pyx":662
+ * for any of the reasons zmq_msg_recv might fail.
+ * """
+ * _check_closed(self) # <<<<<<<<<<<<<<
+ *
+ * if copy:
+ */
+ __pyx_t_1 = __pyx_f_3zmq_7backend_6cython_6socket__check_closed(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":664
+ * _check_closed(self)
+ *
+ * if copy: # <<<<<<<<<<<<<<
+ * return _recv_copy(self.handle, flags)
+ * else:
+ */
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_copy); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_8) {
+
+ /* "zmq/backend/cython/socket.pyx":665
+ *
+ * if copy:
+ * return _recv_copy(self.handle, flags) # <<<<<<<<<<<<<<
+ * else:
+ * frame = _recv_frame(self.handle, flags, track)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_9.__pyx_n = 1;
+ __pyx_t_9.flags = __pyx_v_flags;
+ __pyx_t_1 = __pyx_f_3zmq_7backend_6cython_6socket__recv_copy(__pyx_v_self->handle, &__pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "zmq/backend/cython/socket.pyx":667
+ * return _recv_copy(self.handle, flags)
+ * else:
+ * frame = _recv_frame(self.handle, flags, track) # <<<<<<<<<<<<<<
+ * frame.more = self.getsockopt(zmq.RCVMORE)
+ * return frame
+ */
+ __pyx_t_10.__pyx_n = 2;
+ __pyx_t_10.flags = __pyx_v_flags;
+ __pyx_t_10.track = __pyx_v_track;
+ __pyx_t_1 = ((PyObject *)__pyx_f_3zmq_7backend_6cython_6socket__recv_frame(__pyx_v_self->handle, &__pyx_t_10)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_frame = ((struct __pyx_obj_3zmq_7backend_6cython_7message_Frame *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":668
+ * else:
+ * frame = _recv_frame(self.handle, flags, track)
+ * frame.more = self.getsockopt(zmq.RCVMORE) # <<<<<<<<<<<<<<
+ * return frame
+ *
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getsockopt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_zmq); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_RCVMORE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_2, function);
+ }
+ }
+ if (!__pyx_t_4) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_frame->more = __pyx_t_8;
+
+ /* "zmq/backend/cython/socket.pyx":669
+ * frame = _recv_frame(self.handle, flags, track)
+ * frame.more = self.getsockopt(zmq.RCVMORE)
+ * return frame # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_frame));
+ __pyx_r = ((PyObject *)__pyx_v_frame);
+ goto __pyx_L0;
+ }
+
+ /* "zmq/backend/cython/socket.pyx":631
+ * return _send_frame(self.handle, msg, flags)
+ *
+ * cpdef object recv(self, int flags=0, copy=True, track=False): # <<<<<<<<<<<<<<
+ * """s.recv(flags=0, copy=True, track=False)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.recv", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_frame);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_29recv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_6socket_6Socket_28recv[] = "s.recv(flags=0, copy=True, track=False)\n\n Receive a message.\n\n Parameters\n ----------\n flags : int\n Any supported flag: NOBLOCK. If NOBLOCK is set, this method\n will raise a ZMQError with EAGAIN if a message is not ready.\n If NOBLOCK is not set, then this method will block until a\n message arrives.\n copy : bool\n Should the message be received in a copying or non-copying manner?\n If False a Frame object is returned, if True a string copy of\n message is returned.\n track : bool\n Should the message be tracked for notification that ZMQ has\n finished with it? (ignored if copy=True)\n\n Returns\n -------\n msg : bytes, Frame\n The received message frame. If `copy` is False, then it will be a Frame,\n otherwise it will be bytes.\n \n Raises\n ------\n ZMQError\n for any of the reasons zmq_msg_recv might fail.\n ";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_29recv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ int __pyx_v_flags;
+ PyObject *__pyx_v_copy = 0;
+ PyObject *__pyx_v_track = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("recv (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flags,&__pyx_n_s_copy,&__pyx_n_s_track,0};
+ PyObject* values[3] = {0,0,0};
+ values[1] = ((PyObject *)Py_True);
+ values[2] = ((PyObject *)Py_False);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags);
+ if (value) { values[0] = value; kw_args--; }
+ }
+ case 1:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_copy);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ case 2:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_track);
+ if (value) { values[2] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "recv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ if (values[0]) {
+ __pyx_v_flags = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ } else {
+ __pyx_v_flags = ((int)0);
+ }
+ __pyx_v_copy = values[1];
+ __pyx_v_track = values[2];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("recv", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.recv", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_28recv(((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)__pyx_v_self), __pyx_v_flags, __pyx_v_copy, __pyx_v_track);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_28recv(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, int __pyx_v_flags, PyObject *__pyx_v_copy, PyObject *__pyx_v_track) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_recv __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("recv", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2.__pyx_n = 3;
+ __pyx_t_2.flags = __pyx_v_flags;
+ __pyx_t_2.copy = __pyx_v_copy;
+ __pyx_t_2.track = __pyx_v_track;
+ __pyx_t_1 = __pyx_vtabptr_3zmq_7backend_6cython_6socket_Socket->recv(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.recv", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/socket.pxd":40
+ * # Hold on to a reference to the context to make sure it is not garbage
+ * # collected until the socket it done with it.
+ * cdef public Context context # The zmq Context object that owns this. # <<<<<<<<<<<<<<
+ * cdef public bint _closed # bool property for a closed socket.
+ * cdef int _pid # the pid of the process which created me (for fork safety)
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_7context_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_7context_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_7context___get__(((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_7context___get__(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_self->context));
+ __pyx_r = ((PyObject *)__pyx_v_self->context);
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_3zmq_7backend_6cython_6socket_6Socket_7context_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_3zmq_7backend_6cython_6socket_6Socket_7context_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_7context_2__set__(((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_7context_2__set__(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__set__", 0);
+ if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_3zmq_7backend_6cython_7context_Context))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_v_value;
+ __Pyx_INCREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v_self->context);
+ __Pyx_DECREF(((PyObject *)__pyx_v_self->context));
+ __pyx_v_self->context = ((struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket.context.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_3zmq_7backend_6cython_6socket_6Socket_7context_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_3zmq_7backend_6cython_6socket_6Socket_7context_5__del__(PyObject *__pyx_v_self) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_7context_4__del__(((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_7context_4__del__(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__del__", 0);
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_GOTREF(__pyx_v_self->context);
+ __Pyx_DECREF(((PyObject *)__pyx_v_self->context));
+ __pyx_v_self->context = ((struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)Py_None);
+
+ /* function exit code */
+ __pyx_r = 0;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/socket.pxd":41
+ * # collected until the socket it done with it.
+ * cdef public Context context # The zmq Context object that owns this.
+ * cdef public bint _closed # bool property for a closed socket. # <<<<<<<<<<<<<<
+ * cdef int _pid # the pid of the process which created me (for fork safety)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_7_closed_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_7_closed_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_7_closed___get__(((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_6socket_6Socket_7_closed___get__(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_closed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket._closed.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_3zmq_7backend_6cython_6socket_6Socket_7_closed_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_3zmq_7backend_6cython_6socket_6Socket_7_closed_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_7_closed_2__set__(((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_3zmq_7backend_6cython_6socket_6Socket_7_closed_2__set__(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_self, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__set__", 0);
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_self->_closed = __pyx_t_1;
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_AddTraceback("zmq.backend.cython.socket.Socket._closed.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/checkrc.pxd":5
+ * from libzmq cimport zmq_errno, ZMQ_ETERM
+ *
+ * cdef inline int _check_rc(int rc) except -1: # <<<<<<<<<<<<<<
+ * """internal utility for checking zmq return condition
+ *
+ */
+
+static CYTHON_INLINE int __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(int __pyx_v_rc) {
+ int __pyx_v_errno;
+ PyObject *__pyx_v_Again = NULL;
+ PyObject *__pyx_v_ContextTerminated = NULL;
+ PyObject *__pyx_v_ZMQError = NULL;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_check_rc", 0);
+
+ /* "zmq/backend/cython/checkrc.pxd":10
+ * and raising the appropriate Exception class
+ * """
+ * cdef int errno = zmq_errno() # <<<<<<<<<<<<<<
+ * PyErr_CheckSignals()
+ * if rc < 0:
+ */
+ __pyx_v_errno = zmq_errno();
+
+ /* "zmq/backend/cython/checkrc.pxd":11
+ * """
+ * cdef int errno = zmq_errno()
+ * PyErr_CheckSignals() # <<<<<<<<<<<<<<
+ * if rc < 0:
+ * if errno == EAGAIN:
+ */
+ __pyx_t_1 = PyErr_CheckSignals(); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/checkrc.pxd":12
+ * cdef int errno = zmq_errno()
+ * PyErr_CheckSignals()
+ * if rc < 0: # <<<<<<<<<<<<<<
+ * if errno == EAGAIN:
+ * from zmq.error import Again
+ */
+ __pyx_t_2 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/checkrc.pxd":16
+ * from zmq.error import Again
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM: # <<<<<<<<<<<<<<
+ * from zmq.error import ContextTerminated
+ * raise ContextTerminated(errno)
+ */
+ switch (__pyx_v_errno) {
+
+ /* "zmq/backend/cython/checkrc.pxd":13
+ * PyErr_CheckSignals()
+ * if rc < 0:
+ * if errno == EAGAIN: # <<<<<<<<<<<<<<
+ * from zmq.error import Again
+ * raise Again(errno)
+ */
+ case EAGAIN:
+
+ /* "zmq/backend/cython/checkrc.pxd":14
+ * if rc < 0:
+ * if errno == EAGAIN:
+ * from zmq.error import Again # <<<<<<<<<<<<<<
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM:
+ */
+ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_n_s_Again);
+ PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Again);
+ __Pyx_GIVEREF(__pyx_n_s_Again);
+ __pyx_t_4 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Again); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_Again = __pyx_t_3;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "zmq/backend/cython/checkrc.pxd":15
+ * if errno == EAGAIN:
+ * from zmq.error import Again
+ * raise Again(errno) # <<<<<<<<<<<<<<
+ * elif errno == ZMQ_ETERM:
+ * from zmq.error import ContextTerminated
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_Again);
+ __pyx_t_5 = __pyx_v_Again; __pyx_t_6 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ }
+ }
+ if (!__pyx_t_6) {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ } else {
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ break;
+
+ /* "zmq/backend/cython/checkrc.pxd":16
+ * from zmq.error import Again
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM: # <<<<<<<<<<<<<<
+ * from zmq.error import ContextTerminated
+ * raise ContextTerminated(errno)
+ */
+ case ETERM:
+
+ /* "zmq/backend/cython/checkrc.pxd":17
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM:
+ * from zmq.error import ContextTerminated # <<<<<<<<<<<<<<
+ * raise ContextTerminated(errno)
+ * else:
+ */
+ __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_n_s_ContextTerminated);
+ PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_ContextTerminated);
+ __Pyx_GIVEREF(__pyx_n_s_ContextTerminated);
+ __pyx_t_5 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_ContextTerminated); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_4);
+ __pyx_v_ContextTerminated = __pyx_t_4;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+ /* "zmq/backend/cython/checkrc.pxd":18
+ * elif errno == ZMQ_ETERM:
+ * from zmq.error import ContextTerminated
+ * raise ContextTerminated(errno) # <<<<<<<<<<<<<<
+ * else:
+ * from zmq.error import ZMQError
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_v_ContextTerminated);
+ __pyx_t_7 = __pyx_v_ContextTerminated; __pyx_t_3 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
+ if (likely(__pyx_t_3)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_7, function);
+ }
+ }
+ if (!__pyx_t_3) {
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ } else {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ break;
+ default:
+
+ /* "zmq/backend/cython/checkrc.pxd":20
+ * raise ContextTerminated(errno)
+ * else:
+ * from zmq.error import ZMQError # <<<<<<<<<<<<<<
+ * raise ZMQError(errno)
+ * # return -1
+ */
+ __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_n_s_ZMQError);
+ PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_ZMQError);
+ __Pyx_GIVEREF(__pyx_n_s_ZMQError);
+ __pyx_t_7 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_5, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_ZMQError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_5);
+ __pyx_v_ZMQError = __pyx_t_5;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "zmq/backend/cython/checkrc.pxd":21
+ * else:
+ * from zmq.error import ZMQError
+ * raise ZMQError(errno) # <<<<<<<<<<<<<<
+ * # return -1
+ * return 0
+ */
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_v_ZMQError);
+ __pyx_t_6 = __pyx_v_ZMQError; __pyx_t_4 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
+ }
+ }
+ if (!__pyx_t_4) {
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ } else {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_Raise(__pyx_t_7, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ break;
+ }
+ }
+
+ /* "zmq/backend/cython/checkrc.pxd":23
+ * raise ZMQError(errno)
+ * # return -1
+ * return 0 # <<<<<<<<<<<<<<
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/checkrc.pxd":5
+ * from libzmq cimport zmq_errno, ZMQ_ETERM
+ *
+ * cdef inline int _check_rc(int rc) except -1: # <<<<<<<<<<<<<<
+ * """internal utility for checking zmq return condition
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_AddTraceback("zmq.backend.cython.checkrc._check_rc", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_Again);
+ __Pyx_XDECREF(__pyx_v_ContextTerminated);
+ __Pyx_XDECREF(__pyx_v_ZMQError);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "message.pxd":55
+ *
+ *
+ * cdef inline object copy_zmq_msg_bytes(zmq_msg_t *zmq_msg): # <<<<<<<<<<<<<<
+ * """ Copy the data from a zmq_msg_t """
+ * cdef char *data_c = NULL
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_3zmq_7backend_6cython_7message_copy_zmq_msg_bytes(zmq_msg_t *__pyx_v_zmq_msg) {
+ char *__pyx_v_data_c;
+ Py_ssize_t __pyx_v_data_len_c;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("copy_zmq_msg_bytes", 0);
+
+ /* "message.pxd":57
+ * cdef inline object copy_zmq_msg_bytes(zmq_msg_t *zmq_msg):
+ * """ Copy the data from a zmq_msg_t """
+ * cdef char *data_c = NULL # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t data_len_c
+ * data_c = <char *>zmq_msg_data(zmq_msg)
+ */
+ __pyx_v_data_c = NULL;
+
+ /* "message.pxd":59
+ * cdef char *data_c = NULL
+ * cdef Py_ssize_t data_len_c
+ * data_c = <char *>zmq_msg_data(zmq_msg) # <<<<<<<<<<<<<<
+ * data_len_c = zmq_msg_size(zmq_msg)
+ * return PyBytes_FromStringAndSize(data_c, data_len_c)
+ */
+ __pyx_v_data_c = ((char *)zmq_msg_data(__pyx_v_zmq_msg));
+
+ /* "message.pxd":60
+ * cdef Py_ssize_t data_len_c
+ * data_c = <char *>zmq_msg_data(zmq_msg)
+ * data_len_c = zmq_msg_size(zmq_msg) # <<<<<<<<<<<<<<
+ * return PyBytes_FromStringAndSize(data_c, data_len_c)
+ *
+ */
+ __pyx_v_data_len_c = zmq_msg_size(__pyx_v_zmq_msg);
+
+ /* "message.pxd":61
+ * data_c = <char *>zmq_msg_data(zmq_msg)
+ * data_len_c = zmq_msg_size(zmq_msg)
+ * return PyBytes_FromStringAndSize(data_c, data_len_c) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyBytes_FromStringAndSize(__pyx_v_data_c, __pyx_v_data_len_c); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "message.pxd":55
+ *
+ *
+ * cdef inline object copy_zmq_msg_bytes(zmq_msg_t *zmq_msg): # <<<<<<<<<<<<<<
+ * """ Copy the data from a zmq_msg_t """
+ * cdef char *data_c = NULL
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("zmq.backend.cython.message.copy_zmq_msg_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":88
+ *
+ *
+ * cdef inline int memoryview_available(): # <<<<<<<<<<<<<<
+ * return PY_MAJOR_VERSION >= 3 or (PY_MAJOR_VERSION >=2 and PY_MINOR_VERSION >= 7)
+ *
+ */
+
+static CYTHON_INLINE int __pyx_f_7buffers_memoryview_available(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ __Pyx_RefNannySetupContext("memoryview_available", 0);
+
+ /* "buffers.pxd":89
+ *
+ * cdef inline int memoryview_available():
+ * return PY_MAJOR_VERSION >= 3 or (PY_MAJOR_VERSION >=2 and PY_MINOR_VERSION >= 7) # <<<<<<<<<<<<<<
+ *
+ * cdef inline int oldstyle_available():
+ */
+ __pyx_t_2 = (PY_MAJOR_VERSION >= 3);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L3_bool_binop_done;
+ }
+ __pyx_t_2 = (PY_MAJOR_VERSION >= 2);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L3_bool_binop_done;
+ }
+ __pyx_t_2 = (PY_MINOR_VERSION >= 7);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L3_bool_binop_done:;
+ __pyx_r = __pyx_t_1;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":88
+ *
+ *
+ * cdef inline int memoryview_available(): # <<<<<<<<<<<<<<
+ * return PY_MAJOR_VERSION >= 3 or (PY_MAJOR_VERSION >=2 and PY_MINOR_VERSION >= 7)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":91
+ * return PY_MAJOR_VERSION >= 3 or (PY_MAJOR_VERSION >=2 and PY_MINOR_VERSION >= 7)
+ *
+ * cdef inline int oldstyle_available(): # <<<<<<<<<<<<<<
+ * return PY_MAJOR_VERSION < 3
+ *
+ */
+
+static CYTHON_INLINE int __pyx_f_7buffers_oldstyle_available(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("oldstyle_available", 0);
+
+ /* "buffers.pxd":92
+ *
+ * cdef inline int oldstyle_available():
+ * return PY_MAJOR_VERSION < 3 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = (PY_MAJOR_VERSION < 3);
+ goto __pyx_L0;
+
+ /* "buffers.pxd":91
+ * return PY_MAJOR_VERSION >= 3 or (PY_MAJOR_VERSION >=2 and PY_MINOR_VERSION >= 7)
+ *
+ * cdef inline int oldstyle_available(): # <<<<<<<<<<<<<<
+ * return PY_MAJOR_VERSION < 3
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":95
+ *
+ *
+ * cdef inline int check_buffer(object ob): # <<<<<<<<<<<<<<
+ * """Version independent check for whether an object is a buffer.
+ *
+ */
+
+static CYTHON_INLINE int __pyx_f_7buffers_check_buffer(PyObject *__pyx_v_ob) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ __Pyx_RefNannySetupContext("check_buffer", 0);
+
+ /* "buffers.pxd":107
+ * int : 0 if no buffer interface, 3 if newstyle buffer interface, 2 if oldstyle.
+ * """
+ * if PyObject_CheckBuffer(ob): # <<<<<<<<<<<<<<
+ * return 3
+ * if oldstyle_available():
+ */
+ __pyx_t_1 = (PyObject_CheckBuffer(__pyx_v_ob) != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":108
+ * """
+ * if PyObject_CheckBuffer(ob):
+ * return 3 # <<<<<<<<<<<<<<
+ * if oldstyle_available():
+ * return PyObject_CheckReadBuffer(ob) and 2
+ */
+ __pyx_r = 3;
+ goto __pyx_L0;
+ }
+
+ /* "buffers.pxd":109
+ * if PyObject_CheckBuffer(ob):
+ * return 3
+ * if oldstyle_available(): # <<<<<<<<<<<<<<
+ * return PyObject_CheckReadBuffer(ob) and 2
+ * return 0
+ */
+ __pyx_t_1 = (__pyx_f_7buffers_oldstyle_available() != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":110
+ * return 3
+ * if oldstyle_available():
+ * return PyObject_CheckReadBuffer(ob) and 2 # <<<<<<<<<<<<<<
+ * return 0
+ *
+ */
+ __pyx_t_3 = PyObject_CheckReadBuffer(__pyx_v_ob);
+ if (__pyx_t_3) {
+ } else {
+ __pyx_t_2 = __pyx_t_3;
+ goto __pyx_L5_bool_binop_done;
+ }
+ __pyx_t_2 = 2;
+ __pyx_L5_bool_binop_done:;
+ __pyx_r = __pyx_t_2;
+ goto __pyx_L0;
+ }
+
+ /* "buffers.pxd":111
+ * if oldstyle_available():
+ * return PyObject_CheckReadBuffer(ob) and 2
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":95
+ *
+ *
+ * cdef inline int check_buffer(object ob): # <<<<<<<<<<<<<<
+ * """Version independent check for whether an object is a buffer.
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":114
+ *
+ *
+ * cdef inline object asbuffer(object ob, int writable, int format, # <<<<<<<<<<<<<<
+ * void **base, Py_ssize_t *size,
+ * Py_ssize_t *itemsize):
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_asbuffer(PyObject *__pyx_v_ob, int __pyx_v_writable, int __pyx_v_format, void **__pyx_v_base, Py_ssize_t *__pyx_v_size, Py_ssize_t *__pyx_v_itemsize) {
+ void *__pyx_v_bptr;
+ Py_ssize_t __pyx_v_blen;
+ Py_ssize_t __pyx_v_bitemlen;
+ Py_buffer __pyx_v_view;
+ int __pyx_v_flags;
+ int __pyx_v_mode;
+ PyObject *__pyx_v_bfmt = NULL;
+ PyObject *__pyx_v_dtype = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ void *__pyx_t_5;
+ Py_ssize_t __pyx_t_6;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *__pyx_t_10 = NULL;
+ PyObject *__pyx_t_11 = NULL;
+ PyObject *__pyx_t_12 = NULL;
+ PyObject *__pyx_t_13 = NULL;
+ PyObject *__pyx_t_14 = NULL;
+ PyObject *__pyx_t_15 = NULL;
+ PyObject *__pyx_t_16 = NULL;
+ int __pyx_t_17;
+ int __pyx_t_18;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("asbuffer", 0);
+
+ /* "buffers.pxd":141
+ * """
+ *
+ * cdef void *bptr = NULL # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t blen = 0, bitemlen = 0
+ * cdef Py_buffer view
+ */
+ __pyx_v_bptr = NULL;
+
+ /* "buffers.pxd":142
+ *
+ * cdef void *bptr = NULL
+ * cdef Py_ssize_t blen = 0, bitemlen = 0 # <<<<<<<<<<<<<<
+ * cdef Py_buffer view
+ * cdef int flags = PyBUF_SIMPLE
+ */
+ __pyx_v_blen = 0;
+ __pyx_v_bitemlen = 0;
+
+ /* "buffers.pxd":144
+ * cdef Py_ssize_t blen = 0, bitemlen = 0
+ * cdef Py_buffer view
+ * cdef int flags = PyBUF_SIMPLE # <<<<<<<<<<<<<<
+ * cdef int mode = 0
+ *
+ */
+ __pyx_v_flags = PyBUF_SIMPLE;
+
+ /* "buffers.pxd":145
+ * cdef Py_buffer view
+ * cdef int flags = PyBUF_SIMPLE
+ * cdef int mode = 0 # <<<<<<<<<<<<<<
+ *
+ * bfmt = None
+ */
+ __pyx_v_mode = 0;
+
+ /* "buffers.pxd":147
+ * cdef int mode = 0
+ *
+ * bfmt = None # <<<<<<<<<<<<<<
+ *
+ * mode = check_buffer(ob)
+ */
+ __Pyx_INCREF(Py_None);
+ __pyx_v_bfmt = Py_None;
+
+ /* "buffers.pxd":149
+ * bfmt = None
+ *
+ * mode = check_buffer(ob) # <<<<<<<<<<<<<<
+ * if mode == 0:
+ * raise TypeError("%r does not provide a buffer interface."%ob)
+ */
+ __pyx_v_mode = __pyx_f_7buffers_check_buffer(__pyx_v_ob);
+
+ /* "buffers.pxd":150
+ *
+ * mode = check_buffer(ob)
+ * if mode == 0: # <<<<<<<<<<<<<<
+ * raise TypeError("%r does not provide a buffer interface."%ob)
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_mode == 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":151
+ * mode = check_buffer(ob)
+ * if mode == 0:
+ * raise TypeError("%r does not provide a buffer interface."%ob) # <<<<<<<<<<<<<<
+ *
+ * if mode == 3:
+ */
+ __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_r_does_not_provide_a_buffer_int, __pyx_v_ob); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ {__pyx_filename = __pyx_f[4]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "buffers.pxd":153
+ * raise TypeError("%r does not provide a buffer interface."%ob)
+ *
+ * if mode == 3: # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS
+ * if writable:
+ */
+ __pyx_t_1 = ((__pyx_v_mode == 3) != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":154
+ *
+ * if mode == 3:
+ * flags = PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
+ * if writable:
+ * flags |= PyBUF_WRITABLE
+ */
+ __pyx_v_flags = PyBUF_ANY_CONTIGUOUS;
+
+ /* "buffers.pxd":155
+ * if mode == 3:
+ * flags = PyBUF_ANY_CONTIGUOUS
+ * if writable: # <<<<<<<<<<<<<<
+ * flags |= PyBUF_WRITABLE
+ * if format:
+ */
+ __pyx_t_1 = (__pyx_v_writable != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":156
+ * flags = PyBUF_ANY_CONTIGUOUS
+ * if writable:
+ * flags |= PyBUF_WRITABLE # <<<<<<<<<<<<<<
+ * if format:
+ * flags |= PyBUF_FORMAT
+ */
+ __pyx_v_flags = (__pyx_v_flags | PyBUF_WRITABLE);
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+
+ /* "buffers.pxd":157
+ * if writable:
+ * flags |= PyBUF_WRITABLE
+ * if format: # <<<<<<<<<<<<<<
+ * flags |= PyBUF_FORMAT
+ * PyObject_GetBuffer(ob, &view, flags)
+ */
+ __pyx_t_1 = (__pyx_v_format != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":158
+ * flags |= PyBUF_WRITABLE
+ * if format:
+ * flags |= PyBUF_FORMAT # <<<<<<<<<<<<<<
+ * PyObject_GetBuffer(ob, &view, flags)
+ * bptr = view.buf
+ */
+ __pyx_v_flags = (__pyx_v_flags | PyBUF_FORMAT);
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+
+ /* "buffers.pxd":159
+ * if format:
+ * flags |= PyBUF_FORMAT
+ * PyObject_GetBuffer(ob, &view, flags) # <<<<<<<<<<<<<<
+ * bptr = view.buf
+ * blen = view.len
+ */
+ __pyx_t_4 = PyObject_GetBuffer(__pyx_v_ob, (&__pyx_v_view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "buffers.pxd":160
+ * flags |= PyBUF_FORMAT
+ * PyObject_GetBuffer(ob, &view, flags)
+ * bptr = view.buf # <<<<<<<<<<<<<<
+ * blen = view.len
+ * if format:
+ */
+ __pyx_t_5 = __pyx_v_view.buf;
+ __pyx_v_bptr = __pyx_t_5;
+
+ /* "buffers.pxd":161
+ * PyObject_GetBuffer(ob, &view, flags)
+ * bptr = view.buf
+ * blen = view.len # <<<<<<<<<<<<<<
+ * if format:
+ * if view.format != NULL:
+ */
+ __pyx_t_6 = __pyx_v_view.len;
+ __pyx_v_blen = __pyx_t_6;
+
+ /* "buffers.pxd":162
+ * bptr = view.buf
+ * blen = view.len
+ * if format: # <<<<<<<<<<<<<<
+ * if view.format != NULL:
+ * bfmt = view.format
+ */
+ __pyx_t_1 = (__pyx_v_format != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":163
+ * blen = view.len
+ * if format:
+ * if view.format != NULL: # <<<<<<<<<<<<<<
+ * bfmt = view.format
+ * bitemlen = view.itemsize
+ */
+ __pyx_t_1 = ((__pyx_v_view.format != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":164
+ * if format:
+ * if view.format != NULL:
+ * bfmt = view.format # <<<<<<<<<<<<<<
+ * bitemlen = view.itemsize
+ * PyBuffer_Release(&view)
+ */
+ __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_view.format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF_SET(__pyx_v_bfmt, __pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "buffers.pxd":165
+ * if view.format != NULL:
+ * bfmt = view.format
+ * bitemlen = view.itemsize # <<<<<<<<<<<<<<
+ * PyBuffer_Release(&view)
+ * else: # oldstyle
+ */
+ __pyx_t_6 = __pyx_v_view.itemsize;
+ __pyx_v_bitemlen = __pyx_t_6;
+ goto __pyx_L8;
+ }
+ __pyx_L8:;
+ goto __pyx_L7;
+ }
+ __pyx_L7:;
+
+ /* "buffers.pxd":166
+ * bfmt = view.format
+ * bitemlen = view.itemsize
+ * PyBuffer_Release(&view) # <<<<<<<<<<<<<<
+ * else: # oldstyle
+ * if writable:
+ */
+ PyBuffer_Release((&__pyx_v_view));
+ goto __pyx_L4;
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":168
+ * PyBuffer_Release(&view)
+ * else: # oldstyle
+ * if writable: # <<<<<<<<<<<<<<
+ * PyObject_AsWriteBuffer(ob, &bptr, &blen)
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_writable != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":169
+ * else: # oldstyle
+ * if writable:
+ * PyObject_AsWriteBuffer(ob, &bptr, &blen) # <<<<<<<<<<<<<<
+ * else:
+ * PyObject_AsReadBuffer(ob, <const_void **>&bptr, &blen)
+ */
+ __pyx_t_4 = PyObject_AsWriteBuffer(__pyx_v_ob, (&__pyx_v_bptr), (&__pyx_v_blen)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L9;
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":171
+ * PyObject_AsWriteBuffer(ob, &bptr, &blen)
+ * else:
+ * PyObject_AsReadBuffer(ob, <const_void **>&bptr, &blen) # <<<<<<<<<<<<<<
+ * if format:
+ * try: # numpy.ndarray
+ */
+ __pyx_t_4 = PyObject_AsReadBuffer(__pyx_v_ob, ((const void **)(&__pyx_v_bptr)), (&__pyx_v_blen)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_L9:;
+
+ /* "buffers.pxd":172
+ * else:
+ * PyObject_AsReadBuffer(ob, <const_void **>&bptr, &blen)
+ * if format: # <<<<<<<<<<<<<<
+ * try: # numpy.ndarray
+ * dtype = ob.dtype
+ */
+ __pyx_t_1 = (__pyx_v_format != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":173
+ * PyObject_AsReadBuffer(ob, <const_void **>&bptr, &blen)
+ * if format:
+ * try: # numpy.ndarray # <<<<<<<<<<<<<<
+ * dtype = ob.dtype
+ * bfmt = dtype.char
+ */
+ {
+ __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
+ __Pyx_XGOTREF(__pyx_t_7);
+ __Pyx_XGOTREF(__pyx_t_8);
+ __Pyx_XGOTREF(__pyx_t_9);
+ /*try:*/ {
+
+ /* "buffers.pxd":174
+ * if format:
+ * try: # numpy.ndarray
+ * dtype = ob.dtype # <<<<<<<<<<<<<<
+ * bfmt = dtype.char
+ * bitemlen = dtype.itemsize
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ob, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_v_dtype = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "buffers.pxd":175
+ * try: # numpy.ndarray
+ * dtype = ob.dtype
+ * bfmt = dtype.char # <<<<<<<<<<<<<<
+ * bitemlen = dtype.itemsize
+ * except AttributeError:
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_char); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF_SET(__pyx_v_bfmt, __pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "buffers.pxd":176
+ * dtype = ob.dtype
+ * bfmt = dtype.char
+ * bitemlen = dtype.itemsize # <<<<<<<<<<<<<<
+ * except AttributeError:
+ * try: # array.array
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_bitemlen = __pyx_t_6;
+ }
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+ goto __pyx_L18_try_end;
+ __pyx_L11_error:;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "buffers.pxd":177
+ * bfmt = dtype.char
+ * bitemlen = dtype.itemsize
+ * except AttributeError: # <<<<<<<<<<<<<<
+ * try: # array.array
+ * bfmt = ob.typecode
+ */
+ __pyx_t_4 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("buffers.asbuffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GOTREF(__pyx_t_10);
+
+ /* "buffers.pxd":178
+ * bitemlen = dtype.itemsize
+ * except AttributeError:
+ * try: # array.array # <<<<<<<<<<<<<<
+ * bfmt = ob.typecode
+ * bitemlen = ob.itemsize
+ */
+ {
+ __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
+ __Pyx_XGOTREF(__pyx_t_11);
+ __Pyx_XGOTREF(__pyx_t_12);
+ __Pyx_XGOTREF(__pyx_t_13);
+ /*try:*/ {
+
+ /* "buffers.pxd":179
+ * except AttributeError:
+ * try: # array.array
+ * bfmt = ob.typecode # <<<<<<<<<<<<<<
+ * bitemlen = ob.itemsize
+ * except AttributeError:
+ */
+ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_ob, __pyx_n_s_typecode); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __Pyx_DECREF_SET(__pyx_v_bfmt, __pyx_t_14);
+ __pyx_t_14 = 0;
+
+ /* "buffers.pxd":180
+ * try: # array.array
+ * bfmt = ob.typecode
+ * bitemlen = ob.itemsize # <<<<<<<<<<<<<<
+ * except AttributeError:
+ * if isinstance(ob, bytes):
+ */
+ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_ob, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __pyx_v_bitemlen = __pyx_t_6;
+ }
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+ goto __pyx_L28_try_end;
+ __pyx_L21_error:;
+ __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+
+ /* "buffers.pxd":181
+ * bfmt = ob.typecode
+ * bitemlen = ob.itemsize
+ * except AttributeError: # <<<<<<<<<<<<<<
+ * if isinstance(ob, bytes):
+ * bfmt = b"B"
+ */
+ __pyx_t_4 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("buffers.asbuffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GOTREF(__pyx_t_16);
+
+ /* "buffers.pxd":182
+ * bitemlen = ob.itemsize
+ * except AttributeError:
+ * if isinstance(ob, bytes): # <<<<<<<<<<<<<<
+ * bfmt = b"B"
+ * bitemlen = 1
+ */
+ __pyx_t_1 = PyBytes_Check(__pyx_v_ob);
+ __pyx_t_17 = (__pyx_t_1 != 0);
+ if (__pyx_t_17) {
+
+ /* "buffers.pxd":183
+ * except AttributeError:
+ * if isinstance(ob, bytes):
+ * bfmt = b"B" # <<<<<<<<<<<<<<
+ * bitemlen = 1
+ * else:
+ */
+ __Pyx_INCREF(__pyx_n_b_B);
+ __Pyx_DECREF_SET(__pyx_v_bfmt, __pyx_n_b_B);
+
+ /* "buffers.pxd":184
+ * if isinstance(ob, bytes):
+ * bfmt = b"B"
+ * bitemlen = 1 # <<<<<<<<<<<<<<
+ * else:
+ * # nothing found
+ */
+ __pyx_v_bitemlen = 1;
+ goto __pyx_L31;
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":187
+ * else:
+ * # nothing found
+ * bfmt = None # <<<<<<<<<<<<<<
+ * bitemlen = 0
+ * if base: base[0] = <void *>bptr
+ */
+ __Pyx_INCREF(Py_None);
+ __Pyx_DECREF_SET(__pyx_v_bfmt, Py_None);
+
+ /* "buffers.pxd":188
+ * # nothing found
+ * bfmt = None
+ * bitemlen = 0 # <<<<<<<<<<<<<<
+ * if base: base[0] = <void *>bptr
+ * if size: size[0] = <Py_ssize_t>blen
+ */
+ __pyx_v_bitemlen = 0;
+ }
+ __pyx_L31:;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ goto __pyx_L22_exception_handled;
+ }
+ goto __pyx_L23_except_error;
+ __pyx_L23_except_error:;
+ __Pyx_XGIVEREF(__pyx_t_11);
+ __Pyx_XGIVEREF(__pyx_t_12);
+ __Pyx_XGIVEREF(__pyx_t_13);
+ __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
+ goto __pyx_L13_except_error;
+ __pyx_L22_exception_handled:;
+ __Pyx_XGIVEREF(__pyx_t_11);
+ __Pyx_XGIVEREF(__pyx_t_12);
+ __Pyx_XGIVEREF(__pyx_t_13);
+ __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
+ __pyx_L28_try_end:;
+ }
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ goto __pyx_L12_exception_handled;
+ }
+ goto __pyx_L13_except_error;
+ __pyx_L13_except_error:;
+ __Pyx_XGIVEREF(__pyx_t_7);
+ __Pyx_XGIVEREF(__pyx_t_8);
+ __Pyx_XGIVEREF(__pyx_t_9);
+ __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
+ goto __pyx_L1_error;
+ __pyx_L12_exception_handled:;
+ __Pyx_XGIVEREF(__pyx_t_7);
+ __Pyx_XGIVEREF(__pyx_t_8);
+ __Pyx_XGIVEREF(__pyx_t_9);
+ __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
+ __pyx_L18_try_end:;
+ }
+ goto __pyx_L10;
+ }
+ __pyx_L10:;
+ }
+ __pyx_L4:;
+
+ /* "buffers.pxd":189
+ * bfmt = None
+ * bitemlen = 0
+ * if base: base[0] = <void *>bptr # <<<<<<<<<<<<<<
+ * if size: size[0] = <Py_ssize_t>blen
+ * if itemsize: itemsize[0] = <Py_ssize_t>bitemlen
+ */
+ __pyx_t_17 = (__pyx_v_base != 0);
+ if (__pyx_t_17) {
+ (__pyx_v_base[0]) = ((void *)__pyx_v_bptr);
+ goto __pyx_L32;
+ }
+ __pyx_L32:;
+
+ /* "buffers.pxd":190
+ * bitemlen = 0
+ * if base: base[0] = <void *>bptr
+ * if size: size[0] = <Py_ssize_t>blen # <<<<<<<<<<<<<<
+ * if itemsize: itemsize[0] = <Py_ssize_t>bitemlen
+ *
+ */
+ __pyx_t_17 = (__pyx_v_size != 0);
+ if (__pyx_t_17) {
+ (__pyx_v_size[0]) = ((Py_ssize_t)__pyx_v_blen);
+ goto __pyx_L33;
+ }
+ __pyx_L33:;
+
+ /* "buffers.pxd":191
+ * if base: base[0] = <void *>bptr
+ * if size: size[0] = <Py_ssize_t>blen
+ * if itemsize: itemsize[0] = <Py_ssize_t>bitemlen # <<<<<<<<<<<<<<
+ *
+ * if PY_MAJOR_VERSION >= 3 and bfmt is not None:
+ */
+ __pyx_t_17 = (__pyx_v_itemsize != 0);
+ if (__pyx_t_17) {
+ (__pyx_v_itemsize[0]) = ((Py_ssize_t)__pyx_v_bitemlen);
+ goto __pyx_L34;
+ }
+ __pyx_L34:;
+
+ /* "buffers.pxd":193
+ * if itemsize: itemsize[0] = <Py_ssize_t>bitemlen
+ *
+ * if PY_MAJOR_VERSION >= 3 and bfmt is not None: # <<<<<<<<<<<<<<
+ * return bfmt.decode('ascii')
+ * return bfmt
+ */
+ __pyx_t_1 = ((PY_MAJOR_VERSION >= 3) != 0);
+ if (__pyx_t_1) {
+ } else {
+ __pyx_t_17 = __pyx_t_1;
+ goto __pyx_L36_bool_binop_done;
+ }
+ __pyx_t_1 = (__pyx_v_bfmt != Py_None);
+ __pyx_t_18 = (__pyx_t_1 != 0);
+ __pyx_t_17 = __pyx_t_18;
+ __pyx_L36_bool_binop_done:;
+ if (__pyx_t_17) {
+
+ /* "buffers.pxd":194
+ *
+ * if PY_MAJOR_VERSION >= 3 and bfmt is not None:
+ * return bfmt.decode('ascii') # <<<<<<<<<<<<<<
+ * return bfmt
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_bfmt, __pyx_n_s_decode); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "buffers.pxd":195
+ * if PY_MAJOR_VERSION >= 3 and bfmt is not None:
+ * return bfmt.decode('ascii')
+ * return bfmt # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_bfmt);
+ __pyx_r = __pyx_v_bfmt;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":114
+ *
+ *
+ * cdef inline object asbuffer(object ob, int writable, int format, # <<<<<<<<<<<<<<
+ * void **base, Py_ssize_t *size,
+ * Py_ssize_t *itemsize):
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_10);
+ __Pyx_XDECREF(__pyx_t_14);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_XDECREF(__pyx_t_16);
+ __Pyx_AddTraceback("buffers.asbuffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_bfmt);
+ __Pyx_XDECREF(__pyx_v_dtype);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":198
+ *
+ *
+ * cdef inline object asbuffer_r(object ob, void **base, Py_ssize_t *size): # <<<<<<<<<<<<<<
+ * """Wrapper for standard calls to asbuffer with a readonly buffer."""
+ * asbuffer(ob, 0, 0, base, size, NULL)
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_asbuffer_r(PyObject *__pyx_v_ob, void **__pyx_v_base, Py_ssize_t *__pyx_v_size) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("asbuffer_r", 0);
+
+ /* "buffers.pxd":200
+ * cdef inline object asbuffer_r(object ob, void **base, Py_ssize_t *size):
+ * """Wrapper for standard calls to asbuffer with a readonly buffer."""
+ * asbuffer(ob, 0, 0, base, size, NULL) # <<<<<<<<<<<<<<
+ * return ob
+ *
+ */
+ __pyx_t_1 = __pyx_f_7buffers_asbuffer(__pyx_v_ob, 0, 0, __pyx_v_base, __pyx_v_size, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "buffers.pxd":201
+ * """Wrapper for standard calls to asbuffer with a readonly buffer."""
+ * asbuffer(ob, 0, 0, base, size, NULL)
+ * return ob # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_ob);
+ __pyx_r = __pyx_v_ob;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":198
+ *
+ *
+ * cdef inline object asbuffer_r(object ob, void **base, Py_ssize_t *size): # <<<<<<<<<<<<<<
+ * """Wrapper for standard calls to asbuffer with a readonly buffer."""
+ * asbuffer(ob, 0, 0, base, size, NULL)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("buffers.asbuffer_r", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":204
+ *
+ *
+ * cdef inline object asbuffer_w(object ob, void **base, Py_ssize_t *size): # <<<<<<<<<<<<<<
+ * """Wrapper for standard calls to asbuffer with a writable buffer."""
+ * asbuffer(ob, 1, 0, base, size, NULL)
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_asbuffer_w(PyObject *__pyx_v_ob, void **__pyx_v_base, Py_ssize_t *__pyx_v_size) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("asbuffer_w", 0);
+
+ /* "buffers.pxd":206
+ * cdef inline object asbuffer_w(object ob, void **base, Py_ssize_t *size):
+ * """Wrapper for standard calls to asbuffer with a writable buffer."""
+ * asbuffer(ob, 1, 0, base, size, NULL) # <<<<<<<<<<<<<<
+ * return ob
+ *
+ */
+ __pyx_t_1 = __pyx_f_7buffers_asbuffer(__pyx_v_ob, 1, 0, __pyx_v_base, __pyx_v_size, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "buffers.pxd":207
+ * """Wrapper for standard calls to asbuffer with a writable buffer."""
+ * asbuffer(ob, 1, 0, base, size, NULL)
+ * return ob # <<<<<<<<<<<<<<
+ *
+ * #------------------------------------------------------------------------------
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_ob);
+ __pyx_r = __pyx_v_ob;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":204
+ *
+ *
+ * cdef inline object asbuffer_w(object ob, void **base, Py_ssize_t *size): # <<<<<<<<<<<<<<
+ * """Wrapper for standard calls to asbuffer with a writable buffer."""
+ * asbuffer(ob, 1, 0, base, size, NULL)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("buffers.asbuffer_w", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":214
+ *
+ *
+ * cdef inline object frombuffer_3(void *ptr, Py_ssize_t s, int readonly): # <<<<<<<<<<<<<<
+ * """Python 3 version of frombuffer.
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer_3(void *__pyx_v_ptr, Py_ssize_t __pyx_v_s, int __pyx_v_readonly) {
+ Py_buffer __pyx_v_pybuf;
+ Py_ssize_t *__pyx_v_shape;
+ PyObject *__pyx_v_astr = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1[1];
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("frombuffer_3", 0);
+
+ /* "buffers.pxd":221
+ * """
+ * cdef Py_buffer pybuf
+ * cdef Py_ssize_t *shape = [s] # <<<<<<<<<<<<<<
+ * cdef str astr=""
+ * PyBuffer_FillInfo(&pybuf, astr, ptr, s, readonly, PyBUF_SIMPLE)
+ */
+ __pyx_t_1[0] = __pyx_v_s;
+ __pyx_v_shape = __pyx_t_1;
+
+ /* "buffers.pxd":222
+ * cdef Py_buffer pybuf
+ * cdef Py_ssize_t *shape = [s]
+ * cdef str astr="" # <<<<<<<<<<<<<<
+ * PyBuffer_FillInfo(&pybuf, astr, ptr, s, readonly, PyBUF_SIMPLE)
+ * pybuf.format = "B"
+ */
+ __Pyx_INCREF(__pyx_kp_s__22);
+ __pyx_v_astr = __pyx_kp_s__22;
+
+ /* "buffers.pxd":223
+ * cdef Py_ssize_t *shape = [s]
+ * cdef str astr=""
+ * PyBuffer_FillInfo(&pybuf, astr, ptr, s, readonly, PyBUF_SIMPLE) # <<<<<<<<<<<<<<
+ * pybuf.format = "B"
+ * pybuf.shape = shape
+ */
+ __pyx_t_2 = PyBuffer_FillInfo((&__pyx_v_pybuf), __pyx_v_astr, __pyx_v_ptr, __pyx_v_s, __pyx_v_readonly, PyBUF_SIMPLE); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "buffers.pxd":224
+ * cdef str astr=""
+ * PyBuffer_FillInfo(&pybuf, astr, ptr, s, readonly, PyBUF_SIMPLE)
+ * pybuf.format = "B" # <<<<<<<<<<<<<<
+ * pybuf.shape = shape
+ * return PyMemoryView_FromBuffer(&pybuf)
+ */
+ __pyx_v_pybuf.format = __pyx_k_B;
+
+ /* "buffers.pxd":225
+ * PyBuffer_FillInfo(&pybuf, astr, ptr, s, readonly, PyBUF_SIMPLE)
+ * pybuf.format = "B"
+ * pybuf.shape = shape # <<<<<<<<<<<<<<
+ * return PyMemoryView_FromBuffer(&pybuf)
+ *
+ */
+ __pyx_v_pybuf.shape = __pyx_v_shape;
+
+ /* "buffers.pxd":226
+ * pybuf.format = "B"
+ * pybuf.shape = shape
+ * return PyMemoryView_FromBuffer(&pybuf) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = PyMemoryView_FromBuffer((&__pyx_v_pybuf)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":214
+ *
+ *
+ * cdef inline object frombuffer_3(void *ptr, Py_ssize_t s, int readonly): # <<<<<<<<<<<<<<
+ * """Python 3 version of frombuffer.
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("buffers.frombuffer_3", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_astr);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":229
+ *
+ *
+ * cdef inline object frombuffer_2(void *ptr, Py_ssize_t s, int readonly): # <<<<<<<<<<<<<<
+ * """Python 2 version of frombuffer.
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer_2(void *__pyx_v_ptr, Py_ssize_t __pyx_v_s, int __pyx_v_readonly) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("frombuffer_2", 0);
+
+ /* "buffers.pxd":235
+ * """
+ *
+ * if oldstyle_available(): # <<<<<<<<<<<<<<
+ * if readonly:
+ * return PyBuffer_FromMemory(ptr, s)
+ */
+ __pyx_t_1 = (__pyx_f_7buffers_oldstyle_available() != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":236
+ *
+ * if oldstyle_available():
+ * if readonly: # <<<<<<<<<<<<<<
+ * return PyBuffer_FromMemory(ptr, s)
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_readonly != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":237
+ * if oldstyle_available():
+ * if readonly:
+ * return PyBuffer_FromMemory(ptr, s) # <<<<<<<<<<<<<<
+ * else:
+ * return PyBuffer_FromReadWriteMemory(ptr, s)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyBuffer_FromMemory(__pyx_v_ptr, __pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":239
+ * return PyBuffer_FromMemory(ptr, s)
+ * else:
+ * return PyBuffer_FromReadWriteMemory(ptr, s) # <<<<<<<<<<<<<<
+ * else:
+ * raise NotImplementedError("Old style buffers not available.")
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyBuffer_FromReadWriteMemory(__pyx_v_ptr, __pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":241
+ * return PyBuffer_FromReadWriteMemory(ptr, s)
+ * else:
+ * raise NotImplementedError("Old style buffers not available.") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ {__pyx_filename = __pyx_f[4]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "buffers.pxd":229
+ *
+ *
+ * cdef inline object frombuffer_2(void *ptr, Py_ssize_t s, int readonly): # <<<<<<<<<<<<<<
+ * """Python 2 version of frombuffer.
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("buffers.frombuffer_2", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":244
+ *
+ *
+ * cdef inline object frombuffer(void *ptr, Py_ssize_t s, int readonly): # <<<<<<<<<<<<<<
+ * """Create a Python Buffer/View of a C array.
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer(void *__pyx_v_ptr, Py_ssize_t __pyx_v_s, int __pyx_v_readonly) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("frombuffer", 0);
+
+ /* "buffers.pxd":261
+ * """
+ * # oldstyle first priority for now
+ * if oldstyle_available(): # <<<<<<<<<<<<<<
+ * return frombuffer_2(ptr, s, readonly)
+ * else:
+ */
+ __pyx_t_1 = (__pyx_f_7buffers_oldstyle_available() != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":262
+ * # oldstyle first priority for now
+ * if oldstyle_available():
+ * return frombuffer_2(ptr, s, readonly) # <<<<<<<<<<<<<<
+ * else:
+ * return frombuffer_3(ptr, s, readonly)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_f_7buffers_frombuffer_2(__pyx_v_ptr, __pyx_v_s, __pyx_v_readonly); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":264
+ * return frombuffer_2(ptr, s, readonly)
+ * else:
+ * return frombuffer_3(ptr, s, readonly) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_f_7buffers_frombuffer_3(__pyx_v_ptr, __pyx_v_s, __pyx_v_readonly); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "buffers.pxd":244
+ *
+ *
+ * cdef inline object frombuffer(void *ptr, Py_ssize_t s, int readonly): # <<<<<<<<<<<<<<
+ * """Create a Python Buffer/View of a C array.
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("buffers.frombuffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":267
+ *
+ *
+ * cdef inline object frombuffer_r(void *ptr, Py_ssize_t s): # <<<<<<<<<<<<<<
+ * """Wrapper for readonly view frombuffer."""
+ * return frombuffer(ptr, s, 1)
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer_r(void *__pyx_v_ptr, Py_ssize_t __pyx_v_s) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("frombuffer_r", 0);
+
+ /* "buffers.pxd":269
+ * cdef inline object frombuffer_r(void *ptr, Py_ssize_t s):
+ * """Wrapper for readonly view frombuffer."""
+ * return frombuffer(ptr, s, 1) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_f_7buffers_frombuffer(__pyx_v_ptr, __pyx_v_s, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":267
+ *
+ *
+ * cdef inline object frombuffer_r(void *ptr, Py_ssize_t s): # <<<<<<<<<<<<<<
+ * """Wrapper for readonly view frombuffer."""
+ * return frombuffer(ptr, s, 1)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("buffers.frombuffer_r", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":272
+ *
+ *
+ * cdef inline object frombuffer_w(void *ptr, Py_ssize_t s): # <<<<<<<<<<<<<<
+ * """Wrapper for writable view frombuffer."""
+ * return frombuffer(ptr, s, 0)
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer_w(void *__pyx_v_ptr, Py_ssize_t __pyx_v_s) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("frombuffer_w", 0);
+
+ /* "buffers.pxd":274
+ * cdef inline object frombuffer_w(void *ptr, Py_ssize_t s):
+ * """Wrapper for writable view frombuffer."""
+ * return frombuffer(ptr, s, 0) # <<<<<<<<<<<<<<
+ *
+ * #------------------------------------------------------------------------------
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_f_7buffers_frombuffer(__pyx_v_ptr, __pyx_v_s, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":272
+ *
+ *
+ * cdef inline object frombuffer_w(void *ptr, Py_ssize_t s): # <<<<<<<<<<<<<<
+ * """Wrapper for writable view frombuffer."""
+ * return frombuffer(ptr, s, 0)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("buffers.frombuffer_w", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":281
+ * #------------------------------------------------------------------------------
+ *
+ * cdef inline object viewfromobject(object obj, int readonly): # <<<<<<<<<<<<<<
+ * """Construct a Python Buffer/View object from another Python object.
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_viewfromobject(PyObject *__pyx_v_obj, int __pyx_v_readonly) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("viewfromobject", 0);
+
+ /* "buffers.pxd":297
+ * Buffer/View of the original object.
+ * """
+ * if not memoryview_available(): # <<<<<<<<<<<<<<
+ * if readonly:
+ * return PyBuffer_FromObject(obj, 0, Py_END_OF_BUFFER)
+ */
+ __pyx_t_1 = ((!(__pyx_f_7buffers_memoryview_available() != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":298
+ * """
+ * if not memoryview_available():
+ * if readonly: # <<<<<<<<<<<<<<
+ * return PyBuffer_FromObject(obj, 0, Py_END_OF_BUFFER)
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_readonly != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":299
+ * if not memoryview_available():
+ * if readonly:
+ * return PyBuffer_FromObject(obj, 0, Py_END_OF_BUFFER) # <<<<<<<<<<<<<<
+ * else:
+ * return PyBuffer_FromReadWriteObject(obj, 0, Py_END_OF_BUFFER)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyBuffer_FromObject(__pyx_v_obj, 0, Py_END_OF_BUFFER); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":301
+ * return PyBuffer_FromObject(obj, 0, Py_END_OF_BUFFER)
+ * else:
+ * return PyBuffer_FromReadWriteObject(obj, 0, Py_END_OF_BUFFER) # <<<<<<<<<<<<<<
+ * else:
+ * return PyMemoryView_FromObject(obj)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyBuffer_FromReadWriteObject(__pyx_v_obj, 0, Py_END_OF_BUFFER); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":303
+ * return PyBuffer_FromReadWriteObject(obj, 0, Py_END_OF_BUFFER)
+ * else:
+ * return PyMemoryView_FromObject(obj) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyMemoryView_FromObject(__pyx_v_obj); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "buffers.pxd":281
+ * #------------------------------------------------------------------------------
+ *
+ * cdef inline object viewfromobject(object obj, int readonly): # <<<<<<<<<<<<<<
+ * """Construct a Python Buffer/View object from another Python object.
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("buffers.viewfromobject", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":306
+ *
+ *
+ * cdef inline object viewfromobject_r(object obj): # <<<<<<<<<<<<<<
+ * """Wrapper for readonly viewfromobject."""
+ * return viewfromobject(obj, 1)
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_viewfromobject_r(PyObject *__pyx_v_obj) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("viewfromobject_r", 0);
+
+ /* "buffers.pxd":308
+ * cdef inline object viewfromobject_r(object obj):
+ * """Wrapper for readonly viewfromobject."""
+ * return viewfromobject(obj, 1) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_f_7buffers_viewfromobject(__pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":306
+ *
+ *
+ * cdef inline object viewfromobject_r(object obj): # <<<<<<<<<<<<<<
+ * """Wrapper for readonly viewfromobject."""
+ * return viewfromobject(obj, 1)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("buffers.viewfromobject_r", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":311
+ *
+ *
+ * cdef inline object viewfromobject_w(object obj): # <<<<<<<<<<<<<<
+ * """Wrapper for writable viewfromobject."""
+ * return viewfromobject(obj, 0)
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_viewfromobject_w(PyObject *__pyx_v_obj) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("viewfromobject_w", 0);
+
+ /* "buffers.pxd":313
+ * cdef inline object viewfromobject_w(object obj):
+ * """Wrapper for writable viewfromobject."""
+ * return viewfromobject(obj, 0) # <<<<<<<<<<<<<<
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_f_7buffers_viewfromobject(__pyx_v_obj, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":311
+ *
+ *
+ * cdef inline object viewfromobject_w(object obj): # <<<<<<<<<<<<<<
+ * """Wrapper for writable viewfromobject."""
+ * return viewfromobject(obj, 0)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("buffers.viewfromobject_w", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+static struct __pyx_vtabstruct_3zmq_7backend_6cython_6socket_Socket __pyx_vtable_3zmq_7backend_6cython_6socket_Socket;
+
+static PyObject *__pyx_tp_new_3zmq_7backend_6cython_6socket_Socket(PyTypeObject *t, PyObject *a, PyObject *k) {
+ struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *p;
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)o);
+ p->__pyx_vtab = __pyx_vtabptr_3zmq_7backend_6cython_6socket_Socket;
+ p->context = ((struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)Py_None); Py_INCREF(Py_None);
+ if (unlikely(__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_3__cinit__(o, a, k) < 0)) {
+ Py_DECREF(o); o = 0;
+ }
+ return o;
+}
+
+static void __pyx_tp_dealloc_3zmq_7backend_6cython_6socket_Socket(PyObject *o) {
+ struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *p = (struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)o;
+ #if PY_VERSION_HEX >= 0x030400a1
+ if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ PyObject_GC_UnTrack(o);
+ {
+ PyObject *etype, *eval, *etb;
+ PyErr_Fetch(&etype, &eval, &etb);
+ ++Py_REFCNT(o);
+ __pyx_pw_3zmq_7backend_6cython_6socket_6Socket_5__dealloc__(o);
+ --Py_REFCNT(o);
+ PyErr_Restore(etype, eval, etb);
+ }
+ if (p->__weakref__) PyObject_ClearWeakRefs(o);
+ Py_CLEAR(p->context);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+
+static int __pyx_tp_traverse_3zmq_7backend_6cython_6socket_Socket(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *p = (struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)o;
+ if (p->context) {
+ e = (*v)(((PyObject*)p->context), a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_3zmq_7backend_6cython_6socket_Socket(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *p = (struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)o;
+ tmp = ((PyObject*)p->context);
+ p->context = ((struct __pyx_obj_3zmq_7backend_6cython_7context_Context *)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ return 0;
+}
+
+static PyObject *__pyx_getprop_3zmq_7backend_6cython_6socket_6Socket_context(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_3zmq_7backend_6cython_6socket_6Socket_7context_1__get__(o);
+}
+
+static int __pyx_setprop_3zmq_7backend_6cython_6socket_6Socket_context(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
+ if (v) {
+ return __pyx_pw_3zmq_7backend_6cython_6socket_6Socket_7context_3__set__(o, v);
+ }
+ else {
+ return __pyx_pw_3zmq_7backend_6cython_6socket_6Socket_7context_5__del__(o);
+ }
+}
+
+static PyObject *__pyx_getprop_3zmq_7backend_6cython_6socket_6Socket__closed(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_3zmq_7backend_6cython_6socket_6Socket_7_closed_1__get__(o);
+}
+
+static int __pyx_setprop_3zmq_7backend_6cython_6socket_6Socket__closed(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
+ if (v) {
+ return __pyx_pw_3zmq_7backend_6cython_6socket_6Socket_7_closed_3__set__(o, v);
+ }
+ else {
+ PyErr_SetString(PyExc_NotImplementedError, "__del__");
+ return -1;
+ }
+}
+
+static PyMethodDef __pyx_methods_3zmq_7backend_6cython_6socket_Socket[] = {
+ {"underlying", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_7underlying, METH_NOARGS, __pyx_doc_3zmq_7backend_6cython_6socket_6Socket_6underlying},
+ {"closed", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_9closed, METH_NOARGS, 0},
+ {"close", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_11close, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3zmq_7backend_6cython_6socket_6Socket_10close},
+ {"set", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_13set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3zmq_7backend_6cython_6socket_6Socket_12set},
+ {"get", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_15get, METH_O, __pyx_doc_3zmq_7backend_6cython_6socket_6Socket_14get},
+ {"bind", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_17bind, METH_O, __pyx_doc_3zmq_7backend_6cython_6socket_6Socket_16bind},
+ {"connect", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_19connect, METH_O, __pyx_doc_3zmq_7backend_6cython_6socket_6Socket_18connect},
+ {"unbind", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_21unbind, METH_O, __pyx_doc_3zmq_7backend_6cython_6socket_6Socket_20unbind},
+ {"disconnect", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_23disconnect, METH_O, __pyx_doc_3zmq_7backend_6cython_6socket_6Socket_22disconnect},
+ {"monitor", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_25monitor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3zmq_7backend_6cython_6socket_6Socket_24monitor},
+ {"send", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_27send, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3zmq_7backend_6cython_6socket_6Socket_26send},
+ {"recv", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_6socket_6Socket_29recv, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3zmq_7backend_6cython_6socket_6Socket_28recv},
+ {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets_3zmq_7backend_6cython_6socket_Socket[] = {
+ {(char *)"context", __pyx_getprop_3zmq_7backend_6cython_6socket_6Socket_context, __pyx_setprop_3zmq_7backend_6cython_6socket_6Socket_context, 0, 0},
+ {(char *)"_closed", __pyx_getprop_3zmq_7backend_6cython_6socket_6Socket__closed, __pyx_setprop_3zmq_7backend_6cython_6socket_6Socket__closed, 0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type_3zmq_7backend_6cython_6socket_Socket = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "zmq.backend.cython.socket.Socket", /*tp_name*/
+ sizeof(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_3zmq_7backend_6cython_6socket_Socket, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ "Socket(context, socket_type)\n\n A 0MQ socket.\n\n These objects will generally be constructed via the socket() method of a Context object.\n \n Note: 0MQ Sockets are *not* threadsafe. **DO NOT** share them across threads.\n \n Parameters\n ----------\n context : Context\n The 0MQ Context this Socket belongs to.\n socket_type : int\n The socket type, which can be any of the 0MQ socket types: \n REQ, REP, PUB, SUB, PAIR, DEALER, ROUTER, PULL, PUSH, XPUB, XSUB.\n \n See Also\n --------\n .Context.socket : method for creating a socket bound to a Context.\n ", /*tp_doc*/
+ __pyx_tp_traverse_3zmq_7backend_6cython_6socket_Socket, /*tp_traverse*/
+ __pyx_tp_clear_3zmq_7backend_6cython_6socket_Socket, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_3zmq_7backend_6cython_6socket_Socket, /*tp_methods*/
+ 0, /*tp_members*/
+ __pyx_getsets_3zmq_7backend_6cython_6socket_Socket, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ __pyx_pw_3zmq_7backend_6cython_6socket_6Socket_1__init__, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_3zmq_7backend_6cython_6socket_Socket, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+
+static PyMethodDef __pyx_methods[] = {
+ {0, 0, 0, 0}
+};
+
+static char* __pyx_import_star_type_names[] = {
+ "Context",
+ "Frame",
+ "Py_ssize_t",
+ "Socket",
+ "__pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_recv",
+ "__pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_send",
+ "__pyx_opt_args_3zmq_7backend_6cython_6socket__recv_copy",
+ "__pyx_opt_args_3zmq_7backend_6cython_6socket__recv_frame",
+ "__pyx_opt_args_3zmq_7backend_6cython_6socket__send_copy",
+ "__pyx_opt_args_3zmq_7backend_6cython_6socket__send_frame",
+ "const_char_ptr",
+ "const_void_ptr",
+ "fd_t",
+ "int64_t",
+ "zmq_free_fn",
+ "zmq_msg_t",
+ "zmq_pollitem_t",
+ 0
+};
+
+static int __pyx_import_star_set(PyObject *o, PyObject* py_name, char *name) {
+ char** type_name = __pyx_import_star_type_names;
+ while (*type_name) {
+ if (__Pyx_StrEq(name, *type_name)) {
+ PyErr_Format(PyExc_TypeError, "Cannot overwrite C type %s", name);
+ goto bad;
+ }
+ type_name++;
+ }
+ if (0);
+ else {
+ if (PyObject_SetAttr(__pyx_m, py_name, o) < 0) goto bad;
+ }
+ return 0;
+ bad:
+ return -1;
+}
+
+
+/* import_all_from is an unexposed function from ceval.c */
+
+static int
+__Pyx_import_all_from(PyObject *locals, PyObject *v)
+{
+ PyObject *all = PyObject_GetAttrString(v, "__all__");
+ PyObject *dict, *name, *value;
+ int skip_leading_underscores = 0;
+ int pos, err;
+
+ if (all == NULL) {
+ if (!PyErr_ExceptionMatches(PyExc_AttributeError))
+ return -1; /* Unexpected error */
+ PyErr_Clear();
+ dict = PyObject_GetAttrString(v, "__dict__");
+ if (dict == NULL) {
+ if (!PyErr_ExceptionMatches(PyExc_AttributeError))
+ return -1;
+ PyErr_SetString(PyExc_ImportError,
+ "from-import-* object has no __dict__ and no __all__");
+ return -1;
+ }
+#if PY_MAJOR_VERSION < 3
+ all = PyObject_CallMethod(dict, (char *)"keys", NULL);
+#else
+ all = PyMapping_Keys(dict);
+#endif
+ Py_DECREF(dict);
+ if (all == NULL)
+ return -1;
+ skip_leading_underscores = 1;
+ }
+
+ for (pos = 0, err = 0; ; pos++) {
+ name = PySequence_GetItem(all, pos);
+ if (name == NULL) {
+ if (!PyErr_ExceptionMatches(PyExc_IndexError))
+ err = -1;
+ else
+ PyErr_Clear();
+ break;
+ }
+ if (skip_leading_underscores &&
+#if PY_MAJOR_VERSION < 3
+ PyString_Check(name) &&
+ PyString_AS_STRING(name)[0] == '_')
+#else
+ PyUnicode_Check(name) &&
+ PyUnicode_AS_UNICODE(name)[0] == '_')
+#endif
+ {
+ Py_DECREF(name);
+ continue;
+ }
+ value = PyObject_GetAttr(v, name);
+ if (value == NULL)
+ err = -1;
+ else if (PyDict_CheckExact(locals))
+ err = PyDict_SetItem(locals, name, value);
+ else
+ err = PyObject_SetItem(locals, name, value);
+ Py_DECREF(name);
+ Py_XDECREF(value);
+ if (err != 0)
+ break;
+ }
+ Py_DECREF(all);
+ return err;
+}
+
+
+static int __pyx_import_star(PyObject* m) {
+
+ int i;
+ int ret = -1;
+ char* s;
+ PyObject *locals = 0;
+ PyObject *list = 0;
+#if PY_MAJOR_VERSION >= 3
+ PyObject *utf8_name = 0;
+#endif
+ PyObject *name;
+ PyObject *item;
+
+ locals = PyDict_New(); if (!locals) goto bad;
+ if (__Pyx_import_all_from(locals, m) < 0) goto bad;
+ list = PyDict_Items(locals); if (!list) goto bad;
+
+ for(i=0; i<PyList_GET_SIZE(list); i++) {
+ name = PyTuple_GET_ITEM(PyList_GET_ITEM(list, i), 0);
+ item = PyTuple_GET_ITEM(PyList_GET_ITEM(list, i), 1);
+#if PY_MAJOR_VERSION >= 3
+ utf8_name = PyUnicode_AsUTF8String(name);
+ if (!utf8_name) goto bad;
+ s = PyBytes_AS_STRING(utf8_name);
+ if (__pyx_import_star_set(item, name, s) < 0) goto bad;
+ Py_DECREF(utf8_name); utf8_name = 0;
+#else
+ s = PyString_AsString(name);
+ if (!s) goto bad;
+ if (__pyx_import_star_set(item, name, s) < 0) goto bad;
+#endif
+ }
+ ret = 0;
+
+bad:
+ Py_XDECREF(locals);
+ Py_XDECREF(list);
+#if PY_MAJOR_VERSION >= 3
+ Py_XDECREF(utf8_name);
+#endif
+ return ret;
+}
+
+
+#if PY_MAJOR_VERSION >= 3
+static struct PyModuleDef __pyx_moduledef = {
+ #if PY_VERSION_HEX < 0x03020000
+ { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
+ #else
+ PyModuleDef_HEAD_INIT,
+ #endif
+ "socket",
+ __pyx_k_0MQ_Socket_class, /* m_doc */
+ -1, /* m_size */
+ __pyx_methods /* m_methods */,
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL /* m_free */
+};
+#endif
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+ {&__pyx_n_s_Again, __pyx_k_Again, sizeof(__pyx_k_Again), 0, 0, 1, 1},
+ {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
+ {&__pyx_n_b_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 0, 1},
+ {&__pyx_n_s_ContextTerminated, __pyx_k_ContextTerminated, sizeof(__pyx_k_ContextTerminated), 0, 0, 1, 1},
+ {&__pyx_n_s_ENOTSOCK, __pyx_k_ENOTSOCK, sizeof(__pyx_k_ENOTSOCK), 0, 0, 1, 1},
+ {&__pyx_n_s_Frame, __pyx_k_Frame, sizeof(__pyx_k_Frame), 0, 0, 1, 1},
+ {&__pyx_n_s_IPC_PATH_MAX_LEN, __pyx_k_IPC_PATH_MAX_LEN, sizeof(__pyx_k_IPC_PATH_MAX_LEN), 0, 0, 1, 1},
+ {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
+ {&__pyx_kp_s_Not_a_tracked_message, __pyx_k_Not_a_tracked_message, sizeof(__pyx_k_Not_a_tracked_message), 0, 0, 1, 0},
+ {&__pyx_kp_s_Old_style_buffers_not_available, __pyx_k_Old_style_buffers_not_available, sizeof(__pyx_k_Old_style_buffers_not_available), 0, 0, 1, 0},
+ {&__pyx_n_s_RCVMORE, __pyx_k_RCVMORE, sizeof(__pyx_k_RCVMORE), 0, 0, 1, 1},
+ {&__pyx_n_s_Socket, __pyx_k_Socket, sizeof(__pyx_k_Socket), 0, 0, 1, 1},
+ {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
+ {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
+ {&__pyx_n_s_ZMQBindError, __pyx_k_ZMQBindError, sizeof(__pyx_k_ZMQBindError), 0, 0, 1, 1},
+ {&__pyx_n_s_ZMQError, __pyx_k_ZMQError, sizeof(__pyx_k_ZMQError), 0, 0, 1, 1},
+ {&__pyx_kp_s__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 0, 1, 0},
+ {&__pyx_n_s__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 0, 1, 1},
+ {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0},
+ {&__pyx_n_s_addr, __pyx_k_addr, sizeof(__pyx_k_addr), 0, 0, 1, 1},
+ {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
+ {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1},
+ {&__pyx_n_s_basestring, __pyx_k_basestring, sizeof(__pyx_k_basestring), 0, 0, 1, 1},
+ {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1},
+ {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1},
+ {&__pyx_n_s_bytes_sockopts, __pyx_k_bytes_sockopts, sizeof(__pyx_k_bytes_sockopts), 0, 0, 1, 1},
+ {&__pyx_n_s_cPickle, __pyx_k_cPickle, sizeof(__pyx_k_cPickle), 0, 0, 1, 1},
+ {&__pyx_n_s_char, __pyx_k_char, sizeof(__pyx_k_char), 0, 0, 1, 1},
+ {&__pyx_n_s_check_version, __pyx_k_check_version, sizeof(__pyx_k_check_version), 0, 0, 1, 1},
+ {&__pyx_n_s_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 0, 0, 1, 1},
+ {&__pyx_n_s_codecs, __pyx_k_codecs, sizeof(__pyx_k_codecs), 0, 0, 1, 1},
+ {&__pyx_n_s_constants, __pyx_k_constants, sizeof(__pyx_k_constants), 0, 0, 1, 1},
+ {&__pyx_n_s_context, __pyx_k_context, sizeof(__pyx_k_context), 0, 0, 1, 1},
+ {&__pyx_kp_s_context_must_be_specified, __pyx_k_context_must_be_specified, sizeof(__pyx_k_context_must_be_specified), 0, 0, 1, 0},
+ {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
+ {&__pyx_n_s_copy_mod, __pyx_k_copy_mod, sizeof(__pyx_k_copy_mod), 0, 0, 1, 1},
+ {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
+ {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
+ {&__pyx_n_s_disconnect, __pyx_k_disconnect, sizeof(__pyx_k_disconnect), 0, 0, 1, 1},
+ {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
+ {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
+ {&__pyx_n_s_events, __pyx_k_events, sizeof(__pyx_k_events), 0, 0, 1, 1},
+ {&__pyx_kp_s_expected_bytes_got_r, __pyx_k_expected_bytes_got_r, sizeof(__pyx_k_expected_bytes_got_r), 0, 0, 1, 0},
+ {&__pyx_kp_s_expected_int_got_r, __pyx_k_expected_int_got_r, sizeof(__pyx_k_expected_int_got_r), 0, 0, 1, 0},
+ {&__pyx_kp_s_expected_str_got_r, __pyx_k_expected_str_got_r, sizeof(__pyx_k_expected_str_got_r), 0, 0, 1, 0},
+ {&__pyx_n_s_fd_sockopts, __pyx_k_fd_sockopts, sizeof(__pyx_k_fd_sockopts), 0, 0, 1, 1},
+ {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
+ {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
+ {&__pyx_n_s_getsockopt, __pyx_k_getsockopt, sizeof(__pyx_k_getsockopt), 0, 0, 1, 1},
+ {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+ {&__pyx_n_s_int64_sockopts, __pyx_k_int64_sockopts, sizeof(__pyx_k_int64_sockopts), 0, 0, 1, 1},
+ {&__pyx_kp_s_ipc_path_0_is_longer_than_1_char, __pyx_k_ipc_path_0_is_longer_than_1_char, sizeof(__pyx_k_ipc_path_0_is_longer_than_1_char), 0, 0, 1, 0},
+ {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
+ {&__pyx_n_s_jsonapi, __pyx_k_jsonapi, sizeof(__pyx_k_jsonapi), 0, 0, 1, 1},
+ {&__pyx_n_s_linger, __pyx_k_linger, sizeof(__pyx_k_linger), 0, 0, 1, 1},
+ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+ {&__pyx_n_s_monitor, __pyx_k_monitor, sizeof(__pyx_k_monitor), 0, 0, 1, 1},
+ {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1},
+ {&__pyx_n_s_option, __pyx_k_option, sizeof(__pyx_k_option), 0, 0, 1, 1},
+ {&__pyx_n_s_optval, __pyx_k_optval, sizeof(__pyx_k_optval), 0, 0, 1, 1},
+ {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
+ {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
+ {&__pyx_kp_s_r_does_not_provide_a_buffer_int, __pyx_k_r_does_not_provide_a_buffer_int, sizeof(__pyx_k_r_does_not_provide_a_buffer_int), 0, 0, 1, 0},
+ {&__pyx_n_s_random, __pyx_k_random, sizeof(__pyx_k_random), 0, 0, 1, 1},
+ {&__pyx_n_s_recv, __pyx_k_recv, sizeof(__pyx_k_recv), 0, 0, 1, 1},
+ {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
+ {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
+ {&__pyx_n_s_shadow, __pyx_k_shadow, sizeof(__pyx_k_shadow), 0, 0, 1, 1},
+ {&__pyx_n_s_socket_type, __pyx_k_socket_type, sizeof(__pyx_k_socket_type), 0, 0, 1, 1},
+ {&__pyx_kp_s_socket_type_must_be_specified, __pyx_k_socket_type_must_be_specified, sizeof(__pyx_k_socket_type_must_be_specified), 0, 0, 1, 0},
+ {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
+ {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
+ {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
+ {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+ {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
+ {&__pyx_n_s_track, __pyx_k_track, sizeof(__pyx_k_track), 0, 0, 1, 1},
+ {&__pyx_n_s_tracker, __pyx_k_tracker, sizeof(__pyx_k_tracker), 0, 0, 1, 1},
+ {&__pyx_n_s_typecode, __pyx_k_typecode, sizeof(__pyx_k_typecode), 0, 0, 1, 1},
+ {&__pyx_n_s_unbind, __pyx_k_unbind, sizeof(__pyx_k_unbind), 0, 0, 1, 1},
+ {&__pyx_n_s_underlying, __pyx_k_underlying, sizeof(__pyx_k_underlying), 0, 0, 1, 1},
+ {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1},
+ {&__pyx_kp_s_unicode_not_allowed_use_send_str, __pyx_k_unicode_not_allowed_use_send_str, sizeof(__pyx_k_unicode_not_allowed_use_send_str), 0, 0, 1, 0},
+ {&__pyx_kp_s_unicode_not_allowed_use_setsocko, __pyx_k_unicode_not_allowed_use_setsocko, sizeof(__pyx_k_unicode_not_allowed_use_setsocko), 0, 0, 1, 0},
+ {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0},
+ {&__pyx_n_s_zmq, __pyx_k_zmq, sizeof(__pyx_k_zmq), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq_backend_cython, __pyx_k_zmq_backend_cython, sizeof(__pyx_k_zmq_backend_cython), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq_backend_cython_constants, __pyx_k_zmq_backend_cython_constants, sizeof(__pyx_k_zmq_backend_cython_constants), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq_error, __pyx_k_zmq_error, sizeof(__pyx_k_zmq_error), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq_utils, __pyx_k_zmq_utils, sizeof(__pyx_k_zmq_utils), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq_utils_strtypes, __pyx_k_zmq_utils_strtypes, sizeof(__pyx_k_zmq_utils_strtypes), 0, 0, 1, 1},
+ {0, 0, 0, 0, 0, 0, 0}
+};
+static int __Pyx_InitCachedBuiltins(void) {
+ __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+static int __Pyx_InitCachedConstants(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
+
+ /* "zmq/backend/cython/socket.pyx":221
+ * else:
+ * if context is None:
+ * raise TypeError("context must be specified") # <<<<<<<<<<<<<<
+ * if socket_type < 0:
+ * raise TypeError("socket_type must be specified")
+ */
+ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_context_must_be_specified); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple_);
+ __Pyx_GIVEREF(__pyx_tuple_);
+
+ /* "zmq/backend/cython/socket.pyx":223
+ * raise TypeError("context must be specified")
+ * if socket_type < 0:
+ * raise TypeError("socket_type must be specified") # <<<<<<<<<<<<<<
+ * self._shadow = False
+ * self.handle = zmq_socket(context.handle, socket_type)
+ */
+ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_socket_type_must_be_specified); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__2);
+ __Pyx_GIVEREF(__pyx_tuple__2);
+
+ /* "zmq/backend/cython/socket.pyx":310
+ * _check_closed(self)
+ * if isinstance(optval, unicode):
+ * raise TypeError("unicode not allowed, use setsockopt_string") # <<<<<<<<<<<<<<
+ *
+ * if option in zmq.constants.bytes_sockopts:
+ */
+ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_unicode_not_allowed_use_setsocko); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__3);
+ __Pyx_GIVEREF(__pyx_tuple__3);
+
+ /* "zmq/backend/cython/socket.pyx":427
+ * _check_closed(self)
+ * if isinstance(addr, unicode):
+ * addr = addr.encode('utf-8') # <<<<<<<<<<<<<<
+ * if not isinstance(addr, bytes):
+ * raise TypeError('expected str, got: %r' % addr)
+ */
+ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__4);
+ __Pyx_GIVEREF(__pyx_tuple__4);
+
+ /* "zmq/backend/cython/socket.pyx":436
+ * # py3compat: addr is bytes, but msg wants str
+ * if str is unicode:
+ * addr = addr.decode('utf-8', 'replace') # <<<<<<<<<<<<<<
+ * path = addr.split('://', 1)[-1]
+ * msg = ('ipc path "{0}" is longer than {1} '
+ */
+ __pyx_tuple__5 = PyTuple_Pack(2, __pyx_kp_s_utf_8, __pyx_n_s_replace); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__5);
+ __Pyx_GIVEREF(__pyx_tuple__5);
+
+ /* "zmq/backend/cython/socket.pyx":437
+ * if str is unicode:
+ * addr = addr.decode('utf-8', 'replace')
+ * path = addr.split('://', 1)[-1] # <<<<<<<<<<<<<<
+ * msg = ('ipc path "{0}" is longer than {1} '
+ * 'characters (sizeof(sockaddr_un.sun_path)). '
+ */
+ __pyx_tuple__7 = PyTuple_Pack(2, __pyx_kp_s__6, __pyx_int_1); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__7);
+ __Pyx_GIVEREF(__pyx_tuple__7);
+
+ /* "zmq/backend/cython/socket.pyx":464
+ * _check_closed(self)
+ * if isinstance(addr, unicode):
+ * addr = addr.encode('utf-8') # <<<<<<<<<<<<<<
+ * if not isinstance(addr, bytes):
+ * raise TypeError('expected str, got: %r' % addr)
+ */
+ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__8);
+ __Pyx_GIVEREF(__pyx_tuple__8);
+
+ /* "zmq/backend/cython/socket.pyx":492
+ * cdef char* c_addr
+ *
+ * _check_version((3,2), "unbind") # <<<<<<<<<<<<<<
+ * _check_closed(self)
+ * if isinstance(addr, unicode):
+ */
+ __pyx_tuple__9 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_2); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__9);
+ __Pyx_GIVEREF(__pyx_tuple__9);
+ __pyx_tuple__10 = PyTuple_Pack(2, __pyx_tuple__9, __pyx_n_s_unbind); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__10);
+ __Pyx_GIVEREF(__pyx_tuple__10);
+
+ /* "zmq/backend/cython/socket.pyx":495
+ * _check_closed(self)
+ * if isinstance(addr, unicode):
+ * addr = addr.encode('utf-8') # <<<<<<<<<<<<<<
+ * if not isinstance(addr, bytes):
+ * raise TypeError('expected str, got: %r' % addr)
+ */
+ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__11);
+ __Pyx_GIVEREF(__pyx_tuple__11);
+
+ /* "zmq/backend/cython/socket.pyx":523
+ * cdef char* c_addr
+ *
+ * _check_version((3,2), "disconnect") # <<<<<<<<<<<<<<
+ * _check_closed(self)
+ * if isinstance(addr, unicode):
+ */
+ __pyx_tuple__12 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_2); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__12);
+ __Pyx_GIVEREF(__pyx_tuple__12);
+ __pyx_tuple__13 = PyTuple_Pack(2, __pyx_tuple__12, __pyx_n_s_disconnect); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__13);
+ __Pyx_GIVEREF(__pyx_tuple__13);
+
+ /* "zmq/backend/cython/socket.pyx":526
+ * _check_closed(self)
+ * if isinstance(addr, unicode):
+ * addr = addr.encode('utf-8') # <<<<<<<<<<<<<<
+ * if not isinstance(addr, bytes):
+ * raise TypeError('expected str, got: %r' % addr)
+ */
+ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__14);
+ __Pyx_GIVEREF(__pyx_tuple__14);
+
+ /* "zmq/backend/cython/socket.pyx":559
+ * cdef char* c_addr = NULL
+ *
+ * _check_version((3,2), "monitor") # <<<<<<<<<<<<<<
+ * if addr is not None:
+ * if isinstance(addr, unicode):
+ */
+ __pyx_tuple__16 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_2); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__16);
+ __Pyx_GIVEREF(__pyx_tuple__16);
+ __pyx_tuple__17 = PyTuple_Pack(2, __pyx_tuple__16, __pyx_n_s_monitor); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__17);
+ __Pyx_GIVEREF(__pyx_tuple__17);
+
+ /* "zmq/backend/cython/socket.pyx":562
+ * if addr is not None:
+ * if isinstance(addr, unicode):
+ * addr = addr.encode('utf-8') # <<<<<<<<<<<<<<
+ * if not isinstance(addr, bytes):
+ * raise TypeError('expected str, got: %r' % addr)
+ */
+ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__18);
+ __Pyx_GIVEREF(__pyx_tuple__18);
+
+ /* "zmq/backend/cython/socket.pyx":614
+ *
+ * if isinstance(data, unicode):
+ * raise TypeError("unicode not allowed, use send_string") # <<<<<<<<<<<<<<
+ *
+ * if copy:
+ */
+ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_unicode_not_allowed_use_send_str); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__19);
+ __Pyx_GIVEREF(__pyx_tuple__19);
+
+ /* "zmq/backend/cython/socket.pyx":625
+ * if isinstance(data, Frame):
+ * if track and not data.tracker:
+ * raise ValueError('Not a tracked message') # <<<<<<<<<<<<<<
+ * msg = data
+ * else:
+ */
+ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Not_a_tracked_message); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__20);
+ __Pyx_GIVEREF(__pyx_tuple__20);
+
+ /* "buffers.pxd":194
+ *
+ * if PY_MAJOR_VERSION >= 3 and bfmt is not None:
+ * return bfmt.decode('ascii') # <<<<<<<<<<<<<<
+ * return bfmt
+ *
+ */
+ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__21);
+ __Pyx_GIVEREF(__pyx_tuple__21);
+
+ /* "buffers.pxd":241
+ * return PyBuffer_FromReadWriteMemory(ptr, s)
+ * else:
+ * raise NotImplementedError("Old style buffers not available.") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Old_style_buffers_not_available); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__23);
+ __Pyx_GIVEREF(__pyx_tuple__23);
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static int __Pyx_InitGlobals(void) {
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+#if PY_MAJOR_VERSION < 3
+PyMODINIT_FUNC initsocket(void); /*proto*/
+PyMODINIT_FUNC initsocket(void)
+#else
+PyMODINIT_FUNC PyInit_socket(void); /*proto*/
+PyMODINIT_FUNC PyInit_socket(void)
+#endif
+{
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ #if CYTHON_REFNANNY
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
+ if (!__Pyx_RefNanny) {
+ PyErr_Clear();
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
+ if (!__Pyx_RefNanny)
+ Py_FatalError("failed to import 'refnanny' module");
+ }
+ #endif
+ __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_socket(void)", 0);
+ if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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;}
+ __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;}
+ #ifdef __Pyx_CyFunction_USED
+ if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_FusedFunction_USED
+ if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_Generator_USED
+ if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ /*--- Library function declarations ---*/
+ /*--- Threads initialization code ---*/
+ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
+ #ifdef WITH_THREAD /* Python build with threading support? */
+ PyEval_InitThreads();
+ #endif
+ #endif
+ /*--- Module creation code ---*/
+ #if PY_MAJOR_VERSION < 3
+ __pyx_m = Py_InitModule4("socket", __pyx_methods, __pyx_k_0MQ_Socket_class, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+ #else
+ __pyx_m = PyModule_Create(&__pyx_moduledef);
+ #endif
+ if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_INCREF(__pyx_d);
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_COMPILING_IN_PYPY
+ Py_INCREF(__pyx_b);
+ #endif
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ /*--- Initialize various global constants etc. ---*/
+ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ if (__pyx_module_is_main_zmq__backend__cython__socket) {
+ if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ }
+ #if PY_MAJOR_VERSION >= 3
+ {
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!PyDict_GetItemString(modules, "zmq.backend.cython.socket")) {
+ if (unlikely(PyDict_SetItemString(modules, "zmq.backend.cython.socket", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+ /*--- Builtin init code ---*/
+ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Constants init code ---*/
+ if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Global init code ---*/
+ /*--- Variable export code ---*/
+ /*--- Function export code ---*/
+ /*--- Type init code ---*/
+ __pyx_vtabptr_3zmq_7backend_6cython_6socket_Socket = &__pyx_vtable_3zmq_7backend_6cython_6socket_Socket;
+ __pyx_vtable_3zmq_7backend_6cython_6socket_Socket.send = (PyObject *(*)(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_send *__pyx_optional_args))__pyx_f_3zmq_7backend_6cython_6socket_6Socket_send;
+ __pyx_vtable_3zmq_7backend_6cython_6socket_Socket.recv = (PyObject *(*)(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *, int __pyx_skip_dispatch, struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_recv *__pyx_optional_args))__pyx_f_3zmq_7backend_6cython_6socket_6Socket_recv;
+ if (PyType_Ready(&__pyx_type_3zmq_7backend_6cython_6socket_Socket) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type_3zmq_7backend_6cython_6socket_Socket.tp_print = 0;
+ if (__Pyx_SetVtable(__pyx_type_3zmq_7backend_6cython_6socket_Socket.tp_dict, __pyx_vtabptr_3zmq_7backend_6cython_6socket_Socket) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttrString(__pyx_m, "Socket", (PyObject *)&__pyx_type_3zmq_7backend_6cython_6socket_Socket) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_type_3zmq_7backend_6cython_6socket_Socket.tp_weaklistoffset == 0) __pyx_type_3zmq_7backend_6cython_6socket_Socket.tp_weaklistoffset = offsetof(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket, __weakref__);
+ __pyx_ptype_3zmq_7backend_6cython_6socket_Socket = &__pyx_type_3zmq_7backend_6cython_6socket_Socket;
+ /*--- Type import code ---*/
+ __pyx_ptype_3zmq_7backend_6cython_7context_Context = __Pyx_ImportType("zmq.backend.cython.context", "Context", sizeof(struct __pyx_obj_3zmq_7backend_6cython_7context_Context), 1); if (unlikely(!__pyx_ptype_3zmq_7backend_6cython_7context_Context)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_vtabptr_3zmq_7backend_6cython_7context_Context = (struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context*)__Pyx_GetVtable(__pyx_ptype_3zmq_7backend_6cython_7context_Context->tp_dict); if (unlikely(!__pyx_vtabptr_3zmq_7backend_6cython_7context_Context)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
+ #if CYTHON_COMPILING_IN_PYPY
+ sizeof(PyTypeObject),
+ #else
+ sizeof(PyHeapTypeObject),
+ #endif
+ 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_3zmq_7backend_6cython_7message_MessageTracker = __Pyx_ImportType("zmq.backend.cython.message", "MessageTracker", sizeof(struct __pyx_obj_3zmq_7backend_6cython_7message_MessageTracker), 1); if (unlikely(!__pyx_ptype_3zmq_7backend_6cython_7message_MessageTracker)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_3zmq_7backend_6cython_7message_Frame = __Pyx_ImportType("zmq.backend.cython.message", "Frame", sizeof(struct __pyx_obj_3zmq_7backend_6cython_7message_Frame), 1); if (unlikely(!__pyx_ptype_3zmq_7backend_6cython_7message_Frame)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_vtabptr_3zmq_7backend_6cython_7message_Frame = (struct __pyx_vtabstruct_3zmq_7backend_6cython_7message_Frame*)__Pyx_GetVtable(__pyx_ptype_3zmq_7backend_6cython_7message_Frame->tp_dict); if (unlikely(!__pyx_vtabptr_3zmq_7backend_6cython_7message_Frame)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Variable import code ---*/
+ /*--- Function import code ---*/
+ /*--- Execution code ---*/
+
+ /* "zmq/backend/cython/socket.pyx":58
+ * #-----------------------------------------------------------------------------
+ *
+ * import copy as copy_mod # <<<<<<<<<<<<<<
+ * import time
+ * import sys
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_copy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy_mod, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":59
+ *
+ * import copy as copy_mod
+ * import time # <<<<<<<<<<<<<<
+ * import sys
+ * import random
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":60
+ * import copy as copy_mod
+ * import time
+ * import sys # <<<<<<<<<<<<<<
+ * import random
+ * import struct
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":61
+ * import time
+ * import sys
+ * import random # <<<<<<<<<<<<<<
+ * import struct
+ * import codecs
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_random, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_random, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":62
+ * import sys
+ * import random
+ * import struct # <<<<<<<<<<<<<<
+ * import codecs
+ *
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":63
+ * import random
+ * import struct
+ * import codecs # <<<<<<<<<<<<<<
+ *
+ * from zmq.utils import jsonapi
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_codecs, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":65
+ * import codecs
+ *
+ * from zmq.utils import jsonapi # <<<<<<<<<<<<<<
+ *
+ * try:
+ */
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_s_jsonapi);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_jsonapi);
+ __Pyx_GIVEREF(__pyx_n_s_jsonapi);
+ __pyx_t_2 = __Pyx_Import(__pyx_n_s_zmq_utils, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_jsonapi); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_jsonapi, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":67
+ * from zmq.utils import jsonapi
+ *
+ * try: # <<<<<<<<<<<<<<
+ * import cPickle
+ * pickle = cPickle
+ */
+ {
+ __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
+ __Pyx_XGOTREF(__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_5);
+ /*try:*/ {
+
+ /* "zmq/backend/cython/socket.pyx":68
+ *
+ * try:
+ * import cPickle # <<<<<<<<<<<<<<
+ * pickle = cPickle
+ * except:
+ */
+ __pyx_t_2 = __Pyx_Import(__pyx_n_s_cPickle, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_cPickle, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":69
+ * try:
+ * import cPickle
+ * pickle = cPickle # <<<<<<<<<<<<<<
+ * except:
+ * cPickle = None
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cPickle); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_pickle, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ }
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ goto __pyx_L9_try_end;
+ __pyx_L2_error:;
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":70
+ * import cPickle
+ * pickle = cPickle
+ * except: # <<<<<<<<<<<<<<
+ * cPickle = None
+ * import pickle
+ */
+ /*except:*/ {
+ __Pyx_AddTraceback("zmq.backend.cython.socket", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_t_6);
+
+ /* "zmq/backend/cython/socket.pyx":71
+ * pickle = cPickle
+ * except:
+ * cPickle = None # <<<<<<<<<<<<<<
+ * import pickle
+ *
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_cPickle, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
+
+ /* "zmq/backend/cython/socket.pyx":72
+ * except:
+ * cPickle = None
+ * import pickle # <<<<<<<<<<<<<<
+ *
+ * import zmq
+ */
+ __pyx_t_7 = __Pyx_Import(__pyx_n_s_pickle, 0, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_pickle, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ goto __pyx_L3_exception_handled;
+ }
+ __pyx_L4_except_error:;
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_XGIVEREF(__pyx_t_5);
+ __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+ goto __pyx_L1_error;
+ __pyx_L3_exception_handled:;
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_XGIVEREF(__pyx_t_5);
+ __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+ __pyx_L9_try_end:;
+ }
+
+ /* "zmq/backend/cython/socket.pyx":74
+ * import pickle
+ *
+ * import zmq # <<<<<<<<<<<<<<
+ * from zmq.backend.cython import constants
+ * from zmq.backend.cython.constants import *
+ */
+ __pyx_t_6 = __Pyx_Import(__pyx_n_s_zmq, 0, -1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_zmq, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":75
+ *
+ * import zmq
+ * from zmq.backend.cython import constants # <<<<<<<<<<<<<<
+ * from zmq.backend.cython.constants import *
+ * from zmq.backend.cython.checkrc cimport _check_rc
+ */
+ __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_INCREF(__pyx_n_s_constants);
+ PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_constants);
+ __Pyx_GIVEREF(__pyx_n_s_constants);
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_zmq_backend_cython, __pyx_t_6, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_constants); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_constants, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":76
+ * import zmq
+ * from zmq.backend.cython import constants
+ * from zmq.backend.cython.constants import * # <<<<<<<<<<<<<<
+ * from zmq.backend.cython.checkrc cimport _check_rc
+ * from zmq.error import ZMQError, ZMQBindError, _check_version
+ */
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_s__24);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s__24);
+ __Pyx_GIVEREF(__pyx_n_s__24);
+ __pyx_t_6 = __Pyx_Import(__pyx_n_s_zmq_backend_cython_constants, __pyx_t_1, -1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (__pyx_import_star(__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":78
+ * from zmq.backend.cython.constants import *
+ * from zmq.backend.cython.checkrc cimport _check_rc
+ * from zmq.error import ZMQError, ZMQBindError, _check_version # <<<<<<<<<<<<<<
+ * from zmq.utils.strtypes import bytes,unicode,basestring
+ *
+ */
+ __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_INCREF(__pyx_n_s_ZMQError);
+ PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_ZMQError);
+ __Pyx_GIVEREF(__pyx_n_s_ZMQError);
+ __Pyx_INCREF(__pyx_n_s_ZMQBindError);
+ PyList_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_ZMQBindError);
+ __Pyx_GIVEREF(__pyx_n_s_ZMQBindError);
+ __Pyx_INCREF(__pyx_n_s_check_version);
+ PyList_SET_ITEM(__pyx_t_6, 2, __pyx_n_s_check_version);
+ __Pyx_GIVEREF(__pyx_n_s_check_version);
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_6, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ZMQError); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ZMQError, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ZMQBindError); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ZMQBindError, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_check_version); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_version, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":79
+ * from zmq.backend.cython.checkrc cimport _check_rc
+ * from zmq.error import ZMQError, ZMQBindError, _check_version
+ * from zmq.utils.strtypes import bytes,unicode,basestring # <<<<<<<<<<<<<<
+ *
+ * #-----------------------------------------------------------------------------
+ */
+ __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_s_bytes);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_bytes);
+ __Pyx_GIVEREF(__pyx_n_s_bytes);
+ __Pyx_INCREF(__pyx_n_s_unicode);
+ PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_unicode);
+ __Pyx_GIVEREF(__pyx_n_s_unicode);
+ __Pyx_INCREF(__pyx_n_s_basestring);
+ PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_basestring);
+ __Pyx_GIVEREF(__pyx_n_s_basestring);
+ __pyx_t_6 = __Pyx_Import(__pyx_n_s_zmq_utils_strtypes, __pyx_t_1, -1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_unicode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_unicode, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_basestring); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":85
+ * #-----------------------------------------------------------------------------
+ *
+ * IPC_PATH_MAX_LEN = get_ipc_path_max_len() # <<<<<<<<<<<<<<
+ *
+ * # inline some small socket submethods:
+ */
+ __pyx_t_6 = __Pyx_PyInt_From_int(get_ipc_path_max_len()); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_IPC_PATH_MAX_LEN, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":244
+ *
+ * @property
+ * def underlying(self): # <<<<<<<<<<<<<<
+ * """The address of the underlying libzmq socket"""
+ * return <size_t> self.handle
+ */
+ __pyx_t_6 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_3zmq_7backend_6cython_6socket_Socket, __pyx_n_s_underlying); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+
+ /* "zmq/backend/cython/socket.pyx":243
+ * self.context._remove_socket(self.handle)
+ *
+ * @property # <<<<<<<<<<<<<<
+ * def underlying(self):
+ * """The address of the underlying libzmq socket"""
+ */
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_3zmq_7backend_6cython_6socket_Socket->tp_dict, __pyx_n_s_underlying, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ PyType_Modified(__pyx_ptype_3zmq_7backend_6cython_6socket_Socket);
+
+ /* "zmq/backend/cython/socket.pyx":249
+ *
+ * @property
+ * def closed(self): # <<<<<<<<<<<<<<
+ * return _check_closed_deep(self)
+ *
+ */
+ __pyx_t_6 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_3zmq_7backend_6cython_6socket_Socket, __pyx_n_s_closed); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+
+ /* "zmq/backend/cython/socket.pyx":248
+ * return <size_t> self.handle
+ *
+ * @property # <<<<<<<<<<<<<<
+ * def closed(self):
+ * return _check_closed_deep(self)
+ */
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_3zmq_7backend_6cython_6socket_Socket->tp_dict, __pyx_n_s_closed, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ PyType_Modified(__pyx_ptype_3zmq_7backend_6cython_6socket_Socket);
+
+ /* "zmq/backend/cython/socket.pyx":535
+ * raise ZMQError()
+ *
+ * def monitor(self, addr, int events=ZMQ_EVENT_ALL): # <<<<<<<<<<<<<<
+ * """s.monitor(addr, flags)
+ *
+ */
+ __pyx_k__15 = ZMQ_EVENT_ALL;
+
+ /* "zmq/backend/cython/socket.pyx":672
+ *
+ *
+ * __all__ = ['Socket', 'IPC_PATH_MAX_LEN'] # <<<<<<<<<<<<<<
+ */
+ __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_INCREF(__pyx_n_s_Socket);
+ PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_Socket);
+ __Pyx_GIVEREF(__pyx_n_s_Socket);
+ __Pyx_INCREF(__pyx_n_s_IPC_PATH_MAX_LEN);
+ PyList_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_IPC_PATH_MAX_LEN);
+ __Pyx_GIVEREF(__pyx_n_s_IPC_PATH_MAX_LEN);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
+ /* "zmq/backend/cython/socket.pyx":1
+ * """0MQ Socket class.""" # <<<<<<<<<<<<<<
+ *
+ * #
+ */
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
+ /* "buffers.pxd":311
+ *
+ *
+ * cdef inline object viewfromobject_w(object obj): # <<<<<<<<<<<<<<
+ * """Wrapper for writable viewfromobject."""
+ * return viewfromobject(obj, 0)
+ */
+
+ /*--- Wrapped vars code ---*/
+
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ if (__pyx_m) {
+ if (__pyx_d) {
+ __Pyx_AddTraceback("init zmq.backend.cython.socket", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ }
+ Py_DECREF(__pyx_m); __pyx_m = 0;
+ } else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ImportError, "init zmq.backend.cython.socket");
+ }
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ #if PY_MAJOR_VERSION < 3
+ return;
+ #else
+ return __pyx_m;
+ #endif
+}
+
+/* Runtime support code */
+#if CYTHON_REFNANNY
+static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
+ PyObject *m = NULL, *p = NULL;
+ void *r = NULL;
+ m = PyImport_ImportModule((char *)modname);
+ if (!m) goto end;
+ p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
+ if (!p) goto end;
+ r = PyLong_AsVoidPtr(p);
+end:
+ Py_XDECREF(p);
+ Py_XDECREF(m);
+ return (__Pyx_RefNannyAPIStruct *)r;
+}
+#endif
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
+ PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
+ if (unlikely(!result)) {
+ PyErr_Format(PyExc_NameError,
+#if PY_MAJOR_VERSION >= 3
+ "name '%U' is not defined", name);
+#else
+ "name '%.200s' is not defined", PyString_AS_STRING(name));
+#endif
+ }
+ return result;
+}
+
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
+ PyObject *result;
+#if CYTHON_COMPILING_IN_CPYTHON
+ result = PyDict_GetItem(__pyx_d, name);
+ if (likely(result)) {
+ Py_INCREF(result);
+ } else {
+#else
+ result = PyObject_GetItem(__pyx_d, name);
+ if (!result) {
+ PyErr_Clear();
+#endif
+ result = __Pyx_GetBuiltinName(name);
+ }
+ return result;
+}
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+ PyObject *result;
+ ternaryfunc call = func->ob_type->tp_call;
+ if (unlikely(!call))
+ return PyObject_Call(func, arg, kw);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = (*call)(func, arg, kw);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
+ PyObject *self, *result;
+ PyCFunction cfunc;
+ cfunc = PyCFunction_GET_FUNCTION(func);
+ self = PyCFunction_GET_SELF(func);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = cfunc(self, arg);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject *result;
+ PyObject *args = PyTuple_New(1);
+ if (unlikely(!args)) return NULL;
+ Py_INCREF(arg);
+ PyTuple_SET_ITEM(args, 0, arg);
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#ifdef __Pyx_CyFunction_USED
+ if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+ if (likely(PyCFunction_Check(func))) {
+#endif
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
+ return __Pyx_PyObject_CallMethO(func, arg);
+ }
+ }
+ return __Pyx__PyObject_CallOneArg(func, arg);
+}
+#else
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject* args = PyTuple_Pack(1, arg);
+ return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+}
+#endif
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyThreadState *tstate = PyThreadState_GET();
+ tmp_type = tstate->curexc_type;
+ tmp_value = tstate->curexc_value;
+ tmp_tb = tstate->curexc_traceback;
+ tstate->curexc_type = type;
+ tstate->curexc_value = value;
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_Restore(type, value, tb);
+#endif
+}
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ *type = tstate->curexc_type;
+ *value = tstate->curexc_value;
+ *tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(type, value, tb);
+#endif
+}
+
+#if PY_MAJOR_VERSION < 3
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
+ CYTHON_UNUSED PyObject *cause) {
+ Py_XINCREF(type);
+ if (!value || value == Py_None)
+ value = NULL;
+ else
+ Py_INCREF(value);
+ if (!tb || tb == Py_None)
+ tb = NULL;
+ else {
+ Py_INCREF(tb);
+ if (!PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto raise_error;
+ }
+ }
+ if (PyType_Check(type)) {
+#if CYTHON_COMPILING_IN_PYPY
+ if (!value) {
+ Py_INCREF(Py_None);
+ value = Py_None;
+ }
+#endif
+ PyErr_NormalizeException(&type, &value, &tb);
+ } else {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto raise_error;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(type);
+ Py_INCREF(type);
+ if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto raise_error;
+ }
+ }
+ __Pyx_ErrRestore(type, value, tb);
+ return;
+raise_error:
+ Py_XDECREF(value);
+ Py_XDECREF(type);
+ Py_XDECREF(tb);
+ return;
+}
+#else
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
+ PyObject* owned_instance = NULL;
+ if (tb == Py_None) {
+ tb = 0;
+ } else if (tb && !PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto bad;
+ }
+ if (value == Py_None)
+ value = 0;
+ if (PyExceptionInstance_Check(type)) {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto bad;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(value);
+ } else if (PyExceptionClass_Check(type)) {
+ PyObject *instance_class = NULL;
+ if (value && PyExceptionInstance_Check(value)) {
+ instance_class = (PyObject*) Py_TYPE(value);
+ if (instance_class != type) {
+ if (PyObject_IsSubclass(instance_class, type)) {
+ type = instance_class;
+ } else {
+ instance_class = NULL;
+ }
+ }
+ }
+ if (!instance_class) {
+ PyObject *args;
+ if (!value)
+ args = PyTuple_New(0);
+ else if (PyTuple_Check(value)) {
+ Py_INCREF(value);
+ args = value;
+ } else
+ args = PyTuple_Pack(1, value);
+ if (!args)
+ goto bad;
+ owned_instance = PyObject_Call(type, args, NULL);
+ Py_DECREF(args);
+ if (!owned_instance)
+ goto bad;
+ value = owned_instance;
+ if (!PyExceptionInstance_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "calling %R should have returned an instance of "
+ "BaseException, not %R",
+ type, Py_TYPE(value));
+ goto bad;
+ }
+ }
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto bad;
+ }
+#if PY_VERSION_HEX >= 0x03030000
+ if (cause) {
+#else
+ if (cause && cause != Py_None) {
+#endif
+ PyObject *fixed_cause;
+ if (cause == Py_None) {
+ fixed_cause = NULL;
+ } else if (PyExceptionClass_Check(cause)) {
+ fixed_cause = PyObject_CallObject(cause, NULL);
+ if (fixed_cause == NULL)
+ goto bad;
+ } else if (PyExceptionInstance_Check(cause)) {
+ fixed_cause = cause;
+ Py_INCREF(fixed_cause);
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "exception causes must derive from "
+ "BaseException");
+ goto bad;
+ }
+ PyException_SetCause(value, fixed_cause);
+ }
+ PyErr_SetObject(type, value);
+ if (tb) {
+#if CYTHON_COMPILING_IN_PYPY
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyErr_Fetch(tmp_type, tmp_value, tmp_tb);
+ Py_INCREF(tb);
+ PyErr_Restore(tmp_type, tmp_value, tb);
+ Py_XDECREF(tmp_tb);
+#else
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject* tmp_tb = tstate->curexc_traceback;
+ if (tb != tmp_tb) {
+ Py_INCREF(tb);
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_tb);
+ }
+#endif
+ }
+bad:
+ Py_XDECREF(owned_instance);
+ return;
+}
+#endif
+
+static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
+ if (unlikely(!type)) {
+ PyErr_SetString(PyExc_SystemError, "Missing type object");
+ return 0;
+ }
+ if (likely(PyObject_TypeCheck(obj, type)))
+ return 1;
+ PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
+ Py_TYPE(obj)->tp_name, type->tp_name);
+ return 0;
+}
+
+static void __Pyx_RaiseDoubleKeywordsError(
+ const char* func_name,
+ PyObject* kw_name)
+{
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION >= 3
+ "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
+ #else
+ "%s() got multiple values for keyword argument '%s'", func_name,
+ PyString_AsString(kw_name));
+ #endif
+}
+
+static int __Pyx_ParseOptionalKeywords(
+ PyObject *kwds,
+ PyObject **argnames[],
+ PyObject *kwds2,
+ PyObject *values[],
+ Py_ssize_t num_pos_args,
+ const char* function_name)
+{
+ PyObject *key = 0, *value = 0;
+ Py_ssize_t pos = 0;
+ PyObject*** name;
+ PyObject*** first_kw_arg = argnames + num_pos_args;
+ while (PyDict_Next(kwds, &pos, &key, &value)) {
+ name = first_kw_arg;
+ while (*name && (**name != key)) name++;
+ if (*name) {
+ values[name-argnames] = value;
+ continue;
+ }
+ name = first_kw_arg;
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
+ while (*name) {
+ if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**name, key)) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ if ((**argname == key) || (
+ (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**argname, key))) {
+ goto arg_passed_twice;
+ }
+ argname++;
+ }
+ }
+ } else
+ #endif
+ if (likely(PyUnicode_Check(key))) {
+ while (*name) {
+ int cmp = (**name == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**name, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ int cmp = (**argname == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**argname, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) goto arg_passed_twice;
+ argname++;
+ }
+ }
+ } else
+ goto invalid_keyword_type;
+ if (kwds2) {
+ if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
+ } else {
+ goto invalid_keyword;
+ }
+ }
+ return 0;
+arg_passed_twice:
+ __Pyx_RaiseDoubleKeywordsError(function_name, key);
+ goto bad;
+invalid_keyword_type:
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() keywords must be strings", function_name);
+ goto bad;
+invalid_keyword:
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION < 3
+ "%.200s() got an unexpected keyword argument '%.200s'",
+ function_name, PyString_AsString(key));
+ #else
+ "%s() got an unexpected keyword argument '%U'",
+ function_name, key);
+ #endif
+bad:
+ return -1;
+}
+
+static void __Pyx_RaiseArgtupleInvalid(
+ const char* func_name,
+ int exact,
+ Py_ssize_t num_min,
+ Py_ssize_t num_max,
+ Py_ssize_t num_found)
+{
+ Py_ssize_t num_expected;
+ const char *more_or_less;
+ if (num_found < num_min) {
+ num_expected = num_min;
+ more_or_less = "at least";
+ } else {
+ num_expected = num_max;
+ more_or_less = "at most";
+ }
+ if (exact) {
+ more_or_less = "exactly";
+ }
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+ func_name, more_or_less, num_expected,
+ (num_expected == 1) ? "" : "s", num_found);
+}
+
+static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
+ PyErr_Format(PyExc_TypeError,
+ "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
+ name, type->tp_name, Py_TYPE(obj)->tp_name);
+}
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+ const char *name, int exact)
+{
+ if (unlikely(!type)) {
+ PyErr_SetString(PyExc_SystemError, "Missing type object");
+ return 0;
+ }
+ if (none_allowed && obj == Py_None) return 1;
+ else if (exact) {
+ if (likely(Py_TYPE(obj) == type)) return 1;
+ #if PY_MAJOR_VERSION == 2
+ else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
+ #endif
+ }
+ else {
+ if (likely(PyObject_TypeCheck(obj, type))) return 1;
+ }
+ __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
+ return 0;
+}
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
+#ifdef __Pyx_CyFunction_USED
+ if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+ if (likely(PyCFunction_Check(func))) {
+#endif
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
+ return __Pyx_PyObject_CallMethO(func, NULL);
+ }
+ }
+ return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
+}
+#endif
+
+static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
+ CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
+ int full_traceback) {
+ PyObject *old_exc, *old_val, *old_tb;
+ PyObject *ctx;
+ __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
+ if (full_traceback) {
+ Py_XINCREF(old_exc);
+ Py_XINCREF(old_val);
+ Py_XINCREF(old_tb);
+ __Pyx_ErrRestore(old_exc, old_val, old_tb);
+ PyErr_PrintEx(1);
+ }
+ #if PY_MAJOR_VERSION < 3
+ ctx = PyString_FromString(name);
+ #else
+ ctx = PyUnicode_FromString(name);
+ #endif
+ __Pyx_ErrRestore(old_exc, old_val, old_tb);
+ if (!ctx) {
+ PyErr_WriteUnraisable(Py_None);
+ } else {
+ PyErr_WriteUnraisable(ctx);
+ Py_DECREF(ctx);
+ }
+}
+
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+ PyObject *r;
+ if (!j) return NULL;
+ r = PyObject_GetItem(o, j);
+ Py_DECREF(j);
+ return r;
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
+ int wraparound, int boundscheck) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
+ if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
+ PyObject *r = PyList_GET_ITEM(o, i);
+ Py_INCREF(r);
+ return r;
+ }
+ return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+#else
+ return PySequence_GetItem(o, i);
+#endif
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
+ int wraparound, int boundscheck) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
+ if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
+ PyObject *r = PyTuple_GET_ITEM(o, i);
+ Py_INCREF(r);
+ return r;
+ }
+ return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+#else
+ return PySequence_GetItem(o, i);
+#endif
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
+ int is_list, int wraparound, int boundscheck) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (is_list || PyList_CheckExact(o)) {
+ Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
+ if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
+ PyObject *r = PyList_GET_ITEM(o, n);
+ Py_INCREF(r);
+ return r;
+ }
+ }
+ else if (PyTuple_CheckExact(o)) {
+ Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
+ if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
+ PyObject *r = PyTuple_GET_ITEM(o, n);
+ Py_INCREF(r);
+ return r;
+ }
+ } else {
+ PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
+ if (likely(m && m->sq_item)) {
+ if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
+ Py_ssize_t l = m->sq_length(o);
+ if (likely(l >= 0)) {
+ i += l;
+ } else {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError))
+ PyErr_Clear();
+ else
+ return NULL;
+ }
+ }
+ return m->sq_item(o, i);
+ }
+ }
+#else
+ if (is_list || PySequence_Check(o)) {
+ return PySequence_GetItem(o, i);
+ }
+#endif
+ return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+}
+
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
+ PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
+ if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Format(PyExc_ImportError,
+ #if PY_MAJOR_VERSION < 3
+ "cannot import name %.230s", PyString_AS_STRING(name));
+ #else
+ "cannot import name %S", name);
+ #endif
+ }
+ return value;
+}
+
+static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ *type = tstate->exc_type;
+ *value = tstate->exc_value;
+ *tb = tstate->exc_traceback;
+ Py_XINCREF(*type);
+ Py_XINCREF(*value);
+ Py_XINCREF(*tb);
+#else
+ PyErr_GetExcInfo(type, value, tb);
+#endif
+}
+static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyThreadState *tstate = PyThreadState_GET();
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = type;
+ tstate->exc_value = value;
+ tstate->exc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_SetExcInfo(type, value, tb);
+#endif
+}
+
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *local_type, *local_value, *local_tb;
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyThreadState *tstate = PyThreadState_GET();
+ local_type = tstate->curexc_type;
+ local_value = tstate->curexc_value;
+ local_tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(&local_type, &local_value, &local_tb);
+#endif
+ PyErr_NormalizeException(&local_type, &local_value, &local_tb);
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(tstate->curexc_type))
+#else
+ if (unlikely(PyErr_Occurred()))
+#endif
+ goto bad;
+ #if PY_MAJOR_VERSION >= 3
+ if (local_tb) {
+ if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
+ goto bad;
+ }
+ #endif
+ Py_XINCREF(local_tb);
+ Py_XINCREF(local_type);
+ Py_XINCREF(local_value);
+ *type = local_type;
+ *value = local_value;
+ *tb = local_tb;
+#if CYTHON_COMPILING_IN_CPYTHON
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = local_type;
+ tstate->exc_value = local_value;
+ tstate->exc_traceback = local_tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_SetExcInfo(local_type, local_value, local_tb);
+#endif
+ return 0;
+bad:
+ *type = 0;
+ *value = 0;
+ *tb = 0;
+ Py_XDECREF(local_type);
+ Py_XDECREF(local_value);
+ Py_XDECREF(local_tb);
+ return -1;
+}
+
+static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
+#if PY_VERSION_HEX >= 0x02070000
+ PyObject *ob = PyCapsule_New(vtable, 0, 0);
+#else
+ PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
+#endif
+ if (!ob)
+ goto bad;
+ if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
+ goto bad;
+ Py_DECREF(ob);
+ return 0;
+bad:
+ Py_XDECREF(ob);
+ return -1;
+}
+
+static void* __Pyx_GetVtable(PyObject *dict) {
+ void* ptr;
+ PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
+ if (!ob)
+ goto bad;
+#if PY_VERSION_HEX >= 0x02070000
+ ptr = PyCapsule_GetPointer(ob, 0);
+#else
+ ptr = PyCObject_AsVoidPtr(ob);
+#endif
+ if (!ptr && !PyErr_Occurred())
+ PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
+ Py_DECREF(ob);
+ return ptr;
+bad:
+ Py_XDECREF(ob);
+ return NULL;
+}
+
+static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) {
+ PyObject *result;
+ result = __Pyx_PyObject_GetAttrStr(nmspace, name);
+ if (!result)
+ result = __Pyx_GetModuleGlobalName(name);
+ return result;
+}
+
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+ int start = 0, mid = 0, end = count - 1;
+ if (end >= 0 && code_line > entries[end].code_line) {
+ return count;
+ }
+ while (start < end) {
+ mid = (start + end) / 2;
+ if (code_line < entries[mid].code_line) {
+ end = mid;
+ } else if (code_line > entries[mid].code_line) {
+ start = mid + 1;
+ } else {
+ return mid;
+ }
+ }
+ if (code_line <= entries[mid].code_line) {
+ return mid;
+ } else {
+ return mid + 1;
+ }
+}
+static PyCodeObject *__pyx_find_code_object(int code_line) {
+ PyCodeObject* code_object;
+ int pos;
+ if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
+ return NULL;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
+ return NULL;
+ }
+ code_object = __pyx_code_cache.entries[pos].code_object;
+ Py_INCREF(code_object);
+ return code_object;
+}
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
+ int pos, i;
+ __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
+ if (unlikely(!code_line)) {
+ return;
+ }
+ if (unlikely(!entries)) {
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (likely(entries)) {
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = 64;
+ __pyx_code_cache.count = 1;
+ entries[0].code_line = code_line;
+ entries[0].code_object = code_object;
+ Py_INCREF(code_object);
+ }
+ return;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
+ PyCodeObject* tmp = entries[pos].code_object;
+ entries[pos].code_object = code_object;
+ Py_DECREF(tmp);
+ return;
+ }
+ if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
+ int new_max = __pyx_code_cache.max_count + 64;
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
+ __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (unlikely(!entries)) {
+ return;
+ }
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = new_max;
+ }
+ for (i=__pyx_code_cache.count; i>pos; i--) {
+ entries[i] = entries[i-1];
+ }
+ entries[pos].code_line = code_line;
+ entries[pos].code_object = code_object;
+ __pyx_code_cache.count++;
+ Py_INCREF(code_object);
+}
+
+#include "compile.h"
+#include "frameobject.h"
+#include "traceback.h"
+static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
+ const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyObject *py_srcfile = 0;
+ PyObject *py_funcname = 0;
+ #if PY_MAJOR_VERSION < 3
+ py_srcfile = PyString_FromString(filename);
+ #else
+ py_srcfile = PyUnicode_FromString(filename);
+ #endif
+ if (!py_srcfile) goto bad;
+ if (c_line) {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #else
+ py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #endif
+ }
+ else {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromString(funcname);
+ #else
+ py_funcname = PyUnicode_FromString(funcname);
+ #endif
+ }
+ if (!py_funcname) goto bad;
+ py_code = __Pyx_PyCode_New(
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ __pyx_empty_bytes, /*PyObject *code,*/
+ __pyx_empty_tuple, /*PyObject *consts,*/
+ __pyx_empty_tuple, /*PyObject *names,*/
+ __pyx_empty_tuple, /*PyObject *varnames,*/
+ __pyx_empty_tuple, /*PyObject *freevars,*/
+ __pyx_empty_tuple, /*PyObject *cellvars,*/
+ py_srcfile, /*PyObject *filename,*/
+ py_funcname, /*PyObject *name,*/
+ py_line,
+ __pyx_empty_bytes /*PyObject *lnotab*/
+ );
+ Py_DECREF(py_srcfile);
+ Py_DECREF(py_funcname);
+ return py_code;
+bad:
+ Py_XDECREF(py_srcfile);
+ Py_XDECREF(py_funcname);
+ return NULL;
+}
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyFrameObject *py_frame = 0;
+ py_code = __pyx_find_code_object(c_line ? c_line : py_line);
+ if (!py_code) {
+ py_code = __Pyx_CreateCodeObjectForTraceback(
+ funcname, c_line, py_line, filename);
+ if (!py_code) goto bad;
+ __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
+ }
+ py_frame = PyFrame_New(
+ PyThreadState_GET(), /*PyThreadState *tstate,*/
+ py_code, /*PyCodeObject *code,*/
+ __pyx_d, /*PyObject *globals,*/
+ 0 /*PyObject *locals*/
+ );
+ if (!py_frame) goto bad;
+ py_frame->f_lineno = py_line;
+ PyTraceBack_Here(py_frame);
+bad:
+ Py_XDECREF(py_code);
+ Py_XDECREF(py_frame);
+}
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
+ goto bad;
+ #endif
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ {
+ #if PY_MAJOR_VERSION >= 3
+ if (level == -1) {
+ if (strchr(__Pyx_MODULE_NAME, '.')) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(1);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, 1);
+ #endif
+ if (!module) {
+ if (!PyErr_ExceptionMatches(PyExc_ImportError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ level = 0;
+ }
+ #endif
+ if (!module) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(level);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, level);
+ #endif
+ }
+ }
+bad:
+ #if PY_VERSION_HEX < 0x03030000
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+ const int neg_one = (int) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(int) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(int) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(int),
+ little, !is_unsigned);
+ }
+}
+
+#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value) \
+ { \
+ func_type value = func_value; \
+ if (sizeof(target_type) < sizeof(func_type)) { \
+ if (unlikely(value != (func_type) (target_type) value)) { \
+ func_type zero = 0; \
+ if (is_unsigned && unlikely(value < zero)) \
+ goto raise_neg_overflow; \
+ else \
+ goto raise_overflow; \
+ } \
+ } \
+ return (target_type) value; \
+ }
+
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ #include "longintrepr.h"
+ #endif
+#endif
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+ const int neg_one = (int) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(int) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (int) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(int) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
+ } else if (sizeof(int) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ int val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (int) -1;
+ }
+ } else {
+ int val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (int) -1;
+ val = __Pyx_PyInt_As_int(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to int");
+ return (int) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to int");
+ return (int) -1;
+}
+
+static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
+ const size_t neg_one = (size_t) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(size_t) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (size_t) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(size_t) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(size_t) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(size_t) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(size_t, long, PyLong_AsLong(x))
+ } else if (sizeof(size_t) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(size_t, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ size_t val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (size_t) -1;
+ }
+ } else {
+ size_t val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (size_t) -1;
+ val = __Pyx_PyInt_As_size_t(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to size_t");
+ return (size_t) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to size_t");
+ return (size_t) -1;
+}
+
+static CYTHON_INLINE pyzmq_int64_t __Pyx_PyInt_As_pyzmq_int64_t(PyObject *x) {
+ const pyzmq_int64_t neg_one = (pyzmq_int64_t) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(pyzmq_int64_t) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(pyzmq_int64_t, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (pyzmq_int64_t) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(pyzmq_int64_t, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(pyzmq_int64_t) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(pyzmq_int64_t, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(pyzmq_int64_t) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(pyzmq_int64_t, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(pyzmq_int64_t, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(pyzmq_int64_t, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(pyzmq_int64_t) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(pyzmq_int64_t, long, PyLong_AsLong(x))
+ } else if (sizeof(pyzmq_int64_t) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(pyzmq_int64_t, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ pyzmq_int64_t val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (pyzmq_int64_t) -1;
+ }
+ } else {
+ pyzmq_int64_t val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (pyzmq_int64_t) -1;
+ val = __Pyx_PyInt_As_pyzmq_int64_t(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to pyzmq_int64_t");
+ return (pyzmq_int64_t) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to pyzmq_int64_t");
+ return (pyzmq_int64_t) -1;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_pyzmq_int64_t(pyzmq_int64_t value) {
+ const pyzmq_int64_t neg_one = (pyzmq_int64_t) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(pyzmq_int64_t) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(pyzmq_int64_t) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(pyzmq_int64_t) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(pyzmq_int64_t) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(pyzmq_int64_t) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(pyzmq_int64_t),
+ little, !is_unsigned);
+ }
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ZMQ_FD_T(ZMQ_FD_T value) {
+ const ZMQ_FD_T neg_one = (ZMQ_FD_T) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(ZMQ_FD_T) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(ZMQ_FD_T) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(ZMQ_FD_T) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(ZMQ_FD_T) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(ZMQ_FD_T) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(ZMQ_FD_T),
+ little, !is_unsigned);
+ }
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+ const long neg_one = (long) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(long) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(long) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(long),
+ little, !is_unsigned);
+ }
+}
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+ const long neg_one = (long) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(long) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (long) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(long) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(long) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(long) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
+ } else if (sizeof(long) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ long val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (long) -1;
+ }
+ } else {
+ long val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (long) -1;
+ val = __Pyx_PyInt_As_long(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to long");
+ return (long) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to long");
+ return (long) -1;
+}
+
+static CYTHON_INLINE int __Pyx_StrEq(const char *s1, const char *s2) {
+ while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
+ return *s1 == *s2;
+}
+
+static int __Pyx_check_binary_version(void) {
+ char ctversion[4], rtversion[4];
+ PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
+ if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
+ char message[200];
+ PyOS_snprintf(message, sizeof(message),
+ "compiletime version %s of module '%.100s' "
+ "does not match runtime version %s",
+ ctversion, __Pyx_MODULE_NAME, rtversion);
+ return PyErr_WarnEx(NULL, message, 1);
+ }
+ return 0;
+}
+
+#ifndef __PYX_HAVE_RT_ImportModule
+#define __PYX_HAVE_RT_ImportModule
+static PyObject *__Pyx_ImportModule(const char *name) {
+ PyObject *py_name = 0;
+ PyObject *py_module = 0;
+ py_name = __Pyx_PyIdentifier_FromString(name);
+ if (!py_name)
+ goto bad;
+ py_module = PyImport_Import(py_name);
+ Py_DECREF(py_name);
+ return py_module;
+bad:
+ Py_XDECREF(py_name);
+ return 0;
+}
+#endif
+
+#ifndef __PYX_HAVE_RT_ImportType
+#define __PYX_HAVE_RT_ImportType
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
+ size_t size, int strict)
+{
+ PyObject *py_module = 0;
+ PyObject *result = 0;
+ PyObject *py_name = 0;
+ char warning[200];
+ Py_ssize_t basicsize;
+#ifdef Py_LIMITED_API
+ PyObject *py_basicsize;
+#endif
+ py_module = __Pyx_ImportModule(module_name);
+ if (!py_module)
+ goto bad;
+ py_name = __Pyx_PyIdentifier_FromString(class_name);
+ if (!py_name)
+ goto bad;
+ result = PyObject_GetAttr(py_module, py_name);
+ Py_DECREF(py_name);
+ py_name = 0;
+ Py_DECREF(py_module);
+ py_module = 0;
+ if (!result)
+ goto bad;
+ if (!PyType_Check(result)) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s.%.200s is not a type object",
+ module_name, class_name);
+ goto bad;
+ }
+#ifndef Py_LIMITED_API
+ basicsize = ((PyTypeObject *)result)->tp_basicsize;
+#else
+ py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
+ if (!py_basicsize)
+ goto bad;
+ basicsize = PyLong_AsSsize_t(py_basicsize);
+ Py_DECREF(py_basicsize);
+ py_basicsize = 0;
+ if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
+ goto bad;
+#endif
+ if (!strict && (size_t)basicsize > size) {
+ PyOS_snprintf(warning, sizeof(warning),
+ "%s.%s size changed, may indicate binary incompatibility",
+ module_name, class_name);
+ if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
+ }
+ else if ((size_t)basicsize != size) {
+ PyErr_Format(PyExc_ValueError,
+ "%.200s.%.200s has the wrong size, try recompiling",
+ module_name, class_name);
+ goto bad;
+ }
+ return (PyTypeObject *)result;
+bad:
+ Py_XDECREF(py_module);
+ Py_XDECREF(result);
+ return NULL;
+}
+#endif
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+ while (t->p) {
+ #if PY_MAJOR_VERSION < 3
+ if (t->is_unicode) {
+ *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
+ } else if (t->intern) {
+ *t->p = PyString_InternFromString(t->s);
+ } else {
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+ }
+ #else
+ if (t->is_unicode | t->is_str) {
+ if (t->intern) {
+ *t->p = PyUnicode_InternFromString(t->s);
+ } else if (t->encoding) {
+ *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
+ } else {
+ *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+ }
+ } else {
+ *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
+ }
+ #endif
+ if (!*t->p)
+ return -1;
+ ++t;
+ }
+ return 0;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
+ return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
+ Py_ssize_t ignore;
+ return __Pyx_PyObject_AsStringAndSize(o, &ignore);
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+ if (
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ __Pyx_sys_getdefaultencoding_not_ascii &&
+#endif
+ PyUnicode_Check(o)) {
+#if PY_VERSION_HEX < 0x03030000
+ char* defenc_c;
+ PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
+ if (!defenc) return NULL;
+ defenc_c = PyBytes_AS_STRING(defenc);
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ {
+ char* end = defenc_c + PyBytes_GET_SIZE(defenc);
+ char* c;
+ for (c = defenc_c; c < end; c++) {
+ if ((unsigned char) (*c) >= 128) {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+ }
+ }
+#endif
+ *length = PyBytes_GET_SIZE(defenc);
+ return defenc_c;
+#else
+ if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ if (PyUnicode_IS_ASCII(o)) {
+ *length = PyUnicode_GET_LENGTH(o);
+ return PyUnicode_AsUTF8(o);
+ } else {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+#else
+ return PyUnicode_AsUTF8AndSize(o, length);
+#endif
+#endif
+ } else
+#endif
+#if !CYTHON_COMPILING_IN_PYPY
+ if (PyByteArray_Check(o)) {
+ *length = PyByteArray_GET_SIZE(o);
+ return PyByteArray_AS_STRING(o);
+ } else
+#endif
+ {
+ char* result;
+ int r = PyBytes_AsStringAndSize(o, &result, length);
+ if (unlikely(r < 0)) {
+ return NULL;
+ } else {
+ return result;
+ }
+ }
+}
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
+ int is_true = x == Py_True;
+ if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
+ else return PyObject_IsTrue(x);
+}
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
+ PyNumberMethods *m;
+ const char *name = NULL;
+ PyObject *res = NULL;
+#if PY_MAJOR_VERSION < 3
+ if (PyInt_Check(x) || PyLong_Check(x))
+#else
+ if (PyLong_Check(x))
+#endif
+ return Py_INCREF(x), x;
+ m = Py_TYPE(x)->tp_as_number;
+#if PY_MAJOR_VERSION < 3
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Int(x);
+ }
+ else if (m && m->nb_long) {
+ name = "long";
+ res = PyNumber_Long(x);
+ }
+#else
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Long(x);
+ }
+#endif
+ if (res) {
+#if PY_MAJOR_VERSION < 3
+ if (!PyInt_Check(res) && !PyLong_Check(res)) {
+#else
+ if (!PyLong_Check(res)) {
+#endif
+ PyErr_Format(PyExc_TypeError,
+ "__%.4s__ returned non-%.4s (type %.200s)",
+ name, name, Py_TYPE(res)->tp_name);
+ Py_DECREF(res);
+ return NULL;
+ }
+ }
+ else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "an integer is required");
+ }
+ return res;
+}
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+ Py_ssize_t ival;
+ PyObject *x;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(b)))
+ return PyInt_AS_LONG(b);
+#endif
+ if (likely(PyLong_CheckExact(b))) {
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(b)) {
+ case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
+ case 0: return 0;
+ case 1: return ((PyLongObject*)b)->ob_digit[0];
+ }
+ #endif
+ #endif
+ return PyLong_AsSsize_t(b);
+ }
+ x = PyNumber_Index(b);
+ if (!x) return -1;
+ ival = PyInt_AsSsize_t(x);
+ Py_DECREF(x);
+ return ival;
+}
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
+ return PyInt_FromSize_t(ival);
+}
+
+
+#endif /* Py_PYTHON_H */
diff --git a/scripts/external_libs/zmq/backend/cython/socket.pxd b/scripts/external_libs/platform/cel59/zmq/backend/cython/socket.pxd
index b8a331e2..b8a331e2 100644
--- a/scripts/external_libs/zmq/backend/cython/socket.pxd
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/socket.pxd
diff --git a/scripts/external_libs/platform/cel59/zmq/backend/cython/socket.pyx b/scripts/external_libs/platform/cel59/zmq/backend/cython/socket.pyx
new file mode 100644
index 00000000..9b9ec36e
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/socket.pyx
@@ -0,0 +1,672 @@
+"""0MQ Socket class."""
+
+#
+# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
+#
+# This file is part of pyzmq.
+#
+# pyzmq is free software; you can redistribute it and/or modify it under
+# the terms of the Lesser GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# pyzmq is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# Lesser GNU General Public License for more details.
+#
+# You should have received a copy of the Lesser GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+#-----------------------------------------------------------------------------
+# Cython Imports
+#-----------------------------------------------------------------------------
+
+# get version-independent aliases:
+cdef extern from "pyversion_compat.h":
+ pass
+
+from libc.errno cimport ENAMETOOLONG
+from libc.string cimport memcpy
+
+from cpython cimport PyBytes_FromStringAndSize
+from cpython cimport PyBytes_AsString, PyBytes_Size
+from cpython cimport Py_DECREF, Py_INCREF
+
+from buffers cimport asbuffer_r, viewfromobject_r
+
+from libzmq cimport *
+from message cimport Frame, copy_zmq_msg_bytes
+
+from context cimport Context
+
+cdef extern from "Python.h":
+ ctypedef int Py_ssize_t
+
+cdef extern from "ipcmaxlen.h":
+ int get_ipc_path_max_len()
+
+cdef extern from "getpid_compat.h":
+ int getpid()
+
+
+#-----------------------------------------------------------------------------
+# Python Imports
+#-----------------------------------------------------------------------------
+
+import copy as copy_mod
+import time
+import sys
+import random
+import struct
+import codecs
+
+from zmq.utils import jsonapi
+
+try:
+ import cPickle
+ pickle = cPickle
+except:
+ cPickle = None
+ import pickle
+
+import zmq
+from zmq.backend.cython import constants
+from zmq.backend.cython.constants import *
+from zmq.backend.cython.checkrc cimport _check_rc
+from zmq.error import ZMQError, ZMQBindError, _check_version
+from zmq.utils.strtypes import bytes,unicode,basestring
+
+#-----------------------------------------------------------------------------
+# Code
+#-----------------------------------------------------------------------------
+
+IPC_PATH_MAX_LEN = get_ipc_path_max_len()
+
+# inline some small socket submethods:
+# true methods frequently cannot be inlined, acc. Cython docs
+
+cdef inline _check_closed(Socket s):
+ """raise ENOTSUP if socket is closed
+
+ Does not do a deep check
+ """
+ if s._closed:
+ raise ZMQError(ENOTSOCK)
+
+cdef inline _check_closed_deep(Socket s):
+ """thorough check of whether the socket has been closed,
+ even if by another entity (e.g. ctx.destroy).
+
+ Only used by the `closed` property.
+
+ returns True if closed, False otherwise
+ """
+ cdef int rc
+ cdef int errno
+ cdef int stype
+ cdef size_t sz=sizeof(int)
+ if s._closed:
+ return True
+ else:
+ rc = zmq_getsockopt(s.handle, ZMQ_TYPE, <void *>&stype, &sz)
+ if rc < 0 and zmq_errno() == ENOTSOCK:
+ s._closed = True
+ return True
+ else:
+ _check_rc(rc)
+ return False
+
+cdef inline Frame _recv_frame(void *handle, int flags=0, track=False):
+ """Receive a message in a non-copying manner and return a Frame."""
+ cdef int rc
+ msg = zmq.Frame(track=track)
+ cdef Frame cmsg = msg
+
+ with nogil:
+ rc = zmq_msg_recv(&cmsg.zmq_msg, handle, flags)
+
+ _check_rc(rc)
+ return msg
+
+cdef inline object _recv_copy(void *handle, int flags=0):
+ """Receive a message and return a copy"""
+ cdef zmq_msg_t zmq_msg
+ with nogil:
+ zmq_msg_init (&zmq_msg)
+ rc = zmq_msg_recv(&zmq_msg, handle, flags)
+ _check_rc(rc)
+ msg_bytes = copy_zmq_msg_bytes(&zmq_msg)
+ zmq_msg_close(&zmq_msg)
+ return msg_bytes
+
+cdef inline object _send_frame(void *handle, Frame msg, int flags=0):
+ """Send a Frame on this socket in a non-copy manner."""
+ cdef int rc
+ cdef Frame msg_copy
+
+ # Always copy so the original message isn't garbage collected.
+ # This doesn't do a real copy, just a reference.
+ msg_copy = msg.fast_copy()
+
+ with nogil:
+ rc = zmq_msg_send(&msg_copy.zmq_msg, handle, flags)
+
+ _check_rc(rc)
+ return msg.tracker
+
+
+cdef inline object _send_copy(void *handle, object msg, int flags=0):
+ """Send a message on this socket by copying its content."""
+ cdef int rc, rc2
+ cdef zmq_msg_t data
+ cdef char *msg_c
+ cdef Py_ssize_t msg_c_len=0
+
+ # copy to c array:
+ asbuffer_r(msg, <void **>&msg_c, &msg_c_len)
+
+ # Copy the msg before sending. This avoids any complications with
+ # the GIL, etc.
+ # If zmq_msg_init_* fails we must not call zmq_msg_close (Bus Error)
+ rc = zmq_msg_init_size(&data, msg_c_len)
+
+ _check_rc(rc)
+
+ with nogil:
+ memcpy(zmq_msg_data(&data), msg_c, zmq_msg_size(&data))
+ rc = zmq_msg_send(&data, handle, flags)
+ rc2 = zmq_msg_close(&data)
+ _check_rc(rc)
+ _check_rc(rc2)
+
+
+cdef class Socket:
+ """Socket(context, socket_type)
+
+ A 0MQ socket.
+
+ These objects will generally be constructed via the socket() method of a Context object.
+
+ Note: 0MQ Sockets are *not* threadsafe. **DO NOT** share them across threads.
+
+ Parameters
+ ----------
+ context : Context
+ The 0MQ Context this Socket belongs to.
+ socket_type : int
+ The socket type, which can be any of the 0MQ socket types:
+ REQ, REP, PUB, SUB, PAIR, DEALER, ROUTER, PULL, PUSH, XPUB, XSUB.
+
+ See Also
+ --------
+ .Context.socket : method for creating a socket bound to a Context.
+ """
+
+ # no-op for the signature
+ def __init__(self, context=None, socket_type=-1, shadow=0):
+ pass
+
+ def __cinit__(self, Context context=None, int socket_type=-1, size_t shadow=0, *args, **kwargs):
+ cdef Py_ssize_t c_handle
+
+ self.handle = NULL
+ self.context = context
+ if shadow:
+ self._shadow = True
+ self.handle = <void *>shadow
+ else:
+ if context is None:
+ raise TypeError("context must be specified")
+ if socket_type < 0:
+ raise TypeError("socket_type must be specified")
+ self._shadow = False
+ self.handle = zmq_socket(context.handle, socket_type)
+ if self.handle == NULL:
+ raise ZMQError()
+ self._closed = False
+ self._pid = getpid()
+ if context:
+ context._add_socket(self.handle)
+
+ def __dealloc__(self):
+ """remove from context's list
+
+ But be careful that context might not exist if called during gc
+ """
+ if self.handle != NULL and not self._shadow and getpid() == self._pid:
+ # during gc, self.context might be NULL
+ if self.context and not self.context.closed:
+ self.context._remove_socket(self.handle)
+
+ @property
+ def underlying(self):
+ """The address of the underlying libzmq socket"""
+ return <size_t> self.handle
+
+ @property
+ def closed(self):
+ return _check_closed_deep(self)
+
+ def close(self, linger=None):
+ """s.close(linger=None)
+
+ Close the socket.
+
+ If linger is specified, LINGER sockopt will be set prior to closing.
+
+ This can be called to close the socket by hand. If this is not
+ called, the socket will automatically be closed when it is
+ garbage collected.
+ """
+ cdef int rc=0
+ cdef int linger_c
+ cdef bint setlinger=False
+
+ if linger is not None:
+ linger_c = linger
+ setlinger=True
+
+ if self.handle != NULL and not self._closed and getpid() == self._pid:
+ if setlinger:
+ zmq_setsockopt(self.handle, ZMQ_LINGER, &linger_c, sizeof(int))
+ rc = zmq_close(self.handle)
+ if rc != 0 and zmq_errno() != ENOTSOCK:
+ # ignore ENOTSOCK (closed by Context)
+ _check_rc(rc)
+ self._closed = True
+ # during gc, self.context might be NULL
+ if self.context:
+ self.context._remove_socket(self.handle)
+ self.handle = NULL
+
+ def set(self, int option, optval):
+ """s.set(option, optval)
+
+ Set socket options.
+
+ See the 0MQ API documentation for details on specific options.
+
+ Parameters
+ ----------
+ option : int
+ The option to set. Available values will depend on your
+ version of libzmq. Examples include::
+
+ zmq.SUBSCRIBE, UNSUBSCRIBE, IDENTITY, HWM, LINGER, FD
+
+ optval : int or bytes
+ The value of the option to set.
+ """
+ cdef int64_t optval_int64_c
+ cdef int optval_int_c
+ cdef int rc
+ cdef char* optval_c
+ cdef Py_ssize_t sz
+
+ _check_closed(self)
+ if isinstance(optval, unicode):
+ raise TypeError("unicode not allowed, use setsockopt_string")
+
+ if option in zmq.constants.bytes_sockopts:
+ if not isinstance(optval, bytes):
+ raise TypeError('expected bytes, got: %r' % optval)
+ optval_c = PyBytes_AsString(optval)
+ sz = PyBytes_Size(optval)
+ rc = zmq_setsockopt(
+ self.handle, option,
+ optval_c, sz
+ )
+ elif option in zmq.constants.int64_sockopts:
+ if not isinstance(optval, int):
+ raise TypeError('expected int, got: %r' % optval)
+ optval_int64_c = optval
+ rc = zmq_setsockopt(
+ self.handle, option,
+ &optval_int64_c, sizeof(int64_t)
+ )
+ else:
+ # default is to assume int, which is what most new sockopts will be
+ # this lets pyzmq work with newer libzmq which may add constants
+ # pyzmq has not yet added, rather than artificially raising. Invalid
+ # sockopts will still raise just the same, but it will be libzmq doing
+ # the raising.
+ if not isinstance(optval, int):
+ raise TypeError('expected int, got: %r' % optval)
+ optval_int_c = optval
+ rc = zmq_setsockopt(
+ self.handle, option,
+ &optval_int_c, sizeof(int)
+ )
+
+ _check_rc(rc)
+
+ def get(self, int option):
+ """s.get(option)
+
+ Get the value of a socket option.
+
+ See the 0MQ API documentation for details on specific options.
+
+ Parameters
+ ----------
+ option : int
+ The option to get. Available values will depend on your
+ version of libzmq. Examples include::
+
+ zmq.IDENTITY, HWM, LINGER, FD, EVENTS
+
+ Returns
+ -------
+ optval : int or bytes
+ The value of the option as a bytestring or int.
+ """
+ cdef int64_t optval_int64_c
+ cdef int optval_int_c
+ cdef fd_t optval_fd_c
+ cdef char identity_str_c [255]
+ cdef size_t sz
+ cdef int rc
+
+ _check_closed(self)
+
+ if option in zmq.constants.bytes_sockopts:
+ sz = 255
+ rc = zmq_getsockopt(self.handle, option, <void *>identity_str_c, &sz)
+ _check_rc(rc)
+ # strip null-terminated strings *except* identity
+ if option != ZMQ_IDENTITY and sz > 0 and (<char *>identity_str_c)[sz-1] == b'\0':
+ sz -= 1
+ result = PyBytes_FromStringAndSize(<char *>identity_str_c, sz)
+ elif option in zmq.constants.int64_sockopts:
+ sz = sizeof(int64_t)
+ rc = zmq_getsockopt(self.handle, option, <void *>&optval_int64_c, &sz)
+ _check_rc(rc)
+ result = optval_int64_c
+ elif option in zmq.constants.fd_sockopts:
+ sz = sizeof(fd_t)
+ rc = zmq_getsockopt(self.handle, option, <void *>&optval_fd_c, &sz)
+ _check_rc(rc)
+ result = optval_fd_c
+ else:
+ # default is to assume int, which is what most new sockopts will be
+ # this lets pyzmq work with newer libzmq which may add constants
+ # pyzmq has not yet added, rather than artificially raising. Invalid
+ # sockopts will still raise just the same, but it will be libzmq doing
+ # the raising.
+ sz = sizeof(int)
+ rc = zmq_getsockopt(self.handle, option, <void *>&optval_int_c, &sz)
+ _check_rc(rc)
+ result = optval_int_c
+
+ return result
+
+ def bind(self, addr):
+ """s.bind(addr)
+
+ Bind the socket to an address.
+
+ This causes the socket to listen on a network port. Sockets on the
+ other side of this connection will use ``Socket.connect(addr)`` to
+ connect to this socket.
+
+ Parameters
+ ----------
+ addr : str
+ The address string. This has the form 'protocol://interface:port',
+ for example 'tcp://127.0.0.1:5555'. Protocols supported include
+ tcp, udp, pgm, epgm, inproc and ipc. If the address is unicode, it is
+ encoded to utf-8 first.
+ """
+ cdef int rc
+ cdef char* c_addr
+
+ _check_closed(self)
+ if isinstance(addr, unicode):
+ addr = addr.encode('utf-8')
+ if not isinstance(addr, bytes):
+ raise TypeError('expected str, got: %r' % addr)
+ c_addr = addr
+ rc = zmq_bind(self.handle, c_addr)
+ if rc != 0:
+ if IPC_PATH_MAX_LEN and zmq_errno() == ENAMETOOLONG:
+ # py3compat: addr is bytes, but msg wants str
+ if str is unicode:
+ addr = addr.decode('utf-8', 'replace')
+ path = addr.split('://', 1)[-1]
+ msg = ('ipc path "{0}" is longer than {1} '
+ 'characters (sizeof(sockaddr_un.sun_path)). '
+ 'zmq.IPC_PATH_MAX_LEN constant can be used '
+ 'to check addr length (if it is defined).'
+ .format(path, IPC_PATH_MAX_LEN))
+ raise ZMQError(msg=msg)
+ _check_rc(rc)
+
+ def connect(self, addr):
+ """s.connect(addr)
+
+ Connect to a remote 0MQ socket.
+
+ Parameters
+ ----------
+ addr : str
+ The address string. This has the form 'protocol://interface:port',
+ for example 'tcp://127.0.0.1:5555'. Protocols supported are
+ tcp, upd, pgm, inproc and ipc. If the address is unicode, it is
+ encoded to utf-8 first.
+ """
+ cdef int rc
+ cdef char* c_addr
+
+ _check_closed(self)
+ if isinstance(addr, unicode):
+ addr = addr.encode('utf-8')
+ if not isinstance(addr, bytes):
+ raise TypeError('expected str, got: %r' % addr)
+ c_addr = addr
+
+ rc = zmq_connect(self.handle, c_addr)
+ if rc != 0:
+ raise ZMQError()
+
+ def unbind(self, addr):
+ """s.unbind(addr)
+
+ Unbind from an address (undoes a call to bind).
+
+ .. versionadded:: libzmq-3.2
+ .. versionadded:: 13.0
+
+ Parameters
+ ----------
+ addr : str
+ The address string. This has the form 'protocol://interface:port',
+ for example 'tcp://127.0.0.1:5555'. Protocols supported are
+ tcp, upd, pgm, inproc and ipc. If the address is unicode, it is
+ encoded to utf-8 first.
+ """
+ cdef int rc
+ cdef char* c_addr
+
+ _check_version((3,2), "unbind")
+ _check_closed(self)
+ if isinstance(addr, unicode):
+ addr = addr.encode('utf-8')
+ if not isinstance(addr, bytes):
+ raise TypeError('expected str, got: %r' % addr)
+ c_addr = addr
+
+ rc = zmq_unbind(self.handle, c_addr)
+ if rc != 0:
+ raise ZMQError()
+
+ def disconnect(self, addr):
+ """s.disconnect(addr)
+
+ Disconnect from a remote 0MQ socket (undoes a call to connect).
+
+ .. versionadded:: libzmq-3.2
+ .. versionadded:: 13.0
+
+ Parameters
+ ----------
+ addr : str
+ The address string. This has the form 'protocol://interface:port',
+ for example 'tcp://127.0.0.1:5555'. Protocols supported are
+ tcp, upd, pgm, inproc and ipc. If the address is unicode, it is
+ encoded to utf-8 first.
+ """
+ cdef int rc
+ cdef char* c_addr
+
+ _check_version((3,2), "disconnect")
+ _check_closed(self)
+ if isinstance(addr, unicode):
+ addr = addr.encode('utf-8')
+ if not isinstance(addr, bytes):
+ raise TypeError('expected str, got: %r' % addr)
+ c_addr = addr
+
+ rc = zmq_disconnect(self.handle, c_addr)
+ if rc != 0:
+ raise ZMQError()
+
+ def monitor(self, addr, int events=ZMQ_EVENT_ALL):
+ """s.monitor(addr, flags)
+
+ Start publishing socket events on inproc.
+ See libzmq docs for zmq_monitor for details.
+
+ While this function is available from libzmq 3.2,
+ pyzmq cannot parse monitor messages from libzmq prior to 4.0.
+
+ .. versionadded: libzmq-3.2
+ .. versionadded: 14.0
+
+ Parameters
+ ----------
+ addr : str
+ The inproc url used for monitoring. Passing None as
+ the addr will cause an existing socket monitor to be
+ deregistered.
+ events : int [default: zmq.EVENT_ALL]
+ The zmq event bitmask for which events will be sent to the monitor.
+ """
+ cdef int rc, c_flags
+ cdef char* c_addr = NULL
+
+ _check_version((3,2), "monitor")
+ if addr is not None:
+ if isinstance(addr, unicode):
+ addr = addr.encode('utf-8')
+ if not isinstance(addr, bytes):
+ raise TypeError('expected str, got: %r' % addr)
+ c_addr = addr
+ c_flags = events
+ rc = zmq_socket_monitor(self.handle, c_addr, c_flags)
+ _check_rc(rc)
+
+ #-------------------------------------------------------------------------
+ # Sending and receiving messages
+ #-------------------------------------------------------------------------
+
+ cpdef object send(self, object data, int flags=0, copy=True, track=False):
+ """s.send(data, flags=0, copy=True, track=False)
+
+ Send a message on this socket.
+
+ This queues the message to be sent by the IO thread at a later time.
+
+ Parameters
+ ----------
+ data : object, str, Frame
+ The content of the message.
+ flags : int
+ Any supported flag: NOBLOCK, SNDMORE.
+ copy : bool
+ Should the message be sent in a copying or non-copying manner.
+ track : bool
+ Should the message be tracked for notification that ZMQ has
+ finished with it? (ignored if copy=True)
+
+ Returns
+ -------
+ None : if `copy` or not track
+ None if message was sent, raises an exception otherwise.
+ MessageTracker : if track and not copy
+ a MessageTracker object, whose `pending` property will
+ be True until the send is completed.
+
+ Raises
+ ------
+ TypeError
+ If a unicode object is passed
+ ValueError
+ If `track=True`, but an untracked Frame is passed.
+ ZMQError
+ If the send does not succeed for any reason.
+
+ """
+ _check_closed(self)
+
+ if isinstance(data, unicode):
+ raise TypeError("unicode not allowed, use send_string")
+
+ if copy:
+ # msg.bytes never returns the input data object
+ # it is always a copy, but always the same copy
+ if isinstance(data, Frame):
+ data = data.buffer
+ return _send_copy(self.handle, data, flags)
+ else:
+ if isinstance(data, Frame):
+ if track and not data.tracker:
+ raise ValueError('Not a tracked message')
+ msg = data
+ else:
+ msg = Frame(data, track=track)
+ return _send_frame(self.handle, msg, flags)
+
+ cpdef object recv(self, int flags=0, copy=True, track=False):
+ """s.recv(flags=0, copy=True, track=False)
+
+ Receive a message.
+
+ Parameters
+ ----------
+ flags : int
+ Any supported flag: NOBLOCK. If NOBLOCK is set, this method
+ will raise a ZMQError with EAGAIN if a message is not ready.
+ If NOBLOCK is not set, then this method will block until a
+ message arrives.
+ copy : bool
+ Should the message be received in a copying or non-copying manner?
+ If False a Frame object is returned, if True a string copy of
+ message is returned.
+ track : bool
+ Should the message be tracked for notification that ZMQ has
+ finished with it? (ignored if copy=True)
+
+ Returns
+ -------
+ msg : bytes, Frame
+ The received message frame. If `copy` is False, then it will be a Frame,
+ otherwise it will be bytes.
+
+ Raises
+ ------
+ ZMQError
+ for any of the reasons zmq_msg_recv might fail.
+ """
+ _check_closed(self)
+
+ if copy:
+ return _recv_copy(self.handle, flags)
+ else:
+ frame = _recv_frame(self.handle, flags, track)
+ frame.more = self.getsockopt(zmq.RCVMORE)
+ return frame
+
+
+__all__ = ['Socket', 'IPC_PATH_MAX_LEN']
diff --git a/scripts/external_libs/platform/cel59/zmq/backend/cython/utils.c b/scripts/external_libs/platform/cel59/zmq/backend/cython/utils.c
new file mode 100644
index 00000000..f96eb4e6
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/utils.c
@@ -0,0 +1,2943 @@
+/* Generated by Cython 0.21.2 */
+
+#define PY_SSIZE_T_CLEAN
+#ifndef CYTHON_USE_PYLONG_INTERNALS
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#else
+#include "pyconfig.h"
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 1
+#else
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#endif
+#endif
+#endif
+#include "Python.h"
+#ifndef Py_PYTHON_H
+ #error Python headers needed to compile C extensions, please install development version of Python.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+ #error Cython requires Python 2.6+ or Python 3.2+.
+#else
+#define CYTHON_ABI "0_21_2"
+#include <stddef.h>
+#ifndef offsetof
+#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+ #ifndef __stdcall
+ #define __stdcall
+ #endif
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
+ #ifndef __fastcall
+ #define __fastcall
+ #endif
+#endif
+#ifndef DL_IMPORT
+ #define DL_IMPORT(t) t
+#endif
+#ifndef DL_EXPORT
+ #define DL_EXPORT(t) t
+#endif
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifndef Py_HUGE_VAL
+ #define Py_HUGE_VAL HUGE_VAL
+#endif
+#ifdef PYPY_VERSION
+#define CYTHON_COMPILING_IN_PYPY 1
+#define CYTHON_COMPILING_IN_CPYTHON 0
+#else
+#define CYTHON_COMPILING_IN_PYPY 0
+#define CYTHON_COMPILING_IN_CPYTHON 1
+#endif
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
+#define Py_OptimizeFlag 0
+#endif
+#define __PYX_BUILD_PY_SSIZE_T "n"
+#define CYTHON_FORMAT_SSIZE_T "z"
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyClass_Type
+#else
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyType_Type
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define Py_TPFLAGS_CHECKTYPES 0
+ #define Py_TPFLAGS_HAVE_INDEX 0
+ #define Py_TPFLAGS_HAVE_NEWBUFFER 0
+#endif
+#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+ #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
+#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
+ #define CYTHON_PEP393_ENABLED 1
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
+ 0 : _PyUnicode_Ready((PyObject *)(op)))
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
+ #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
+ #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+#else
+ #define CYTHON_PEP393_ENABLED 0
+ #define __Pyx_PyUnicode_READY(op) (0)
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
+ #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
+ #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+ #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyFrozenSet_Size(s) PyObject_Size(s)
+#else
+ #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
+ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
+ #define __Pyx_PyFrozenSet_Size(s) PySet_Size(s)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
+#else
+ #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBaseString_Type PyUnicode_Type
+ #define PyStringObject PyUnicodeObject
+ #define PyString_Type PyUnicode_Type
+ #define PyString_Check PyUnicode_Check
+ #define PyString_CheckExact PyUnicode_CheckExact
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
+ #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
+#else
+ #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+ #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
+#endif
+#ifndef PySet_CheckExact
+ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
+#endif
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#if PY_MAJOR_VERSION >= 3
+ #define PyIntObject PyLongObject
+ #define PyInt_Type PyLong_Type
+ #define PyInt_Check(op) PyLong_Check(op)
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
+ #define PyInt_FromString PyLong_FromString
+ #define PyInt_FromUnicode PyLong_FromUnicode
+ #define PyInt_FromLong PyLong_FromLong
+ #define PyInt_FromSize_t PyLong_FromSize_t
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
+ #define PyInt_AsLong PyLong_AsLong
+ #define PyInt_AS_LONG PyLong_AS_LONG
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+ #define PyNumber_Int PyNumber_Long
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBoolObject PyLongObject
+#endif
+#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
+ #ifndef PyUnicode_InternFromString
+ #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
+ #endif
+#endif
+#if PY_VERSION_HEX < 0x030200A4
+ typedef long Py_hash_t;
+ #define __Pyx_PyInt_FromHash_t PyInt_FromLong
+ #define __Pyx_PyInt_AsHash_t PyInt_AsLong
+#else
+ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
+ #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+#else
+ #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
+#endif
+#ifndef CYTHON_INLINE
+ #if defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+#ifndef CYTHON_RESTRICT
+ #if defined(__GNUC__)
+ #define CYTHON_RESTRICT __restrict__
+ #elif defined(_MSC_VER) && _MSC_VER >= 1400
+ #define CYTHON_RESTRICT __restrict
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_RESTRICT restrict
+ #else
+ #define CYTHON_RESTRICT
+ #endif
+#endif
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
+#else
+static CYTHON_INLINE float __PYX_NAN() {
+ /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
+ a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
+ a quiet NaN. */
+ float value;
+ memset(&value, 0xFF, sizeof(value));
+ return value;
+}
+#endif
+#ifdef __cplusplus
+template<typename T>
+void __Pyx_call_destructor(T* x) {
+ x->~T();
+}
+#endif
+
+
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
+#else
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
+#endif
+
+#ifndef __PYX_EXTERN_C
+ #ifdef __cplusplus
+ #define __PYX_EXTERN_C extern "C"
+ #else
+ #define __PYX_EXTERN_C extern
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+#define _USE_MATH_DEFINES
+#endif
+#include <math.h>
+#define __PYX_HAVE__zmq__backend__cython__utils
+#define __PYX_HAVE_API__zmq__backend__cython__utils
+#include "zmq_compat.h"
+#include "zmq.h"
+#include "zmq_utils.h"
+#ifdef _OPENMP
+#include <omp.h>
+#endif /* _OPENMP */
+
+#ifdef PYREX_WITHOUT_ASSERTIONS
+#define CYTHON_WITHOUT_ASSERTIONS
+#endif
+
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
+ const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \
+ (sizeof(type) < sizeof(Py_ssize_t)) || \
+ (sizeof(type) > sizeof(Py_ssize_t) && \
+ likely(v < (type)PY_SSIZE_T_MAX || \
+ v == (type)PY_SSIZE_T_MAX) && \
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \
+ v == (type)PY_SSIZE_T_MIN))) || \
+ (sizeof(type) == sizeof(Py_ssize_t) && \
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \
+ v == (type)PY_SSIZE_T_MAX))) )
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
+#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
+#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
+#define __Pyx_PyBytes_FromString PyBytes_FromString
+#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#else
+ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
+#endif
+#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
+#if PY_MAJOR_VERSION < 3
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
+{
+ const Py_UNICODE *u_end = u;
+ while (*u_end++) ;
+ return (size_t)(u_end - u - 1);
+}
+#else
+#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
+#endif
+#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
+#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
+#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
+#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
+#else
+#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
+#endif
+#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ PyObject* ascii_chars_u = NULL;
+ PyObject* ascii_chars_b = NULL;
+ const char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ if (strcmp(default_encoding_c, "ascii") == 0) {
+ __Pyx_sys_getdefaultencoding_not_ascii = 0;
+ } else {
+ char ascii_chars[128];
+ int c;
+ for (c = 0; c < 128; c++) {
+ ascii_chars[c] = c;
+ }
+ __Pyx_sys_getdefaultencoding_not_ascii = 1;
+ ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
+ if (!ascii_chars_u) goto bad;
+ ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
+ if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
+ PyErr_Format(
+ PyExc_ValueError,
+ "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
+ default_encoding_c);
+ goto bad;
+ }
+ Py_DECREF(ascii_chars_u);
+ Py_DECREF(ascii_chars_b);
+ }
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ Py_XDECREF(ascii_chars_u);
+ Py_XDECREF(ascii_chars_b);
+ return -1;
+}
+#endif
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
+#else
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+static char* __PYX_DEFAULT_STRING_ENCODING;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
+ if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
+ strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ return -1;
+}
+#endif
+#endif
+
+
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+ #define likely(x) __builtin_expect(!!(x), 1)
+ #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
+ #define likely(x) (x)
+ #define unlikely(x) (x)
+#endif /* __GNUC__ */
+
+static PyObject *__pyx_m;
+static PyObject *__pyx_d;
+static PyObject *__pyx_b;
+static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
+static int __pyx_lineno;
+static int __pyx_clineno = 0;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+
+
+static const char *__pyx_f[] = {
+ "zmq/backend/cython/utils.pyx",
+};
+
+/*--- Type declarations ---*/
+struct __pyx_obj_3zmq_7backend_6cython_5utils_Stopwatch;
+
+/* "zmq/backend/cython/utils.pxd":27
+ *
+ *
+ * cdef class Stopwatch: # <<<<<<<<<<<<<<
+ * cdef void *watch # The C handle for the underlying zmq object
+ *
+ */
+struct __pyx_obj_3zmq_7backend_6cython_5utils_Stopwatch {
+ PyObject_HEAD
+ void *watch;
+};
+
+#ifndef CYTHON_REFNANNY
+ #define CYTHON_REFNANNY 0
+#endif
+#if CYTHON_REFNANNY
+ typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*SetupContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+ } __Pyx_RefNannyAPIStruct;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
+ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
+#ifdef WITH_THREAD
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ if (acquire_gil) { \
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ PyGILState_Release(__pyx_gilstate_save); \
+ } else { \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ }
+#else
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+#endif
+ #define __Pyx_RefNannyFinishContext() \
+ __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
+ #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
+ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
+#else
+ #define __Pyx_RefNannyDeclarations
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)
+ #define __Pyx_RefNannyFinishContext()
+ #define __Pyx_INCREF(r) Py_INCREF(r)
+ #define __Pyx_DECREF(r) Py_DECREF(r)
+ #define __Pyx_GOTREF(r)
+ #define __Pyx_GIVEREF(r)
+ #define __Pyx_XINCREF(r) Py_XINCREF(r)
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
+ #define __Pyx_XGOTREF(r)
+ #define __Pyx_XGIVEREF(r)
+#endif
+#define __Pyx_XDECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_XDECREF(tmp); \
+ } while (0)
+#define __Pyx_DECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_DECREF(tmp); \
+ } while (0)
+#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
+#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_getattro))
+ return tp->tp_getattro(obj, attr_name);
+#if PY_MAJOR_VERSION < 3
+ if (likely(tp->tp_getattr))
+ return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
+#endif
+ return PyObject_GetAttr(obj, attr_name);
+}
+#else
+#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
+#endif
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
+#else
+#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+ Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+
+static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
+
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
+
+typedef struct {
+ int code_line;
+ PyCodeObject* code_object;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+ int count;
+ int max_count;
+ __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename);
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value);
+
+#ifndef __PYX_FORCE_INIT_THREADS
+ #define __PYX_FORCE_INIT_THREADS 0
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+
+static int __Pyx_check_binary_version(void);
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+
+
+/* Module declarations from 'zmq.backend.cython.libzmq' */
+
+/* Module declarations from 'zmq.backend.cython.utils' */
+static PyTypeObject *__pyx_ptype_3zmq_7backend_6cython_5utils_Stopwatch = 0;
+#define __Pyx_MODULE_NAME "zmq.backend.cython.utils"
+int __pyx_module_is_main_zmq__backend__cython__utils = 0;
+
+/* Implementation of 'zmq.backend.cython.utils' */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_5utils_has(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_capability); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_5utils_2curve_keypair(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static int __pyx_pf_3zmq_7backend_6cython_5utils_9Stopwatch___cinit__(struct __pyx_obj_3zmq_7backend_6cython_5utils_Stopwatch *__pyx_v_self); /* proto */
+static void __pyx_pf_3zmq_7backend_6cython_5utils_9Stopwatch_2__dealloc__(struct __pyx_obj_3zmq_7backend_6cython_5utils_Stopwatch *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_5utils_9Stopwatch_4start(struct __pyx_obj_3zmq_7backend_6cython_5utils_Stopwatch *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_5utils_9Stopwatch_6stop(struct __pyx_obj_3zmq_7backend_6cython_5utils_Stopwatch *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_3zmq_7backend_6cython_5utils_9Stopwatch_8sleep(CYTHON_UNUSED struct __pyx_obj_3zmq_7backend_6cython_5utils_Stopwatch *__pyx_v_self, int __pyx_v_seconds); /* proto */
+static PyObject *__pyx_tp_new_3zmq_7backend_6cython_5utils_Stopwatch(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static char __pyx_k_rc[] = "rc";
+static char __pyx_k_all[] = "__all__";
+static char __pyx_k_has[] = "has";
+static char __pyx_k_ccap[] = "ccap";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_utf8[] = "utf8";
+static char __pyx_k_encode[] = "encode";
+static char __pyx_k_import[] = "__import__";
+static char __pyx_k_unicode[] = "unicode";
+static char __pyx_k_zmq_has[] = "zmq.has";
+static char __pyx_k_ZMQError[] = "ZMQError";
+static char __pyx_k_check_rc[] = "_check_rc";
+static char __pyx_k_0MQ_utils[] = "0MQ utils.";
+static char __pyx_k_Stopwatch[] = "Stopwatch";
+static char __pyx_k_zmq_error[] = "zmq.error";
+static char __pyx_k_capability[] = "capability";
+static char __pyx_k_public_key[] = "public_key";
+static char __pyx_k_secret_key[] = "secret_key";
+static char __pyx_k_check_version[] = "_check_version";
+static char __pyx_k_curve_keypair[] = "curve_keypair";
+static char __pyx_k_zmq_utils_strtypes[] = "zmq.utils.strtypes";
+static char __pyx_k_zmq_backend_cython_utils[] = "zmq.backend.cython.utils";
+static char __pyx_k_Stopwatch_is_already_running[] = "Stopwatch is already running.";
+static char __pyx_k_Must_start_the_Stopwatch_before[] = "Must start the Stopwatch before calling stop.";
+static char __pyx_k_private_tmp_pyzmq_release_zmq_b[] = "/private/tmp/pyzmq-release/zmq/backend/cython/utils.pyx";
+static PyObject *__pyx_kp_s_Must_start_the_Stopwatch_before;
+static PyObject *__pyx_n_s_Stopwatch;
+static PyObject *__pyx_kp_s_Stopwatch_is_already_running;
+static PyObject *__pyx_n_s_ZMQError;
+static PyObject *__pyx_n_s_all;
+static PyObject *__pyx_n_s_capability;
+static PyObject *__pyx_n_s_ccap;
+static PyObject *__pyx_n_s_check_rc;
+static PyObject *__pyx_n_s_check_version;
+static PyObject *__pyx_n_s_curve_keypair;
+static PyObject *__pyx_n_s_encode;
+static PyObject *__pyx_n_s_has;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_kp_s_private_tmp_pyzmq_release_zmq_b;
+static PyObject *__pyx_n_s_public_key;
+static PyObject *__pyx_n_s_rc;
+static PyObject *__pyx_n_s_secret_key;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_n_s_unicode;
+static PyObject *__pyx_n_s_utf8;
+static PyObject *__pyx_n_s_zmq_backend_cython_utils;
+static PyObject *__pyx_n_s_zmq_error;
+static PyObject *__pyx_kp_s_zmq_has;
+static PyObject *__pyx_n_s_zmq_utils_strtypes;
+static PyObject *__pyx_int_0;
+static PyObject *__pyx_int_1;
+static PyObject *__pyx_int_4;
+static PyObject *__pyx_tuple_;
+static PyObject *__pyx_tuple__2;
+static PyObject *__pyx_tuple__3;
+static PyObject *__pyx_tuple__4;
+static PyObject *__pyx_tuple__5;
+static PyObject *__pyx_tuple__6;
+static PyObject *__pyx_tuple__7;
+static PyObject *__pyx_tuple__8;
+static PyObject *__pyx_tuple__10;
+static PyObject *__pyx_codeobj__9;
+static PyObject *__pyx_codeobj__11;
+
+/* "zmq/backend/cython/utils.pyx":29
+ * from zmq.utils.strtypes import unicode
+ *
+ * def has(capability): # <<<<<<<<<<<<<<
+ * """Check for zmq capability by name (e.g. 'ipc', 'curve')
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_5utils_1has(PyObject *__pyx_self, PyObject *__pyx_v_capability); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_5utils_has[] = "Check for zmq capability by name (e.g. 'ipc', 'curve')\n \n .. versionadded:: libzmq-4.1\n .. versionadded:: 14.1\n ";
+static PyMethodDef __pyx_mdef_3zmq_7backend_6cython_5utils_1has = {"has", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_5utils_1has, METH_O, __pyx_doc_3zmq_7backend_6cython_5utils_has};
+static PyObject *__pyx_pw_3zmq_7backend_6cython_5utils_1has(PyObject *__pyx_self, PyObject *__pyx_v_capability) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("has (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_5utils_has(__pyx_self, ((PyObject *)__pyx_v_capability));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_5utils_has(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_capability) {
+ PyObject *__pyx_v_ccap = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ const char * __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("has", 0);
+ __Pyx_INCREF(__pyx_v_capability);
+
+ /* "zmq/backend/cython/utils.pyx":35
+ * .. versionadded:: 14.1
+ * """
+ * _check_version((4,1), 'zmq.has') # <<<<<<<<<<<<<<
+ * cdef bytes ccap
+ * if isinstance(capability, unicode):
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/utils.pyx":37
+ * _check_version((4,1), 'zmq.has')
+ * cdef bytes ccap
+ * if isinstance(capability, unicode): # <<<<<<<<<<<<<<
+ * capability = capability.encode('utf8')
+ * ccap = capability
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyObject_IsInstance(__pyx_v_capability, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = (__pyx_t_3 != 0);
+ if (__pyx_t_4) {
+
+ /* "zmq/backend/cython/utils.pyx":38
+ * cdef bytes ccap
+ * if isinstance(capability, unicode):
+ * capability = capability.encode('utf8') # <<<<<<<<<<<<<<
+ * ccap = capability
+ * return bool(zmq_has(ccap))
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_capability, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF_SET(__pyx_v_capability, __pyx_t_1);
+ __pyx_t_1 = 0;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/utils.pyx":39
+ * if isinstance(capability, unicode):
+ * capability = capability.encode('utf8')
+ * ccap = capability # <<<<<<<<<<<<<<
+ * return bool(zmq_has(ccap))
+ *
+ */
+ if (!(likely(PyBytes_CheckExact(__pyx_v_capability))||((__pyx_v_capability) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_capability)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_v_capability;
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_v_ccap = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/utils.pyx":40
+ * capability = capability.encode('utf8')
+ * ccap = capability
+ * return bool(zmq_has(ccap)) # <<<<<<<<<<<<<<
+ *
+ * def curve_keypair():
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_ccap); if (unlikely((__pyx_t_5 == (const char *)NULL) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(zmq_has(__pyx_t_5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_4))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/utils.pyx":29
+ * from zmq.utils.strtypes import unicode
+ *
+ * def has(capability): # <<<<<<<<<<<<<<
+ * """Check for zmq capability by name (e.g. 'ipc', 'curve')
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("zmq.backend.cython.utils.has", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_ccap);
+ __Pyx_XDECREF(__pyx_v_capability);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/utils.pyx":42
+ * return bool(zmq_has(ccap))
+ *
+ * def curve_keypair(): # <<<<<<<<<<<<<<
+ * """generate a Z85 keypair for use with zmq.CURVE security
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_5utils_3curve_keypair(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_5utils_2curve_keypair[] = "generate a Z85 keypair for use with zmq.CURVE security\n \n Requires libzmq (\342\211\245 4.0) to have been linked with libsodium.\n \n .. versionadded:: libzmq-4.0\n .. versionadded:: 14.0\n \n Returns\n -------\n (public, secret) : two bytestrings\n The public and private keypair as 40 byte z85-encoded bytestrings.\n ";
+static PyMethodDef __pyx_mdef_3zmq_7backend_6cython_5utils_3curve_keypair = {"curve_keypair", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_5utils_3curve_keypair, METH_NOARGS, __pyx_doc_3zmq_7backend_6cython_5utils_2curve_keypair};
+static PyObject *__pyx_pw_3zmq_7backend_6cython_5utils_3curve_keypair(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("curve_keypair (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_5utils_2curve_keypair(__pyx_self);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_5utils_2curve_keypair(CYTHON_UNUSED PyObject *__pyx_self) {
+ int __pyx_v_rc;
+ char __pyx_v_public_key[64];
+ char __pyx_v_secret_key[64];
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("curve_keypair", 0);
+
+ /* "zmq/backend/cython/utils.pyx":58
+ * cdef char[64] public_key
+ * cdef char[64] secret_key
+ * _check_version((4,0), "curve_keypair") # <<<<<<<<<<<<<<
+ * rc = zmq_curve_keypair (public_key, secret_key)
+ * _check_rc(rc)
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/utils.pyx":59
+ * cdef char[64] secret_key
+ * _check_version((4,0), "curve_keypair")
+ * rc = zmq_curve_keypair (public_key, secret_key) # <<<<<<<<<<<<<<
+ * _check_rc(rc)
+ * return public_key, secret_key
+ */
+ __pyx_v_rc = zmq_curve_keypair(__pyx_v_public_key, __pyx_v_secret_key);
+
+ /* "zmq/backend/cython/utils.pyx":60
+ * _check_version((4,0), "curve_keypair")
+ * rc = zmq_curve_keypair (public_key, secret_key)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ * return public_key, secret_key
+ *
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_rc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_1, function);
+ }
+ }
+ if (!__pyx_t_4) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ } else {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/utils.pyx":61
+ * rc = zmq_curve_keypair (public_key, secret_key)
+ * _check_rc(rc)
+ * return public_key, secret_key # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_public_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_secret_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_2 = 0;
+ __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 0;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/utils.pyx":42
+ * return bool(zmq_has(ccap))
+ *
+ * def curve_keypair(): # <<<<<<<<<<<<<<
+ * """generate a Z85 keypair for use with zmq.CURVE security
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("zmq.backend.cython.utils.curve_keypair", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/utils.pyx":72
+ * """
+ *
+ * def __cinit__(self): # <<<<<<<<<<<<<<
+ * self.watch = NULL
+ *
+ */
+
+/* Python wrapper */
+static int __pyx_pw_3zmq_7backend_6cython_5utils_9Stopwatch_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_3zmq_7backend_6cython_5utils_9Stopwatch_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+ if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
+ if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_5utils_9Stopwatch___cinit__(((struct __pyx_obj_3zmq_7backend_6cython_5utils_Stopwatch *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_3zmq_7backend_6cython_5utils_9Stopwatch___cinit__(struct __pyx_obj_3zmq_7backend_6cython_5utils_Stopwatch *__pyx_v_self) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__cinit__", 0);
+
+ /* "zmq/backend/cython/utils.pyx":73
+ *
+ * def __cinit__(self):
+ * self.watch = NULL # <<<<<<<<<<<<<<
+ *
+ * def __dealloc__(self):
+ */
+ __pyx_v_self->watch = NULL;
+
+ /* "zmq/backend/cython/utils.pyx":72
+ * """
+ *
+ * def __cinit__(self): # <<<<<<<<<<<<<<
+ * self.watch = NULL
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/utils.pyx":75
+ * self.watch = NULL
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * # copy of self.stop() we can't call object methods in dealloc as it
+ * # might already be partially deleted
+ */
+
+/* Python wrapper */
+static void __pyx_pw_3zmq_7backend_6cython_5utils_9Stopwatch_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_pw_3zmq_7backend_6cython_5utils_9Stopwatch_3__dealloc__(PyObject *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+ __pyx_pf_3zmq_7backend_6cython_5utils_9Stopwatch_2__dealloc__(((struct __pyx_obj_3zmq_7backend_6cython_5utils_Stopwatch *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_pf_3zmq_7backend_6cython_5utils_9Stopwatch_2__dealloc__(struct __pyx_obj_3zmq_7backend_6cython_5utils_Stopwatch *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+ /* "zmq/backend/cython/utils.pyx":78
+ * # copy of self.stop() we can't call object methods in dealloc as it
+ * # might already be partially deleted
+ * if self.watch: # <<<<<<<<<<<<<<
+ * zmq_stopwatch_stop(self.watch)
+ * self.watch = NULL
+ */
+ __pyx_t_1 = (__pyx_v_self->watch != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/utils.pyx":79
+ * # might already be partially deleted
+ * if self.watch:
+ * zmq_stopwatch_stop(self.watch) # <<<<<<<<<<<<<<
+ * self.watch = NULL
+ *
+ */
+ zmq_stopwatch_stop(__pyx_v_self->watch);
+
+ /* "zmq/backend/cython/utils.pyx":80
+ * if self.watch:
+ * zmq_stopwatch_stop(self.watch)
+ * self.watch = NULL # <<<<<<<<<<<<<<
+ *
+ * def start(self):
+ */
+ __pyx_v_self->watch = NULL;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/utils.pyx":75
+ * self.watch = NULL
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * # copy of self.stop() we can't call object methods in dealloc as it
+ * # might already be partially deleted
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "zmq/backend/cython/utils.pyx":82
+ * self.watch = NULL
+ *
+ * def start(self): # <<<<<<<<<<<<<<
+ * """s.start()
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_5utils_9Stopwatch_5start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_5utils_9Stopwatch_4start[] = "s.start()\n\n Start the stopwatch.\n ";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_5utils_9Stopwatch_5start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("start (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_5utils_9Stopwatch_4start(((struct __pyx_obj_3zmq_7backend_6cython_5utils_Stopwatch *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_5utils_9Stopwatch_4start(struct __pyx_obj_3zmq_7backend_6cython_5utils_Stopwatch *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("start", 0);
+
+ /* "zmq/backend/cython/utils.pyx":87
+ * Start the stopwatch.
+ * """
+ * if self.watch == NULL: # <<<<<<<<<<<<<<
+ * self.watch = zmq_stopwatch_start()
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_self->watch == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/utils.pyx":88
+ * """
+ * if self.watch == NULL:
+ * self.watch = zmq_stopwatch_start() # <<<<<<<<<<<<<<
+ * else:
+ * raise ZMQError('Stopwatch is already running.')
+ */
+ __pyx_v_self->watch = zmq_stopwatch_start();
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "zmq/backend/cython/utils.pyx":90
+ * self.watch = zmq_stopwatch_start()
+ * else:
+ * raise ZMQError('Stopwatch is already running.') # <<<<<<<<<<<<<<
+ *
+ * def stop(self):
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ZMQError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_L3:;
+
+ /* "zmq/backend/cython/utils.pyx":82
+ * self.watch = NULL
+ *
+ * def start(self): # <<<<<<<<<<<<<<
+ * """s.start()
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("zmq.backend.cython.utils.Stopwatch.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/utils.pyx":92
+ * raise ZMQError('Stopwatch is already running.')
+ *
+ * def stop(self): # <<<<<<<<<<<<<<
+ * """s.stop()
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_5utils_9Stopwatch_7stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_5utils_9Stopwatch_6stop[] = "s.stop()\n\n Stop the stopwatch.\n \n Returns\n -------\n t : unsigned long int\n the number of microseconds since ``start()`` was called.\n ";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_5utils_9Stopwatch_7stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("stop (wrapper)", 0);
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_5utils_9Stopwatch_6stop(((struct __pyx_obj_3zmq_7backend_6cython_5utils_Stopwatch *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_5utils_9Stopwatch_6stop(struct __pyx_obj_3zmq_7backend_6cython_5utils_Stopwatch *__pyx_v_self) {
+ unsigned long __pyx_v_time;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("stop", 0);
+
+ /* "zmq/backend/cython/utils.pyx":103
+ * """
+ * cdef unsigned long time
+ * if self.watch == NULL: # <<<<<<<<<<<<<<
+ * raise ZMQError('Must start the Stopwatch before calling stop.')
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_self->watch == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/backend/cython/utils.pyx":104
+ * cdef unsigned long time
+ * if self.watch == NULL:
+ * raise ZMQError('Must start the Stopwatch before calling stop.') # <<<<<<<<<<<<<<
+ * else:
+ * time = zmq_stopwatch_stop(self.watch)
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ZMQError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ /*else*/ {
+
+ /* "zmq/backend/cython/utils.pyx":106
+ * raise ZMQError('Must start the Stopwatch before calling stop.')
+ * else:
+ * time = zmq_stopwatch_stop(self.watch) # <<<<<<<<<<<<<<
+ * self.watch = NULL
+ * return time
+ */
+ __pyx_v_time = zmq_stopwatch_stop(__pyx_v_self->watch);
+
+ /* "zmq/backend/cython/utils.pyx":107
+ * else:
+ * time = zmq_stopwatch_stop(self.watch)
+ * self.watch = NULL # <<<<<<<<<<<<<<
+ * return time
+ *
+ */
+ __pyx_v_self->watch = NULL;
+
+ /* "zmq/backend/cython/utils.pyx":108
+ * time = zmq_stopwatch_stop(self.watch)
+ * self.watch = NULL
+ * return time # <<<<<<<<<<<<<<
+ *
+ * def sleep(self, int seconds):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = __Pyx_PyInt_From_unsigned_long(__pyx_v_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/backend/cython/utils.pyx":92
+ * raise ZMQError('Stopwatch is already running.')
+ *
+ * def stop(self): # <<<<<<<<<<<<<<
+ * """s.stop()
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("zmq.backend.cython.utils.Stopwatch.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/utils.pyx":110
+ * return time
+ *
+ * def sleep(self, int seconds): # <<<<<<<<<<<<<<
+ * """s.sleep(seconds)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7backend_6cython_5utils_9Stopwatch_9sleep(PyObject *__pyx_v_self, PyObject *__pyx_arg_seconds); /*proto*/
+static char __pyx_doc_3zmq_7backend_6cython_5utils_9Stopwatch_8sleep[] = "s.sleep(seconds)\n\n Sleep for an integer number of seconds.\n ";
+static PyObject *__pyx_pw_3zmq_7backend_6cython_5utils_9Stopwatch_9sleep(PyObject *__pyx_v_self, PyObject *__pyx_arg_seconds) {
+ int __pyx_v_seconds;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("sleep (wrapper)", 0);
+ assert(__pyx_arg_seconds); {
+ __pyx_v_seconds = __Pyx_PyInt_As_int(__pyx_arg_seconds); if (unlikely((__pyx_v_seconds == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("zmq.backend.cython.utils.Stopwatch.sleep", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_3zmq_7backend_6cython_5utils_9Stopwatch_8sleep(((struct __pyx_obj_3zmq_7backend_6cython_5utils_Stopwatch *)__pyx_v_self), ((int)__pyx_v_seconds));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7backend_6cython_5utils_9Stopwatch_8sleep(CYTHON_UNUSED struct __pyx_obj_3zmq_7backend_6cython_5utils_Stopwatch *__pyx_v_self, int __pyx_v_seconds) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("sleep", 0);
+
+ /* "zmq/backend/cython/utils.pyx":115
+ * Sleep for an integer number of seconds.
+ * """
+ * with nogil: # <<<<<<<<<<<<<<
+ * zmq_sleep(seconds)
+ *
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ #endif
+ /*try:*/ {
+
+ /* "zmq/backend/cython/utils.pyx":116
+ * """
+ * with nogil:
+ * zmq_sleep(seconds) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ zmq_sleep(__pyx_v_seconds);
+ }
+
+ /* "zmq/backend/cython/utils.pyx":115
+ * Sleep for an integer number of seconds.
+ * """
+ * with nogil: # <<<<<<<<<<<<<<
+ * zmq_sleep(seconds)
+ *
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+ }
+ }
+
+ /* "zmq/backend/cython/utils.pyx":110
+ * return time
+ *
+ * def sleep(self, int seconds): # <<<<<<<<<<<<<<
+ * """s.sleep(seconds)
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_tp_new_3zmq_7backend_6cython_5utils_Stopwatch(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ if (unlikely(__pyx_pw_3zmq_7backend_6cython_5utils_9Stopwatch_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) {
+ Py_DECREF(o); o = 0;
+ }
+ return o;
+}
+
+static void __pyx_tp_dealloc_3zmq_7backend_6cython_5utils_Stopwatch(PyObject *o) {
+ #if PY_VERSION_HEX >= 0x030400a1
+ if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ {
+ PyObject *etype, *eval, *etb;
+ PyErr_Fetch(&etype, &eval, &etb);
+ ++Py_REFCNT(o);
+ __pyx_pw_3zmq_7backend_6cython_5utils_9Stopwatch_3__dealloc__(o);
+ --Py_REFCNT(o);
+ PyErr_Restore(etype, eval, etb);
+ }
+ (*Py_TYPE(o)->tp_free)(o);
+}
+
+static PyMethodDef __pyx_methods_3zmq_7backend_6cython_5utils_Stopwatch[] = {
+ {"start", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_5utils_9Stopwatch_5start, METH_NOARGS, __pyx_doc_3zmq_7backend_6cython_5utils_9Stopwatch_4start},
+ {"stop", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_5utils_9Stopwatch_7stop, METH_NOARGS, __pyx_doc_3zmq_7backend_6cython_5utils_9Stopwatch_6stop},
+ {"sleep", (PyCFunction)__pyx_pw_3zmq_7backend_6cython_5utils_9Stopwatch_9sleep, METH_O, __pyx_doc_3zmq_7backend_6cython_5utils_9Stopwatch_8sleep},
+ {0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type_3zmq_7backend_6cython_5utils_Stopwatch = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "zmq.backend.cython.utils.Stopwatch", /*tp_name*/
+ sizeof(struct __pyx_obj_3zmq_7backend_6cython_5utils_Stopwatch), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_3zmq_7backend_6cython_5utils_Stopwatch, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ "Stopwatch()\n\n A simple stopwatch based on zmq_stopwatch_start/stop.\n\n This class should be used for benchmarking and timing 0MQ code.\n ", /*tp_doc*/
+ 0, /*tp_traverse*/
+ 0, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_3zmq_7backend_6cython_5utils_Stopwatch, /*tp_methods*/
+ 0, /*tp_members*/
+ 0, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_3zmq_7backend_6cython_5utils_Stopwatch, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+
+static PyMethodDef __pyx_methods[] = {
+ {0, 0, 0, 0}
+};
+
+#if PY_MAJOR_VERSION >= 3
+static struct PyModuleDef __pyx_moduledef = {
+ #if PY_VERSION_HEX < 0x03020000
+ { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
+ #else
+ PyModuleDef_HEAD_INIT,
+ #endif
+ "utils",
+ __pyx_k_0MQ_utils, /* m_doc */
+ -1, /* m_size */
+ __pyx_methods /* m_methods */,
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL /* m_free */
+};
+#endif
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+ {&__pyx_kp_s_Must_start_the_Stopwatch_before, __pyx_k_Must_start_the_Stopwatch_before, sizeof(__pyx_k_Must_start_the_Stopwatch_before), 0, 0, 1, 0},
+ {&__pyx_n_s_Stopwatch, __pyx_k_Stopwatch, sizeof(__pyx_k_Stopwatch), 0, 0, 1, 1},
+ {&__pyx_kp_s_Stopwatch_is_already_running, __pyx_k_Stopwatch_is_already_running, sizeof(__pyx_k_Stopwatch_is_already_running), 0, 0, 1, 0},
+ {&__pyx_n_s_ZMQError, __pyx_k_ZMQError, sizeof(__pyx_k_ZMQError), 0, 0, 1, 1},
+ {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
+ {&__pyx_n_s_capability, __pyx_k_capability, sizeof(__pyx_k_capability), 0, 0, 1, 1},
+ {&__pyx_n_s_ccap, __pyx_k_ccap, sizeof(__pyx_k_ccap), 0, 0, 1, 1},
+ {&__pyx_n_s_check_rc, __pyx_k_check_rc, sizeof(__pyx_k_check_rc), 0, 0, 1, 1},
+ {&__pyx_n_s_check_version, __pyx_k_check_version, sizeof(__pyx_k_check_version), 0, 0, 1, 1},
+ {&__pyx_n_s_curve_keypair, __pyx_k_curve_keypair, sizeof(__pyx_k_curve_keypair), 0, 0, 1, 1},
+ {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
+ {&__pyx_n_s_has, __pyx_k_has, sizeof(__pyx_k_has), 0, 0, 1, 1},
+ {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+ {&__pyx_kp_s_private_tmp_pyzmq_release_zmq_b, __pyx_k_private_tmp_pyzmq_release_zmq_b, sizeof(__pyx_k_private_tmp_pyzmq_release_zmq_b), 0, 0, 1, 0},
+ {&__pyx_n_s_public_key, __pyx_k_public_key, sizeof(__pyx_k_public_key), 0, 0, 1, 1},
+ {&__pyx_n_s_rc, __pyx_k_rc, sizeof(__pyx_k_rc), 0, 0, 1, 1},
+ {&__pyx_n_s_secret_key, __pyx_k_secret_key, sizeof(__pyx_k_secret_key), 0, 0, 1, 1},
+ {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+ {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1},
+ {&__pyx_n_s_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq_backend_cython_utils, __pyx_k_zmq_backend_cython_utils, sizeof(__pyx_k_zmq_backend_cython_utils), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq_error, __pyx_k_zmq_error, sizeof(__pyx_k_zmq_error), 0, 0, 1, 1},
+ {&__pyx_kp_s_zmq_has, __pyx_k_zmq_has, sizeof(__pyx_k_zmq_has), 0, 0, 1, 0},
+ {&__pyx_n_s_zmq_utils_strtypes, __pyx_k_zmq_utils_strtypes, sizeof(__pyx_k_zmq_utils_strtypes), 0, 0, 1, 1},
+ {0, 0, 0, 0, 0, 0, 0}
+};
+static int __Pyx_InitCachedBuiltins(void) {
+ return 0;
+}
+
+static int __Pyx_InitCachedConstants(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
+
+ /* "zmq/backend/cython/utils.pyx":35
+ * .. versionadded:: 14.1
+ * """
+ * _check_version((4,1), 'zmq.has') # <<<<<<<<<<<<<<
+ * cdef bytes ccap
+ * if isinstance(capability, unicode):
+ */
+ __pyx_tuple_ = PyTuple_Pack(2, __pyx_int_4, __pyx_int_1); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple_);
+ __Pyx_GIVEREF(__pyx_tuple_);
+ __pyx_tuple__2 = PyTuple_Pack(2, __pyx_tuple_, __pyx_kp_s_zmq_has); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__2);
+ __Pyx_GIVEREF(__pyx_tuple__2);
+
+ /* "zmq/backend/cython/utils.pyx":38
+ * cdef bytes ccap
+ * if isinstance(capability, unicode):
+ * capability = capability.encode('utf8') # <<<<<<<<<<<<<<
+ * ccap = capability
+ * return bool(zmq_has(ccap))
+ */
+ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__3);
+ __Pyx_GIVEREF(__pyx_tuple__3);
+
+ /* "zmq/backend/cython/utils.pyx":58
+ * cdef char[64] public_key
+ * cdef char[64] secret_key
+ * _check_version((4,0), "curve_keypair") # <<<<<<<<<<<<<<
+ * rc = zmq_curve_keypair (public_key, secret_key)
+ * _check_rc(rc)
+ */
+ __pyx_tuple__4 = PyTuple_Pack(2, __pyx_int_4, __pyx_int_0); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__4);
+ __Pyx_GIVEREF(__pyx_tuple__4);
+ __pyx_tuple__5 = PyTuple_Pack(2, __pyx_tuple__4, __pyx_n_s_curve_keypair); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__5);
+ __Pyx_GIVEREF(__pyx_tuple__5);
+
+ /* "zmq/backend/cython/utils.pyx":90
+ * self.watch = zmq_stopwatch_start()
+ * else:
+ * raise ZMQError('Stopwatch is already running.') # <<<<<<<<<<<<<<
+ *
+ * def stop(self):
+ */
+ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Stopwatch_is_already_running); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__6);
+ __Pyx_GIVEREF(__pyx_tuple__6);
+
+ /* "zmq/backend/cython/utils.pyx":104
+ * cdef unsigned long time
+ * if self.watch == NULL:
+ * raise ZMQError('Must start the Stopwatch before calling stop.') # <<<<<<<<<<<<<<
+ * else:
+ * time = zmq_stopwatch_stop(self.watch)
+ */
+ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Must_start_the_Stopwatch_before); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__7);
+ __Pyx_GIVEREF(__pyx_tuple__7);
+
+ /* "zmq/backend/cython/utils.pyx":29
+ * from zmq.utils.strtypes import unicode
+ *
+ * def has(capability): # <<<<<<<<<<<<<<
+ * """Check for zmq capability by name (e.g. 'ipc', 'curve')
+ *
+ */
+ __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_capability, __pyx_n_s_ccap); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__8);
+ __Pyx_GIVEREF(__pyx_tuple__8);
+ __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_pyzmq_release_zmq_b, __pyx_n_s_has, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/utils.pyx":42
+ * return bool(zmq_has(ccap))
+ *
+ * def curve_keypair(): # <<<<<<<<<<<<<<
+ * """generate a Z85 keypair for use with zmq.CURVE security
+ *
+ */
+ __pyx_tuple__10 = PyTuple_Pack(3, __pyx_n_s_rc, __pyx_n_s_public_key, __pyx_n_s_secret_key); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__10);
+ __Pyx_GIVEREF(__pyx_tuple__10);
+ __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_pyzmq_release_zmq_b, __pyx_n_s_curve_keypair, 42, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static int __Pyx_InitGlobals(void) {
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+#if PY_MAJOR_VERSION < 3
+PyMODINIT_FUNC initutils(void); /*proto*/
+PyMODINIT_FUNC initutils(void)
+#else
+PyMODINIT_FUNC PyInit_utils(void); /*proto*/
+PyMODINIT_FUNC PyInit_utils(void)
+#endif
+{
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ #if CYTHON_REFNANNY
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
+ if (!__Pyx_RefNanny) {
+ PyErr_Clear();
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
+ if (!__Pyx_RefNanny)
+ Py_FatalError("failed to import 'refnanny' module");
+ }
+ #endif
+ __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_utils(void)", 0);
+ if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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;}
+ __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;}
+ #ifdef __Pyx_CyFunction_USED
+ if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_FusedFunction_USED
+ if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_Generator_USED
+ if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ /*--- Library function declarations ---*/
+ /*--- Threads initialization code ---*/
+ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
+ #ifdef WITH_THREAD /* Python build with threading support? */
+ PyEval_InitThreads();
+ #endif
+ #endif
+ /*--- Module creation code ---*/
+ #if PY_MAJOR_VERSION < 3
+ __pyx_m = Py_InitModule4("utils", __pyx_methods, __pyx_k_0MQ_utils, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+ #else
+ __pyx_m = PyModule_Create(&__pyx_moduledef);
+ #endif
+ if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_INCREF(__pyx_d);
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_COMPILING_IN_PYPY
+ Py_INCREF(__pyx_b);
+ #endif
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ /*--- Initialize various global constants etc. ---*/
+ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ if (__pyx_module_is_main_zmq__backend__cython__utils) {
+ if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ }
+ #if PY_MAJOR_VERSION >= 3
+ {
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!PyDict_GetItemString(modules, "zmq.backend.cython.utils")) {
+ if (unlikely(PyDict_SetItemString(modules, "zmq.backend.cython.utils", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+ /*--- Builtin init code ---*/
+ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Constants init code ---*/
+ if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Global init code ---*/
+ /*--- Variable export code ---*/
+ /*--- Function export code ---*/
+ /*--- Type init code ---*/
+ if (PyType_Ready(&__pyx_type_3zmq_7backend_6cython_5utils_Stopwatch) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type_3zmq_7backend_6cython_5utils_Stopwatch.tp_print = 0;
+ if (PyObject_SetAttrString(__pyx_m, "Stopwatch", (PyObject *)&__pyx_type_3zmq_7backend_6cython_5utils_Stopwatch) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_3zmq_7backend_6cython_5utils_Stopwatch = &__pyx_type_3zmq_7backend_6cython_5utils_Stopwatch;
+ /*--- Type import code ---*/
+ /*--- Variable import code ---*/
+ /*--- Function import code ---*/
+ /*--- Execution code ---*/
+
+ /* "zmq/backend/cython/utils.pyx":26
+ * zmq_has, const_char_ptr
+ * )
+ * from zmq.error import ZMQError, _check_rc, _check_version # <<<<<<<<<<<<<<
+ * from zmq.utils.strtypes import unicode
+ *
+ */
+ __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_s_ZMQError);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ZMQError);
+ __Pyx_GIVEREF(__pyx_n_s_ZMQError);
+ __Pyx_INCREF(__pyx_n_s_check_rc);
+ PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_check_rc);
+ __Pyx_GIVEREF(__pyx_n_s_check_rc);
+ __Pyx_INCREF(__pyx_n_s_check_version);
+ PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_check_version);
+ __Pyx_GIVEREF(__pyx_n_s_check_version);
+ __pyx_t_2 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ZMQError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ZMQError, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_check_rc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_rc, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_check_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_version, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/backend/cython/utils.pyx":27
+ * )
+ * from zmq.error import ZMQError, _check_rc, _check_version
+ * from zmq.utils.strtypes import unicode # <<<<<<<<<<<<<<
+ *
+ * def has(capability):
+ */
+ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_n_s_unicode);
+ PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_unicode);
+ __Pyx_GIVEREF(__pyx_n_s_unicode);
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_zmq_utils_strtypes, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_unicode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_unicode, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/utils.pyx":29
+ * from zmq.utils.strtypes import unicode
+ *
+ * def has(capability): # <<<<<<<<<<<<<<
+ * """Check for zmq capability by name (e.g. 'ipc', 'curve')
+ *
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3zmq_7backend_6cython_5utils_1has, NULL, __pyx_n_s_zmq_backend_cython_utils); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_has, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/utils.pyx":42
+ * return bool(zmq_has(ccap))
+ *
+ * def curve_keypair(): # <<<<<<<<<<<<<<
+ * """generate a Z85 keypair for use with zmq.CURVE security
+ *
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3zmq_7backend_6cython_5utils_3curve_keypair, NULL, __pyx_n_s_zmq_backend_cython_utils); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_curve_keypair, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/utils.pyx":119
+ *
+ *
+ * __all__ = ['has', 'curve_keypair', 'Stopwatch'] # <<<<<<<<<<<<<<
+ */
+ __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_s_has);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_has);
+ __Pyx_GIVEREF(__pyx_n_s_has);
+ __Pyx_INCREF(__pyx_n_s_curve_keypair);
+ PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_curve_keypair);
+ __Pyx_GIVEREF(__pyx_n_s_curve_keypair);
+ __Pyx_INCREF(__pyx_n_s_Stopwatch);
+ PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_Stopwatch);
+ __Pyx_GIVEREF(__pyx_n_s_Stopwatch);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "zmq/backend/cython/utils.pyx":1
+ * """0MQ utils.""" # <<<<<<<<<<<<<<
+ *
+ * #
+ */
+ __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;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /*--- Wrapped vars code ---*/
+
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ if (__pyx_m) {
+ if (__pyx_d) {
+ __Pyx_AddTraceback("init zmq.backend.cython.utils", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ }
+ Py_DECREF(__pyx_m); __pyx_m = 0;
+ } else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ImportError, "init zmq.backend.cython.utils");
+ }
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ #if PY_MAJOR_VERSION < 3
+ return;
+ #else
+ return __pyx_m;
+ #endif
+}
+
+/* Runtime support code */
+#if CYTHON_REFNANNY
+static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
+ PyObject *m = NULL, *p = NULL;
+ void *r = NULL;
+ m = PyImport_ImportModule((char *)modname);
+ if (!m) goto end;
+ p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
+ if (!p) goto end;
+ r = PyLong_AsVoidPtr(p);
+end:
+ Py_XDECREF(p);
+ Py_XDECREF(m);
+ return (__Pyx_RefNannyAPIStruct *)r;
+}
+#endif
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
+ PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
+ if (unlikely(!result)) {
+ PyErr_Format(PyExc_NameError,
+#if PY_MAJOR_VERSION >= 3
+ "name '%U' is not defined", name);
+#else
+ "name '%.200s' is not defined", PyString_AS_STRING(name));
+#endif
+ }
+ return result;
+}
+
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
+ PyObject *result;
+#if CYTHON_COMPILING_IN_CPYTHON
+ result = PyDict_GetItem(__pyx_d, name);
+ if (likely(result)) {
+ Py_INCREF(result);
+ } else {
+#else
+ result = PyObject_GetItem(__pyx_d, name);
+ if (!result) {
+ PyErr_Clear();
+#endif
+ result = __Pyx_GetBuiltinName(name);
+ }
+ return result;
+}
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+ PyObject *result;
+ ternaryfunc call = func->ob_type->tp_call;
+ if (unlikely(!call))
+ return PyObject_Call(func, arg, kw);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = (*call)(func, arg, kw);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
+ PyObject *self, *result;
+ PyCFunction cfunc;
+ cfunc = PyCFunction_GET_FUNCTION(func);
+ self = PyCFunction_GET_SELF(func);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = cfunc(self, arg);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject *result;
+ PyObject *args = PyTuple_New(1);
+ if (unlikely(!args)) return NULL;
+ Py_INCREF(arg);
+ PyTuple_SET_ITEM(args, 0, arg);
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#ifdef __Pyx_CyFunction_USED
+ if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+ if (likely(PyCFunction_Check(func))) {
+#endif
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
+ return __Pyx_PyObject_CallMethO(func, arg);
+ }
+ }
+ return __Pyx__PyObject_CallOneArg(func, arg);
+}
+#else
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject* args = PyTuple_Pack(1, arg);
+ return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+}
+#endif
+
+static void __Pyx_RaiseArgtupleInvalid(
+ const char* func_name,
+ int exact,
+ Py_ssize_t num_min,
+ Py_ssize_t num_max,
+ Py_ssize_t num_found)
+{
+ Py_ssize_t num_expected;
+ const char *more_or_less;
+ if (num_found < num_min) {
+ num_expected = num_min;
+ more_or_less = "at least";
+ } else {
+ num_expected = num_max;
+ more_or_less = "at most";
+ }
+ if (exact) {
+ more_or_less = "exactly";
+ }
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+ func_name, more_or_less, num_expected,
+ (num_expected == 1) ? "" : "s", num_found);
+}
+
+static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
+ PyObject *kwdict,
+ const char* function_name,
+ int kw_allowed)
+{
+ PyObject* key = 0;
+ Py_ssize_t pos = 0;
+#if CYTHON_COMPILING_IN_PYPY
+ if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
+ goto invalid_keyword;
+ return 1;
+#else
+ while (PyDict_Next(kwdict, &pos, &key, 0)) {
+ #if PY_MAJOR_VERSION < 3
+ if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
+ #endif
+ if (unlikely(!PyUnicode_Check(key)))
+ goto invalid_keyword_type;
+ }
+ if ((!kw_allowed) && unlikely(key))
+ goto invalid_keyword;
+ return 1;
+invalid_keyword_type:
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() keywords must be strings", function_name);
+ return 0;
+#endif
+invalid_keyword:
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION < 3
+ "%.200s() got an unexpected keyword argument '%.200s'",
+ function_name, PyString_AsString(key));
+ #else
+ "%s() got an unexpected keyword argument '%U'",
+ function_name, key);
+ #endif
+ return 0;
+}
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyThreadState *tstate = PyThreadState_GET();
+ tmp_type = tstate->curexc_type;
+ tmp_value = tstate->curexc_value;
+ tmp_tb = tstate->curexc_traceback;
+ tstate->curexc_type = type;
+ tstate->curexc_value = value;
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_Restore(type, value, tb);
+#endif
+}
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ *type = tstate->curexc_type;
+ *value = tstate->curexc_value;
+ *tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(type, value, tb);
+#endif
+}
+
+#if PY_MAJOR_VERSION < 3
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
+ CYTHON_UNUSED PyObject *cause) {
+ Py_XINCREF(type);
+ if (!value || value == Py_None)
+ value = NULL;
+ else
+ Py_INCREF(value);
+ if (!tb || tb == Py_None)
+ tb = NULL;
+ else {
+ Py_INCREF(tb);
+ if (!PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto raise_error;
+ }
+ }
+ if (PyType_Check(type)) {
+#if CYTHON_COMPILING_IN_PYPY
+ if (!value) {
+ Py_INCREF(Py_None);
+ value = Py_None;
+ }
+#endif
+ PyErr_NormalizeException(&type, &value, &tb);
+ } else {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto raise_error;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(type);
+ Py_INCREF(type);
+ if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto raise_error;
+ }
+ }
+ __Pyx_ErrRestore(type, value, tb);
+ return;
+raise_error:
+ Py_XDECREF(value);
+ Py_XDECREF(type);
+ Py_XDECREF(tb);
+ return;
+}
+#else
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
+ PyObject* owned_instance = NULL;
+ if (tb == Py_None) {
+ tb = 0;
+ } else if (tb && !PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto bad;
+ }
+ if (value == Py_None)
+ value = 0;
+ if (PyExceptionInstance_Check(type)) {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto bad;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(value);
+ } else if (PyExceptionClass_Check(type)) {
+ PyObject *instance_class = NULL;
+ if (value && PyExceptionInstance_Check(value)) {
+ instance_class = (PyObject*) Py_TYPE(value);
+ if (instance_class != type) {
+ if (PyObject_IsSubclass(instance_class, type)) {
+ type = instance_class;
+ } else {
+ instance_class = NULL;
+ }
+ }
+ }
+ if (!instance_class) {
+ PyObject *args;
+ if (!value)
+ args = PyTuple_New(0);
+ else if (PyTuple_Check(value)) {
+ Py_INCREF(value);
+ args = value;
+ } else
+ args = PyTuple_Pack(1, value);
+ if (!args)
+ goto bad;
+ owned_instance = PyObject_Call(type, args, NULL);
+ Py_DECREF(args);
+ if (!owned_instance)
+ goto bad;
+ value = owned_instance;
+ if (!PyExceptionInstance_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "calling %R should have returned an instance of "
+ "BaseException, not %R",
+ type, Py_TYPE(value));
+ goto bad;
+ }
+ }
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto bad;
+ }
+#if PY_VERSION_HEX >= 0x03030000
+ if (cause) {
+#else
+ if (cause && cause != Py_None) {
+#endif
+ PyObject *fixed_cause;
+ if (cause == Py_None) {
+ fixed_cause = NULL;
+ } else if (PyExceptionClass_Check(cause)) {
+ fixed_cause = PyObject_CallObject(cause, NULL);
+ if (fixed_cause == NULL)
+ goto bad;
+ } else if (PyExceptionInstance_Check(cause)) {
+ fixed_cause = cause;
+ Py_INCREF(fixed_cause);
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "exception causes must derive from "
+ "BaseException");
+ goto bad;
+ }
+ PyException_SetCause(value, fixed_cause);
+ }
+ PyErr_SetObject(type, value);
+ if (tb) {
+#if CYTHON_COMPILING_IN_PYPY
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyErr_Fetch(tmp_type, tmp_value, tmp_tb);
+ Py_INCREF(tb);
+ PyErr_Restore(tmp_type, tmp_value, tb);
+ Py_XDECREF(tmp_tb);
+#else
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject* tmp_tb = tstate->curexc_traceback;
+ if (tb != tmp_tb) {
+ Py_INCREF(tb);
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_tb);
+ }
+#endif
+ }
+bad:
+ Py_XDECREF(owned_instance);
+ return;
+}
+#endif
+
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
+ PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
+ if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Format(PyExc_ImportError,
+ #if PY_MAJOR_VERSION < 3
+ "cannot import name %.230s", PyString_AS_STRING(name));
+ #else
+ "cannot import name %S", name);
+ #endif
+ }
+ return value;
+}
+
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+ int start = 0, mid = 0, end = count - 1;
+ if (end >= 0 && code_line > entries[end].code_line) {
+ return count;
+ }
+ while (start < end) {
+ mid = (start + end) / 2;
+ if (code_line < entries[mid].code_line) {
+ end = mid;
+ } else if (code_line > entries[mid].code_line) {
+ start = mid + 1;
+ } else {
+ return mid;
+ }
+ }
+ if (code_line <= entries[mid].code_line) {
+ return mid;
+ } else {
+ return mid + 1;
+ }
+}
+static PyCodeObject *__pyx_find_code_object(int code_line) {
+ PyCodeObject* code_object;
+ int pos;
+ if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
+ return NULL;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
+ return NULL;
+ }
+ code_object = __pyx_code_cache.entries[pos].code_object;
+ Py_INCREF(code_object);
+ return code_object;
+}
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
+ int pos, i;
+ __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
+ if (unlikely(!code_line)) {
+ return;
+ }
+ if (unlikely(!entries)) {
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (likely(entries)) {
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = 64;
+ __pyx_code_cache.count = 1;
+ entries[0].code_line = code_line;
+ entries[0].code_object = code_object;
+ Py_INCREF(code_object);
+ }
+ return;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
+ PyCodeObject* tmp = entries[pos].code_object;
+ entries[pos].code_object = code_object;
+ Py_DECREF(tmp);
+ return;
+ }
+ if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
+ int new_max = __pyx_code_cache.max_count + 64;
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
+ __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (unlikely(!entries)) {
+ return;
+ }
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = new_max;
+ }
+ for (i=__pyx_code_cache.count; i>pos; i--) {
+ entries[i] = entries[i-1];
+ }
+ entries[pos].code_line = code_line;
+ entries[pos].code_object = code_object;
+ __pyx_code_cache.count++;
+ Py_INCREF(code_object);
+}
+
+#include "compile.h"
+#include "frameobject.h"
+#include "traceback.h"
+static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
+ const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyObject *py_srcfile = 0;
+ PyObject *py_funcname = 0;
+ #if PY_MAJOR_VERSION < 3
+ py_srcfile = PyString_FromString(filename);
+ #else
+ py_srcfile = PyUnicode_FromString(filename);
+ #endif
+ if (!py_srcfile) goto bad;
+ if (c_line) {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #else
+ py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #endif
+ }
+ else {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromString(funcname);
+ #else
+ py_funcname = PyUnicode_FromString(funcname);
+ #endif
+ }
+ if (!py_funcname) goto bad;
+ py_code = __Pyx_PyCode_New(
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ __pyx_empty_bytes, /*PyObject *code,*/
+ __pyx_empty_tuple, /*PyObject *consts,*/
+ __pyx_empty_tuple, /*PyObject *names,*/
+ __pyx_empty_tuple, /*PyObject *varnames,*/
+ __pyx_empty_tuple, /*PyObject *freevars,*/
+ __pyx_empty_tuple, /*PyObject *cellvars,*/
+ py_srcfile, /*PyObject *filename,*/
+ py_funcname, /*PyObject *name,*/
+ py_line,
+ __pyx_empty_bytes /*PyObject *lnotab*/
+ );
+ Py_DECREF(py_srcfile);
+ Py_DECREF(py_funcname);
+ return py_code;
+bad:
+ Py_XDECREF(py_srcfile);
+ Py_XDECREF(py_funcname);
+ return NULL;
+}
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyFrameObject *py_frame = 0;
+ py_code = __pyx_find_code_object(c_line ? c_line : py_line);
+ if (!py_code) {
+ py_code = __Pyx_CreateCodeObjectForTraceback(
+ funcname, c_line, py_line, filename);
+ if (!py_code) goto bad;
+ __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
+ }
+ py_frame = PyFrame_New(
+ PyThreadState_GET(), /*PyThreadState *tstate,*/
+ py_code, /*PyCodeObject *code,*/
+ __pyx_d, /*PyObject *globals,*/
+ 0 /*PyObject *locals*/
+ );
+ if (!py_frame) goto bad;
+ py_frame->f_lineno = py_line;
+ PyTraceBack_Here(py_frame);
+bad:
+ Py_XDECREF(py_code);
+ Py_XDECREF(py_frame);
+}
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
+ goto bad;
+ #endif
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ {
+ #if PY_MAJOR_VERSION >= 3
+ if (level == -1) {
+ if (strchr(__Pyx_MODULE_NAME, '.')) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(1);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, 1);
+ #endif
+ if (!module) {
+ if (!PyErr_ExceptionMatches(PyExc_ImportError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ level = 0;
+ }
+ #endif
+ if (!module) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(level);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, level);
+ #endif
+ }
+ }
+bad:
+ #if PY_VERSION_HEX < 0x03030000
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
+}
+
+#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value) \
+ { \
+ func_type value = func_value; \
+ if (sizeof(target_type) < sizeof(func_type)) { \
+ if (unlikely(value != (func_type) (target_type) value)) { \
+ func_type zero = 0; \
+ if (is_unsigned && unlikely(value < zero)) \
+ goto raise_neg_overflow; \
+ else \
+ goto raise_overflow; \
+ } \
+ } \
+ return (target_type) value; \
+ }
+
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ #include "longintrepr.h"
+ #endif
+#endif
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+ const int neg_one = (int) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(int) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (int) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(int) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
+ } else if (sizeof(int) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ int val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (int) -1;
+ }
+ } else {
+ int val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (int) -1;
+ val = __Pyx_PyInt_As_int(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to int");
+ return (int) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to int");
+ return (int) -1;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+ const int neg_one = (int) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(int) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(int) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(int),
+ little, !is_unsigned);
+ }
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value) {
+ const unsigned long neg_one = (unsigned long) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(unsigned long) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(unsigned long) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(unsigned long) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(unsigned long) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(unsigned long) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(unsigned long),
+ little, !is_unsigned);
+ }
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+ const long neg_one = (long) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(long) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(long) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(long),
+ little, !is_unsigned);
+ }
+}
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+ const long neg_one = (long) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(long) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (long) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(long) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(long) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(long) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
+ } else if (sizeof(long) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ long val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (long) -1;
+ }
+ } else {
+ long val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (long) -1;
+ val = __Pyx_PyInt_As_long(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to long");
+ return (long) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to long");
+ return (long) -1;
+}
+
+static int __Pyx_check_binary_version(void) {
+ char ctversion[4], rtversion[4];
+ PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
+ if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
+ char message[200];
+ PyOS_snprintf(message, sizeof(message),
+ "compiletime version %s of module '%.100s' "
+ "does not match runtime version %s",
+ ctversion, __Pyx_MODULE_NAME, rtversion);
+ return PyErr_WarnEx(NULL, message, 1);
+ }
+ return 0;
+}
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+ while (t->p) {
+ #if PY_MAJOR_VERSION < 3
+ if (t->is_unicode) {
+ *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
+ } else if (t->intern) {
+ *t->p = PyString_InternFromString(t->s);
+ } else {
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+ }
+ #else
+ if (t->is_unicode | t->is_str) {
+ if (t->intern) {
+ *t->p = PyUnicode_InternFromString(t->s);
+ } else if (t->encoding) {
+ *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
+ } else {
+ *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+ }
+ } else {
+ *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
+ }
+ #endif
+ if (!*t->p)
+ return -1;
+ ++t;
+ }
+ return 0;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
+ return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
+ Py_ssize_t ignore;
+ return __Pyx_PyObject_AsStringAndSize(o, &ignore);
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+ if (
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ __Pyx_sys_getdefaultencoding_not_ascii &&
+#endif
+ PyUnicode_Check(o)) {
+#if PY_VERSION_HEX < 0x03030000
+ char* defenc_c;
+ PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
+ if (!defenc) return NULL;
+ defenc_c = PyBytes_AS_STRING(defenc);
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ {
+ char* end = defenc_c + PyBytes_GET_SIZE(defenc);
+ char* c;
+ for (c = defenc_c; c < end; c++) {
+ if ((unsigned char) (*c) >= 128) {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+ }
+ }
+#endif
+ *length = PyBytes_GET_SIZE(defenc);
+ return defenc_c;
+#else
+ if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ if (PyUnicode_IS_ASCII(o)) {
+ *length = PyUnicode_GET_LENGTH(o);
+ return PyUnicode_AsUTF8(o);
+ } else {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+#else
+ return PyUnicode_AsUTF8AndSize(o, length);
+#endif
+#endif
+ } else
+#endif
+#if !CYTHON_COMPILING_IN_PYPY
+ if (PyByteArray_Check(o)) {
+ *length = PyByteArray_GET_SIZE(o);
+ return PyByteArray_AS_STRING(o);
+ } else
+#endif
+ {
+ char* result;
+ int r = PyBytes_AsStringAndSize(o, &result, length);
+ if (unlikely(r < 0)) {
+ return NULL;
+ } else {
+ return result;
+ }
+ }
+}
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
+ int is_true = x == Py_True;
+ if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
+ else return PyObject_IsTrue(x);
+}
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
+ PyNumberMethods *m;
+ const char *name = NULL;
+ PyObject *res = NULL;
+#if PY_MAJOR_VERSION < 3
+ if (PyInt_Check(x) || PyLong_Check(x))
+#else
+ if (PyLong_Check(x))
+#endif
+ return Py_INCREF(x), x;
+ m = Py_TYPE(x)->tp_as_number;
+#if PY_MAJOR_VERSION < 3
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Int(x);
+ }
+ else if (m && m->nb_long) {
+ name = "long";
+ res = PyNumber_Long(x);
+ }
+#else
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Long(x);
+ }
+#endif
+ if (res) {
+#if PY_MAJOR_VERSION < 3
+ if (!PyInt_Check(res) && !PyLong_Check(res)) {
+#else
+ if (!PyLong_Check(res)) {
+#endif
+ PyErr_Format(PyExc_TypeError,
+ "__%.4s__ returned non-%.4s (type %.200s)",
+ name, name, Py_TYPE(res)->tp_name);
+ Py_DECREF(res);
+ return NULL;
+ }
+ }
+ else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "an integer is required");
+ }
+ return res;
+}
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+ Py_ssize_t ival;
+ PyObject *x;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(b)))
+ return PyInt_AS_LONG(b);
+#endif
+ if (likely(PyLong_CheckExact(b))) {
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(b)) {
+ case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
+ case 0: return 0;
+ case 1: return ((PyLongObject*)b)->ob_digit[0];
+ }
+ #endif
+ #endif
+ return PyLong_AsSsize_t(b);
+ }
+ x = PyNumber_Index(b);
+ if (!x) return -1;
+ ival = PyInt_AsSsize_t(x);
+ Py_DECREF(x);
+ return ival;
+}
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
+ return PyInt_FromSize_t(ival);
+}
+
+
+#endif /* Py_PYTHON_H */
diff --git a/scripts/external_libs/zmq/backend/cython/utils.pxd b/scripts/external_libs/platform/cel59/zmq/backend/cython/utils.pxd
index 1d7117f1..1d7117f1 100644
--- a/scripts/external_libs/zmq/backend/cython/utils.pxd
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/utils.pxd
diff --git a/scripts/external_libs/platform/cel59/zmq/backend/cython/utils.pyx b/scripts/external_libs/platform/cel59/zmq/backend/cython/utils.pyx
new file mode 100644
index 00000000..68976e3b
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/backend/cython/utils.pyx
@@ -0,0 +1,119 @@
+"""0MQ utils."""
+
+#
+# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
+#
+# This file is part of pyzmq.
+#
+# pyzmq is free software; you can redistribute it and/or modify it under
+# the terms of the Lesser GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# pyzmq is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# Lesser GNU General Public License for more details.
+#
+# You should have received a copy of the Lesser GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+from libzmq cimport (
+ zmq_stopwatch_start, zmq_stopwatch_stop, zmq_sleep, zmq_curve_keypair,
+ zmq_has, const_char_ptr
+)
+from zmq.error import ZMQError, _check_rc, _check_version
+from zmq.utils.strtypes import unicode
+
+def has(capability):
+ """Check for zmq capability by name (e.g. 'ipc', 'curve')
+
+ .. versionadded:: libzmq-4.1
+ .. versionadded:: 14.1
+ """
+ _check_version((4,1), 'zmq.has')
+ cdef bytes ccap
+ if isinstance(capability, unicode):
+ capability = capability.encode('utf8')
+ ccap = capability
+ return bool(zmq_has(ccap))
+
+def curve_keypair():
+ """generate a Z85 keypair for use with zmq.CURVE security
+
+ Requires libzmq (≥ 4.0) to have been linked with libsodium.
+
+ .. versionadded:: libzmq-4.0
+ .. versionadded:: 14.0
+
+ Returns
+ -------
+ (public, secret) : two bytestrings
+ The public and private keypair as 40 byte z85-encoded bytestrings.
+ """
+ cdef int rc
+ cdef char[64] public_key
+ cdef char[64] secret_key
+ _check_version((4,0), "curve_keypair")
+ rc = zmq_curve_keypair (public_key, secret_key)
+ _check_rc(rc)
+ return public_key, secret_key
+
+
+cdef class Stopwatch:
+ """Stopwatch()
+
+ A simple stopwatch based on zmq_stopwatch_start/stop.
+
+ This class should be used for benchmarking and timing 0MQ code.
+ """
+
+ def __cinit__(self):
+ self.watch = NULL
+
+ def __dealloc__(self):
+ # copy of self.stop() we can't call object methods in dealloc as it
+ # might already be partially deleted
+ if self.watch:
+ zmq_stopwatch_stop(self.watch)
+ self.watch = NULL
+
+ def start(self):
+ """s.start()
+
+ Start the stopwatch.
+ """
+ if self.watch == NULL:
+ self.watch = zmq_stopwatch_start()
+ else:
+ raise ZMQError('Stopwatch is already running.')
+
+ def stop(self):
+ """s.stop()
+
+ Stop the stopwatch.
+
+ Returns
+ -------
+ t : unsigned long int
+ the number of microseconds since ``start()`` was called.
+ """
+ cdef unsigned long time
+ if self.watch == NULL:
+ raise ZMQError('Must start the Stopwatch before calling stop.')
+ else:
+ time = zmq_stopwatch_stop(self.watch)
+ self.watch = NULL
+ return time
+
+ def sleep(self, int seconds):
+ """s.sleep(seconds)
+
+ Sleep for an integer number of seconds.
+ """
+ with nogil:
+ zmq_sleep(seconds)
+
+
+__all__ = ['has', 'curve_keypair', 'Stopwatch']
diff --git a/scripts/external_libs/zmq/backend/select.py b/scripts/external_libs/platform/cel59/zmq/backend/select.py
index 0a2e09a2..0a2e09a2 100644
--- a/scripts/external_libs/zmq/backend/select.py
+++ b/scripts/external_libs/platform/cel59/zmq/backend/select.py
diff --git a/scripts/external_libs/zmq/devices/__init__.py b/scripts/external_libs/platform/cel59/zmq/devices/__init__.py
index 23715963..23715963 100644
--- a/scripts/external_libs/zmq/devices/__init__.py
+++ b/scripts/external_libs/platform/cel59/zmq/devices/__init__.py
diff --git a/scripts/external_libs/zmq/devices/basedevice.py b/scripts/external_libs/platform/cel59/zmq/devices/basedevice.py
index 7ba1b7ac..7ba1b7ac 100644
--- a/scripts/external_libs/zmq/devices/basedevice.py
+++ b/scripts/external_libs/platform/cel59/zmq/devices/basedevice.py
diff --git a/scripts/external_libs/platform/cel59/zmq/devices/monitoredqueue.c b/scripts/external_libs/platform/cel59/zmq/devices/monitoredqueue.c
new file mode 100644
index 00000000..92c2448f
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/devices/monitoredqueue.c
@@ -0,0 +1,5724 @@
+/* Generated by Cython 0.21.2 */
+
+#define PY_SSIZE_T_CLEAN
+#ifndef CYTHON_USE_PYLONG_INTERNALS
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#else
+#include "pyconfig.h"
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 1
+#else
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#endif
+#endif
+#endif
+#include "Python.h"
+#ifndef Py_PYTHON_H
+ #error Python headers needed to compile C extensions, please install development version of Python.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+ #error Cython requires Python 2.6+ or Python 3.2+.
+#else
+#define CYTHON_ABI "0_21_2"
+#include <stddef.h>
+#ifndef offsetof
+#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+ #ifndef __stdcall
+ #define __stdcall
+ #endif
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
+ #ifndef __fastcall
+ #define __fastcall
+ #endif
+#endif
+#ifndef DL_IMPORT
+ #define DL_IMPORT(t) t
+#endif
+#ifndef DL_EXPORT
+ #define DL_EXPORT(t) t
+#endif
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifndef Py_HUGE_VAL
+ #define Py_HUGE_VAL HUGE_VAL
+#endif
+#ifdef PYPY_VERSION
+#define CYTHON_COMPILING_IN_PYPY 1
+#define CYTHON_COMPILING_IN_CPYTHON 0
+#else
+#define CYTHON_COMPILING_IN_PYPY 0
+#define CYTHON_COMPILING_IN_CPYTHON 1
+#endif
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
+#define Py_OptimizeFlag 0
+#endif
+#define __PYX_BUILD_PY_SSIZE_T "n"
+#define CYTHON_FORMAT_SSIZE_T "z"
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyClass_Type
+#else
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyType_Type
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define Py_TPFLAGS_CHECKTYPES 0
+ #define Py_TPFLAGS_HAVE_INDEX 0
+ #define Py_TPFLAGS_HAVE_NEWBUFFER 0
+#endif
+#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+ #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
+#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
+ #define CYTHON_PEP393_ENABLED 1
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
+ 0 : _PyUnicode_Ready((PyObject *)(op)))
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
+ #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
+ #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+#else
+ #define CYTHON_PEP393_ENABLED 0
+ #define __Pyx_PyUnicode_READY(op) (0)
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
+ #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
+ #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+ #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyFrozenSet_Size(s) PyObject_Size(s)
+#else
+ #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
+ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
+ #define __Pyx_PyFrozenSet_Size(s) PySet_Size(s)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
+#else
+ #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBaseString_Type PyUnicode_Type
+ #define PyStringObject PyUnicodeObject
+ #define PyString_Type PyUnicode_Type
+ #define PyString_Check PyUnicode_Check
+ #define PyString_CheckExact PyUnicode_CheckExact
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
+ #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
+#else
+ #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+ #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
+#endif
+#ifndef PySet_CheckExact
+ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
+#endif
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#if PY_MAJOR_VERSION >= 3
+ #define PyIntObject PyLongObject
+ #define PyInt_Type PyLong_Type
+ #define PyInt_Check(op) PyLong_Check(op)
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
+ #define PyInt_FromString PyLong_FromString
+ #define PyInt_FromUnicode PyLong_FromUnicode
+ #define PyInt_FromLong PyLong_FromLong
+ #define PyInt_FromSize_t PyLong_FromSize_t
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
+ #define PyInt_AsLong PyLong_AsLong
+ #define PyInt_AS_LONG PyLong_AS_LONG
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+ #define PyNumber_Int PyNumber_Long
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBoolObject PyLongObject
+#endif
+#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
+ #ifndef PyUnicode_InternFromString
+ #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
+ #endif
+#endif
+#if PY_VERSION_HEX < 0x030200A4
+ typedef long Py_hash_t;
+ #define __Pyx_PyInt_FromHash_t PyInt_FromLong
+ #define __Pyx_PyInt_AsHash_t PyInt_AsLong
+#else
+ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
+ #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+#else
+ #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
+#endif
+#ifndef CYTHON_INLINE
+ #if defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+#ifndef CYTHON_RESTRICT
+ #if defined(__GNUC__)
+ #define CYTHON_RESTRICT __restrict__
+ #elif defined(_MSC_VER) && _MSC_VER >= 1400
+ #define CYTHON_RESTRICT __restrict
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_RESTRICT restrict
+ #else
+ #define CYTHON_RESTRICT
+ #endif
+#endif
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
+#else
+static CYTHON_INLINE float __PYX_NAN() {
+ /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
+ a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
+ a quiet NaN. */
+ float value;
+ memset(&value, 0xFF, sizeof(value));
+ return value;
+}
+#endif
+#ifdef __cplusplus
+template<typename T>
+void __Pyx_call_destructor(T* x) {
+ x->~T();
+}
+#endif
+
+
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
+#else
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
+#endif
+
+#ifndef __PYX_EXTERN_C
+ #ifdef __cplusplus
+ #define __PYX_EXTERN_C extern "C"
+ #else
+ #define __PYX_EXTERN_C extern
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+#define _USE_MATH_DEFINES
+#endif
+#include <math.h>
+#define __PYX_HAVE__zmq__devices__monitoredqueue
+#define __PYX_HAVE_API__zmq__devices__monitoredqueue
+#include "zmq_compat.h"
+#include "zmq.h"
+#include "zmq_utils.h"
+#include "string.h"
+#include "pyversion_compat.h"
+#include "errno.h"
+#include "stdio.h"
+#include "pythread.h"
+#ifdef _OPENMP
+#include <omp.h>
+#endif /* _OPENMP */
+
+#ifdef PYREX_WITHOUT_ASSERTIONS
+#define CYTHON_WITHOUT_ASSERTIONS
+#endif
+
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
+ const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \
+ (sizeof(type) < sizeof(Py_ssize_t)) || \
+ (sizeof(type) > sizeof(Py_ssize_t) && \
+ likely(v < (type)PY_SSIZE_T_MAX || \
+ v == (type)PY_SSIZE_T_MAX) && \
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \
+ v == (type)PY_SSIZE_T_MIN))) || \
+ (sizeof(type) == sizeof(Py_ssize_t) && \
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \
+ v == (type)PY_SSIZE_T_MAX))) )
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
+#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
+#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
+#define __Pyx_PyBytes_FromString PyBytes_FromString
+#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#else
+ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
+#endif
+#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
+#if PY_MAJOR_VERSION < 3
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
+{
+ const Py_UNICODE *u_end = u;
+ while (*u_end++) ;
+ return (size_t)(u_end - u - 1);
+}
+#else
+#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
+#endif
+#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
+#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
+#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
+#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
+#else
+#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
+#endif
+#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ PyObject* ascii_chars_u = NULL;
+ PyObject* ascii_chars_b = NULL;
+ const char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ if (strcmp(default_encoding_c, "ascii") == 0) {
+ __Pyx_sys_getdefaultencoding_not_ascii = 0;
+ } else {
+ char ascii_chars[128];
+ int c;
+ for (c = 0; c < 128; c++) {
+ ascii_chars[c] = c;
+ }
+ __Pyx_sys_getdefaultencoding_not_ascii = 1;
+ ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
+ if (!ascii_chars_u) goto bad;
+ ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
+ if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
+ PyErr_Format(
+ PyExc_ValueError,
+ "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
+ default_encoding_c);
+ goto bad;
+ }
+ Py_DECREF(ascii_chars_u);
+ Py_DECREF(ascii_chars_b);
+ }
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ Py_XDECREF(ascii_chars_u);
+ Py_XDECREF(ascii_chars_b);
+ return -1;
+}
+#endif
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
+#else
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+static char* __PYX_DEFAULT_STRING_ENCODING;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
+ if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
+ strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ return -1;
+}
+#endif
+#endif
+
+
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+ #define likely(x) __builtin_expect(!!(x), 1)
+ #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
+ #define likely(x) (x)
+ #define unlikely(x) (x)
+#endif /* __GNUC__ */
+
+static PyObject *__pyx_m;
+static PyObject *__pyx_d;
+static PyObject *__pyx_b;
+static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
+static int __pyx_lineno;
+static int __pyx_clineno = 0;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+
+
+static const char *__pyx_f[] = {
+ "zmq/devices/monitoredqueue.pyx",
+ "zmq/backend/cython/checkrc.pxd",
+ "zmq/utils/buffers.pxd",
+ "zmq/backend/cython/context.pxd",
+ "zmq/backend/cython/socket.pxd",
+ "type.pxd",
+ "bool.pxd",
+ "complex.pxd",
+};
+
+/*--- Type declarations ---*/
+struct __pyx_obj_3zmq_7backend_6cython_7context_Context;
+struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket;
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_send;
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_recv;
+
+/* "zmq/backend/cython/socket.pxd":45
+ *
+ * # cpdef methods for direct-cython access:
+ * cpdef object send(self, object data, int flags=*, copy=*, track=*) # <<<<<<<<<<<<<<
+ * cpdef object recv(self, int flags=*, copy=*, track=*)
+ *
+ */
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_send {
+ int __pyx_n;
+ int flags;
+ PyObject *copy;
+ PyObject *track;
+};
+
+/* "zmq/backend/cython/socket.pxd":46
+ * # cpdef methods for direct-cython access:
+ * cpdef object send(self, object data, int flags=*, copy=*, track=*)
+ * cpdef object recv(self, int flags=*, copy=*, track=*) # <<<<<<<<<<<<<<
+ *
+ */
+struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_recv {
+ int __pyx_n;
+ int flags;
+ PyObject *copy;
+ PyObject *track;
+};
+
+/* "context.pxd":26
+ * #-----------------------------------------------------------------------------
+ *
+ * cdef class Context: # <<<<<<<<<<<<<<
+ *
+ * cdef object __weakref__ # enable weakref
+ */
+struct __pyx_obj_3zmq_7backend_6cython_7context_Context {
+ PyObject_HEAD
+ struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context *__pyx_vtab;
+ PyObject *__weakref__;
+ void *handle;
+ int _shadow;
+ void **_sockets;
+ size_t _n_sockets;
+ size_t _max_sockets;
+ int _pid;
+ int closed;
+};
+
+
+/* "zmq/backend/cython/socket.pxd":33
+ *
+ *
+ * cdef class Socket: # <<<<<<<<<<<<<<
+ *
+ * cdef object __weakref__ # enable weakref
+ */
+struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket {
+ PyObject_HEAD
+ struct __pyx_vtabstruct_3zmq_7backend_6cython_6socket_Socket *__pyx_vtab;
+ PyObject *__weakref__;
+ void *handle;
+ int _shadow;
+ struct __pyx_obj_3zmq_7backend_6cython_7context_Context *context;
+ int _closed;
+ int _pid;
+};
+
+
+
+/* "context.pxd":26
+ * #-----------------------------------------------------------------------------
+ *
+ * cdef class Context: # <<<<<<<<<<<<<<
+ *
+ * cdef object __weakref__ # enable weakref
+ */
+
+struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context {
+ int (*_term)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *);
+ void (*_add_socket)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *, void *);
+ void (*_remove_socket)(struct __pyx_obj_3zmq_7backend_6cython_7context_Context *, void *);
+};
+static struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context *__pyx_vtabptr_3zmq_7backend_6cython_7context_Context;
+
+
+/* "zmq/backend/cython/socket.pxd":33
+ *
+ *
+ * cdef class Socket: # <<<<<<<<<<<<<<
+ *
+ * cdef object __weakref__ # enable weakref
+ */
+
+struct __pyx_vtabstruct_3zmq_7backend_6cython_6socket_Socket {
+ PyObject *(*send)(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_send *__pyx_optional_args);
+ PyObject *(*recv)(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *, int __pyx_skip_dispatch, struct __pyx_opt_args_3zmq_7backend_6cython_6socket_6Socket_recv *__pyx_optional_args);
+};
+static struct __pyx_vtabstruct_3zmq_7backend_6cython_6socket_Socket *__pyx_vtabptr_3zmq_7backend_6cython_6socket_Socket;
+#ifndef CYTHON_REFNANNY
+ #define CYTHON_REFNANNY 0
+#endif
+#if CYTHON_REFNANNY
+ typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*SetupContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+ } __Pyx_RefNannyAPIStruct;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
+ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
+#ifdef WITH_THREAD
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ if (acquire_gil) { \
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ PyGILState_Release(__pyx_gilstate_save); \
+ } else { \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ }
+#else
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+#endif
+ #define __Pyx_RefNannyFinishContext() \
+ __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
+ #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
+ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
+#else
+ #define __Pyx_RefNannyDeclarations
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)
+ #define __Pyx_RefNannyFinishContext()
+ #define __Pyx_INCREF(r) Py_INCREF(r)
+ #define __Pyx_DECREF(r) Py_DECREF(r)
+ #define __Pyx_GOTREF(r)
+ #define __Pyx_GIVEREF(r)
+ #define __Pyx_XINCREF(r) Py_XINCREF(r)
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
+ #define __Pyx_XGOTREF(r)
+ #define __Pyx_XGIVEREF(r)
+#endif
+#define __Pyx_XDECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_XDECREF(tmp); \
+ } while (0)
+#define __Pyx_DECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_DECREF(tmp); \
+ } while (0)
+#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
+#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
+
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+ Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
+
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+ const char* function_name);
+
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+ const char *name, int exact);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_getattro))
+ return tp->tp_getattro(obj, attr_name);
+#if PY_MAJOR_VERSION < 3
+ if (likely(tp->tp_getattr))
+ return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
+#endif
+ return PyObject_GetAttr(obj, attr_name);
+}
+#else
+#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
+#endif
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
+#else
+#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
+
+static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
+static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);
+
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+
+static void* __Pyx_GetVtable(PyObject *dict);
+
+typedef struct {
+ int code_line;
+ PyCodeObject* code_object;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+ int count;
+ int max_count;
+ __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename);
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+#ifndef __PYX_FORCE_INIT_THREADS
+ #define __PYX_FORCE_INIT_THREADS 0
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+static int __Pyx_check_binary_version(void);
+
+#if !defined(__Pyx_PyIdentifier_FromString)
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
+#else
+ #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
+#endif
+#endif
+
+static PyObject *__Pyx_ImportModule(const char *name);
+
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+
+
+/* Module declarations from 'libzmq' */
+
+/* Module declarations from 'libc.string' */
+
+/* Module declarations from 'buffers' */
+static CYTHON_INLINE int __pyx_f_7buffers_memoryview_available(void); /*proto*/
+static CYTHON_INLINE int __pyx_f_7buffers_oldstyle_available(void); /*proto*/
+static CYTHON_INLINE int __pyx_f_7buffers_check_buffer(PyObject *); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_asbuffer(PyObject *, int, int, void **, Py_ssize_t *, Py_ssize_t *); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_asbuffer_r(PyObject *, void **, Py_ssize_t *); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer_3(void *, Py_ssize_t, int); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer_2(void *, Py_ssize_t, int); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer(void *, Py_ssize_t, int); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_viewfromobject(PyObject *, int); /*proto*/
+
+/* Module declarations from 'zmq.backend.cython.context' */
+static PyTypeObject *__pyx_ptype_3zmq_7backend_6cython_7context_Context = 0;
+
+/* Module declarations from 'zmq.backend.cython.socket' */
+static PyTypeObject *__pyx_ptype_3zmq_7backend_6cython_6socket_Socket = 0;
+
+/* Module declarations from 'libc.errno' */
+
+/* Module declarations from 'cpython.version' */
+
+/* Module declarations from 'cpython.ref' */
+
+/* Module declarations from 'cpython.exc' */
+
+/* Module declarations from 'cpython.module' */
+
+/* Module declarations from 'cpython.mem' */
+
+/* Module declarations from 'cpython.tuple' */
+
+/* Module declarations from 'cpython.list' */
+
+/* Module declarations from 'libc.stdio' */
+
+/* Module declarations from 'cpython.object' */
+
+/* Module declarations from 'cpython.sequence' */
+
+/* Module declarations from 'cpython.mapping' */
+
+/* Module declarations from 'cpython.iterator' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.type' */
+static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
+
+/* Module declarations from 'cpython.number' */
+
+/* Module declarations from 'cpython.int' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.bool' */
+static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
+
+/* Module declarations from 'cpython.long' */
+
+/* Module declarations from 'cpython.float' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.complex' */
+static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
+
+/* Module declarations from 'cpython.string' */
+
+/* Module declarations from 'cpython.unicode' */
+
+/* Module declarations from 'cpython.dict' */
+
+/* Module declarations from 'cpython.instance' */
+
+/* Module declarations from 'cpython.function' */
+
+/* Module declarations from 'cpython.method' */
+
+/* Module declarations from 'cpython.weakref' */
+
+/* Module declarations from 'cpython.getargs' */
+
+/* Module declarations from 'cpython.pythread' */
+
+/* Module declarations from 'cpython.pystate' */
+
+/* Module declarations from 'cpython.cobject' */
+
+/* Module declarations from 'cpython.oldbuffer' */
+
+/* Module declarations from 'cpython.set' */
+
+/* Module declarations from 'cpython.buffer' */
+
+/* Module declarations from 'cpython.bytes' */
+
+/* Module declarations from 'cpython.pycapsule' */
+
+/* Module declarations from 'cpython' */
+
+/* Module declarations from 'zmq.backend.cython.libzmq' */
+
+/* Module declarations from 'zmq.backend.cython.checkrc' */
+static CYTHON_INLINE int __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(int); /*proto*/
+
+/* Module declarations from 'zmq.devices.monitoredqueue' */
+static CYTHON_INLINE int __pyx_f_3zmq_7devices_14monitoredqueue__relay(void *, void *, void *, zmq_msg_t, zmq_msg_t, zmq_msg_t, int); /*proto*/
+static CYTHON_INLINE int __pyx_f_3zmq_7devices_14monitoredqueue_c_monitored_queue(void *, void *, void *, zmq_msg_t *, zmq_msg_t *, int); /*proto*/
+#define __Pyx_MODULE_NAME "zmq.devices.monitoredqueue"
+int __pyx_module_is_main_zmq__devices__monitoredqueue = 0;
+
+/* Implementation of 'zmq.devices.monitoredqueue' */
+static PyObject *__pyx_builtin_TypeError;
+static PyObject *__pyx_builtin_AttributeError;
+static PyObject *__pyx_builtin_NotImplementedError;
+static PyObject *__pyx_pf_3zmq_7devices_14monitoredqueue_monitored_queue(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_in_socket, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_out_socket, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_mon_socket, PyObject *__pyx_v_in_prefix, PyObject *__pyx_v_out_prefix); /* proto */
+static char __pyx_k_B[] = "B";
+static char __pyx_k__2[] = "";
+static char __pyx_k_in[] = "in";
+static char __pyx_k_rc[] = "rc";
+static char __pyx_k_all[] = "__all__";
+static char __pyx_k_ins[] = "ins";
+static char __pyx_k_out[] = "out";
+static char __pyx_k_zmq[] = "zmq";
+static char __pyx_k_char[] = "char";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_mons[] = "mons";
+static char __pyx_k_outs[] = "outs";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_type[] = "type";
+static char __pyx_k_Again[] = "Again";
+static char __pyx_k_ascii[] = "ascii";
+static char __pyx_k_dtype[] = "dtype";
+static char __pyx_k_msg_c[] = "msg_c";
+static char __pyx_k_ROUTER[] = "ROUTER";
+static char __pyx_k_decode[] = "decode";
+static char __pyx_k_import[] = "__import__";
+static char __pyx_k_in_msg[] = "in_msg";
+static char __pyx_k_out_msg[] = "out_msg";
+static char __pyx_k_ZMQError[] = "ZMQError";
+static char __pyx_k_itemsize[] = "itemsize";
+static char __pyx_k_swap_ids[] = "swap_ids";
+static char __pyx_k_typecode[] = "typecode";
+static char __pyx_k_TypeError[] = "TypeError";
+static char __pyx_k_in_prefix[] = "in_prefix";
+static char __pyx_k_in_socket[] = "in_socket";
+static char __pyx_k_msg_c_len[] = "msg_c_len";
+static char __pyx_k_zmq_error[] = "zmq.error";
+static char __pyx_k_mon_socket[] = "mon_socket";
+static char __pyx_k_out_prefix[] = "out_prefix";
+static char __pyx_k_out_socket[] = "out_socket";
+static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static char __pyx_k_AttributeError[] = "AttributeError";
+static char __pyx_k_monitored_queue[] = "monitored_queue";
+static char __pyx_k_ContextTerminated[] = "ContextTerminated";
+static char __pyx_k_NotImplementedError[] = "NotImplementedError";
+static char __pyx_k_zmq_devices_monitoredqueue[] = "zmq.devices.monitoredqueue";
+static char __pyx_k_Old_style_buffers_not_available[] = "Old style buffers not available.";
+static char __pyx_k_private_tmp_pyzmq_release_zmq_d[] = "/private/tmp/pyzmq-release/zmq/devices/monitoredqueue.pyx";
+static char __pyx_k_r_does_not_provide_a_buffer_int[] = "%r does not provide a buffer interface.";
+static char __pyx_k_MonitoredQueue_classes_and_funct[] = "MonitoredQueue classes and functions.\n\nAuthors\n-------\n* MinRK\n* Brian Granger\n";
+static PyObject *__pyx_n_s_Again;
+static PyObject *__pyx_n_s_AttributeError;
+static PyObject *__pyx_n_b_B;
+static PyObject *__pyx_n_s_ContextTerminated;
+static PyObject *__pyx_n_s_NotImplementedError;
+static PyObject *__pyx_kp_s_Old_style_buffers_not_available;
+static PyObject *__pyx_n_s_ROUTER;
+static PyObject *__pyx_n_s_TypeError;
+static PyObject *__pyx_n_s_ZMQError;
+static PyObject *__pyx_kp_s__2;
+static PyObject *__pyx_n_s_all;
+static PyObject *__pyx_n_s_ascii;
+static PyObject *__pyx_n_s_char;
+static PyObject *__pyx_n_s_decode;
+static PyObject *__pyx_n_s_dtype;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_b_in;
+static PyObject *__pyx_n_s_in_msg;
+static PyObject *__pyx_n_s_in_prefix;
+static PyObject *__pyx_n_s_in_socket;
+static PyObject *__pyx_n_s_ins;
+static PyObject *__pyx_n_s_itemsize;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_mon_socket;
+static PyObject *__pyx_n_s_monitored_queue;
+static PyObject *__pyx_n_s_mons;
+static PyObject *__pyx_n_s_msg_c;
+static PyObject *__pyx_n_s_msg_c_len;
+static PyObject *__pyx_n_b_out;
+static PyObject *__pyx_n_s_out_msg;
+static PyObject *__pyx_n_s_out_prefix;
+static PyObject *__pyx_n_s_out_socket;
+static PyObject *__pyx_n_s_outs;
+static PyObject *__pyx_kp_s_private_tmp_pyzmq_release_zmq_d;
+static PyObject *__pyx_n_s_pyx_vtable;
+static PyObject *__pyx_kp_s_r_does_not_provide_a_buffer_int;
+static PyObject *__pyx_n_s_rc;
+static PyObject *__pyx_n_s_swap_ids;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_n_s_type;
+static PyObject *__pyx_n_s_typecode;
+static PyObject *__pyx_n_s_zmq;
+static PyObject *__pyx_n_s_zmq_devices_monitoredqueue;
+static PyObject *__pyx_n_s_zmq_error;
+static PyObject *__pyx_tuple_;
+static PyObject *__pyx_tuple__3;
+static PyObject *__pyx_tuple__4;
+static PyObject *__pyx_codeobj__5;
+
+/* "zmq/devices/monitoredqueue.pyx":40
+ *
+ *
+ * def monitored_queue(Socket in_socket, Socket out_socket, Socket mon_socket, # <<<<<<<<<<<<<<
+ * bytes in_prefix=b'in', bytes out_prefix=b'out'):
+ * """monitored_queue(in_socket, out_socket, mon_socket,
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3zmq_7devices_14monitoredqueue_1monitored_queue(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_3zmq_7devices_14monitoredqueue_monitored_queue[] = "monitored_queue(in_socket, out_socket, mon_socket,\n in_prefix=b'in', out_prefix=b'out')\n \n Start a monitored queue device.\n \n A monitored queue is very similar to the zmq.proxy device (monitored queue came first).\n \n Differences from zmq.proxy:\n \n - monitored_queue supports both in and out being ROUTER sockets\n (via swapping IDENTITY prefixes).\n - monitor messages are prefixed, making in and out messages distinguishable.\n \n Parameters\n ----------\n in_socket : Socket\n One of the sockets to the Queue. Its messages will be prefixed with\n 'in'.\n out_socket : Socket\n One of the sockets to the Queue. Its messages will be prefixed with\n 'out'. The only difference between in/out socket is this prefix.\n mon_socket : Socket\n This socket sends out every message received by each of the others\n with an in/out prefix specifying which one it was.\n in_prefix : str\n Prefix added to broadcast messages from in_socket.\n out_prefix : str\n Prefix added to broadcast messages from out_socket.\n ";
+static PyMethodDef __pyx_mdef_3zmq_7devices_14monitoredqueue_1monitored_queue = {"monitored_queue", (PyCFunction)__pyx_pw_3zmq_7devices_14monitoredqueue_1monitored_queue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3zmq_7devices_14monitoredqueue_monitored_queue};
+static PyObject *__pyx_pw_3zmq_7devices_14monitoredqueue_1monitored_queue(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_in_socket = 0;
+ struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_out_socket = 0;
+ struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_mon_socket = 0;
+ PyObject *__pyx_v_in_prefix = 0;
+ PyObject *__pyx_v_out_prefix = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("monitored_queue (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_socket,&__pyx_n_s_out_socket,&__pyx_n_s_mon_socket,&__pyx_n_s_in_prefix,&__pyx_n_s_out_prefix,0};
+ PyObject* values[5] = {0,0,0,0,0};
+ values[3] = ((PyObject*)__pyx_n_b_in);
+ values[4] = ((PyObject*)__pyx_n_b_out);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_socket)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out_socket)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("monitored_queue", 0, 3, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mon_socket)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("monitored_queue", 0, 3, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 3:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_prefix);
+ if (value) { values[3] = value; kw_args--; }
+ }
+ case 4:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out_prefix);
+ if (value) { values[4] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "monitored_queue") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_in_socket = ((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)values[0]);
+ __pyx_v_out_socket = ((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)values[1]);
+ __pyx_v_mon_socket = ((struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *)values[2]);
+ __pyx_v_in_prefix = ((PyObject*)values[3]);
+ __pyx_v_out_prefix = ((PyObject*)values[4]);
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("monitored_queue", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("zmq.devices.monitoredqueue.monitored_queue", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in_socket), __pyx_ptype_3zmq_7backend_6cython_6socket_Socket, 1, "in_socket", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out_socket), __pyx_ptype_3zmq_7backend_6cython_6socket_Socket, 1, "out_socket", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mon_socket), __pyx_ptype_3zmq_7backend_6cython_6socket_Socket, 1, "mon_socket", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in_prefix), (&PyBytes_Type), 1, "in_prefix", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out_prefix), (&PyBytes_Type), 1, "out_prefix", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_r = __pyx_pf_3zmq_7devices_14monitoredqueue_monitored_queue(__pyx_self, __pyx_v_in_socket, __pyx_v_out_socket, __pyx_v_mon_socket, __pyx_v_in_prefix, __pyx_v_out_prefix);
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_3zmq_7devices_14monitoredqueue_monitored_queue(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_in_socket, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_out_socket, struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket *__pyx_v_mon_socket, PyObject *__pyx_v_in_prefix, PyObject *__pyx_v_out_prefix) {
+ void *__pyx_v_ins;
+ void *__pyx_v_outs;
+ void *__pyx_v_mons;
+ zmq_msg_t __pyx_v_in_msg;
+ zmq_msg_t __pyx_v_out_msg;
+ int __pyx_v_swap_ids;
+ char *__pyx_v_msg_c;
+ Py_ssize_t __pyx_v_msg_c_len;
+ int __pyx_v_rc;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ void *__pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_t_6;
+ int __pyx_t_7;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("monitored_queue", 0);
+
+ /* "zmq/devices/monitoredqueue.pyx":72
+ * """
+ *
+ * cdef void *ins=in_socket.handle # <<<<<<<<<<<<<<
+ * cdef void *outs=out_socket.handle
+ * cdef void *mons=mon_socket.handle
+ */
+ __pyx_t_1 = __pyx_v_in_socket->handle;
+ __pyx_v_ins = __pyx_t_1;
+
+ /* "zmq/devices/monitoredqueue.pyx":73
+ *
+ * cdef void *ins=in_socket.handle
+ * cdef void *outs=out_socket.handle # <<<<<<<<<<<<<<
+ * cdef void *mons=mon_socket.handle
+ * cdef zmq_msg_t in_msg
+ */
+ __pyx_t_1 = __pyx_v_out_socket->handle;
+ __pyx_v_outs = __pyx_t_1;
+
+ /* "zmq/devices/monitoredqueue.pyx":74
+ * cdef void *ins=in_socket.handle
+ * cdef void *outs=out_socket.handle
+ * cdef void *mons=mon_socket.handle # <<<<<<<<<<<<<<
+ * cdef zmq_msg_t in_msg
+ * cdef zmq_msg_t out_msg
+ */
+ __pyx_t_1 = __pyx_v_mon_socket->handle;
+ __pyx_v_mons = __pyx_t_1;
+
+ /* "zmq/devices/monitoredqueue.pyx":78
+ * cdef zmq_msg_t out_msg
+ * cdef bint swap_ids
+ * cdef char *msg_c = NULL # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t msg_c_len
+ * cdef int rc
+ */
+ __pyx_v_msg_c = NULL;
+
+ /* "zmq/devices/monitoredqueue.pyx":83
+ *
+ * # force swap_ids if both ROUTERs
+ * swap_ids = (in_socket.type == ROUTER and out_socket.type == ROUTER) # <<<<<<<<<<<<<<
+ *
+ * # build zmq_msg objects from str prefixes
+ */
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_in_socket), __pyx_n_s_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ROUTER); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (__pyx_t_6) {
+ } else {
+ __pyx_t_2 = __pyx_t_6;
+ goto __pyx_L3_bool_binop_done;
+ }
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out_socket), __pyx_n_s_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ROUTER); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = __pyx_t_6;
+ __pyx_L3_bool_binop_done:;
+ __pyx_v_swap_ids = __pyx_t_2;
+
+ /* "zmq/devices/monitoredqueue.pyx":86
+ *
+ * # build zmq_msg objects from str prefixes
+ * asbuffer_r(in_prefix, <void **>&msg_c, &msg_c_len) # <<<<<<<<<<<<<<
+ * rc = zmq_msg_init_size(&in_msg, msg_c_len)
+ * _check_rc(rc)
+ */
+ __pyx_t_3 = __pyx_f_7buffers_asbuffer_r(__pyx_v_in_prefix, ((void **)(&__pyx_v_msg_c)), (&__pyx_v_msg_c_len)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "zmq/devices/monitoredqueue.pyx":87
+ * # build zmq_msg objects from str prefixes
+ * asbuffer_r(in_prefix, <void **>&msg_c, &msg_c_len)
+ * rc = zmq_msg_init_size(&in_msg, msg_c_len) # <<<<<<<<<<<<<<
+ * _check_rc(rc)
+ *
+ */
+ __pyx_v_rc = zmq_msg_init_size((&__pyx_v_in_msg), __pyx_v_msg_c_len);
+
+ /* "zmq/devices/monitoredqueue.pyx":88
+ * asbuffer_r(in_prefix, <void **>&msg_c, &msg_c_len)
+ * rc = zmq_msg_init_size(&in_msg, msg_c_len)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ *
+ * memcpy(zmq_msg_data(&in_msg), msg_c, zmq_msg_size(&in_msg))
+ */
+ __pyx_t_7 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/devices/monitoredqueue.pyx":90
+ * _check_rc(rc)
+ *
+ * memcpy(zmq_msg_data(&in_msg), msg_c, zmq_msg_size(&in_msg)) # <<<<<<<<<<<<<<
+ *
+ * asbuffer_r(out_prefix, <void **>&msg_c, &msg_c_len)
+ */
+ memcpy(zmq_msg_data((&__pyx_v_in_msg)), __pyx_v_msg_c, zmq_msg_size((&__pyx_v_in_msg)));
+
+ /* "zmq/devices/monitoredqueue.pyx":92
+ * memcpy(zmq_msg_data(&in_msg), msg_c, zmq_msg_size(&in_msg))
+ *
+ * asbuffer_r(out_prefix, <void **>&msg_c, &msg_c_len) # <<<<<<<<<<<<<<
+ *
+ * rc = zmq_msg_init_size(&out_msg, msg_c_len)
+ */
+ __pyx_t_3 = __pyx_f_7buffers_asbuffer_r(__pyx_v_out_prefix, ((void **)(&__pyx_v_msg_c)), (&__pyx_v_msg_c_len)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "zmq/devices/monitoredqueue.pyx":94
+ * asbuffer_r(out_prefix, <void **>&msg_c, &msg_c_len)
+ *
+ * rc = zmq_msg_init_size(&out_msg, msg_c_len) # <<<<<<<<<<<<<<
+ * _check_rc(rc)
+ *
+ */
+ __pyx_v_rc = zmq_msg_init_size((&__pyx_v_out_msg), __pyx_v_msg_c_len);
+
+ /* "zmq/devices/monitoredqueue.pyx":95
+ *
+ * rc = zmq_msg_init_size(&out_msg, msg_c_len)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ *
+ * with nogil:
+ */
+ __pyx_t_7 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/devices/monitoredqueue.pyx":97
+ * _check_rc(rc)
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * memcpy(zmq_msg_data(&out_msg), msg_c, zmq_msg_size(&out_msg))
+ * rc = c_monitored_queue(ins, outs, mons, &in_msg, &out_msg, swap_ids)
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ #endif
+ /*try:*/ {
+
+ /* "zmq/devices/monitoredqueue.pyx":98
+ *
+ * with nogil:
+ * memcpy(zmq_msg_data(&out_msg), msg_c, zmq_msg_size(&out_msg)) # <<<<<<<<<<<<<<
+ * rc = c_monitored_queue(ins, outs, mons, &in_msg, &out_msg, swap_ids)
+ * _check_rc(rc)
+ */
+ memcpy(zmq_msg_data((&__pyx_v_out_msg)), __pyx_v_msg_c, zmq_msg_size((&__pyx_v_out_msg)));
+
+ /* "zmq/devices/monitoredqueue.pyx":99
+ * with nogil:
+ * memcpy(zmq_msg_data(&out_msg), msg_c, zmq_msg_size(&out_msg))
+ * rc = c_monitored_queue(ins, outs, mons, &in_msg, &out_msg, swap_ids) # <<<<<<<<<<<<<<
+ * _check_rc(rc)
+ * return rc
+ */
+ __pyx_v_rc = __pyx_f_3zmq_7devices_14monitoredqueue_c_monitored_queue(__pyx_v_ins, __pyx_v_outs, __pyx_v_mons, (&__pyx_v_in_msg), (&__pyx_v_out_msg), __pyx_v_swap_ids);
+ }
+
+ /* "zmq/devices/monitoredqueue.pyx":97
+ * _check_rc(rc)
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * memcpy(zmq_msg_data(&out_msg), msg_c, zmq_msg_size(&out_msg))
+ * rc = c_monitored_queue(ins, outs, mons, &in_msg, &out_msg, swap_ids)
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L7;
+ }
+ __pyx_L7:;
+ }
+ }
+
+ /* "zmq/devices/monitoredqueue.pyx":100
+ * memcpy(zmq_msg_data(&out_msg), msg_c, zmq_msg_size(&out_msg))
+ * rc = c_monitored_queue(ins, outs, mons, &in_msg, &out_msg, swap_ids)
+ * _check_rc(rc) # <<<<<<<<<<<<<<
+ * return rc
+ *
+ */
+ __pyx_t_7 = __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(__pyx_v_rc); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/devices/monitoredqueue.pyx":101
+ * rc = c_monitored_queue(ins, outs, mons, &in_msg, &out_msg, swap_ids)
+ * _check_rc(rc)
+ * return rc # <<<<<<<<<<<<<<
+ *
+ * __all__ = ['monitored_queue']
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "zmq/devices/monitoredqueue.pyx":40
+ *
+ *
+ * def monitored_queue(Socket in_socket, Socket out_socket, Socket mon_socket, # <<<<<<<<<<<<<<
+ * bytes in_prefix=b'in', bytes out_prefix=b'out'):
+ * """monitored_queue(in_socket, out_socket, mon_socket,
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("zmq.devices.monitoredqueue.monitored_queue", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/backend/cython/checkrc.pxd":5
+ * from libzmq cimport zmq_errno, ZMQ_ETERM
+ *
+ * cdef inline int _check_rc(int rc) except -1: # <<<<<<<<<<<<<<
+ * """internal utility for checking zmq return condition
+ *
+ */
+
+static CYTHON_INLINE int __pyx_f_3zmq_7backend_6cython_7checkrc__check_rc(int __pyx_v_rc) {
+ int __pyx_v_errno;
+ PyObject *__pyx_v_Again = NULL;
+ PyObject *__pyx_v_ContextTerminated = NULL;
+ PyObject *__pyx_v_ZMQError = NULL;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_check_rc", 0);
+
+ /* "zmq/backend/cython/checkrc.pxd":10
+ * and raising the appropriate Exception class
+ * """
+ * cdef int errno = zmq_errno() # <<<<<<<<<<<<<<
+ * PyErr_CheckSignals()
+ * if rc < 0:
+ */
+ __pyx_v_errno = zmq_errno();
+
+ /* "zmq/backend/cython/checkrc.pxd":11
+ * """
+ * cdef int errno = zmq_errno()
+ * PyErr_CheckSignals() # <<<<<<<<<<<<<<
+ * if rc < 0:
+ * if errno == EAGAIN:
+ */
+ __pyx_t_1 = PyErr_CheckSignals(); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "zmq/backend/cython/checkrc.pxd":12
+ * cdef int errno = zmq_errno()
+ * PyErr_CheckSignals()
+ * if rc < 0: # <<<<<<<<<<<<<<
+ * if errno == EAGAIN:
+ * from zmq.error import Again
+ */
+ __pyx_t_2 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "zmq/backend/cython/checkrc.pxd":16
+ * from zmq.error import Again
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM: # <<<<<<<<<<<<<<
+ * from zmq.error import ContextTerminated
+ * raise ContextTerminated(errno)
+ */
+ switch (__pyx_v_errno) {
+
+ /* "zmq/backend/cython/checkrc.pxd":13
+ * PyErr_CheckSignals()
+ * if rc < 0:
+ * if errno == EAGAIN: # <<<<<<<<<<<<<<
+ * from zmq.error import Again
+ * raise Again(errno)
+ */
+ case EAGAIN:
+
+ /* "zmq/backend/cython/checkrc.pxd":14
+ * if rc < 0:
+ * if errno == EAGAIN:
+ * from zmq.error import Again # <<<<<<<<<<<<<<
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM:
+ */
+ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_n_s_Again);
+ PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Again);
+ __Pyx_GIVEREF(__pyx_n_s_Again);
+ __pyx_t_4 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Again); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_Again = __pyx_t_3;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "zmq/backend/cython/checkrc.pxd":15
+ * if errno == EAGAIN:
+ * from zmq.error import Again
+ * raise Again(errno) # <<<<<<<<<<<<<<
+ * elif errno == ZMQ_ETERM:
+ * from zmq.error import ContextTerminated
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_Again);
+ __pyx_t_5 = __pyx_v_Again; __pyx_t_6 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ }
+ }
+ if (!__pyx_t_6) {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ } else {
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ break;
+
+ /* "zmq/backend/cython/checkrc.pxd":16
+ * from zmq.error import Again
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM: # <<<<<<<<<<<<<<
+ * from zmq.error import ContextTerminated
+ * raise ContextTerminated(errno)
+ */
+ case ETERM:
+
+ /* "zmq/backend/cython/checkrc.pxd":17
+ * raise Again(errno)
+ * elif errno == ZMQ_ETERM:
+ * from zmq.error import ContextTerminated # <<<<<<<<<<<<<<
+ * raise ContextTerminated(errno)
+ * else:
+ */
+ __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_n_s_ContextTerminated);
+ PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_ContextTerminated);
+ __Pyx_GIVEREF(__pyx_n_s_ContextTerminated);
+ __pyx_t_5 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_ContextTerminated); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_4);
+ __pyx_v_ContextTerminated = __pyx_t_4;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+ /* "zmq/backend/cython/checkrc.pxd":18
+ * elif errno == ZMQ_ETERM:
+ * from zmq.error import ContextTerminated
+ * raise ContextTerminated(errno) # <<<<<<<<<<<<<<
+ * else:
+ * from zmq.error import ZMQError
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_v_ContextTerminated);
+ __pyx_t_7 = __pyx_v_ContextTerminated; __pyx_t_3 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
+ if (likely(__pyx_t_3)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_7, function);
+ }
+ }
+ if (!__pyx_t_3) {
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ } else {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ break;
+ default:
+
+ /* "zmq/backend/cython/checkrc.pxd":20
+ * raise ContextTerminated(errno)
+ * else:
+ * from zmq.error import ZMQError # <<<<<<<<<<<<<<
+ * raise ZMQError(errno)
+ * # return -1
+ */
+ __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_n_s_ZMQError);
+ PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_ZMQError);
+ __Pyx_GIVEREF(__pyx_n_s_ZMQError);
+ __pyx_t_7 = __Pyx_Import(__pyx_n_s_zmq_error, __pyx_t_5, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_ZMQError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_5);
+ __pyx_v_ZMQError = __pyx_t_5;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "zmq/backend/cython/checkrc.pxd":21
+ * else:
+ * from zmq.error import ZMQError
+ * raise ZMQError(errno) # <<<<<<<<<<<<<<
+ * # return -1
+ * return 0
+ */
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_v_ZMQError);
+ __pyx_t_6 = __pyx_v_ZMQError; __pyx_t_4 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
+ }
+ }
+ if (!__pyx_t_4) {
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ } else {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_Raise(__pyx_t_7, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ break;
+ }
+ }
+
+ /* "zmq/backend/cython/checkrc.pxd":23
+ * raise ZMQError(errno)
+ * # return -1
+ * return 0 # <<<<<<<<<<<<<<
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "zmq/backend/cython/checkrc.pxd":5
+ * from libzmq cimport zmq_errno, ZMQ_ETERM
+ *
+ * cdef inline int _check_rc(int rc) except -1: # <<<<<<<<<<<<<<
+ * """internal utility for checking zmq return condition
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_AddTraceback("zmq.backend.cython.checkrc._check_rc", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_Again);
+ __Pyx_XDECREF(__pyx_v_ContextTerminated);
+ __Pyx_XDECREF(__pyx_v_ZMQError);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":88
+ *
+ *
+ * cdef inline int memoryview_available(): # <<<<<<<<<<<<<<
+ * return PY_MAJOR_VERSION >= 3 or (PY_MAJOR_VERSION >=2 and PY_MINOR_VERSION >= 7)
+ *
+ */
+
+static CYTHON_INLINE int __pyx_f_7buffers_memoryview_available(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ __Pyx_RefNannySetupContext("memoryview_available", 0);
+
+ /* "buffers.pxd":89
+ *
+ * cdef inline int memoryview_available():
+ * return PY_MAJOR_VERSION >= 3 or (PY_MAJOR_VERSION >=2 and PY_MINOR_VERSION >= 7) # <<<<<<<<<<<<<<
+ *
+ * cdef inline int oldstyle_available():
+ */
+ __pyx_t_2 = (PY_MAJOR_VERSION >= 3);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L3_bool_binop_done;
+ }
+ __pyx_t_2 = (PY_MAJOR_VERSION >= 2);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L3_bool_binop_done;
+ }
+ __pyx_t_2 = (PY_MINOR_VERSION >= 7);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L3_bool_binop_done:;
+ __pyx_r = __pyx_t_1;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":88
+ *
+ *
+ * cdef inline int memoryview_available(): # <<<<<<<<<<<<<<
+ * return PY_MAJOR_VERSION >= 3 or (PY_MAJOR_VERSION >=2 and PY_MINOR_VERSION >= 7)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":91
+ * return PY_MAJOR_VERSION >= 3 or (PY_MAJOR_VERSION >=2 and PY_MINOR_VERSION >= 7)
+ *
+ * cdef inline int oldstyle_available(): # <<<<<<<<<<<<<<
+ * return PY_MAJOR_VERSION < 3
+ *
+ */
+
+static CYTHON_INLINE int __pyx_f_7buffers_oldstyle_available(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("oldstyle_available", 0);
+
+ /* "buffers.pxd":92
+ *
+ * cdef inline int oldstyle_available():
+ * return PY_MAJOR_VERSION < 3 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = (PY_MAJOR_VERSION < 3);
+ goto __pyx_L0;
+
+ /* "buffers.pxd":91
+ * return PY_MAJOR_VERSION >= 3 or (PY_MAJOR_VERSION >=2 and PY_MINOR_VERSION >= 7)
+ *
+ * cdef inline int oldstyle_available(): # <<<<<<<<<<<<<<
+ * return PY_MAJOR_VERSION < 3
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":95
+ *
+ *
+ * cdef inline int check_buffer(object ob): # <<<<<<<<<<<<<<
+ * """Version independent check for whether an object is a buffer.
+ *
+ */
+
+static CYTHON_INLINE int __pyx_f_7buffers_check_buffer(PyObject *__pyx_v_ob) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ __Pyx_RefNannySetupContext("check_buffer", 0);
+
+ /* "buffers.pxd":107
+ * int : 0 if no buffer interface, 3 if newstyle buffer interface, 2 if oldstyle.
+ * """
+ * if PyObject_CheckBuffer(ob): # <<<<<<<<<<<<<<
+ * return 3
+ * if oldstyle_available():
+ */
+ __pyx_t_1 = (PyObject_CheckBuffer(__pyx_v_ob) != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":108
+ * """
+ * if PyObject_CheckBuffer(ob):
+ * return 3 # <<<<<<<<<<<<<<
+ * if oldstyle_available():
+ * return PyObject_CheckReadBuffer(ob) and 2
+ */
+ __pyx_r = 3;
+ goto __pyx_L0;
+ }
+
+ /* "buffers.pxd":109
+ * if PyObject_CheckBuffer(ob):
+ * return 3
+ * if oldstyle_available(): # <<<<<<<<<<<<<<
+ * return PyObject_CheckReadBuffer(ob) and 2
+ * return 0
+ */
+ __pyx_t_1 = (__pyx_f_7buffers_oldstyle_available() != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":110
+ * return 3
+ * if oldstyle_available():
+ * return PyObject_CheckReadBuffer(ob) and 2 # <<<<<<<<<<<<<<
+ * return 0
+ *
+ */
+ __pyx_t_3 = PyObject_CheckReadBuffer(__pyx_v_ob);
+ if (__pyx_t_3) {
+ } else {
+ __pyx_t_2 = __pyx_t_3;
+ goto __pyx_L5_bool_binop_done;
+ }
+ __pyx_t_2 = 2;
+ __pyx_L5_bool_binop_done:;
+ __pyx_r = __pyx_t_2;
+ goto __pyx_L0;
+ }
+
+ /* "buffers.pxd":111
+ * if oldstyle_available():
+ * return PyObject_CheckReadBuffer(ob) and 2
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":95
+ *
+ *
+ * cdef inline int check_buffer(object ob): # <<<<<<<<<<<<<<
+ * """Version independent check for whether an object is a buffer.
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":114
+ *
+ *
+ * cdef inline object asbuffer(object ob, int writable, int format, # <<<<<<<<<<<<<<
+ * void **base, Py_ssize_t *size,
+ * Py_ssize_t *itemsize):
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_asbuffer(PyObject *__pyx_v_ob, int __pyx_v_writable, int __pyx_v_format, void **__pyx_v_base, Py_ssize_t *__pyx_v_size, Py_ssize_t *__pyx_v_itemsize) {
+ void *__pyx_v_bptr;
+ Py_ssize_t __pyx_v_blen;
+ Py_ssize_t __pyx_v_bitemlen;
+ Py_buffer __pyx_v_view;
+ int __pyx_v_flags;
+ int __pyx_v_mode;
+ PyObject *__pyx_v_bfmt = NULL;
+ PyObject *__pyx_v_dtype = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ void *__pyx_t_5;
+ Py_ssize_t __pyx_t_6;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *__pyx_t_10 = NULL;
+ PyObject *__pyx_t_11 = NULL;
+ PyObject *__pyx_t_12 = NULL;
+ PyObject *__pyx_t_13 = NULL;
+ PyObject *__pyx_t_14 = NULL;
+ PyObject *__pyx_t_15 = NULL;
+ PyObject *__pyx_t_16 = NULL;
+ int __pyx_t_17;
+ int __pyx_t_18;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("asbuffer", 0);
+
+ /* "buffers.pxd":141
+ * """
+ *
+ * cdef void *bptr = NULL # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t blen = 0, bitemlen = 0
+ * cdef Py_buffer view
+ */
+ __pyx_v_bptr = NULL;
+
+ /* "buffers.pxd":142
+ *
+ * cdef void *bptr = NULL
+ * cdef Py_ssize_t blen = 0, bitemlen = 0 # <<<<<<<<<<<<<<
+ * cdef Py_buffer view
+ * cdef int flags = PyBUF_SIMPLE
+ */
+ __pyx_v_blen = 0;
+ __pyx_v_bitemlen = 0;
+
+ /* "buffers.pxd":144
+ * cdef Py_ssize_t blen = 0, bitemlen = 0
+ * cdef Py_buffer view
+ * cdef int flags = PyBUF_SIMPLE # <<<<<<<<<<<<<<
+ * cdef int mode = 0
+ *
+ */
+ __pyx_v_flags = PyBUF_SIMPLE;
+
+ /* "buffers.pxd":145
+ * cdef Py_buffer view
+ * cdef int flags = PyBUF_SIMPLE
+ * cdef int mode = 0 # <<<<<<<<<<<<<<
+ *
+ * bfmt = None
+ */
+ __pyx_v_mode = 0;
+
+ /* "buffers.pxd":147
+ * cdef int mode = 0
+ *
+ * bfmt = None # <<<<<<<<<<<<<<
+ *
+ * mode = check_buffer(ob)
+ */
+ __Pyx_INCREF(Py_None);
+ __pyx_v_bfmt = Py_None;
+
+ /* "buffers.pxd":149
+ * bfmt = None
+ *
+ * mode = check_buffer(ob) # <<<<<<<<<<<<<<
+ * if mode == 0:
+ * raise TypeError("%r does not provide a buffer interface."%ob)
+ */
+ __pyx_v_mode = __pyx_f_7buffers_check_buffer(__pyx_v_ob);
+
+ /* "buffers.pxd":150
+ *
+ * mode = check_buffer(ob)
+ * if mode == 0: # <<<<<<<<<<<<<<
+ * raise TypeError("%r does not provide a buffer interface."%ob)
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_mode == 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":151
+ * mode = check_buffer(ob)
+ * if mode == 0:
+ * raise TypeError("%r does not provide a buffer interface."%ob) # <<<<<<<<<<<<<<
+ *
+ * if mode == 3:
+ */
+ __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_r_does_not_provide_a_buffer_int, __pyx_v_ob); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "buffers.pxd":153
+ * raise TypeError("%r does not provide a buffer interface."%ob)
+ *
+ * if mode == 3: # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS
+ * if writable:
+ */
+ __pyx_t_1 = ((__pyx_v_mode == 3) != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":154
+ *
+ * if mode == 3:
+ * flags = PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
+ * if writable:
+ * flags |= PyBUF_WRITABLE
+ */
+ __pyx_v_flags = PyBUF_ANY_CONTIGUOUS;
+
+ /* "buffers.pxd":155
+ * if mode == 3:
+ * flags = PyBUF_ANY_CONTIGUOUS
+ * if writable: # <<<<<<<<<<<<<<
+ * flags |= PyBUF_WRITABLE
+ * if format:
+ */
+ __pyx_t_1 = (__pyx_v_writable != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":156
+ * flags = PyBUF_ANY_CONTIGUOUS
+ * if writable:
+ * flags |= PyBUF_WRITABLE # <<<<<<<<<<<<<<
+ * if format:
+ * flags |= PyBUF_FORMAT
+ */
+ __pyx_v_flags = (__pyx_v_flags | PyBUF_WRITABLE);
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+
+ /* "buffers.pxd":157
+ * if writable:
+ * flags |= PyBUF_WRITABLE
+ * if format: # <<<<<<<<<<<<<<
+ * flags |= PyBUF_FORMAT
+ * PyObject_GetBuffer(ob, &view, flags)
+ */
+ __pyx_t_1 = (__pyx_v_format != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":158
+ * flags |= PyBUF_WRITABLE
+ * if format:
+ * flags |= PyBUF_FORMAT # <<<<<<<<<<<<<<
+ * PyObject_GetBuffer(ob, &view, flags)
+ * bptr = view.buf
+ */
+ __pyx_v_flags = (__pyx_v_flags | PyBUF_FORMAT);
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+
+ /* "buffers.pxd":159
+ * if format:
+ * flags |= PyBUF_FORMAT
+ * PyObject_GetBuffer(ob, &view, flags) # <<<<<<<<<<<<<<
+ * bptr = view.buf
+ * blen = view.len
+ */
+ __pyx_t_4 = PyObject_GetBuffer(__pyx_v_ob, (&__pyx_v_view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "buffers.pxd":160
+ * flags |= PyBUF_FORMAT
+ * PyObject_GetBuffer(ob, &view, flags)
+ * bptr = view.buf # <<<<<<<<<<<<<<
+ * blen = view.len
+ * if format:
+ */
+ __pyx_t_5 = __pyx_v_view.buf;
+ __pyx_v_bptr = __pyx_t_5;
+
+ /* "buffers.pxd":161
+ * PyObject_GetBuffer(ob, &view, flags)
+ * bptr = view.buf
+ * blen = view.len # <<<<<<<<<<<<<<
+ * if format:
+ * if view.format != NULL:
+ */
+ __pyx_t_6 = __pyx_v_view.len;
+ __pyx_v_blen = __pyx_t_6;
+
+ /* "buffers.pxd":162
+ * bptr = view.buf
+ * blen = view.len
+ * if format: # <<<<<<<<<<<<<<
+ * if view.format != NULL:
+ * bfmt = view.format
+ */
+ __pyx_t_1 = (__pyx_v_format != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":163
+ * blen = view.len
+ * if format:
+ * if view.format != NULL: # <<<<<<<<<<<<<<
+ * bfmt = view.format
+ * bitemlen = view.itemsize
+ */
+ __pyx_t_1 = ((__pyx_v_view.format != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":164
+ * if format:
+ * if view.format != NULL:
+ * bfmt = view.format # <<<<<<<<<<<<<<
+ * bitemlen = view.itemsize
+ * PyBuffer_Release(&view)
+ */
+ __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_view.format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF_SET(__pyx_v_bfmt, __pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "buffers.pxd":165
+ * if view.format != NULL:
+ * bfmt = view.format
+ * bitemlen = view.itemsize # <<<<<<<<<<<<<<
+ * PyBuffer_Release(&view)
+ * else: # oldstyle
+ */
+ __pyx_t_6 = __pyx_v_view.itemsize;
+ __pyx_v_bitemlen = __pyx_t_6;
+ goto __pyx_L8;
+ }
+ __pyx_L8:;
+ goto __pyx_L7;
+ }
+ __pyx_L7:;
+
+ /* "buffers.pxd":166
+ * bfmt = view.format
+ * bitemlen = view.itemsize
+ * PyBuffer_Release(&view) # <<<<<<<<<<<<<<
+ * else: # oldstyle
+ * if writable:
+ */
+ PyBuffer_Release((&__pyx_v_view));
+ goto __pyx_L4;
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":168
+ * PyBuffer_Release(&view)
+ * else: # oldstyle
+ * if writable: # <<<<<<<<<<<<<<
+ * PyObject_AsWriteBuffer(ob, &bptr, &blen)
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_writable != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":169
+ * else: # oldstyle
+ * if writable:
+ * PyObject_AsWriteBuffer(ob, &bptr, &blen) # <<<<<<<<<<<<<<
+ * else:
+ * PyObject_AsReadBuffer(ob, <const_void **>&bptr, &blen)
+ */
+ __pyx_t_4 = PyObject_AsWriteBuffer(__pyx_v_ob, (&__pyx_v_bptr), (&__pyx_v_blen)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L9;
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":171
+ * PyObject_AsWriteBuffer(ob, &bptr, &blen)
+ * else:
+ * PyObject_AsReadBuffer(ob, <const_void **>&bptr, &blen) # <<<<<<<<<<<<<<
+ * if format:
+ * try: # numpy.ndarray
+ */
+ __pyx_t_4 = PyObject_AsReadBuffer(__pyx_v_ob, ((const void **)(&__pyx_v_bptr)), (&__pyx_v_blen)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_L9:;
+
+ /* "buffers.pxd":172
+ * else:
+ * PyObject_AsReadBuffer(ob, <const_void **>&bptr, &blen)
+ * if format: # <<<<<<<<<<<<<<
+ * try: # numpy.ndarray
+ * dtype = ob.dtype
+ */
+ __pyx_t_1 = (__pyx_v_format != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":173
+ * PyObject_AsReadBuffer(ob, <const_void **>&bptr, &blen)
+ * if format:
+ * try: # numpy.ndarray # <<<<<<<<<<<<<<
+ * dtype = ob.dtype
+ * bfmt = dtype.char
+ */
+ {
+ __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
+ __Pyx_XGOTREF(__pyx_t_7);
+ __Pyx_XGOTREF(__pyx_t_8);
+ __Pyx_XGOTREF(__pyx_t_9);
+ /*try:*/ {
+
+ /* "buffers.pxd":174
+ * if format:
+ * try: # numpy.ndarray
+ * dtype = ob.dtype # <<<<<<<<<<<<<<
+ * bfmt = dtype.char
+ * bitemlen = dtype.itemsize
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ob, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_v_dtype = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "buffers.pxd":175
+ * try: # numpy.ndarray
+ * dtype = ob.dtype
+ * bfmt = dtype.char # <<<<<<<<<<<<<<
+ * bitemlen = dtype.itemsize
+ * except AttributeError:
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_char); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF_SET(__pyx_v_bfmt, __pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "buffers.pxd":176
+ * dtype = ob.dtype
+ * bfmt = dtype.char
+ * bitemlen = dtype.itemsize # <<<<<<<<<<<<<<
+ * except AttributeError:
+ * try: # array.array
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_bitemlen = __pyx_t_6;
+ }
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+ goto __pyx_L18_try_end;
+ __pyx_L11_error:;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "buffers.pxd":177
+ * bfmt = dtype.char
+ * bitemlen = dtype.itemsize
+ * except AttributeError: # <<<<<<<<<<<<<<
+ * try: # array.array
+ * bfmt = ob.typecode
+ */
+ __pyx_t_4 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("buffers.asbuffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GOTREF(__pyx_t_10);
+
+ /* "buffers.pxd":178
+ * bitemlen = dtype.itemsize
+ * except AttributeError:
+ * try: # array.array # <<<<<<<<<<<<<<
+ * bfmt = ob.typecode
+ * bitemlen = ob.itemsize
+ */
+ {
+ __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
+ __Pyx_XGOTREF(__pyx_t_11);
+ __Pyx_XGOTREF(__pyx_t_12);
+ __Pyx_XGOTREF(__pyx_t_13);
+ /*try:*/ {
+
+ /* "buffers.pxd":179
+ * except AttributeError:
+ * try: # array.array
+ * bfmt = ob.typecode # <<<<<<<<<<<<<<
+ * bitemlen = ob.itemsize
+ * except AttributeError:
+ */
+ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_ob, __pyx_n_s_typecode); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __Pyx_DECREF_SET(__pyx_v_bfmt, __pyx_t_14);
+ __pyx_t_14 = 0;
+
+ /* "buffers.pxd":180
+ * try: # array.array
+ * bfmt = ob.typecode
+ * bitemlen = ob.itemsize # <<<<<<<<<<<<<<
+ * except AttributeError:
+ * if isinstance(ob, bytes):
+ */
+ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_ob, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __pyx_v_bitemlen = __pyx_t_6;
+ }
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+ goto __pyx_L28_try_end;
+ __pyx_L21_error:;
+ __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+
+ /* "buffers.pxd":181
+ * bfmt = ob.typecode
+ * bitemlen = ob.itemsize
+ * except AttributeError: # <<<<<<<<<<<<<<
+ * if isinstance(ob, bytes):
+ * bfmt = b"B"
+ */
+ __pyx_t_4 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("buffers.asbuffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GOTREF(__pyx_t_16);
+
+ /* "buffers.pxd":182
+ * bitemlen = ob.itemsize
+ * except AttributeError:
+ * if isinstance(ob, bytes): # <<<<<<<<<<<<<<
+ * bfmt = b"B"
+ * bitemlen = 1
+ */
+ __pyx_t_1 = PyBytes_Check(__pyx_v_ob);
+ __pyx_t_17 = (__pyx_t_1 != 0);
+ if (__pyx_t_17) {
+
+ /* "buffers.pxd":183
+ * except AttributeError:
+ * if isinstance(ob, bytes):
+ * bfmt = b"B" # <<<<<<<<<<<<<<
+ * bitemlen = 1
+ * else:
+ */
+ __Pyx_INCREF(__pyx_n_b_B);
+ __Pyx_DECREF_SET(__pyx_v_bfmt, __pyx_n_b_B);
+
+ /* "buffers.pxd":184
+ * if isinstance(ob, bytes):
+ * bfmt = b"B"
+ * bitemlen = 1 # <<<<<<<<<<<<<<
+ * else:
+ * # nothing found
+ */
+ __pyx_v_bitemlen = 1;
+ goto __pyx_L31;
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":187
+ * else:
+ * # nothing found
+ * bfmt = None # <<<<<<<<<<<<<<
+ * bitemlen = 0
+ * if base: base[0] = <void *>bptr
+ */
+ __Pyx_INCREF(Py_None);
+ __Pyx_DECREF_SET(__pyx_v_bfmt, Py_None);
+
+ /* "buffers.pxd":188
+ * # nothing found
+ * bfmt = None
+ * bitemlen = 0 # <<<<<<<<<<<<<<
+ * if base: base[0] = <void *>bptr
+ * if size: size[0] = <Py_ssize_t>blen
+ */
+ __pyx_v_bitemlen = 0;
+ }
+ __pyx_L31:;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ goto __pyx_L22_exception_handled;
+ }
+ goto __pyx_L23_except_error;
+ __pyx_L23_except_error:;
+ __Pyx_XGIVEREF(__pyx_t_11);
+ __Pyx_XGIVEREF(__pyx_t_12);
+ __Pyx_XGIVEREF(__pyx_t_13);
+ __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
+ goto __pyx_L13_except_error;
+ __pyx_L22_exception_handled:;
+ __Pyx_XGIVEREF(__pyx_t_11);
+ __Pyx_XGIVEREF(__pyx_t_12);
+ __Pyx_XGIVEREF(__pyx_t_13);
+ __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
+ __pyx_L28_try_end:;
+ }
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ goto __pyx_L12_exception_handled;
+ }
+ goto __pyx_L13_except_error;
+ __pyx_L13_except_error:;
+ __Pyx_XGIVEREF(__pyx_t_7);
+ __Pyx_XGIVEREF(__pyx_t_8);
+ __Pyx_XGIVEREF(__pyx_t_9);
+ __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
+ goto __pyx_L1_error;
+ __pyx_L12_exception_handled:;
+ __Pyx_XGIVEREF(__pyx_t_7);
+ __Pyx_XGIVEREF(__pyx_t_8);
+ __Pyx_XGIVEREF(__pyx_t_9);
+ __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
+ __pyx_L18_try_end:;
+ }
+ goto __pyx_L10;
+ }
+ __pyx_L10:;
+ }
+ __pyx_L4:;
+
+ /* "buffers.pxd":189
+ * bfmt = None
+ * bitemlen = 0
+ * if base: base[0] = <void *>bptr # <<<<<<<<<<<<<<
+ * if size: size[0] = <Py_ssize_t>blen
+ * if itemsize: itemsize[0] = <Py_ssize_t>bitemlen
+ */
+ __pyx_t_17 = (__pyx_v_base != 0);
+ if (__pyx_t_17) {
+ (__pyx_v_base[0]) = ((void *)__pyx_v_bptr);
+ goto __pyx_L32;
+ }
+ __pyx_L32:;
+
+ /* "buffers.pxd":190
+ * bitemlen = 0
+ * if base: base[0] = <void *>bptr
+ * if size: size[0] = <Py_ssize_t>blen # <<<<<<<<<<<<<<
+ * if itemsize: itemsize[0] = <Py_ssize_t>bitemlen
+ *
+ */
+ __pyx_t_17 = (__pyx_v_size != 0);
+ if (__pyx_t_17) {
+ (__pyx_v_size[0]) = ((Py_ssize_t)__pyx_v_blen);
+ goto __pyx_L33;
+ }
+ __pyx_L33:;
+
+ /* "buffers.pxd":191
+ * if base: base[0] = <void *>bptr
+ * if size: size[0] = <Py_ssize_t>blen
+ * if itemsize: itemsize[0] = <Py_ssize_t>bitemlen # <<<<<<<<<<<<<<
+ *
+ * if PY_MAJOR_VERSION >= 3 and bfmt is not None:
+ */
+ __pyx_t_17 = (__pyx_v_itemsize != 0);
+ if (__pyx_t_17) {
+ (__pyx_v_itemsize[0]) = ((Py_ssize_t)__pyx_v_bitemlen);
+ goto __pyx_L34;
+ }
+ __pyx_L34:;
+
+ /* "buffers.pxd":193
+ * if itemsize: itemsize[0] = <Py_ssize_t>bitemlen
+ *
+ * if PY_MAJOR_VERSION >= 3 and bfmt is not None: # <<<<<<<<<<<<<<
+ * return bfmt.decode('ascii')
+ * return bfmt
+ */
+ __pyx_t_1 = ((PY_MAJOR_VERSION >= 3) != 0);
+ if (__pyx_t_1) {
+ } else {
+ __pyx_t_17 = __pyx_t_1;
+ goto __pyx_L36_bool_binop_done;
+ }
+ __pyx_t_1 = (__pyx_v_bfmt != Py_None);
+ __pyx_t_18 = (__pyx_t_1 != 0);
+ __pyx_t_17 = __pyx_t_18;
+ __pyx_L36_bool_binop_done:;
+ if (__pyx_t_17) {
+
+ /* "buffers.pxd":194
+ *
+ * if PY_MAJOR_VERSION >= 3 and bfmt is not None:
+ * return bfmt.decode('ascii') # <<<<<<<<<<<<<<
+ * return bfmt
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_bfmt, __pyx_n_s_decode); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "buffers.pxd":195
+ * if PY_MAJOR_VERSION >= 3 and bfmt is not None:
+ * return bfmt.decode('ascii')
+ * return bfmt # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_bfmt);
+ __pyx_r = __pyx_v_bfmt;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":114
+ *
+ *
+ * cdef inline object asbuffer(object ob, int writable, int format, # <<<<<<<<<<<<<<
+ * void **base, Py_ssize_t *size,
+ * Py_ssize_t *itemsize):
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_10);
+ __Pyx_XDECREF(__pyx_t_14);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_XDECREF(__pyx_t_16);
+ __Pyx_AddTraceback("buffers.asbuffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_bfmt);
+ __Pyx_XDECREF(__pyx_v_dtype);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":198
+ *
+ *
+ * cdef inline object asbuffer_r(object ob, void **base, Py_ssize_t *size): # <<<<<<<<<<<<<<
+ * """Wrapper for standard calls to asbuffer with a readonly buffer."""
+ * asbuffer(ob, 0, 0, base, size, NULL)
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_asbuffer_r(PyObject *__pyx_v_ob, void **__pyx_v_base, Py_ssize_t *__pyx_v_size) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("asbuffer_r", 0);
+
+ /* "buffers.pxd":200
+ * cdef inline object asbuffer_r(object ob, void **base, Py_ssize_t *size):
+ * """Wrapper for standard calls to asbuffer with a readonly buffer."""
+ * asbuffer(ob, 0, 0, base, size, NULL) # <<<<<<<<<<<<<<
+ * return ob
+ *
+ */
+ __pyx_t_1 = __pyx_f_7buffers_asbuffer(__pyx_v_ob, 0, 0, __pyx_v_base, __pyx_v_size, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "buffers.pxd":201
+ * """Wrapper for standard calls to asbuffer with a readonly buffer."""
+ * asbuffer(ob, 0, 0, base, size, NULL)
+ * return ob # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_ob);
+ __pyx_r = __pyx_v_ob;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":198
+ *
+ *
+ * cdef inline object asbuffer_r(object ob, void **base, Py_ssize_t *size): # <<<<<<<<<<<<<<
+ * """Wrapper for standard calls to asbuffer with a readonly buffer."""
+ * asbuffer(ob, 0, 0, base, size, NULL)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("buffers.asbuffer_r", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":204
+ *
+ *
+ * cdef inline object asbuffer_w(object ob, void **base, Py_ssize_t *size): # <<<<<<<<<<<<<<
+ * """Wrapper for standard calls to asbuffer with a writable buffer."""
+ * asbuffer(ob, 1, 0, base, size, NULL)
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_asbuffer_w(PyObject *__pyx_v_ob, void **__pyx_v_base, Py_ssize_t *__pyx_v_size) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("asbuffer_w", 0);
+
+ /* "buffers.pxd":206
+ * cdef inline object asbuffer_w(object ob, void **base, Py_ssize_t *size):
+ * """Wrapper for standard calls to asbuffer with a writable buffer."""
+ * asbuffer(ob, 1, 0, base, size, NULL) # <<<<<<<<<<<<<<
+ * return ob
+ *
+ */
+ __pyx_t_1 = __pyx_f_7buffers_asbuffer(__pyx_v_ob, 1, 0, __pyx_v_base, __pyx_v_size, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "buffers.pxd":207
+ * """Wrapper for standard calls to asbuffer with a writable buffer."""
+ * asbuffer(ob, 1, 0, base, size, NULL)
+ * return ob # <<<<<<<<<<<<<<
+ *
+ * #------------------------------------------------------------------------------
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_ob);
+ __pyx_r = __pyx_v_ob;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":204
+ *
+ *
+ * cdef inline object asbuffer_w(object ob, void **base, Py_ssize_t *size): # <<<<<<<<<<<<<<
+ * """Wrapper for standard calls to asbuffer with a writable buffer."""
+ * asbuffer(ob, 1, 0, base, size, NULL)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("buffers.asbuffer_w", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":214
+ *
+ *
+ * cdef inline object frombuffer_3(void *ptr, Py_ssize_t s, int readonly): # <<<<<<<<<<<<<<
+ * """Python 3 version of frombuffer.
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer_3(void *__pyx_v_ptr, Py_ssize_t __pyx_v_s, int __pyx_v_readonly) {
+ Py_buffer __pyx_v_pybuf;
+ Py_ssize_t *__pyx_v_shape;
+ PyObject *__pyx_v_astr = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1[1];
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("frombuffer_3", 0);
+
+ /* "buffers.pxd":221
+ * """
+ * cdef Py_buffer pybuf
+ * cdef Py_ssize_t *shape = [s] # <<<<<<<<<<<<<<
+ * cdef str astr=""
+ * PyBuffer_FillInfo(&pybuf, astr, ptr, s, readonly, PyBUF_SIMPLE)
+ */
+ __pyx_t_1[0] = __pyx_v_s;
+ __pyx_v_shape = __pyx_t_1;
+
+ /* "buffers.pxd":222
+ * cdef Py_buffer pybuf
+ * cdef Py_ssize_t *shape = [s]
+ * cdef str astr="" # <<<<<<<<<<<<<<
+ * PyBuffer_FillInfo(&pybuf, astr, ptr, s, readonly, PyBUF_SIMPLE)
+ * pybuf.format = "B"
+ */
+ __Pyx_INCREF(__pyx_kp_s__2);
+ __pyx_v_astr = __pyx_kp_s__2;
+
+ /* "buffers.pxd":223
+ * cdef Py_ssize_t *shape = [s]
+ * cdef str astr=""
+ * PyBuffer_FillInfo(&pybuf, astr, ptr, s, readonly, PyBUF_SIMPLE) # <<<<<<<<<<<<<<
+ * pybuf.format = "B"
+ * pybuf.shape = shape
+ */
+ __pyx_t_2 = PyBuffer_FillInfo((&__pyx_v_pybuf), __pyx_v_astr, __pyx_v_ptr, __pyx_v_s, __pyx_v_readonly, PyBUF_SIMPLE); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "buffers.pxd":224
+ * cdef str astr=""
+ * PyBuffer_FillInfo(&pybuf, astr, ptr, s, readonly, PyBUF_SIMPLE)
+ * pybuf.format = "B" # <<<<<<<<<<<<<<
+ * pybuf.shape = shape
+ * return PyMemoryView_FromBuffer(&pybuf)
+ */
+ __pyx_v_pybuf.format = __pyx_k_B;
+
+ /* "buffers.pxd":225
+ * PyBuffer_FillInfo(&pybuf, astr, ptr, s, readonly, PyBUF_SIMPLE)
+ * pybuf.format = "B"
+ * pybuf.shape = shape # <<<<<<<<<<<<<<
+ * return PyMemoryView_FromBuffer(&pybuf)
+ *
+ */
+ __pyx_v_pybuf.shape = __pyx_v_shape;
+
+ /* "buffers.pxd":226
+ * pybuf.format = "B"
+ * pybuf.shape = shape
+ * return PyMemoryView_FromBuffer(&pybuf) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = PyMemoryView_FromBuffer((&__pyx_v_pybuf)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":214
+ *
+ *
+ * cdef inline object frombuffer_3(void *ptr, Py_ssize_t s, int readonly): # <<<<<<<<<<<<<<
+ * """Python 3 version of frombuffer.
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("buffers.frombuffer_3", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_astr);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":229
+ *
+ *
+ * cdef inline object frombuffer_2(void *ptr, Py_ssize_t s, int readonly): # <<<<<<<<<<<<<<
+ * """Python 2 version of frombuffer.
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer_2(void *__pyx_v_ptr, Py_ssize_t __pyx_v_s, int __pyx_v_readonly) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("frombuffer_2", 0);
+
+ /* "buffers.pxd":235
+ * """
+ *
+ * if oldstyle_available(): # <<<<<<<<<<<<<<
+ * if readonly:
+ * return PyBuffer_FromMemory(ptr, s)
+ */
+ __pyx_t_1 = (__pyx_f_7buffers_oldstyle_available() != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":236
+ *
+ * if oldstyle_available():
+ * if readonly: # <<<<<<<<<<<<<<
+ * return PyBuffer_FromMemory(ptr, s)
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_readonly != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":237
+ * if oldstyle_available():
+ * if readonly:
+ * return PyBuffer_FromMemory(ptr, s) # <<<<<<<<<<<<<<
+ * else:
+ * return PyBuffer_FromReadWriteMemory(ptr, s)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyBuffer_FromMemory(__pyx_v_ptr, __pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":239
+ * return PyBuffer_FromMemory(ptr, s)
+ * else:
+ * return PyBuffer_FromReadWriteMemory(ptr, s) # <<<<<<<<<<<<<<
+ * else:
+ * raise NotImplementedError("Old style buffers not available.")
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyBuffer_FromReadWriteMemory(__pyx_v_ptr, __pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":241
+ * return PyBuffer_FromReadWriteMemory(ptr, s)
+ * else:
+ * raise NotImplementedError("Old style buffers not available.") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "buffers.pxd":229
+ *
+ *
+ * cdef inline object frombuffer_2(void *ptr, Py_ssize_t s, int readonly): # <<<<<<<<<<<<<<
+ * """Python 2 version of frombuffer.
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("buffers.frombuffer_2", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":244
+ *
+ *
+ * cdef inline object frombuffer(void *ptr, Py_ssize_t s, int readonly): # <<<<<<<<<<<<<<
+ * """Create a Python Buffer/View of a C array.
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer(void *__pyx_v_ptr, Py_ssize_t __pyx_v_s, int __pyx_v_readonly) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("frombuffer", 0);
+
+ /* "buffers.pxd":261
+ * """
+ * # oldstyle first priority for now
+ * if oldstyle_available(): # <<<<<<<<<<<<<<
+ * return frombuffer_2(ptr, s, readonly)
+ * else:
+ */
+ __pyx_t_1 = (__pyx_f_7buffers_oldstyle_available() != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":262
+ * # oldstyle first priority for now
+ * if oldstyle_available():
+ * return frombuffer_2(ptr, s, readonly) # <<<<<<<<<<<<<<
+ * else:
+ * return frombuffer_3(ptr, s, readonly)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_f_7buffers_frombuffer_2(__pyx_v_ptr, __pyx_v_s, __pyx_v_readonly); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":264
+ * return frombuffer_2(ptr, s, readonly)
+ * else:
+ * return frombuffer_3(ptr, s, readonly) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_f_7buffers_frombuffer_3(__pyx_v_ptr, __pyx_v_s, __pyx_v_readonly); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "buffers.pxd":244
+ *
+ *
+ * cdef inline object frombuffer(void *ptr, Py_ssize_t s, int readonly): # <<<<<<<<<<<<<<
+ * """Create a Python Buffer/View of a C array.
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("buffers.frombuffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":267
+ *
+ *
+ * cdef inline object frombuffer_r(void *ptr, Py_ssize_t s): # <<<<<<<<<<<<<<
+ * """Wrapper for readonly view frombuffer."""
+ * return frombuffer(ptr, s, 1)
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer_r(void *__pyx_v_ptr, Py_ssize_t __pyx_v_s) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("frombuffer_r", 0);
+
+ /* "buffers.pxd":269
+ * cdef inline object frombuffer_r(void *ptr, Py_ssize_t s):
+ * """Wrapper for readonly view frombuffer."""
+ * return frombuffer(ptr, s, 1) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_f_7buffers_frombuffer(__pyx_v_ptr, __pyx_v_s, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":267
+ *
+ *
+ * cdef inline object frombuffer_r(void *ptr, Py_ssize_t s): # <<<<<<<<<<<<<<
+ * """Wrapper for readonly view frombuffer."""
+ * return frombuffer(ptr, s, 1)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("buffers.frombuffer_r", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":272
+ *
+ *
+ * cdef inline object frombuffer_w(void *ptr, Py_ssize_t s): # <<<<<<<<<<<<<<
+ * """Wrapper for writable view frombuffer."""
+ * return frombuffer(ptr, s, 0)
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer_w(void *__pyx_v_ptr, Py_ssize_t __pyx_v_s) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("frombuffer_w", 0);
+
+ /* "buffers.pxd":274
+ * cdef inline object frombuffer_w(void *ptr, Py_ssize_t s):
+ * """Wrapper for writable view frombuffer."""
+ * return frombuffer(ptr, s, 0) # <<<<<<<<<<<<<<
+ *
+ * #------------------------------------------------------------------------------
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_f_7buffers_frombuffer(__pyx_v_ptr, __pyx_v_s, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":272
+ *
+ *
+ * cdef inline object frombuffer_w(void *ptr, Py_ssize_t s): # <<<<<<<<<<<<<<
+ * """Wrapper for writable view frombuffer."""
+ * return frombuffer(ptr, s, 0)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("buffers.frombuffer_w", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":281
+ * #------------------------------------------------------------------------------
+ *
+ * cdef inline object viewfromobject(object obj, int readonly): # <<<<<<<<<<<<<<
+ * """Construct a Python Buffer/View object from another Python object.
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_viewfromobject(PyObject *__pyx_v_obj, int __pyx_v_readonly) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("viewfromobject", 0);
+
+ /* "buffers.pxd":297
+ * Buffer/View of the original object.
+ * """
+ * if not memoryview_available(): # <<<<<<<<<<<<<<
+ * if readonly:
+ * return PyBuffer_FromObject(obj, 0, Py_END_OF_BUFFER)
+ */
+ __pyx_t_1 = ((!(__pyx_f_7buffers_memoryview_available() != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":298
+ * """
+ * if not memoryview_available():
+ * if readonly: # <<<<<<<<<<<<<<
+ * return PyBuffer_FromObject(obj, 0, Py_END_OF_BUFFER)
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_readonly != 0);
+ if (__pyx_t_1) {
+
+ /* "buffers.pxd":299
+ * if not memoryview_available():
+ * if readonly:
+ * return PyBuffer_FromObject(obj, 0, Py_END_OF_BUFFER) # <<<<<<<<<<<<<<
+ * else:
+ * return PyBuffer_FromReadWriteObject(obj, 0, Py_END_OF_BUFFER)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyBuffer_FromObject(__pyx_v_obj, 0, Py_END_OF_BUFFER); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":301
+ * return PyBuffer_FromObject(obj, 0, Py_END_OF_BUFFER)
+ * else:
+ * return PyBuffer_FromReadWriteObject(obj, 0, Py_END_OF_BUFFER) # <<<<<<<<<<<<<<
+ * else:
+ * return PyMemoryView_FromObject(obj)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyBuffer_FromReadWriteObject(__pyx_v_obj, 0, Py_END_OF_BUFFER); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+ }
+ /*else*/ {
+
+ /* "buffers.pxd":303
+ * return PyBuffer_FromReadWriteObject(obj, 0, Py_END_OF_BUFFER)
+ * else:
+ * return PyMemoryView_FromObject(obj) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyMemoryView_FromObject(__pyx_v_obj); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "buffers.pxd":281
+ * #------------------------------------------------------------------------------
+ *
+ * cdef inline object viewfromobject(object obj, int readonly): # <<<<<<<<<<<<<<
+ * """Construct a Python Buffer/View object from another Python object.
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("buffers.viewfromobject", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":306
+ *
+ *
+ * cdef inline object viewfromobject_r(object obj): # <<<<<<<<<<<<<<
+ * """Wrapper for readonly viewfromobject."""
+ * return viewfromobject(obj, 1)
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_viewfromobject_r(PyObject *__pyx_v_obj) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("viewfromobject_r", 0);
+
+ /* "buffers.pxd":308
+ * cdef inline object viewfromobject_r(object obj):
+ * """Wrapper for readonly viewfromobject."""
+ * return viewfromobject(obj, 1) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_f_7buffers_viewfromobject(__pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":306
+ *
+ *
+ * cdef inline object viewfromobject_r(object obj): # <<<<<<<<<<<<<<
+ * """Wrapper for readonly viewfromobject."""
+ * return viewfromobject(obj, 1)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("buffers.viewfromobject_r", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "buffers.pxd":311
+ *
+ *
+ * cdef inline object viewfromobject_w(object obj): # <<<<<<<<<<<<<<
+ * """Wrapper for writable viewfromobject."""
+ * return viewfromobject(obj, 0)
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7buffers_viewfromobject_w(PyObject *__pyx_v_obj) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("viewfromobject_w", 0);
+
+ /* "buffers.pxd":313
+ * cdef inline object viewfromobject_w(object obj):
+ * """Wrapper for writable viewfromobject."""
+ * return viewfromobject(obj, 0) # <<<<<<<<<<<<<<
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_f_7buffers_viewfromobject(__pyx_v_obj, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "buffers.pxd":311
+ *
+ *
+ * cdef inline object viewfromobject_w(object obj): # <<<<<<<<<<<<<<
+ * """Wrapper for writable viewfromobject."""
+ * return viewfromobject(obj, 0)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("buffers.viewfromobject_w", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "zmq/devices/monitoredqueue.pxd":39
+ * #-----------------------------------------------------------------------------
+ *
+ * cdef inline int _relay(void *insocket_, void *outsocket_, void *sidesocket_, # <<<<<<<<<<<<<<
+ * zmq_msg_t msg, zmq_msg_t side_msg, zmq_msg_t id_msg,
+ * bint swap_ids) nogil:
+ */
+
+static CYTHON_INLINE int __pyx_f_3zmq_7devices_14monitoredqueue__relay(void *__pyx_v_insocket_, void *__pyx_v_outsocket_, void *__pyx_v_sidesocket_, zmq_msg_t __pyx_v_msg, zmq_msg_t __pyx_v_side_msg, zmq_msg_t __pyx_v_id_msg, int __pyx_v_swap_ids) {
+ int __pyx_v_rc;
+ pyzmq_int64_t __pyx_v_flag_2;
+ int __pyx_v_flag_3;
+ int __pyx_v_flags;
+ size_t __pyx_v_flagsz;
+ void *__pyx_v_flag_ptr;
+ int __pyx_r;
+ int __pyx_t_1;
+
+ /* "zmq/devices/monitoredqueue.pxd":50
+ * cdef void * flag_ptr
+ *
+ * if ZMQ_VERSION_MAJOR < 3: # <<<<<<<<<<<<<<
+ * flagsz = sizeof (int64_t)
+ * flag_ptr = &flag_2
+ */
+ __pyx_t_1 = ((ZMQ_VERSION_MAJOR < 3) != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/devices/monitoredqueue.pxd":51
+ *
+ * if ZMQ_VERSION_MAJOR < 3:
+ * flagsz = sizeof (int64_t) # <<<<<<<<<<<<<<
+ * flag_ptr = &flag_2
+ * else:
+ */
+ __pyx_v_flagsz = (sizeof(pyzmq_int64_t));
+
+ /* "zmq/devices/monitoredqueue.pxd":52
+ * if ZMQ_VERSION_MAJOR < 3:
+ * flagsz = sizeof (int64_t)
+ * flag_ptr = &flag_2 # <<<<<<<<<<<<<<
+ * else:
+ * flagsz = sizeof (int)
+ */
+ __pyx_v_flag_ptr = (&__pyx_v_flag_2);
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "zmq/devices/monitoredqueue.pxd":54
+ * flag_ptr = &flag_2
+ * else:
+ * flagsz = sizeof (int) # <<<<<<<<<<<<<<
+ * flag_ptr = &flag_3
+ *
+ */
+ __pyx_v_flagsz = (sizeof(int));
+
+ /* "zmq/devices/monitoredqueue.pxd":55
+ * else:
+ * flagsz = sizeof (int)
+ * flag_ptr = &flag_3 # <<<<<<<<<<<<<<
+ *
+ * if swap_ids:# both router, must send second identity first
+ */
+ __pyx_v_flag_ptr = (&__pyx_v_flag_3);
+ }
+ __pyx_L3:;
+
+ /* "zmq/devices/monitoredqueue.pxd":57
+ * flag_ptr = &flag_3
+ *
+ * if swap_ids:# both router, must send second identity first # <<<<<<<<<<<<<<
+ * # recv two ids into msg, id_msg
+ * rc = zmq_msg_recv(&msg, insocket_, 0)
+ */
+ __pyx_t_1 = (__pyx_v_swap_ids != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/devices/monitoredqueue.pxd":59
+ * if swap_ids:# both router, must send second identity first
+ * # recv two ids into msg, id_msg
+ * rc = zmq_msg_recv(&msg, insocket_, 0) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ *
+ */
+ __pyx_v_rc = zmq_msg_recv((&__pyx_v_msg), __pyx_v_insocket_, 0);
+
+ /* "zmq/devices/monitoredqueue.pxd":60
+ * # recv two ids into msg, id_msg
+ * rc = zmq_msg_recv(&msg, insocket_, 0)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ *
+ * rc = zmq_msg_recv(&id_msg, insocket_, 0)
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/devices/monitoredqueue.pxd":62
+ * if rc < 0: return rc
+ *
+ * rc = zmq_msg_recv(&id_msg, insocket_, 0) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ *
+ */
+ __pyx_v_rc = zmq_msg_recv((&__pyx_v_id_msg), __pyx_v_insocket_, 0);
+
+ /* "zmq/devices/monitoredqueue.pxd":63
+ *
+ * rc = zmq_msg_recv(&id_msg, insocket_, 0)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ *
+ * # send second id (id_msg) first
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/devices/monitoredqueue.pxd":67
+ * # send second id (id_msg) first
+ * #!!!! always send a copy before the original !!!!
+ * rc = zmq_msg_copy(&side_msg, &id_msg) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ * rc = zmq_msg_send(&side_msg, outsocket_, ZMQ_SNDMORE)
+ */
+ __pyx_v_rc = zmq_msg_copy((&__pyx_v_side_msg), (&__pyx_v_id_msg));
+
+ /* "zmq/devices/monitoredqueue.pxd":68
+ * #!!!! always send a copy before the original !!!!
+ * rc = zmq_msg_copy(&side_msg, &id_msg)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ * rc = zmq_msg_send(&side_msg, outsocket_, ZMQ_SNDMORE)
+ * if rc < 0: return rc
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/devices/monitoredqueue.pxd":69
+ * rc = zmq_msg_copy(&side_msg, &id_msg)
+ * if rc < 0: return rc
+ * rc = zmq_msg_send(&side_msg, outsocket_, ZMQ_SNDMORE) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ * rc = zmq_msg_send(&id_msg, sidesocket_, ZMQ_SNDMORE)
+ */
+ __pyx_v_rc = zmq_msg_send((&__pyx_v_side_msg), __pyx_v_outsocket_, ZMQ_SNDMORE);
+
+ /* "zmq/devices/monitoredqueue.pxd":70
+ * if rc < 0: return rc
+ * rc = zmq_msg_send(&side_msg, outsocket_, ZMQ_SNDMORE)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ * rc = zmq_msg_send(&id_msg, sidesocket_, ZMQ_SNDMORE)
+ * if rc < 0: return rc
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/devices/monitoredqueue.pxd":71
+ * rc = zmq_msg_send(&side_msg, outsocket_, ZMQ_SNDMORE)
+ * if rc < 0: return rc
+ * rc = zmq_msg_send(&id_msg, sidesocket_, ZMQ_SNDMORE) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ * # send first id (msg) second
+ */
+ __pyx_v_rc = zmq_msg_send((&__pyx_v_id_msg), __pyx_v_sidesocket_, ZMQ_SNDMORE);
+
+ /* "zmq/devices/monitoredqueue.pxd":72
+ * if rc < 0: return rc
+ * rc = zmq_msg_send(&id_msg, sidesocket_, ZMQ_SNDMORE)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ * # send first id (msg) second
+ * rc = zmq_msg_copy(&side_msg, &msg)
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/devices/monitoredqueue.pxd":74
+ * if rc < 0: return rc
+ * # send first id (msg) second
+ * rc = zmq_msg_copy(&side_msg, &msg) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ * rc = zmq_msg_send(&side_msg, outsocket_, ZMQ_SNDMORE)
+ */
+ __pyx_v_rc = zmq_msg_copy((&__pyx_v_side_msg), (&__pyx_v_msg));
+
+ /* "zmq/devices/monitoredqueue.pxd":75
+ * # send first id (msg) second
+ * rc = zmq_msg_copy(&side_msg, &msg)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ * rc = zmq_msg_send(&side_msg, outsocket_, ZMQ_SNDMORE)
+ * if rc < 0: return rc
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/devices/monitoredqueue.pxd":76
+ * rc = zmq_msg_copy(&side_msg, &msg)
+ * if rc < 0: return rc
+ * rc = zmq_msg_send(&side_msg, outsocket_, ZMQ_SNDMORE) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ * rc = zmq_msg_send(&msg, sidesocket_, ZMQ_SNDMORE)
+ */
+ __pyx_v_rc = zmq_msg_send((&__pyx_v_side_msg), __pyx_v_outsocket_, ZMQ_SNDMORE);
+
+ /* "zmq/devices/monitoredqueue.pxd":77
+ * if rc < 0: return rc
+ * rc = zmq_msg_send(&side_msg, outsocket_, ZMQ_SNDMORE)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ * rc = zmq_msg_send(&msg, sidesocket_, ZMQ_SNDMORE)
+ * if rc < 0: return rc
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/devices/monitoredqueue.pxd":78
+ * rc = zmq_msg_send(&side_msg, outsocket_, ZMQ_SNDMORE)
+ * if rc < 0: return rc
+ * rc = zmq_msg_send(&msg, sidesocket_, ZMQ_SNDMORE) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ * while (True):
+ */
+ __pyx_v_rc = zmq_msg_send((&__pyx_v_msg), __pyx_v_sidesocket_, ZMQ_SNDMORE);
+
+ /* "zmq/devices/monitoredqueue.pxd":79
+ * if rc < 0: return rc
+ * rc = zmq_msg_send(&msg, sidesocket_, ZMQ_SNDMORE)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ * while (True):
+ * rc = zmq_msg_recv(&msg, insocket_, 0)
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "zmq/devices/monitoredqueue.pxd":80
+ * rc = zmq_msg_send(&msg, sidesocket_, ZMQ_SNDMORE)
+ * if rc < 0: return rc
+ * while (True): # <<<<<<<<<<<<<<
+ * rc = zmq_msg_recv(&msg, insocket_, 0)
+ * if rc < 0: return rc
+ */
+ while (1) {
+
+ /* "zmq/devices/monitoredqueue.pxd":81
+ * if rc < 0: return rc
+ * while (True):
+ * rc = zmq_msg_recv(&msg, insocket_, 0) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ * # assert (rc == 0)
+ */
+ __pyx_v_rc = zmq_msg_recv((&__pyx_v_msg), __pyx_v_insocket_, 0);
+
+ /* "zmq/devices/monitoredqueue.pxd":82
+ * while (True):
+ * rc = zmq_msg_recv(&msg, insocket_, 0)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ * # assert (rc == 0)
+ * rc = zmq_getsockopt (insocket_, ZMQ_RCVMORE, flag_ptr, &flagsz)
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/devices/monitoredqueue.pxd":84
+ * if rc < 0: return rc
+ * # assert (rc == 0)
+ * rc = zmq_getsockopt (insocket_, ZMQ_RCVMORE, flag_ptr, &flagsz) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ * flags = 0
+ */
+ __pyx_v_rc = zmq_getsockopt(__pyx_v_insocket_, ZMQ_RCVMORE, __pyx_v_flag_ptr, (&__pyx_v_flagsz));
+
+ /* "zmq/devices/monitoredqueue.pxd":85
+ * # assert (rc == 0)
+ * rc = zmq_getsockopt (insocket_, ZMQ_RCVMORE, flag_ptr, &flagsz)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ * flags = 0
+ * if ZMQ_VERSION_MAJOR < 3:
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/devices/monitoredqueue.pxd":86
+ * rc = zmq_getsockopt (insocket_, ZMQ_RCVMORE, flag_ptr, &flagsz)
+ * if rc < 0: return rc
+ * flags = 0 # <<<<<<<<<<<<<<
+ * if ZMQ_VERSION_MAJOR < 3:
+ * if flag_2:
+ */
+ __pyx_v_flags = 0;
+
+ /* "zmq/devices/monitoredqueue.pxd":87
+ * if rc < 0: return rc
+ * flags = 0
+ * if ZMQ_VERSION_MAJOR < 3: # <<<<<<<<<<<<<<
+ * if flag_2:
+ * flags |= ZMQ_SNDMORE
+ */
+ __pyx_t_1 = ((ZMQ_VERSION_MAJOR < 3) != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/devices/monitoredqueue.pxd":88
+ * flags = 0
+ * if ZMQ_VERSION_MAJOR < 3:
+ * if flag_2: # <<<<<<<<<<<<<<
+ * flags |= ZMQ_SNDMORE
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_flag_2 != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/devices/monitoredqueue.pxd":89
+ * if ZMQ_VERSION_MAJOR < 3:
+ * if flag_2:
+ * flags |= ZMQ_SNDMORE # <<<<<<<<<<<<<<
+ * else:
+ * if flag_3:
+ */
+ __pyx_v_flags = (__pyx_v_flags | ZMQ_SNDMORE);
+ goto __pyx_L18;
+ }
+ __pyx_L18:;
+ goto __pyx_L17;
+ }
+ /*else*/ {
+
+ /* "zmq/devices/monitoredqueue.pxd":91
+ * flags |= ZMQ_SNDMORE
+ * else:
+ * if flag_3: # <<<<<<<<<<<<<<
+ * flags |= ZMQ_SNDMORE
+ * # LABEL has been removed:
+ */
+ __pyx_t_1 = (__pyx_v_flag_3 != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/devices/monitoredqueue.pxd":92
+ * else:
+ * if flag_3:
+ * flags |= ZMQ_SNDMORE # <<<<<<<<<<<<<<
+ * # LABEL has been removed:
+ * # rc = zmq_getsockopt (insocket_, ZMQ_RCVLABEL, flag_ptr, &flagsz)
+ */
+ __pyx_v_flags = (__pyx_v_flags | ZMQ_SNDMORE);
+ goto __pyx_L19;
+ }
+ __pyx_L19:;
+ }
+ __pyx_L17:;
+
+ /* "zmq/devices/monitoredqueue.pxd":99
+ * # assert (rc == 0)
+ *
+ * rc = zmq_msg_copy(&side_msg, &msg) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ * if flags:
+ */
+ __pyx_v_rc = zmq_msg_copy((&__pyx_v_side_msg), (&__pyx_v_msg));
+
+ /* "zmq/devices/monitoredqueue.pxd":100
+ *
+ * rc = zmq_msg_copy(&side_msg, &msg)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ * if flags:
+ * rc = zmq_msg_send(&side_msg, outsocket_, flags)
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/devices/monitoredqueue.pxd":101
+ * rc = zmq_msg_copy(&side_msg, &msg)
+ * if rc < 0: return rc
+ * if flags: # <<<<<<<<<<<<<<
+ * rc = zmq_msg_send(&side_msg, outsocket_, flags)
+ * if rc < 0: return rc
+ */
+ __pyx_t_1 = (__pyx_v_flags != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/devices/monitoredqueue.pxd":102
+ * if rc < 0: return rc
+ * if flags:
+ * rc = zmq_msg_send(&side_msg, outsocket_, flags) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ * # only SNDMORE for side-socket
+ */
+ __pyx_v_rc = zmq_msg_send((&__pyx_v_side_msg), __pyx_v_outsocket_, __pyx_v_flags);
+
+ /* "zmq/devices/monitoredqueue.pxd":103
+ * if flags:
+ * rc = zmq_msg_send(&side_msg, outsocket_, flags)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ * # only SNDMORE for side-socket
+ * rc = zmq_msg_send(&msg, sidesocket_, ZMQ_SNDMORE)
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/devices/monitoredqueue.pxd":105
+ * if rc < 0: return rc
+ * # only SNDMORE for side-socket
+ * rc = zmq_msg_send(&msg, sidesocket_, ZMQ_SNDMORE) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ * else:
+ */
+ __pyx_v_rc = zmq_msg_send((&__pyx_v_msg), __pyx_v_sidesocket_, ZMQ_SNDMORE);
+
+ /* "zmq/devices/monitoredqueue.pxd":106
+ * # only SNDMORE for side-socket
+ * rc = zmq_msg_send(&msg, sidesocket_, ZMQ_SNDMORE)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ * else:
+ * rc = zmq_msg_send(&side_msg, outsocket_, 0)
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+ goto __pyx_L21;
+ }
+ /*else*/ {
+
+ /* "zmq/devices/monitoredqueue.pxd":108
+ * if rc < 0: return rc
+ * else:
+ * rc = zmq_msg_send(&side_msg, outsocket_, 0) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ * rc = zmq_msg_send(&msg, sidesocket_, 0)
+ */
+ __pyx_v_rc = zmq_msg_send((&__pyx_v_side_msg), __pyx_v_outsocket_, 0);
+
+ /* "zmq/devices/monitoredqueue.pxd":109
+ * else:
+ * rc = zmq_msg_send(&side_msg, outsocket_, 0)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ * rc = zmq_msg_send(&msg, sidesocket_, 0)
+ * if rc < 0: return rc
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/devices/monitoredqueue.pxd":110
+ * rc = zmq_msg_send(&side_msg, outsocket_, 0)
+ * if rc < 0: return rc
+ * rc = zmq_msg_send(&msg, sidesocket_, 0) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ * break
+ */
+ __pyx_v_rc = zmq_msg_send((&__pyx_v_msg), __pyx_v_sidesocket_, 0);
+
+ /* "zmq/devices/monitoredqueue.pxd":111
+ * if rc < 0: return rc
+ * rc = zmq_msg_send(&msg, sidesocket_, 0)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ * break
+ * return rc
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/devices/monitoredqueue.pxd":112
+ * rc = zmq_msg_send(&msg, sidesocket_, 0)
+ * if rc < 0: return rc
+ * break # <<<<<<<<<<<<<<
+ * return rc
+ *
+ */
+ goto __pyx_L14_break;
+ }
+ __pyx_L21:;
+ }
+ __pyx_L14_break:;
+
+ /* "zmq/devices/monitoredqueue.pxd":113
+ * if rc < 0: return rc
+ * break
+ * return rc # <<<<<<<<<<<<<<
+ *
+ * # the MonitoredQueue C function, adapted from zmq::queue.cpp :
+ */
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+
+ /* "zmq/devices/monitoredqueue.pxd":39
+ * #-----------------------------------------------------------------------------
+ *
+ * cdef inline int _relay(void *insocket_, void *outsocket_, void *sidesocket_, # <<<<<<<<<<<<<<
+ * zmq_msg_t msg, zmq_msg_t side_msg, zmq_msg_t id_msg,
+ * bint swap_ids) nogil:
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "zmq/devices/monitoredqueue.pxd":116
+ *
+ * # the MonitoredQueue C function, adapted from zmq::queue.cpp :
+ * cdef inline int c_monitored_queue (void *insocket_, void *outsocket_, # <<<<<<<<<<<<<<
+ * void *sidesocket_, zmq_msg_t *in_msg_ptr,
+ * zmq_msg_t *out_msg_ptr, int swap_ids) nogil:
+ */
+
+static CYTHON_INLINE int __pyx_f_3zmq_7devices_14monitoredqueue_c_monitored_queue(void *__pyx_v_insocket_, void *__pyx_v_outsocket_, void *__pyx_v_sidesocket_, zmq_msg_t *__pyx_v_in_msg_ptr, zmq_msg_t *__pyx_v_out_msg_ptr, int __pyx_v_swap_ids) {
+ zmq_msg_t __pyx_v_msg;
+ int __pyx_v_rc;
+ zmq_msg_t __pyx_v_id_msg;
+ zmq_msg_t __pyx_v_side_msg;
+ zmq_pollitem_t __pyx_v_items[2];
+ int __pyx_r;
+ int __pyx_t_1;
+
+ /* "zmq/devices/monitoredqueue.pxd":125
+ *
+ * cdef zmq_msg_t msg
+ * cdef int rc = zmq_msg_init (&msg) # <<<<<<<<<<<<<<
+ * cdef zmq_msg_t id_msg
+ * rc = zmq_msg_init (&id_msg)
+ */
+ __pyx_v_rc = zmq_msg_init((&__pyx_v_msg));
+
+ /* "zmq/devices/monitoredqueue.pxd":127
+ * cdef int rc = zmq_msg_init (&msg)
+ * cdef zmq_msg_t id_msg
+ * rc = zmq_msg_init (&id_msg) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ * cdef zmq_msg_t side_msg
+ */
+ __pyx_v_rc = zmq_msg_init((&__pyx_v_id_msg));
+
+ /* "zmq/devices/monitoredqueue.pxd":128
+ * cdef zmq_msg_t id_msg
+ * rc = zmq_msg_init (&id_msg)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ * cdef zmq_msg_t side_msg
+ * rc = zmq_msg_init (&side_msg)
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/devices/monitoredqueue.pxd":130
+ * if rc < 0: return rc
+ * cdef zmq_msg_t side_msg
+ * rc = zmq_msg_init (&side_msg) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ *
+ */
+ __pyx_v_rc = zmq_msg_init((&__pyx_v_side_msg));
+
+ /* "zmq/devices/monitoredqueue.pxd":131
+ * cdef zmq_msg_t side_msg
+ * rc = zmq_msg_init (&side_msg)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ *
+ * cdef zmq_pollitem_t items [2]
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/devices/monitoredqueue.pxd":134
+ *
+ * cdef zmq_pollitem_t items [2]
+ * items [0].socket = insocket_ # <<<<<<<<<<<<<<
+ * items [0].fd = 0
+ * items [0].events = ZMQ_POLLIN
+ */
+ (__pyx_v_items[0]).socket = __pyx_v_insocket_;
+
+ /* "zmq/devices/monitoredqueue.pxd":135
+ * cdef zmq_pollitem_t items [2]
+ * items [0].socket = insocket_
+ * items [0].fd = 0 # <<<<<<<<<<<<<<
+ * items [0].events = ZMQ_POLLIN
+ * items [0].revents = 0
+ */
+ (__pyx_v_items[0]).fd = 0;
+
+ /* "zmq/devices/monitoredqueue.pxd":136
+ * items [0].socket = insocket_
+ * items [0].fd = 0
+ * items [0].events = ZMQ_POLLIN # <<<<<<<<<<<<<<
+ * items [0].revents = 0
+ * items [1].socket = outsocket_
+ */
+ (__pyx_v_items[0]).events = ZMQ_POLLIN;
+
+ /* "zmq/devices/monitoredqueue.pxd":137
+ * items [0].fd = 0
+ * items [0].events = ZMQ_POLLIN
+ * items [0].revents = 0 # <<<<<<<<<<<<<<
+ * items [1].socket = outsocket_
+ * items [1].fd = 0
+ */
+ (__pyx_v_items[0]).revents = 0;
+
+ /* "zmq/devices/monitoredqueue.pxd":138
+ * items [0].events = ZMQ_POLLIN
+ * items [0].revents = 0
+ * items [1].socket = outsocket_ # <<<<<<<<<<<<<<
+ * items [1].fd = 0
+ * items [1].events = ZMQ_POLLIN
+ */
+ (__pyx_v_items[1]).socket = __pyx_v_outsocket_;
+
+ /* "zmq/devices/monitoredqueue.pxd":139
+ * items [0].revents = 0
+ * items [1].socket = outsocket_
+ * items [1].fd = 0 # <<<<<<<<<<<<<<
+ * items [1].events = ZMQ_POLLIN
+ * items [1].revents = 0
+ */
+ (__pyx_v_items[1]).fd = 0;
+
+ /* "zmq/devices/monitoredqueue.pxd":140
+ * items [1].socket = outsocket_
+ * items [1].fd = 0
+ * items [1].events = ZMQ_POLLIN # <<<<<<<<<<<<<<
+ * items [1].revents = 0
+ * # I don't think sidesocket should be polled?
+ */
+ (__pyx_v_items[1]).events = ZMQ_POLLIN;
+
+ /* "zmq/devices/monitoredqueue.pxd":141
+ * items [1].fd = 0
+ * items [1].events = ZMQ_POLLIN
+ * items [1].revents = 0 # <<<<<<<<<<<<<<
+ * # I don't think sidesocket should be polled?
+ * # items [2].socket = sidesocket_
+ */
+ (__pyx_v_items[1]).revents = 0;
+
+ /* "zmq/devices/monitoredqueue.pxd":148
+ * # items [2].revents = 0
+ *
+ * while (True): # <<<<<<<<<<<<<<
+ *
+ * # // Wait while there are either requests or replies to process.
+ */
+ while (1) {
+
+ /* "zmq/devices/monitoredqueue.pxd":151
+ *
+ * # // Wait while there are either requests or replies to process.
+ * rc = zmq_poll (&items [0], 2, -1) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ * # // The algorithm below asumes ratio of request and replies processed
+ */
+ __pyx_v_rc = zmq_poll((&(__pyx_v_items[0])), 2, -1);
+
+ /* "zmq/devices/monitoredqueue.pxd":152
+ * # // Wait while there are either requests or replies to process.
+ * rc = zmq_poll (&items [0], 2, -1)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ * # // The algorithm below asumes ratio of request and replies processed
+ * # // under full load to be 1:1. Although processing requests replies
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/devices/monitoredqueue.pxd":159
+ * #
+ * # // Process a request.
+ * if (items [0].revents & ZMQ_POLLIN): # <<<<<<<<<<<<<<
+ * # send in_prefix to side socket
+ * rc = zmq_msg_copy(&side_msg, in_msg_ptr)
+ */
+ __pyx_t_1 = (((__pyx_v_items[0]).revents & ZMQ_POLLIN) != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/devices/monitoredqueue.pxd":161
+ * if (items [0].revents & ZMQ_POLLIN):
+ * # send in_prefix to side socket
+ * rc = zmq_msg_copy(&side_msg, in_msg_ptr) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ * rc = zmq_msg_send(&side_msg, sidesocket_, ZMQ_SNDMORE)
+ */
+ __pyx_v_rc = zmq_msg_copy((&__pyx_v_side_msg), __pyx_v_in_msg_ptr);
+
+ /* "zmq/devices/monitoredqueue.pxd":162
+ * # send in_prefix to side socket
+ * rc = zmq_msg_copy(&side_msg, in_msg_ptr)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ * rc = zmq_msg_send(&side_msg, sidesocket_, ZMQ_SNDMORE)
+ * if rc < 0: return rc
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/devices/monitoredqueue.pxd":163
+ * rc = zmq_msg_copy(&side_msg, in_msg_ptr)
+ * if rc < 0: return rc
+ * rc = zmq_msg_send(&side_msg, sidesocket_, ZMQ_SNDMORE) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ * # relay the rest of the message
+ */
+ __pyx_v_rc = zmq_msg_send((&__pyx_v_side_msg), __pyx_v_sidesocket_, ZMQ_SNDMORE);
+
+ /* "zmq/devices/monitoredqueue.pxd":164
+ * if rc < 0: return rc
+ * rc = zmq_msg_send(&side_msg, sidesocket_, ZMQ_SNDMORE)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ * # relay the rest of the message
+ * rc = _relay(insocket_, outsocket_, sidesocket_, msg, side_msg, id_msg, swap_ids)
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/devices/monitoredqueue.pxd":166
+ * if rc < 0: return rc
+ * # relay the rest of the message
+ * rc = _relay(insocket_, outsocket_, sidesocket_, msg, side_msg, id_msg, swap_ids) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ * if (items [1].revents & ZMQ_POLLIN):
+ */
+ __pyx_v_rc = __pyx_f_3zmq_7devices_14monitoredqueue__relay(__pyx_v_insocket_, __pyx_v_outsocket_, __pyx_v_sidesocket_, __pyx_v_msg, __pyx_v_side_msg, __pyx_v_id_msg, __pyx_v_swap_ids);
+
+ /* "zmq/devices/monitoredqueue.pxd":167
+ * # relay the rest of the message
+ * rc = _relay(insocket_, outsocket_, sidesocket_, msg, side_msg, id_msg, swap_ids)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ * if (items [1].revents & ZMQ_POLLIN):
+ * # send out_prefix to side socket
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+ goto __pyx_L8;
+ }
+ __pyx_L8:;
+
+ /* "zmq/devices/monitoredqueue.pxd":168
+ * rc = _relay(insocket_, outsocket_, sidesocket_, msg, side_msg, id_msg, swap_ids)
+ * if rc < 0: return rc
+ * if (items [1].revents & ZMQ_POLLIN): # <<<<<<<<<<<<<<
+ * # send out_prefix to side socket
+ * rc = zmq_msg_copy(&side_msg, out_msg_ptr)
+ */
+ __pyx_t_1 = (((__pyx_v_items[1]).revents & ZMQ_POLLIN) != 0);
+ if (__pyx_t_1) {
+
+ /* "zmq/devices/monitoredqueue.pxd":170
+ * if (items [1].revents & ZMQ_POLLIN):
+ * # send out_prefix to side socket
+ * rc = zmq_msg_copy(&side_msg, out_msg_ptr) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ * rc = zmq_msg_send(&side_msg, sidesocket_, ZMQ_SNDMORE)
+ */
+ __pyx_v_rc = zmq_msg_copy((&__pyx_v_side_msg), __pyx_v_out_msg_ptr);
+
+ /* "zmq/devices/monitoredqueue.pxd":171
+ * # send out_prefix to side socket
+ * rc = zmq_msg_copy(&side_msg, out_msg_ptr)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ * rc = zmq_msg_send(&side_msg, sidesocket_, ZMQ_SNDMORE)
+ * if rc < 0: return rc
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/devices/monitoredqueue.pxd":172
+ * rc = zmq_msg_copy(&side_msg, out_msg_ptr)
+ * if rc < 0: return rc
+ * rc = zmq_msg_send(&side_msg, sidesocket_, ZMQ_SNDMORE) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ * # relay the rest of the message
+ */
+ __pyx_v_rc = zmq_msg_send((&__pyx_v_side_msg), __pyx_v_sidesocket_, ZMQ_SNDMORE);
+
+ /* "zmq/devices/monitoredqueue.pxd":173
+ * if rc < 0: return rc
+ * rc = zmq_msg_send(&side_msg, sidesocket_, ZMQ_SNDMORE)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ * # relay the rest of the message
+ * rc = _relay(outsocket_, insocket_, sidesocket_, msg, side_msg, id_msg, swap_ids)
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+
+ /* "zmq/devices/monitoredqueue.pxd":175
+ * if rc < 0: return rc
+ * # relay the rest of the message
+ * rc = _relay(outsocket_, insocket_, sidesocket_, msg, side_msg, id_msg, swap_ids) # <<<<<<<<<<<<<<
+ * if rc < 0: return rc
+ * return rc
+ */
+ __pyx_v_rc = __pyx_f_3zmq_7devices_14monitoredqueue__relay(__pyx_v_outsocket_, __pyx_v_insocket_, __pyx_v_sidesocket_, __pyx_v_msg, __pyx_v_side_msg, __pyx_v_id_msg, __pyx_v_swap_ids);
+
+ /* "zmq/devices/monitoredqueue.pxd":176
+ * # relay the rest of the message
+ * rc = _relay(outsocket_, insocket_, sidesocket_, msg, side_msg, id_msg, swap_ids)
+ * if rc < 0: return rc # <<<<<<<<<<<<<<
+ * return rc
+ */
+ __pyx_t_1 = ((__pyx_v_rc < 0) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+ }
+ goto __pyx_L12;
+ }
+ __pyx_L12:;
+ }
+
+ /* "zmq/devices/monitoredqueue.pxd":177
+ * rc = _relay(outsocket_, insocket_, sidesocket_, msg, side_msg, id_msg, swap_ids)
+ * if rc < 0: return rc
+ * return rc # <<<<<<<<<<<<<<
+ */
+ __pyx_r = __pyx_v_rc;
+ goto __pyx_L0;
+
+ /* "zmq/devices/monitoredqueue.pxd":116
+ *
+ * # the MonitoredQueue C function, adapted from zmq::queue.cpp :
+ * cdef inline int c_monitored_queue (void *insocket_, void *outsocket_, # <<<<<<<<<<<<<<
+ * void *sidesocket_, zmq_msg_t *in_msg_ptr,
+ * zmq_msg_t *out_msg_ptr, int swap_ids) nogil:
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+static PyMethodDef __pyx_methods[] = {
+ {0, 0, 0, 0}
+};
+
+#if PY_MAJOR_VERSION >= 3
+static struct PyModuleDef __pyx_moduledef = {
+ #if PY_VERSION_HEX < 0x03020000
+ { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
+ #else
+ PyModuleDef_HEAD_INIT,
+ #endif
+ "monitoredqueue",
+ __pyx_k_MonitoredQueue_classes_and_funct, /* m_doc */
+ -1, /* m_size */
+ __pyx_methods /* m_methods */,
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL /* m_free */
+};
+#endif
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+ {&__pyx_n_s_Again, __pyx_k_Again, sizeof(__pyx_k_Again), 0, 0, 1, 1},
+ {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
+ {&__pyx_n_b_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 0, 1},
+ {&__pyx_n_s_ContextTerminated, __pyx_k_ContextTerminated, sizeof(__pyx_k_ContextTerminated), 0, 0, 1, 1},
+ {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
+ {&__pyx_kp_s_Old_style_buffers_not_available, __pyx_k_Old_style_buffers_not_available, sizeof(__pyx_k_Old_style_buffers_not_available), 0, 0, 1, 0},
+ {&__pyx_n_s_ROUTER, __pyx_k_ROUTER, sizeof(__pyx_k_ROUTER), 0, 0, 1, 1},
+ {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
+ {&__pyx_n_s_ZMQError, __pyx_k_ZMQError, sizeof(__pyx_k_ZMQError), 0, 0, 1, 1},
+ {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0},
+ {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
+ {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1},
+ {&__pyx_n_s_char, __pyx_k_char, sizeof(__pyx_k_char), 0, 0, 1, 1},
+ {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
+ {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
+ {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+ {&__pyx_n_b_in, __pyx_k_in, sizeof(__pyx_k_in), 0, 0, 0, 1},
+ {&__pyx_n_s_in_msg, __pyx_k_in_msg, sizeof(__pyx_k_in_msg), 0, 0, 1, 1},
+ {&__pyx_n_s_in_prefix, __pyx_k_in_prefix, sizeof(__pyx_k_in_prefix), 0, 0, 1, 1},
+ {&__pyx_n_s_in_socket, __pyx_k_in_socket, sizeof(__pyx_k_in_socket), 0, 0, 1, 1},
+ {&__pyx_n_s_ins, __pyx_k_ins, sizeof(__pyx_k_ins), 0, 0, 1, 1},
+ {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
+ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+ {&__pyx_n_s_mon_socket, __pyx_k_mon_socket, sizeof(__pyx_k_mon_socket), 0, 0, 1, 1},
+ {&__pyx_n_s_monitored_queue, __pyx_k_monitored_queue, sizeof(__pyx_k_monitored_queue), 0, 0, 1, 1},
+ {&__pyx_n_s_mons, __pyx_k_mons, sizeof(__pyx_k_mons), 0, 0, 1, 1},
+ {&__pyx_n_s_msg_c, __pyx_k_msg_c, sizeof(__pyx_k_msg_c), 0, 0, 1, 1},
+ {&__pyx_n_s_msg_c_len, __pyx_k_msg_c_len, sizeof(__pyx_k_msg_c_len), 0, 0, 1, 1},
+ {&__pyx_n_b_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 0, 1},
+ {&__pyx_n_s_out_msg, __pyx_k_out_msg, sizeof(__pyx_k_out_msg), 0, 0, 1, 1},
+ {&__pyx_n_s_out_prefix, __pyx_k_out_prefix, sizeof(__pyx_k_out_prefix), 0, 0, 1, 1},
+ {&__pyx_n_s_out_socket, __pyx_k_out_socket, sizeof(__pyx_k_out_socket), 0, 0, 1, 1},
+ {&__pyx_n_s_outs, __pyx_k_outs, sizeof(__pyx_k_outs), 0, 0, 1, 1},
+ {&__pyx_kp_s_private_tmp_pyzmq_release_zmq_d, __pyx_k_private_tmp_pyzmq_release_zmq_d, sizeof(__pyx_k_private_tmp_pyzmq_release_zmq_d), 0, 0, 1, 0},
+ {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
+ {&__pyx_kp_s_r_does_not_provide_a_buffer_int, __pyx_k_r_does_not_provide_a_buffer_int, sizeof(__pyx_k_r_does_not_provide_a_buffer_int), 0, 0, 1, 0},
+ {&__pyx_n_s_rc, __pyx_k_rc, sizeof(__pyx_k_rc), 0, 0, 1, 1},
+ {&__pyx_n_s_swap_ids, __pyx_k_swap_ids, sizeof(__pyx_k_swap_ids), 0, 0, 1, 1},
+ {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+ {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
+ {&__pyx_n_s_typecode, __pyx_k_typecode, sizeof(__pyx_k_typecode), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq, __pyx_k_zmq, sizeof(__pyx_k_zmq), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq_devices_monitoredqueue, __pyx_k_zmq_devices_monitoredqueue, sizeof(__pyx_k_zmq_devices_monitoredqueue), 0, 0, 1, 1},
+ {&__pyx_n_s_zmq_error, __pyx_k_zmq_error, sizeof(__pyx_k_zmq_error), 0, 0, 1, 1},
+ {0, 0, 0, 0, 0, 0, 0}
+};
+static int __Pyx_InitCachedBuiltins(void) {
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+static int __Pyx_InitCachedConstants(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
+
+ /* "buffers.pxd":194
+ *
+ * if PY_MAJOR_VERSION >= 3 and bfmt is not None:
+ * return bfmt.decode('ascii') # <<<<<<<<<<<<<<
+ * return bfmt
+ *
+ */
+ __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple_);
+ __Pyx_GIVEREF(__pyx_tuple_);
+
+ /* "buffers.pxd":241
+ * return PyBuffer_FromReadWriteMemory(ptr, s)
+ * else:
+ * raise NotImplementedError("Old style buffers not available.") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Old_style_buffers_not_available); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__3);
+ __Pyx_GIVEREF(__pyx_tuple__3);
+
+ /* "zmq/devices/monitoredqueue.pyx":40
+ *
+ *
+ * def monitored_queue(Socket in_socket, Socket out_socket, Socket mon_socket, # <<<<<<<<<<<<<<
+ * bytes in_prefix=b'in', bytes out_prefix=b'out'):
+ * """monitored_queue(in_socket, out_socket, mon_socket,
+ */
+ __pyx_tuple__4 = PyTuple_Pack(14, __pyx_n_s_in_socket, __pyx_n_s_out_socket, __pyx_n_s_mon_socket, __pyx_n_s_in_prefix, __pyx_n_s_out_prefix, __pyx_n_s_ins, __pyx_n_s_outs, __pyx_n_s_mons, __pyx_n_s_in_msg, __pyx_n_s_out_msg, __pyx_n_s_swap_ids, __pyx_n_s_msg_c, __pyx_n_s_msg_c_len, __pyx_n_s_rc); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__4);
+ __Pyx_GIVEREF(__pyx_tuple__4);
+ __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(5, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_pyzmq_release_zmq_d, __pyx_n_s_monitored_queue, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static int __Pyx_InitGlobals(void) {
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+#if PY_MAJOR_VERSION < 3
+PyMODINIT_FUNC initmonitoredqueue(void); /*proto*/
+PyMODINIT_FUNC initmonitoredqueue(void)
+#else
+PyMODINIT_FUNC PyInit_monitoredqueue(void); /*proto*/
+PyMODINIT_FUNC PyInit_monitoredqueue(void)
+#endif
+{
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ #if CYTHON_REFNANNY
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
+ if (!__Pyx_RefNanny) {
+ PyErr_Clear();
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
+ if (!__Pyx_RefNanny)
+ Py_FatalError("failed to import 'refnanny' module");
+ }
+ #endif
+ __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_monitoredqueue(void)", 0);
+ if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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;}
+ __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;}
+ #ifdef __Pyx_CyFunction_USED
+ if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_FusedFunction_USED
+ if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_Generator_USED
+ if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ /*--- Library function declarations ---*/
+ /*--- Threads initialization code ---*/
+ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
+ #ifdef WITH_THREAD /* Python build with threading support? */
+ PyEval_InitThreads();
+ #endif
+ #endif
+ /*--- Module creation code ---*/
+ #if PY_MAJOR_VERSION < 3
+ __pyx_m = Py_InitModule4("monitoredqueue", __pyx_methods, __pyx_k_MonitoredQueue_classes_and_funct, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+ #else
+ __pyx_m = PyModule_Create(&__pyx_moduledef);
+ #endif
+ if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_INCREF(__pyx_d);
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_COMPILING_IN_PYPY
+ Py_INCREF(__pyx_b);
+ #endif
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ /*--- Initialize various global constants etc. ---*/
+ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ if (__pyx_module_is_main_zmq__devices__monitoredqueue) {
+ if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ }
+ #if PY_MAJOR_VERSION >= 3
+ {
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!PyDict_GetItemString(modules, "zmq.devices.monitoredqueue")) {
+ if (unlikely(PyDict_SetItemString(modules, "zmq.devices.monitoredqueue", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+ /*--- Builtin init code ---*/
+ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Constants init code ---*/
+ if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Global init code ---*/
+ /*--- Variable export code ---*/
+ /*--- Function export code ---*/
+ /*--- Type init code ---*/
+ /*--- Type import code ---*/
+ __pyx_ptype_3zmq_7backend_6cython_7context_Context = __Pyx_ImportType("zmq.backend.cython.context", "Context", sizeof(struct __pyx_obj_3zmq_7backend_6cython_7context_Context), 1); if (unlikely(!__pyx_ptype_3zmq_7backend_6cython_7context_Context)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_vtabptr_3zmq_7backend_6cython_7context_Context = (struct __pyx_vtabstruct_3zmq_7backend_6cython_7context_Context*)__Pyx_GetVtable(__pyx_ptype_3zmq_7backend_6cython_7context_Context->tp_dict); if (unlikely(!__pyx_vtabptr_3zmq_7backend_6cython_7context_Context)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_3zmq_7backend_6cython_6socket_Socket = __Pyx_ImportType("zmq.backend.cython.socket", "Socket", sizeof(struct __pyx_obj_3zmq_7backend_6cython_6socket_Socket), 1); if (unlikely(!__pyx_ptype_3zmq_7backend_6cython_6socket_Socket)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_vtabptr_3zmq_7backend_6cython_6socket_Socket = (struct __pyx_vtabstruct_3zmq_7backend_6cython_6socket_Socket*)__Pyx_GetVtable(__pyx_ptype_3zmq_7backend_6cython_6socket_Socket->tp_dict); if (unlikely(!__pyx_vtabptr_3zmq_7backend_6cython_6socket_Socket)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
+ #if CYTHON_COMPILING_IN_PYPY
+ sizeof(PyTypeObject),
+ #else
+ sizeof(PyHeapTypeObject),
+ #endif
+ 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Variable import code ---*/
+ /*--- Function import code ---*/
+ /*--- Execution code ---*/
+
+ /* "zmq/devices/monitoredqueue.pyx":33
+ * from zmq.backend.cython.checkrc cimport _check_rc
+ *
+ * from zmq import ROUTER, ZMQError # <<<<<<<<<<<<<<
+ *
+ * #-----------------------------------------------------------------------------
+ */
+ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_s_ROUTER);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ROUTER);
+ __Pyx_GIVEREF(__pyx_n_s_ROUTER);
+ __Pyx_INCREF(__pyx_n_s_ZMQError);
+ PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_ZMQError);
+ __Pyx_GIVEREF(__pyx_n_s_ZMQError);
+ __pyx_t_2 = __Pyx_Import(__pyx_n_s_zmq, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ROUTER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ROUTER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ZMQError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ZMQError, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/devices/monitoredqueue.pyx":40
+ *
+ *
+ * def monitored_queue(Socket in_socket, Socket out_socket, Socket mon_socket, # <<<<<<<<<<<<<<
+ * bytes in_prefix=b'in', bytes out_prefix=b'out'):
+ * """monitored_queue(in_socket, out_socket, mon_socket,
+ */
+ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3zmq_7devices_14monitoredqueue_1monitored_queue, NULL, __pyx_n_s_zmq_devices_monitoredqueue); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_monitored_queue, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/devices/monitoredqueue.pyx":103
+ * return rc
+ *
+ * __all__ = ['monitored_queue'] # <<<<<<<<<<<<<<
+ */
+ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_n_s_monitored_queue);
+ PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_monitored_queue);
+ __Pyx_GIVEREF(__pyx_n_s_monitored_queue);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/devices/monitoredqueue.pyx":1
+ * """MonitoredQueue classes and functions. # <<<<<<<<<<<<<<
+ *
+ * Authors
+ */
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "zmq/devices/monitoredqueue.pxd":116
+ *
+ * # the MonitoredQueue C function, adapted from zmq::queue.cpp :
+ * cdef inline int c_monitored_queue (void *insocket_, void *outsocket_, # <<<<<<<<<<<<<<
+ * void *sidesocket_, zmq_msg_t *in_msg_ptr,
+ * zmq_msg_t *out_msg_ptr, int swap_ids) nogil:
+ */
+
+ /*--- Wrapped vars code ---*/
+
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ if (__pyx_m) {
+ if (__pyx_d) {
+ __Pyx_AddTraceback("init zmq.devices.monitoredqueue", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ }
+ Py_DECREF(__pyx_m); __pyx_m = 0;
+ } else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ImportError, "init zmq.devices.monitoredqueue");
+ }
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ #if PY_MAJOR_VERSION < 3
+ return;
+ #else
+ return __pyx_m;
+ #endif
+}
+
+/* Runtime support code */
+#if CYTHON_REFNANNY
+static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
+ PyObject *m = NULL, *p = NULL;
+ void *r = NULL;
+ m = PyImport_ImportModule((char *)modname);
+ if (!m) goto end;
+ p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
+ if (!p) goto end;
+ r = PyLong_AsVoidPtr(p);
+end:
+ Py_XDECREF(p);
+ Py_XDECREF(m);
+ return (__Pyx_RefNannyAPIStruct *)r;
+}
+#endif
+
+static void __Pyx_RaiseArgtupleInvalid(
+ const char* func_name,
+ int exact,
+ Py_ssize_t num_min,
+ Py_ssize_t num_max,
+ Py_ssize_t num_found)
+{
+ Py_ssize_t num_expected;
+ const char *more_or_less;
+ if (num_found < num_min) {
+ num_expected = num_min;
+ more_or_less = "at least";
+ } else {
+ num_expected = num_max;
+ more_or_less = "at most";
+ }
+ if (exact) {
+ more_or_less = "exactly";
+ }
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+ func_name, more_or_less, num_expected,
+ (num_expected == 1) ? "" : "s", num_found);
+}
+
+static void __Pyx_RaiseDoubleKeywordsError(
+ const char* func_name,
+ PyObject* kw_name)
+{
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION >= 3
+ "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
+ #else
+ "%s() got multiple values for keyword argument '%s'", func_name,
+ PyString_AsString(kw_name));
+ #endif
+}
+
+static int __Pyx_ParseOptionalKeywords(
+ PyObject *kwds,
+ PyObject **argnames[],
+ PyObject *kwds2,
+ PyObject *values[],
+ Py_ssize_t num_pos_args,
+ const char* function_name)
+{
+ PyObject *key = 0, *value = 0;
+ Py_ssize_t pos = 0;
+ PyObject*** name;
+ PyObject*** first_kw_arg = argnames + num_pos_args;
+ while (PyDict_Next(kwds, &pos, &key, &value)) {
+ name = first_kw_arg;
+ while (*name && (**name != key)) name++;
+ if (*name) {
+ values[name-argnames] = value;
+ continue;
+ }
+ name = first_kw_arg;
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
+ while (*name) {
+ if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**name, key)) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ if ((**argname == key) || (
+ (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**argname, key))) {
+ goto arg_passed_twice;
+ }
+ argname++;
+ }
+ }
+ } else
+ #endif
+ if (likely(PyUnicode_Check(key))) {
+ while (*name) {
+ int cmp = (**name == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**name, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ int cmp = (**argname == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**argname, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) goto arg_passed_twice;
+ argname++;
+ }
+ }
+ } else
+ goto invalid_keyword_type;
+ if (kwds2) {
+ if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
+ } else {
+ goto invalid_keyword;
+ }
+ }
+ return 0;
+arg_passed_twice:
+ __Pyx_RaiseDoubleKeywordsError(function_name, key);
+ goto bad;
+invalid_keyword_type:
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() keywords must be strings", function_name);
+ goto bad;
+invalid_keyword:
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION < 3
+ "%.200s() got an unexpected keyword argument '%.200s'",
+ function_name, PyString_AsString(key));
+ #else
+ "%s() got an unexpected keyword argument '%U'",
+ function_name, key);
+ #endif
+bad:
+ return -1;
+}
+
+static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
+ PyErr_Format(PyExc_TypeError,
+ "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
+ name, type->tp_name, Py_TYPE(obj)->tp_name);
+}
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+ const char *name, int exact)
+{
+ if (unlikely(!type)) {
+ PyErr_SetString(PyExc_SystemError, "Missing type object");
+ return 0;
+ }
+ if (none_allowed && obj == Py_None) return 1;
+ else if (exact) {
+ if (likely(Py_TYPE(obj) == type)) return 1;
+ #if PY_MAJOR_VERSION == 2
+ else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
+ #endif
+ }
+ else {
+ if (likely(PyObject_TypeCheck(obj, type))) return 1;
+ }
+ __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
+ return 0;
+}
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
+ PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
+ if (unlikely(!result)) {
+ PyErr_Format(PyExc_NameError,
+#if PY_MAJOR_VERSION >= 3
+ "name '%U' is not defined", name);
+#else
+ "name '%.200s' is not defined", PyString_AS_STRING(name));
+#endif
+ }
+ return result;
+}
+
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
+ PyObject *result;
+#if CYTHON_COMPILING_IN_CPYTHON
+ result = PyDict_GetItem(__pyx_d, name);
+ if (likely(result)) {
+ Py_INCREF(result);
+ } else {
+#else
+ result = PyObject_GetItem(__pyx_d, name);
+ if (!result) {
+ PyErr_Clear();
+#endif
+ result = __Pyx_GetBuiltinName(name);
+ }
+ return result;
+}
+
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
+ PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
+ if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Format(PyExc_ImportError,
+ #if PY_MAJOR_VERSION < 3
+ "cannot import name %.230s", PyString_AS_STRING(name));
+ #else
+ "cannot import name %S", name);
+ #endif
+ }
+ return value;
+}
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+ PyObject *result;
+ ternaryfunc call = func->ob_type->tp_call;
+ if (unlikely(!call))
+ return PyObject_Call(func, arg, kw);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = (*call)(func, arg, kw);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
+ PyObject *self, *result;
+ PyCFunction cfunc;
+ cfunc = PyCFunction_GET_FUNCTION(func);
+ self = PyCFunction_GET_SELF(func);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = cfunc(self, arg);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject *result;
+ PyObject *args = PyTuple_New(1);
+ if (unlikely(!args)) return NULL;
+ Py_INCREF(arg);
+ PyTuple_SET_ITEM(args, 0, arg);
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#ifdef __Pyx_CyFunction_USED
+ if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+ if (likely(PyCFunction_Check(func))) {
+#endif
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
+ return __Pyx_PyObject_CallMethO(func, arg);
+ }
+ }
+ return __Pyx__PyObject_CallOneArg(func, arg);
+}
+#else
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject* args = PyTuple_Pack(1, arg);
+ return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+}
+#endif
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyThreadState *tstate = PyThreadState_GET();
+ tmp_type = tstate->curexc_type;
+ tmp_value = tstate->curexc_value;
+ tmp_tb = tstate->curexc_traceback;
+ tstate->curexc_type = type;
+ tstate->curexc_value = value;
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_Restore(type, value, tb);
+#endif
+}
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ *type = tstate->curexc_type;
+ *value = tstate->curexc_value;
+ *tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(type, value, tb);
+#endif
+}
+
+#if PY_MAJOR_VERSION < 3
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
+ CYTHON_UNUSED PyObject *cause) {
+ Py_XINCREF(type);
+ if (!value || value == Py_None)
+ value = NULL;
+ else
+ Py_INCREF(value);
+ if (!tb || tb == Py_None)
+ tb = NULL;
+ else {
+ Py_INCREF(tb);
+ if (!PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto raise_error;
+ }
+ }
+ if (PyType_Check(type)) {
+#if CYTHON_COMPILING_IN_PYPY
+ if (!value) {
+ Py_INCREF(Py_None);
+ value = Py_None;
+ }
+#endif
+ PyErr_NormalizeException(&type, &value, &tb);
+ } else {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto raise_error;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(type);
+ Py_INCREF(type);
+ if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto raise_error;
+ }
+ }
+ __Pyx_ErrRestore(type, value, tb);
+ return;
+raise_error:
+ Py_XDECREF(value);
+ Py_XDECREF(type);
+ Py_XDECREF(tb);
+ return;
+}
+#else
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
+ PyObject* owned_instance = NULL;
+ if (tb == Py_None) {
+ tb = 0;
+ } else if (tb && !PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto bad;
+ }
+ if (value == Py_None)
+ value = 0;
+ if (PyExceptionInstance_Check(type)) {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto bad;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(value);
+ } else if (PyExceptionClass_Check(type)) {
+ PyObject *instance_class = NULL;
+ if (value && PyExceptionInstance_Check(value)) {
+ instance_class = (PyObject*) Py_TYPE(value);
+ if (instance_class != type) {
+ if (PyObject_IsSubclass(instance_class, type)) {
+ type = instance_class;
+ } else {
+ instance_class = NULL;
+ }
+ }
+ }
+ if (!instance_class) {
+ PyObject *args;
+ if (!value)
+ args = PyTuple_New(0);
+ else if (PyTuple_Check(value)) {
+ Py_INCREF(value);
+ args = value;
+ } else
+ args = PyTuple_Pack(1, value);
+ if (!args)
+ goto bad;
+ owned_instance = PyObject_Call(type, args, NULL);
+ Py_DECREF(args);
+ if (!owned_instance)
+ goto bad;
+ value = owned_instance;
+ if (!PyExceptionInstance_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "calling %R should have returned an instance of "
+ "BaseException, not %R",
+ type, Py_TYPE(value));
+ goto bad;
+ }
+ }
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto bad;
+ }
+#if PY_VERSION_HEX >= 0x03030000
+ if (cause) {
+#else
+ if (cause && cause != Py_None) {
+#endif
+ PyObject *fixed_cause;
+ if (cause == Py_None) {
+ fixed_cause = NULL;
+ } else if (PyExceptionClass_Check(cause)) {
+ fixed_cause = PyObject_CallObject(cause, NULL);
+ if (fixed_cause == NULL)
+ goto bad;
+ } else if (PyExceptionInstance_Check(cause)) {
+ fixed_cause = cause;
+ Py_INCREF(fixed_cause);
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "exception causes must derive from "
+ "BaseException");
+ goto bad;
+ }
+ PyException_SetCause(value, fixed_cause);
+ }
+ PyErr_SetObject(type, value);
+ if (tb) {
+#if CYTHON_COMPILING_IN_PYPY
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyErr_Fetch(tmp_type, tmp_value, tmp_tb);
+ Py_INCREF(tb);
+ PyErr_Restore(tmp_type, tmp_value, tb);
+ Py_XDECREF(tmp_tb);
+#else
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject* tmp_tb = tstate->curexc_traceback;
+ if (tb != tmp_tb) {
+ Py_INCREF(tb);
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_tb);
+ }
+#endif
+ }
+bad:
+ Py_XDECREF(owned_instance);
+ return;
+}
+#endif
+
+static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ *type = tstate->exc_type;
+ *value = tstate->exc_value;
+ *tb = tstate->exc_traceback;
+ Py_XINCREF(*type);
+ Py_XINCREF(*value);
+ Py_XINCREF(*tb);
+#else
+ PyErr_GetExcInfo(type, value, tb);
+#endif
+}
+static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyThreadState *tstate = PyThreadState_GET();
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = type;
+ tstate->exc_value = value;
+ tstate->exc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_SetExcInfo(type, value, tb);
+#endif
+}
+
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *local_type, *local_value, *local_tb;
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyThreadState *tstate = PyThreadState_GET();
+ local_type = tstate->curexc_type;
+ local_value = tstate->curexc_value;
+ local_tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(&local_type, &local_value, &local_tb);
+#endif
+ PyErr_NormalizeException(&local_type, &local_value, &local_tb);
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(tstate->curexc_type))
+#else
+ if (unlikely(PyErr_Occurred()))
+#endif
+ goto bad;
+ #if PY_MAJOR_VERSION >= 3
+ if (local_tb) {
+ if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
+ goto bad;
+ }
+ #endif
+ Py_XINCREF(local_tb);
+ Py_XINCREF(local_type);
+ Py_XINCREF(local_value);
+ *type = local_type;
+ *value = local_value;
+ *tb = local_tb;
+#if CYTHON_COMPILING_IN_CPYTHON
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = local_type;
+ tstate->exc_value = local_value;
+ tstate->exc_traceback = local_tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_SetExcInfo(local_type, local_value, local_tb);
+#endif
+ return 0;
+bad:
+ *type = 0;
+ *value = 0;
+ *tb = 0;
+ Py_XDECREF(local_type);
+ Py_XDECREF(local_value);
+ Py_XDECREF(local_tb);
+ return -1;
+}
+
+static void* __Pyx_GetVtable(PyObject *dict) {
+ void* ptr;
+ PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
+ if (!ob)
+ goto bad;
+#if PY_VERSION_HEX >= 0x02070000
+ ptr = PyCapsule_GetPointer(ob, 0);
+#else
+ ptr = PyCObject_AsVoidPtr(ob);
+#endif
+ if (!ptr && !PyErr_Occurred())
+ PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
+ Py_DECREF(ob);
+ return ptr;
+bad:
+ Py_XDECREF(ob);
+ return NULL;
+}
+
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+ int start = 0, mid = 0, end = count - 1;
+ if (end >= 0 && code_line > entries[end].code_line) {
+ return count;
+ }
+ while (start < end) {
+ mid = (start + end) / 2;
+ if (code_line < entries[mid].code_line) {
+ end = mid;
+ } else if (code_line > entries[mid].code_line) {
+ start = mid + 1;
+ } else {
+ return mid;
+ }
+ }
+ if (code_line <= entries[mid].code_line) {
+ return mid;
+ } else {
+ return mid + 1;
+ }
+}
+static PyCodeObject *__pyx_find_code_object(int code_line) {
+ PyCodeObject* code_object;
+ int pos;
+ if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
+ return NULL;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
+ return NULL;
+ }
+ code_object = __pyx_code_cache.entries[pos].code_object;
+ Py_INCREF(code_object);
+ return code_object;
+}
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
+ int pos, i;
+ __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
+ if (unlikely(!code_line)) {
+ return;
+ }
+ if (unlikely(!entries)) {
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (likely(entries)) {
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = 64;
+ __pyx_code_cache.count = 1;
+ entries[0].code_line = code_line;
+ entries[0].code_object = code_object;
+ Py_INCREF(code_object);
+ }
+ return;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
+ PyCodeObject* tmp = entries[pos].code_object;
+ entries[pos].code_object = code_object;
+ Py_DECREF(tmp);
+ return;
+ }
+ if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
+ int new_max = __pyx_code_cache.max_count + 64;
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
+ __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (unlikely(!entries)) {
+ return;
+ }
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = new_max;
+ }
+ for (i=__pyx_code_cache.count; i>pos; i--) {
+ entries[i] = entries[i-1];
+ }
+ entries[pos].code_line = code_line;
+ entries[pos].code_object = code_object;
+ __pyx_code_cache.count++;
+ Py_INCREF(code_object);
+}
+
+#include "compile.h"
+#include "frameobject.h"
+#include "traceback.h"
+static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
+ const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyObject *py_srcfile = 0;
+ PyObject *py_funcname = 0;
+ #if PY_MAJOR_VERSION < 3
+ py_srcfile = PyString_FromString(filename);
+ #else
+ py_srcfile = PyUnicode_FromString(filename);
+ #endif
+ if (!py_srcfile) goto bad;
+ if (c_line) {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #else
+ py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #endif
+ }
+ else {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromString(funcname);
+ #else
+ py_funcname = PyUnicode_FromString(funcname);
+ #endif
+ }
+ if (!py_funcname) goto bad;
+ py_code = __Pyx_PyCode_New(
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ __pyx_empty_bytes, /*PyObject *code,*/
+ __pyx_empty_tuple, /*PyObject *consts,*/
+ __pyx_empty_tuple, /*PyObject *names,*/
+ __pyx_empty_tuple, /*PyObject *varnames,*/
+ __pyx_empty_tuple, /*PyObject *freevars,*/
+ __pyx_empty_tuple, /*PyObject *cellvars,*/
+ py_srcfile, /*PyObject *filename,*/
+ py_funcname, /*PyObject *name,*/
+ py_line,
+ __pyx_empty_bytes /*PyObject *lnotab*/
+ );
+ Py_DECREF(py_srcfile);
+ Py_DECREF(py_funcname);
+ return py_code;
+bad:
+ Py_XDECREF(py_srcfile);
+ Py_XDECREF(py_funcname);
+ return NULL;
+}
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyFrameObject *py_frame = 0;
+ py_code = __pyx_find_code_object(c_line ? c_line : py_line);
+ if (!py_code) {
+ py_code = __Pyx_CreateCodeObjectForTraceback(
+ funcname, c_line, py_line, filename);
+ if (!py_code) goto bad;
+ __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
+ }
+ py_frame = PyFrame_New(
+ PyThreadState_GET(), /*PyThreadState *tstate,*/
+ py_code, /*PyCodeObject *code,*/
+ __pyx_d, /*PyObject *globals,*/
+ 0 /*PyObject *locals*/
+ );
+ if (!py_frame) goto bad;
+ py_frame->f_lineno = py_line;
+ PyTraceBack_Here(py_frame);
+bad:
+ Py_XDECREF(py_code);
+ Py_XDECREF(py_frame);
+}
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
+ goto bad;
+ #endif
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ {
+ #if PY_MAJOR_VERSION >= 3
+ if (level == -1) {
+ if (strchr(__Pyx_MODULE_NAME, '.')) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(1);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, 1);
+ #endif
+ if (!module) {
+ if (!PyErr_ExceptionMatches(PyExc_ImportError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ level = 0;
+ }
+ #endif
+ if (!module) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(level);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, level);
+ #endif
+ }
+ }
+bad:
+ #if PY_VERSION_HEX < 0x03030000
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+ const int neg_one = (int) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(int) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(int) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(int),
+ little, !is_unsigned);
+ }
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+ const long neg_one = (long) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(long) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(long) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(long long)) {
+ return PyLong_FromLongLong((long long) value);
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(long),
+ little, !is_unsigned);
+ }
+}
+
+#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value) \
+ { \
+ func_type value = func_value; \
+ if (sizeof(target_type) < sizeof(func_type)) { \
+ if (unlikely(value != (func_type) (target_type) value)) { \
+ func_type zero = 0; \
+ if (is_unsigned && unlikely(value < zero)) \
+ goto raise_neg_overflow; \
+ else \
+ goto raise_overflow; \
+ } \
+ } \
+ return (target_type) value; \
+ }
+
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ #include "longintrepr.h"
+ #endif
+#endif
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+ const long neg_one = (long) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(long) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (long) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(long) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(long) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(long) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
+ } else if (sizeof(long) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ long val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (long) -1;
+ }
+ } else {
+ long val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (long) -1;
+ val = __Pyx_PyInt_As_long(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to long");
+ return (long) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to long");
+ return (long) -1;
+}
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+ const int neg_one = (int) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(int) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (int) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(int) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ }
+ } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(x)) {
+ case 0: return 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
+ } else if (sizeof(int) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ int val;
+ PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (int) -1;
+ }
+ } else {
+ int val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (int) -1;
+ val = __Pyx_PyInt_As_int(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to int");
+ return (int) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to int");
+ return (int) -1;
+}
+
+static int __Pyx_check_binary_version(void) {
+ char ctversion[4], rtversion[4];
+ PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
+ if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
+ char message[200];
+ PyOS_snprintf(message, sizeof(message),
+ "compiletime version %s of module '%.100s' "
+ "does not match runtime version %s",
+ ctversion, __Pyx_MODULE_NAME, rtversion);
+ return PyErr_WarnEx(NULL, message, 1);
+ }
+ return 0;
+}
+
+#ifndef __PYX_HAVE_RT_ImportModule
+#define __PYX_HAVE_RT_ImportModule
+static PyObject *__Pyx_ImportModule(const char *name) {
+ PyObject *py_name = 0;
+ PyObject *py_module = 0;
+ py_name = __Pyx_PyIdentifier_FromString(name);
+ if (!py_name)
+ goto bad;
+ py_module = PyImport_Import(py_name);
+ Py_DECREF(py_name);
+ return py_module;
+bad:
+ Py_XDECREF(py_name);
+ return 0;
+}
+#endif
+
+#ifndef __PYX_HAVE_RT_ImportType
+#define __PYX_HAVE_RT_ImportType
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
+ size_t size, int strict)
+{
+ PyObject *py_module = 0;
+ PyObject *result = 0;
+ PyObject *py_name = 0;
+ char warning[200];
+ Py_ssize_t basicsize;
+#ifdef Py_LIMITED_API
+ PyObject *py_basicsize;
+#endif
+ py_module = __Pyx_ImportModule(module_name);
+ if (!py_module)
+ goto bad;
+ py_name = __Pyx_PyIdentifier_FromString(class_name);
+ if (!py_name)
+ goto bad;
+ result = PyObject_GetAttr(py_module, py_name);
+ Py_DECREF(py_name);
+ py_name = 0;
+ Py_DECREF(py_module);
+ py_module = 0;
+ if (!result)
+ goto bad;
+ if (!PyType_Check(result)) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s.%.200s is not a type object",
+ module_name, class_name);
+ goto bad;
+ }
+#ifndef Py_LIMITED_API
+ basicsize = ((PyTypeObject *)result)->tp_basicsize;
+#else
+ py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
+ if (!py_basicsize)
+ goto bad;
+ basicsize = PyLong_AsSsize_t(py_basicsize);
+ Py_DECREF(py_basicsize);
+ py_basicsize = 0;
+ if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
+ goto bad;
+#endif
+ if (!strict && (size_t)basicsize > size) {
+ PyOS_snprintf(warning, sizeof(warning),
+ "%s.%s size changed, may indicate binary incompatibility",
+ module_name, class_name);
+ if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
+ }
+ else if ((size_t)basicsize != size) {
+ PyErr_Format(PyExc_ValueError,
+ "%.200s.%.200s has the wrong size, try recompiling",
+ module_name, class_name);
+ goto bad;
+ }
+ return (PyTypeObject *)result;
+bad:
+ Py_XDECREF(py_module);
+ Py_XDECREF(result);
+ return NULL;
+}
+#endif
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+ while (t->p) {
+ #if PY_MAJOR_VERSION < 3
+ if (t->is_unicode) {
+ *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
+ } else if (t->intern) {
+ *t->p = PyString_InternFromString(t->s);
+ } else {
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+ }
+ #else
+ if (t->is_unicode | t->is_str) {
+ if (t->intern) {
+ *t->p = PyUnicode_InternFromString(t->s);
+ } else if (t->encoding) {
+ *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
+ } else {
+ *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+ }
+ } else {
+ *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
+ }
+ #endif
+ if (!*t->p)
+ return -1;
+ ++t;
+ }
+ return 0;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
+ return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
+ Py_ssize_t ignore;
+ return __Pyx_PyObject_AsStringAndSize(o, &ignore);
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+ if (
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ __Pyx_sys_getdefaultencoding_not_ascii &&
+#endif
+ PyUnicode_Check(o)) {
+#if PY_VERSION_HEX < 0x03030000
+ char* defenc_c;
+ PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
+ if (!defenc) return NULL;
+ defenc_c = PyBytes_AS_STRING(defenc);
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ {
+ char* end = defenc_c + PyBytes_GET_SIZE(defenc);
+ char* c;
+ for (c = defenc_c; c < end; c++) {
+ if ((unsigned char) (*c) >= 128) {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+ }
+ }
+#endif
+ *length = PyBytes_GET_SIZE(defenc);
+ return defenc_c;
+#else
+ if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ if (PyUnicode_IS_ASCII(o)) {
+ *length = PyUnicode_GET_LENGTH(o);
+ return PyUnicode_AsUTF8(o);
+ } else {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+#else
+ return PyUnicode_AsUTF8AndSize(o, length);
+#endif
+#endif
+ } else
+#endif
+#if !CYTHON_COMPILING_IN_PYPY
+ if (PyByteArray_Check(o)) {
+ *length = PyByteArray_GET_SIZE(o);
+ return PyByteArray_AS_STRING(o);
+ } else
+#endif
+ {
+ char* result;
+ int r = PyBytes_AsStringAndSize(o, &result, length);
+ if (unlikely(r < 0)) {
+ return NULL;
+ } else {
+ return result;
+ }
+ }
+}
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
+ int is_true = x == Py_True;
+ if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
+ else return PyObject_IsTrue(x);
+}
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
+ PyNumberMethods *m;
+ const char *name = NULL;
+ PyObject *res = NULL;
+#if PY_MAJOR_VERSION < 3
+ if (PyInt_Check(x) || PyLong_Check(x))
+#else
+ if (PyLong_Check(x))
+#endif
+ return Py_INCREF(x), x;
+ m = Py_TYPE(x)->tp_as_number;
+#if PY_MAJOR_VERSION < 3
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Int(x);
+ }
+ else if (m && m->nb_long) {
+ name = "long";
+ res = PyNumber_Long(x);
+ }
+#else
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Long(x);
+ }
+#endif
+ if (res) {
+#if PY_MAJOR_VERSION < 3
+ if (!PyInt_Check(res) && !PyLong_Check(res)) {
+#else
+ if (!PyLong_Check(res)) {
+#endif
+ PyErr_Format(PyExc_TypeError,
+ "__%.4s__ returned non-%.4s (type %.200s)",
+ name, name, Py_TYPE(res)->tp_name);
+ Py_DECREF(res);
+ return NULL;
+ }
+ }
+ else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "an integer is required");
+ }
+ return res;
+}
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+ Py_ssize_t ival;
+ PyObject *x;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(b)))
+ return PyInt_AS_LONG(b);
+#endif
+ if (likely(PyLong_CheckExact(b))) {
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+ switch (Py_SIZE(b)) {
+ case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
+ case 0: return 0;
+ case 1: return ((PyLongObject*)b)->ob_digit[0];
+ }
+ #endif
+ #endif
+ return PyLong_AsSsize_t(b);
+ }
+ x = PyNumber_Index(b);
+ if (!x) return -1;
+ ival = PyInt_AsSsize_t(x);
+ Py_DECREF(x);
+ return ival;
+}
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
+ return PyInt_FromSize_t(ival);
+}
+
+
+#endif /* Py_PYTHON_H */
diff --git a/scripts/external_libs/zmq/devices/monitoredqueue.pxd b/scripts/external_libs/platform/cel59/zmq/devices/monitoredqueue.pxd
index 1e26ed86..1e26ed86 100644
--- a/scripts/external_libs/zmq/devices/monitoredqueue.pxd
+++ b/scripts/external_libs/platform/cel59/zmq/devices/monitoredqueue.pxd
diff --git a/scripts/external_libs/platform/cel59/zmq/devices/monitoredqueue.py b/scripts/external_libs/platform/cel59/zmq/devices/monitoredqueue.py
new file mode 100644
index 00000000..c6d91429
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/devices/monitoredqueue.py
@@ -0,0 +1,37 @@
+"""pure Python monitored_queue function
+
+For use when Cython extension is unavailable (PyPy).
+
+Authors
+-------
+* MinRK
+"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import zmq
+
+def _relay(ins, outs, sides, prefix, swap_ids):
+ msg = ins.recv_multipart()
+ if swap_ids:
+ msg[:2] = msg[:2][::-1]
+ outs.send_multipart(msg)
+ sides.send_multipart([prefix] + msg)
+
+def monitored_queue(in_socket, out_socket, mon_socket,
+ in_prefix=b'in', out_prefix=b'out'):
+
+ swap_ids = in_socket.type == zmq.ROUTER and out_socket.type == zmq.ROUTER
+
+ poller = zmq.Poller()
+ poller.register(in_socket, zmq.POLLIN)
+ poller.register(out_socket, zmq.POLLIN)
+ while True:
+ events = dict(poller.poll())
+ if in_socket in events:
+ _relay(in_socket, out_socket, mon_socket, in_prefix, swap_ids)
+ if out_socket in events:
+ _relay(out_socket, in_socket, mon_socket, out_prefix, swap_ids)
+
+__all__ = ['monitored_queue']
diff --git a/scripts/external_libs/platform/cel59/zmq/devices/monitoredqueue.pyx b/scripts/external_libs/platform/cel59/zmq/devices/monitoredqueue.pyx
new file mode 100644
index 00000000..d5fec64d
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/devices/monitoredqueue.pyx
@@ -0,0 +1,103 @@
+"""MonitoredQueue classes and functions.
+
+Authors
+-------
+* MinRK
+* Brian Granger
+"""
+
+#-----------------------------------------------------------------------------
+# Copyright (c) 2010-2012 Brian Granger, Min Ragan-Kelley
+#
+# This file is part of pyzmq
+#
+# Distributed under the terms of the New BSD License. The full license is in
+# the file COPYING.BSD, distributed as part of this software.
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# Imports
+#-----------------------------------------------------------------------------
+
+cdef extern from "Python.h":
+ ctypedef int Py_ssize_t
+
+from libc.string cimport memcpy
+
+from buffers cimport asbuffer_r
+from libzmq cimport *
+
+from zmq.backend.cython.socket cimport Socket
+from zmq.backend.cython.checkrc cimport _check_rc
+
+from zmq import ROUTER, ZMQError
+
+#-----------------------------------------------------------------------------
+# MonitoredQueue functions
+#-----------------------------------------------------------------------------
+
+
+def monitored_queue(Socket in_socket, Socket out_socket, Socket mon_socket,
+ bytes in_prefix=b'in', bytes out_prefix=b'out'):
+ """monitored_queue(in_socket, out_socket, mon_socket,
+ in_prefix=b'in', out_prefix=b'out')
+
+ Start a monitored queue device.
+
+ A monitored queue is very similar to the zmq.proxy device (monitored queue came first).
+
+ Differences from zmq.proxy:
+
+ - monitored_queue supports both in and out being ROUTER sockets
+ (via swapping IDENTITY prefixes).
+ - monitor messages are prefixed, making in and out messages distinguishable.
+
+ Parameters
+ ----------
+ in_socket : Socket
+ One of the sockets to the Queue. Its messages will be prefixed with
+ 'in'.
+ out_socket : Socket
+ One of the sockets to the Queue. Its messages will be prefixed with
+ 'out'. The only difference between in/out socket is this prefix.
+ mon_socket : Socket
+ This socket sends out every message received by each of the others
+ with an in/out prefix specifying which one it was.
+ in_prefix : str
+ Prefix added to broadcast messages from in_socket.
+ out_prefix : str
+ Prefix added to broadcast messages from out_socket.
+ """
+
+ cdef void *ins=in_socket.handle
+ cdef void *outs=out_socket.handle
+ cdef void *mons=mon_socket.handle
+ cdef zmq_msg_t in_msg
+ cdef zmq_msg_t out_msg
+ cdef bint swap_ids
+ cdef char *msg_c = NULL
+ cdef Py_ssize_t msg_c_len
+ cdef int rc
+
+ # force swap_ids if both ROUTERs
+ swap_ids = (in_socket.type == ROUTER and out_socket.type == ROUTER)
+
+ # build zmq_msg objects from str prefixes
+ asbuffer_r(in_prefix, <void **>&msg_c, &msg_c_len)
+ rc = zmq_msg_init_size(&in_msg, msg_c_len)
+ _check_rc(rc)
+
+ memcpy(zmq_msg_data(&in_msg), msg_c, zmq_msg_size(&in_msg))
+
+ asbuffer_r(out_prefix, <void **>&msg_c, &msg_c_len)
+
+ rc = zmq_msg_init_size(&out_msg, msg_c_len)
+ _check_rc(rc)
+
+ with nogil:
+ memcpy(zmq_msg_data(&out_msg), msg_c, zmq_msg_size(&out_msg))
+ rc = c_monitored_queue(ins, outs, mons, &in_msg, &out_msg, swap_ids)
+ _check_rc(rc)
+ return rc
+
+__all__ = ['monitored_queue']
diff --git a/scripts/external_libs/zmq/devices/monitoredqueuedevice.py b/scripts/external_libs/platform/cel59/zmq/devices/monitoredqueuedevice.py
index 9723f866..9723f866 100644
--- a/scripts/external_libs/zmq/devices/monitoredqueuedevice.py
+++ b/scripts/external_libs/platform/cel59/zmq/devices/monitoredqueuedevice.py
diff --git a/scripts/external_libs/zmq/devices/proxydevice.py b/scripts/external_libs/platform/cel59/zmq/devices/proxydevice.py
index 68be3f15..68be3f15 100644
--- a/scripts/external_libs/zmq/devices/proxydevice.py
+++ b/scripts/external_libs/platform/cel59/zmq/devices/proxydevice.py
diff --git a/scripts/external_libs/zmq/error.py b/scripts/external_libs/platform/cel59/zmq/error.py
index 48cdaafa..48cdaafa 100644
--- a/scripts/external_libs/zmq/error.py
+++ b/scripts/external_libs/platform/cel59/zmq/error.py
diff --git a/scripts/external_libs/zmq/eventloop/__init__.py b/scripts/external_libs/platform/cel59/zmq/eventloop/__init__.py
index 568e8e8d..568e8e8d 100644
--- a/scripts/external_libs/zmq/eventloop/__init__.py
+++ b/scripts/external_libs/platform/cel59/zmq/eventloop/__init__.py
diff --git a/scripts/external_libs/zmq/eventloop/ioloop.py b/scripts/external_libs/platform/cel59/zmq/eventloop/ioloop.py
index 35f4c418..35f4c418 100644
--- a/scripts/external_libs/zmq/eventloop/ioloop.py
+++ b/scripts/external_libs/platform/cel59/zmq/eventloop/ioloop.py
diff --git a/scripts/external_libs/zmq/eventloop/minitornado/__init__.py b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/__init__.py
index e69de29b..e69de29b 100644
--- a/scripts/external_libs/zmq/eventloop/minitornado/__init__.py
+++ b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/__init__.py
diff --git a/scripts/external_libs/zmq/eventloop/minitornado/concurrent.py b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/concurrent.py
index 519b23d5..519b23d5 100644
--- a/scripts/external_libs/zmq/eventloop/minitornado/concurrent.py
+++ b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/concurrent.py
diff --git a/scripts/external_libs/zmq/eventloop/minitornado/ioloop.py b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/ioloop.py
index 710a3ecb..710a3ecb 100644
--- a/scripts/external_libs/zmq/eventloop/minitornado/ioloop.py
+++ b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/ioloop.py
diff --git a/scripts/external_libs/zmq/eventloop/minitornado/log.py b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/log.py
index 49051e89..49051e89 100644
--- a/scripts/external_libs/zmq/eventloop/minitornado/log.py
+++ b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/log.py
diff --git a/scripts/external_libs/zmq/eventloop/minitornado/platform/__init__.py b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/platform/__init__.py
index e69de29b..e69de29b 100644
--- a/scripts/external_libs/zmq/eventloop/minitornado/platform/__init__.py
+++ b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/platform/__init__.py
diff --git a/scripts/external_libs/zmq/eventloop/minitornado/platform/auto.py b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/platform/auto.py
index b40ccd94..b40ccd94 100644
--- a/scripts/external_libs/zmq/eventloop/minitornado/platform/auto.py
+++ b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/platform/auto.py
diff --git a/scripts/external_libs/zmq/eventloop/minitornado/platform/common.py b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/platform/common.py
index 2d75dc1e..2d75dc1e 100644
--- a/scripts/external_libs/zmq/eventloop/minitornado/platform/common.py
+++ b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/platform/common.py
diff --git a/scripts/external_libs/zmq/eventloop/minitornado/platform/interface.py b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/platform/interface.py
index 07da6bab..07da6bab 100644
--- a/scripts/external_libs/zmq/eventloop/minitornado/platform/interface.py
+++ b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/platform/interface.py
diff --git a/scripts/external_libs/zmq/eventloop/minitornado/platform/posix.py b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/platform/posix.py
index ccffbb66..ccffbb66 100644
--- a/scripts/external_libs/zmq/eventloop/minitornado/platform/posix.py
+++ b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/platform/posix.py
diff --git a/scripts/external_libs/zmq/eventloop/minitornado/platform/windows.py b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/platform/windows.py
index 817bdca1..817bdca1 100644
--- a/scripts/external_libs/zmq/eventloop/minitornado/platform/windows.py
+++ b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/platform/windows.py
diff --git a/scripts/external_libs/zmq/eventloop/minitornado/stack_context.py b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/stack_context.py
index 226d8042..226d8042 100644
--- a/scripts/external_libs/zmq/eventloop/minitornado/stack_context.py
+++ b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/stack_context.py
diff --git a/scripts/external_libs/zmq/eventloop/minitornado/util.py b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/util.py
index c1e2eb95..c1e2eb95 100644
--- a/scripts/external_libs/zmq/eventloop/minitornado/util.py
+++ b/scripts/external_libs/platform/cel59/zmq/eventloop/minitornado/util.py
diff --git a/scripts/external_libs/zmq/eventloop/zmqstream.py b/scripts/external_libs/platform/cel59/zmq/eventloop/zmqstream.py
index 86a97e44..86a97e44 100644
--- a/scripts/external_libs/zmq/eventloop/zmqstream.py
+++ b/scripts/external_libs/platform/cel59/zmq/eventloop/zmqstream.py
diff --git a/scripts/external_libs/zmq/green/__init__.py b/scripts/external_libs/platform/cel59/zmq/green/__init__.py
index ff7e5965..ff7e5965 100644
--- a/scripts/external_libs/zmq/green/__init__.py
+++ b/scripts/external_libs/platform/cel59/zmq/green/__init__.py
diff --git a/scripts/external_libs/zmq/green/core.py b/scripts/external_libs/platform/cel59/zmq/green/core.py
index 9fc73e32..9fc73e32 100644
--- a/scripts/external_libs/zmq/green/core.py
+++ b/scripts/external_libs/platform/cel59/zmq/green/core.py
diff --git a/scripts/external_libs/zmq/green/device.py b/scripts/external_libs/platform/cel59/zmq/green/device.py
index 4b070237..4b070237 100644
--- a/scripts/external_libs/zmq/green/device.py
+++ b/scripts/external_libs/platform/cel59/zmq/green/device.py
diff --git a/scripts/external_libs/zmq/green/eventloop/__init__.py b/scripts/external_libs/platform/cel59/zmq/green/eventloop/__init__.py
index c5150efe..c5150efe 100644
--- a/scripts/external_libs/zmq/green/eventloop/__init__.py
+++ b/scripts/external_libs/platform/cel59/zmq/green/eventloop/__init__.py
diff --git a/scripts/external_libs/zmq/green/eventloop/ioloop.py b/scripts/external_libs/platform/cel59/zmq/green/eventloop/ioloop.py
index e12fd5e9..e12fd5e9 100644
--- a/scripts/external_libs/zmq/green/eventloop/ioloop.py
+++ b/scripts/external_libs/platform/cel59/zmq/green/eventloop/ioloop.py
diff --git a/scripts/external_libs/zmq/green/eventloop/zmqstream.py b/scripts/external_libs/platform/cel59/zmq/green/eventloop/zmqstream.py
index 90fbd1f5..90fbd1f5 100644
--- a/scripts/external_libs/zmq/green/eventloop/zmqstream.py
+++ b/scripts/external_libs/platform/cel59/zmq/green/eventloop/zmqstream.py
diff --git a/scripts/external_libs/zmq/green/poll.py b/scripts/external_libs/platform/cel59/zmq/green/poll.py
index 8f016129..8f016129 100644
--- a/scripts/external_libs/zmq/green/poll.py
+++ b/scripts/external_libs/platform/cel59/zmq/green/poll.py
diff --git a/scripts/external_libs/zmq/log/__init__.py b/scripts/external_libs/platform/cel59/zmq/log/__init__.py
index e69de29b..e69de29b 100644
--- a/scripts/external_libs/zmq/log/__init__.py
+++ b/scripts/external_libs/platform/cel59/zmq/log/__init__.py
diff --git a/scripts/external_libs/zmq/log/handlers.py b/scripts/external_libs/platform/cel59/zmq/log/handlers.py
index 5ff21bf3..5ff21bf3 100644
--- a/scripts/external_libs/zmq/log/handlers.py
+++ b/scripts/external_libs/platform/cel59/zmq/log/handlers.py
diff --git a/scripts/external_libs/zmq/ssh/__init__.py b/scripts/external_libs/platform/cel59/zmq/ssh/__init__.py
index 57f09568..57f09568 100644
--- a/scripts/external_libs/zmq/ssh/__init__.py
+++ b/scripts/external_libs/platform/cel59/zmq/ssh/__init__.py
diff --git a/scripts/external_libs/zmq/ssh/forward.py b/scripts/external_libs/platform/cel59/zmq/ssh/forward.py
index 2d619462..2d619462 100644
--- a/scripts/external_libs/zmq/ssh/forward.py
+++ b/scripts/external_libs/platform/cel59/zmq/ssh/forward.py
diff --git a/scripts/external_libs/zmq/ssh/tunnel.py b/scripts/external_libs/platform/cel59/zmq/ssh/tunnel.py
index 5a0c5433..5a0c5433 100644
--- a/scripts/external_libs/zmq/ssh/tunnel.py
+++ b/scripts/external_libs/platform/cel59/zmq/ssh/tunnel.py
diff --git a/scripts/external_libs/zmq/sugar/__init__.py b/scripts/external_libs/platform/cel59/zmq/sugar/__init__.py
index d0510a44..d0510a44 100644
--- a/scripts/external_libs/zmq/sugar/__init__.py
+++ b/scripts/external_libs/platform/cel59/zmq/sugar/__init__.py
diff --git a/scripts/external_libs/zmq/sugar/attrsettr.py b/scripts/external_libs/platform/cel59/zmq/sugar/attrsettr.py
index 4bbd36d6..4bbd36d6 100644
--- a/scripts/external_libs/zmq/sugar/attrsettr.py
+++ b/scripts/external_libs/platform/cel59/zmq/sugar/attrsettr.py
diff --git a/scripts/external_libs/zmq/sugar/constants.py b/scripts/external_libs/platform/cel59/zmq/sugar/constants.py
index 88281176..88281176 100644
--- a/scripts/external_libs/zmq/sugar/constants.py
+++ b/scripts/external_libs/platform/cel59/zmq/sugar/constants.py
diff --git a/scripts/external_libs/zmq/sugar/context.py b/scripts/external_libs/platform/cel59/zmq/sugar/context.py
index 86a9c5dc..86a9c5dc 100644
--- a/scripts/external_libs/zmq/sugar/context.py
+++ b/scripts/external_libs/platform/cel59/zmq/sugar/context.py
diff --git a/scripts/external_libs/zmq/sugar/frame.py b/scripts/external_libs/platform/cel59/zmq/sugar/frame.py
index 9f556c86..9f556c86 100644
--- a/scripts/external_libs/zmq/sugar/frame.py
+++ b/scripts/external_libs/platform/cel59/zmq/sugar/frame.py
diff --git a/scripts/external_libs/zmq/sugar/poll.py b/scripts/external_libs/platform/cel59/zmq/sugar/poll.py
index c7b1d1bb..c7b1d1bb 100644
--- a/scripts/external_libs/zmq/sugar/poll.py
+++ b/scripts/external_libs/platform/cel59/zmq/sugar/poll.py
diff --git a/scripts/external_libs/zmq/sugar/socket.py b/scripts/external_libs/platform/cel59/zmq/sugar/socket.py
index c91589d7..c91589d7 100644
--- a/scripts/external_libs/zmq/sugar/socket.py
+++ b/scripts/external_libs/platform/cel59/zmq/sugar/socket.py
diff --git a/scripts/external_libs/zmq/sugar/tracker.py b/scripts/external_libs/platform/cel59/zmq/sugar/tracker.py
index fb8c007f..fb8c007f 100644
--- a/scripts/external_libs/zmq/sugar/tracker.py
+++ b/scripts/external_libs/platform/cel59/zmq/sugar/tracker.py
diff --git a/scripts/external_libs/zmq/sugar/version.py b/scripts/external_libs/platform/cel59/zmq/sugar/version.py
index ea8fbbc4..ea8fbbc4 100644
--- a/scripts/external_libs/zmq/sugar/version.py
+++ b/scripts/external_libs/platform/cel59/zmq/sugar/version.py
diff --git a/scripts/external_libs/zmq/tests/__init__.py b/scripts/external_libs/platform/cel59/zmq/tests/__init__.py
index 325a3f19..325a3f19 100644
--- a/scripts/external_libs/zmq/tests/__init__.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/__init__.py
diff --git a/scripts/external_libs/zmq/tests/test_auth.py b/scripts/external_libs/platform/cel59/zmq/tests/test_auth.py
index d350f61f..d350f61f 100644
--- a/scripts/external_libs/zmq/tests/test_auth.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_auth.py
diff --git a/scripts/external_libs/zmq/tests/test_cffi_backend.py b/scripts/external_libs/platform/cel59/zmq/tests/test_cffi_backend.py
index 1f85eebf..1f85eebf 100644
--- a/scripts/external_libs/zmq/tests/test_cffi_backend.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_cffi_backend.py
diff --git a/scripts/external_libs/zmq/tests/test_constants.py b/scripts/external_libs/platform/cel59/zmq/tests/test_constants.py
index d32b2b48..d32b2b48 100644
--- a/scripts/external_libs/zmq/tests/test_constants.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_constants.py
diff --git a/scripts/external_libs/zmq/tests/test_context.py b/scripts/external_libs/platform/cel59/zmq/tests/test_context.py
index e3280778..e3280778 100644
--- a/scripts/external_libs/zmq/tests/test_context.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_context.py
diff --git a/scripts/external_libs/zmq/tests/test_device.py b/scripts/external_libs/platform/cel59/zmq/tests/test_device.py
index f8305074..f8305074 100644
--- a/scripts/external_libs/zmq/tests/test_device.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_device.py
diff --git a/scripts/external_libs/zmq/tests/test_error.py b/scripts/external_libs/platform/cel59/zmq/tests/test_error.py
index a2eee14a..a2eee14a 100644
--- a/scripts/external_libs/zmq/tests/test_error.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_error.py
diff --git a/scripts/external_libs/zmq/tests/test_etc.py b/scripts/external_libs/platform/cel59/zmq/tests/test_etc.py
index ad224064..ad224064 100644
--- a/scripts/external_libs/zmq/tests/test_etc.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_etc.py
diff --git a/scripts/external_libs/zmq/tests/test_imports.py b/scripts/external_libs/platform/cel59/zmq/tests/test_imports.py
index c0ddfaac..c0ddfaac 100644
--- a/scripts/external_libs/zmq/tests/test_imports.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_imports.py
diff --git a/scripts/external_libs/zmq/tests/test_ioloop.py b/scripts/external_libs/platform/cel59/zmq/tests/test_ioloop.py
index 2a8b1153..2a8b1153 100644
--- a/scripts/external_libs/zmq/tests/test_ioloop.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_ioloop.py
diff --git a/scripts/external_libs/zmq/tests/test_log.py b/scripts/external_libs/platform/cel59/zmq/tests/test_log.py
index 9206f095..9206f095 100644
--- a/scripts/external_libs/zmq/tests/test_log.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_log.py
diff --git a/scripts/external_libs/zmq/tests/test_message.py b/scripts/external_libs/platform/cel59/zmq/tests/test_message.py
index d8770bdf..d8770bdf 100644
--- a/scripts/external_libs/zmq/tests/test_message.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_message.py
diff --git a/scripts/external_libs/zmq/tests/test_monitor.py b/scripts/external_libs/platform/cel59/zmq/tests/test_monitor.py
index 4f035388..4f035388 100644
--- a/scripts/external_libs/zmq/tests/test_monitor.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_monitor.py
diff --git a/scripts/external_libs/zmq/tests/test_monqueue.py b/scripts/external_libs/platform/cel59/zmq/tests/test_monqueue.py
index e855602e..e855602e 100644
--- a/scripts/external_libs/zmq/tests/test_monqueue.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_monqueue.py
diff --git a/scripts/external_libs/zmq/tests/test_multipart.py b/scripts/external_libs/platform/cel59/zmq/tests/test_multipart.py
index 24d41be0..24d41be0 100644
--- a/scripts/external_libs/zmq/tests/test_multipart.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_multipart.py
diff --git a/scripts/external_libs/zmq/tests/test_pair.py b/scripts/external_libs/platform/cel59/zmq/tests/test_pair.py
index e88c1e8b..e88c1e8b 100644
--- a/scripts/external_libs/zmq/tests/test_pair.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_pair.py
diff --git a/scripts/external_libs/zmq/tests/test_poll.py b/scripts/external_libs/platform/cel59/zmq/tests/test_poll.py
index 57346c89..57346c89 100644
--- a/scripts/external_libs/zmq/tests/test_poll.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_poll.py
diff --git a/scripts/external_libs/zmq/tests/test_pubsub.py b/scripts/external_libs/platform/cel59/zmq/tests/test_pubsub.py
index a3ee22aa..a3ee22aa 100644
--- a/scripts/external_libs/zmq/tests/test_pubsub.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_pubsub.py
diff --git a/scripts/external_libs/zmq/tests/test_reqrep.py b/scripts/external_libs/platform/cel59/zmq/tests/test_reqrep.py
index de17f2b3..de17f2b3 100644
--- a/scripts/external_libs/zmq/tests/test_reqrep.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_reqrep.py
diff --git a/scripts/external_libs/zmq/tests/test_security.py b/scripts/external_libs/platform/cel59/zmq/tests/test_security.py
index 687b7e0f..687b7e0f 100644
--- a/scripts/external_libs/zmq/tests/test_security.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_security.py
diff --git a/scripts/external_libs/zmq/tests/test_socket.py b/scripts/external_libs/platform/cel59/zmq/tests/test_socket.py
index 5c842edc..5c842edc 100644
--- a/scripts/external_libs/zmq/tests/test_socket.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_socket.py
diff --git a/scripts/external_libs/zmq/tests/test_stopwatch.py b/scripts/external_libs/platform/cel59/zmq/tests/test_stopwatch.py
index 49fb79f2..49fb79f2 100644
--- a/scripts/external_libs/zmq/tests/test_stopwatch.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_stopwatch.py
diff --git a/scripts/external_libs/zmq/tests/test_version.py b/scripts/external_libs/platform/cel59/zmq/tests/test_version.py
index 6ebebf30..6ebebf30 100644
--- a/scripts/external_libs/zmq/tests/test_version.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_version.py
diff --git a/scripts/external_libs/zmq/tests/test_win32_shim.py b/scripts/external_libs/platform/cel59/zmq/tests/test_win32_shim.py
index 55657bda..55657bda 100644
--- a/scripts/external_libs/zmq/tests/test_win32_shim.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_win32_shim.py
diff --git a/scripts/external_libs/zmq/tests/test_z85.py b/scripts/external_libs/platform/cel59/zmq/tests/test_z85.py
index 8a73cb4d..8a73cb4d 100644
--- a/scripts/external_libs/zmq/tests/test_z85.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_z85.py
diff --git a/scripts/external_libs/zmq/tests/test_zmqstream.py b/scripts/external_libs/platform/cel59/zmq/tests/test_zmqstream.py
index cdb3a171..cdb3a171 100644
--- a/scripts/external_libs/zmq/tests/test_zmqstream.py
+++ b/scripts/external_libs/platform/cel59/zmq/tests/test_zmqstream.py
diff --git a/scripts/external_libs/zmq/utils/__init__.py b/scripts/external_libs/platform/cel59/zmq/utils/__init__.py
index e69de29b..e69de29b 100644
--- a/scripts/external_libs/zmq/utils/__init__.py
+++ b/scripts/external_libs/platform/cel59/zmq/utils/__init__.py
diff --git a/scripts/external_libs/zmq/utils/buffers.pxd b/scripts/external_libs/platform/cel59/zmq/utils/buffers.pxd
index 998aa551..998aa551 100644
--- a/scripts/external_libs/zmq/utils/buffers.pxd
+++ b/scripts/external_libs/platform/cel59/zmq/utils/buffers.pxd
diff --git a/scripts/external_libs/platform/cel59/zmq/utils/compiler.json b/scripts/external_libs/platform/cel59/zmq/utils/compiler.json
new file mode 100644
index 00000000..2394c4c4
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/utils/compiler.json
@@ -0,0 +1,24 @@
+{
+ "extra_link_args": [],
+ "define_macros": [
+ [
+ "HAVE_SYS_UN_H",
+ 1
+ ]
+ ],
+ "runtime_library_dirs": [
+ "/auto/srg-sce-swinfra-usr/emb/users/imarom/tmp/pyzmq/zeromq-4.0.2/lib"
+ ],
+ "libraries": [
+ "zmq"
+ ],
+ "library_dirs": [
+ "/auto/srg-sce-swinfra-usr/emb/users/imarom/tmp/pyzmq/zeromq-4.0.2/lib"
+ ],
+ "include_dirs": [
+ "/auto/srg-sce-swinfra-usr/emb/users/imarom/tmp/pyzmq/zeromq-4.0.2/include",
+ "zmq/utils",
+ "zmq/backend/cython",
+ "zmq/devices"
+ ]
+} \ No newline at end of file
diff --git a/scripts/external_libs/platform/cel59/zmq/utils/config.json b/scripts/external_libs/platform/cel59/zmq/utils/config.json
new file mode 100644
index 00000000..e5b09891
--- /dev/null
+++ b/scripts/external_libs/platform/cel59/zmq/utils/config.json
@@ -0,0 +1,9 @@
+{
+ "have_sys_un_h": true,
+ "zmq_prefix": "/auto/srg-sce-swinfra-usr/emb/users/imarom/tmp/pyzmq/zeromq-4.0.2",
+ "no_libzmq_extension": true,
+ "libzmq_extension": false,
+ "bdist_egg": {},
+ "skip_check_zmq": false,
+ "build_ext": {}
+} \ No newline at end of file
diff --git a/scripts/external_libs/zmq/utils/constant_names.py b/scripts/external_libs/platform/cel59/zmq/utils/constant_names.py
index 47da9dc2..47da9dc2 100644
--- a/scripts/external_libs/zmq/utils/constant_names.py
+++ b/scripts/external_libs/platform/cel59/zmq/utils/constant_names.py
diff --git a/scripts/external_libs/zmq/utils/garbage.py b/scripts/external_libs/platform/cel59/zmq/utils/garbage.py
index 80a8725a..80a8725a 100644
--- a/scripts/external_libs/zmq/utils/garbage.py
+++ b/scripts/external_libs/platform/cel59/zmq/utils/garbage.py
diff --git a/scripts/external_libs/zmq/utils/getpid_compat.h b/scripts/external_libs/platform/cel59/zmq/utils/getpid_compat.h
index 47ce90fa..47ce90fa 100644
--- a/scripts/external_libs/zmq/utils/getpid_compat.h
+++ b/scripts/external_libs/platform/cel59/zmq/utils/getpid_compat.h
diff --git a/scripts/external_libs/zmq/utils/interop.py b/scripts/external_libs/platform/cel59/zmq/utils/interop.py
index 26c01969..26c01969 100644
--- a/scripts/external_libs/zmq/utils/interop.py
+++ b/scripts/external_libs/platform/cel59/zmq/utils/interop.py
diff --git a/scripts/external_libs/zmq/utils/ipcmaxlen.h b/scripts/external_libs/platform/cel59/zmq/utils/ipcmaxlen.h
index 7218db78..7218db78 100644
--- a/scripts/external_libs/zmq/utils/ipcmaxlen.h
+++ b/scripts/external_libs/platform/cel59/zmq/utils/ipcmaxlen.h
diff --git a/scripts/external_libs/zmq/utils/jsonapi.py b/scripts/external_libs/platform/cel59/zmq/utils/jsonapi.py
index 865ca6d5..865ca6d5 100644
--- a/scripts/external_libs/zmq/utils/jsonapi.py
+++ b/scripts/external_libs/platform/cel59/zmq/utils/jsonapi.py
diff --git a/scripts/external_libs/zmq/utils/monitor.py b/scripts/external_libs/platform/cel59/zmq/utils/monitor.py
index 734d54b1..734d54b1 100644
--- a/scripts/external_libs/zmq/utils/monitor.py
+++ b/scripts/external_libs/platform/cel59/zmq/utils/monitor.py
diff --git a/scripts/external_libs/zmq/utils/pyversion_compat.h b/scripts/external_libs/platform/cel59/zmq/utils/pyversion_compat.h
index fac09046..fac09046 100644
--- a/scripts/external_libs/zmq/utils/pyversion_compat.h
+++ b/scripts/external_libs/platform/cel59/zmq/utils/pyversion_compat.h
diff --git a/scripts/external_libs/zmq/utils/sixcerpt.py b/scripts/external_libs/platform/cel59/zmq/utils/sixcerpt.py
index 5492fd59..5492fd59 100644
--- a/scripts/external_libs/zmq/utils/sixcerpt.py
+++ b/scripts/external_libs/platform/cel59/zmq/utils/sixcerpt.py
diff --git a/scripts/external_libs/zmq/utils/strtypes.py b/scripts/external_libs/platform/cel59/zmq/utils/strtypes.py
index 548410dc..548410dc 100644
--- a/scripts/external_libs/zmq/utils/strtypes.py
+++ b/scripts/external_libs/platform/cel59/zmq/utils/strtypes.py
diff --git a/scripts/external_libs/zmq/utils/win32.py b/scripts/external_libs/platform/cel59/zmq/utils/win32.py
index ea758299..ea758299 100644
--- a/scripts/external_libs/zmq/utils/win32.py
+++ b/scripts/external_libs/platform/cel59/zmq/utils/win32.py
diff --git a/scripts/external_libs/zmq/utils/z85.py b/scripts/external_libs/platform/cel59/zmq/utils/z85.py
index 1bb1784e..1bb1784e 100644
--- a/scripts/external_libs/zmq/utils/z85.py
+++ b/scripts/external_libs/platform/cel59/zmq/utils/z85.py
diff --git a/scripts/external_libs/zmq/utils/zmq_compat.h b/scripts/external_libs/platform/cel59/zmq/utils/zmq_compat.h
index 81c57b69..81c57b69 100644
--- a/scripts/external_libs/zmq/utils/zmq_compat.h
+++ b/scripts/external_libs/platform/cel59/zmq/utils/zmq_compat.h
diff --git a/scripts/external_libs/zmq/utils/zmq_constants.h b/scripts/external_libs/platform/cel59/zmq/utils/zmq_constants.h
index 97683022..97683022 100644
--- a/scripts/external_libs/zmq/utils/zmq_constants.h
+++ b/scripts/external_libs/platform/cel59/zmq/utils/zmq_constants.h
diff --git a/scripts/external_libs/platform/fedora18/zmq/__init__.py b/scripts/external_libs/platform/fedora18/zmq/__init__.py
new file mode 100644
index 00000000..3408b3ba
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/__init__.py
@@ -0,0 +1,64 @@
+"""Python bindings for 0MQ."""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import os
+import sys
+import glob
+
+# load bundled libzmq, if there is one:
+
+here = os.path.dirname(__file__)
+
+bundled = []
+bundled_sodium = []
+for ext in ('pyd', 'so', 'dll', 'dylib'):
+ bundled_sodium.extend(glob.glob(os.path.join(here, 'libsodium*.%s*' % ext)))
+ bundled.extend(glob.glob(os.path.join(here, 'libzmq*.%s*' % ext)))
+
+if bundled:
+ import ctypes
+ if bundled_sodium:
+ if bundled[0].endswith('.pyd'):
+ # a Windows Extension
+ _libsodium = ctypes.cdll.LoadLibrary(bundled_sodium[0])
+ else:
+ _libsodium = ctypes.CDLL(bundled_sodium[0], mode=ctypes.RTLD_GLOBAL)
+ if bundled[0].endswith('.pyd'):
+ # a Windows Extension
+ _libzmq = ctypes.cdll.LoadLibrary(bundled[0])
+ else:
+ _libzmq = ctypes.CDLL(bundled[0], mode=ctypes.RTLD_GLOBAL)
+ del ctypes
+else:
+ import zipimport
+ try:
+ if isinstance(__loader__, zipimport.zipimporter):
+ # a zipped pyzmq egg
+ from zmq import libzmq as _libzmq
+ except (NameError, ImportError):
+ pass
+ finally:
+ del zipimport
+
+del os, sys, glob, here, bundled, bundled_sodium, ext
+
+# zmq top-level imports
+
+from zmq import backend
+from zmq.backend import *
+from zmq import sugar
+from zmq.sugar import *
+from zmq import devices
+
+def get_includes():
+ """Return a list of directories to include for linking against pyzmq with cython."""
+ from os.path import join, dirname, abspath, pardir
+ base = dirname(__file__)
+ parent = abspath(join(base, pardir))
+ return [ parent ] + [ join(parent, base, subdir) for subdir in ('utils',) ]
+
+
+__all__ = ['get_includes'] + sugar.__all__ + backend.__all__
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/auth/__init__.py b/scripts/external_libs/platform/fedora18/zmq/auth/__init__.py
new file mode 100644
index 00000000..11d3ad6b
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/auth/__init__.py
@@ -0,0 +1,10 @@
+"""Utilities for ZAP authentication.
+
+To run authentication in a background thread, see :mod:`zmq.auth.thread`.
+For integration with the tornado eventloop, see :mod:`zmq.auth.ioloop`.
+
+.. versionadded:: 14.1
+"""
+
+from .base import *
+from .certs import *
diff --git a/scripts/external_libs/platform/fedora18/zmq/auth/base.py b/scripts/external_libs/platform/fedora18/zmq/auth/base.py
new file mode 100644
index 00000000..9b4aaed7
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/auth/base.py
@@ -0,0 +1,272 @@
+"""Base implementation of 0MQ authentication."""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import logging
+
+import zmq
+from zmq.utils import z85
+from zmq.utils.strtypes import bytes, unicode, b, u
+from zmq.error import _check_version
+
+from .certs import load_certificates
+
+
+CURVE_ALLOW_ANY = '*'
+VERSION = b'1.0'
+
+class Authenticator(object):
+ """Implementation of ZAP authentication for zmq connections.
+
+ Note:
+ - libzmq provides four levels of security: default NULL (which the Authenticator does
+ not see), and authenticated NULL, PLAIN, and CURVE, which the Authenticator can see.
+ - until you add policies, all incoming NULL connections are allowed
+ (classic ZeroMQ behavior), and all PLAIN and CURVE connections are denied.
+ """
+
+ def __init__(self, context=None, encoding='utf-8', log=None):
+ _check_version((4,0), "security")
+ self.context = context or zmq.Context.instance()
+ self.encoding = encoding
+ self.allow_any = False
+ self.zap_socket = None
+ self.whitelist = set()
+ self.blacklist = set()
+ # passwords is a dict keyed by domain and contains values
+ # of dicts with username:password pairs.
+ self.passwords = {}
+ # certs is dict keyed by domain and contains values
+ # of dicts keyed by the public keys from the specified location.
+ self.certs = {}
+ self.log = log or logging.getLogger('zmq.auth')
+
+ def start(self):
+ """Create and bind the ZAP socket"""
+ self.zap_socket = self.context.socket(zmq.REP)
+ self.zap_socket.linger = 1
+ self.zap_socket.bind("inproc://zeromq.zap.01")
+
+ def stop(self):
+ """Close the ZAP socket"""
+ if self.zap_socket:
+ self.zap_socket.close()
+ self.zap_socket = None
+
+ def allow(self, *addresses):
+ """Allow (whitelist) IP address(es).
+
+ Connections from addresses not in the whitelist will be rejected.
+
+ - For NULL, all clients from this address will be accepted.
+ - For PLAIN and CURVE, they will be allowed to continue with authentication.
+
+ whitelist is mutually exclusive with blacklist.
+ """
+ if self.blacklist:
+ raise ValueError("Only use a whitelist or a blacklist, not both")
+ self.whitelist.update(addresses)
+
+ def deny(self, *addresses):
+ """Deny (blacklist) IP address(es).
+
+ Addresses not in the blacklist will be allowed to continue with authentication.
+
+ Blacklist is mutually exclusive with whitelist.
+ """
+ if self.whitelist:
+ raise ValueError("Only use a whitelist or a blacklist, not both")
+ self.blacklist.update(addresses)
+
+ def configure_plain(self, domain='*', passwords=None):
+ """Configure PLAIN authentication for a given domain.
+
+ PLAIN authentication uses a plain-text password file.
+ To cover all domains, use "*".
+ You can modify the password file at any time; it is reloaded automatically.
+ """
+ if passwords:
+ self.passwords[domain] = passwords
+
+ def configure_curve(self, domain='*', location=None):
+ """Configure CURVE authentication for a given domain.
+
+ CURVE authentication uses a directory that holds all public client certificates,
+ i.e. their public keys.
+
+ To cover all domains, use "*".
+
+ You can add and remove certificates in that directory at any time.
+
+ To allow all client keys without checking, specify CURVE_ALLOW_ANY for the location.
+ """
+ # If location is CURVE_ALLOW_ANY then allow all clients. Otherwise
+ # treat location as a directory that holds the certificates.
+ if location == CURVE_ALLOW_ANY:
+ self.allow_any = True
+ else:
+ self.allow_any = False
+ try:
+ self.certs[domain] = load_certificates(location)
+ except Exception as e:
+ self.log.error("Failed to load CURVE certs from %s: %s", location, e)
+
+ def handle_zap_message(self, msg):
+ """Perform ZAP authentication"""
+ if len(msg) < 6:
+ self.log.error("Invalid ZAP message, not enough frames: %r", msg)
+ if len(msg) < 2:
+ self.log.error("Not enough information to reply")
+ else:
+ self._send_zap_reply(msg[1], b"400", b"Not enough frames")
+ return
+
+ version, request_id, domain, address, identity, mechanism = msg[:6]
+ credentials = msg[6:]
+
+ domain = u(domain, self.encoding, 'replace')
+ address = u(address, self.encoding, 'replace')
+
+ if (version != VERSION):
+ self.log.error("Invalid ZAP version: %r", msg)
+ self._send_zap_reply(request_id, b"400", b"Invalid version")
+ return
+
+ self.log.debug("version: %r, request_id: %r, domain: %r,"
+ " address: %r, identity: %r, mechanism: %r",
+ version, request_id, domain,
+ address, identity, mechanism,
+ )
+
+
+ # Is address is explicitly whitelisted or blacklisted?
+ allowed = False
+ denied = False
+ reason = b"NO ACCESS"
+
+ if self.whitelist:
+ if address in self.whitelist:
+ allowed = True
+ self.log.debug("PASSED (whitelist) address=%s", address)
+ else:
+ denied = True
+ reason = b"Address not in whitelist"
+ self.log.debug("DENIED (not in whitelist) address=%s", address)
+
+ elif self.blacklist:
+ if address in self.blacklist:
+ denied = True
+ reason = b"Address is blacklisted"
+ self.log.debug("DENIED (blacklist) address=%s", address)
+ else:
+ allowed = True
+ self.log.debug("PASSED (not in blacklist) address=%s", address)
+
+ # Perform authentication mechanism-specific checks if necessary
+ username = u("user")
+ if not denied:
+
+ if mechanism == b'NULL' and not allowed:
+ # For NULL, we allow if the address wasn't blacklisted
+ self.log.debug("ALLOWED (NULL)")
+ allowed = True
+
+ elif mechanism == b'PLAIN':
+ # For PLAIN, even a whitelisted address must authenticate
+ if len(credentials) != 2:
+ self.log.error("Invalid PLAIN credentials: %r", credentials)
+ self._send_zap_reply(request_id, b"400", b"Invalid credentials")
+ return
+ username, password = [ u(c, self.encoding, 'replace') for c in credentials ]
+ allowed, reason = self._authenticate_plain(domain, username, password)
+
+ elif mechanism == b'CURVE':
+ # For CURVE, even a whitelisted address must authenticate
+ if len(credentials) != 1:
+ self.log.error("Invalid CURVE credentials: %r", credentials)
+ self._send_zap_reply(request_id, b"400", b"Invalid credentials")
+ return
+ key = credentials[0]
+ allowed, reason = self._authenticate_curve(domain, key)
+
+ if allowed:
+ self._send_zap_reply(request_id, b"200", b"OK", username)
+ else:
+ self._send_zap_reply(request_id, b"400", reason)
+
+ def _authenticate_plain(self, domain, username, password):
+ """PLAIN ZAP authentication"""
+ allowed = False
+ reason = b""
+ if self.passwords:
+ # If no domain is not specified then use the default domain
+ if not domain:
+ domain = '*'
+
+ if domain in self.passwords:
+ if username in self.passwords[domain]:
+ if password == self.passwords[domain][username]:
+ allowed = True
+ else:
+ reason = b"Invalid password"
+ else:
+ reason = b"Invalid username"
+ else:
+ reason = b"Invalid domain"
+
+ if allowed:
+ self.log.debug("ALLOWED (PLAIN) domain=%s username=%s password=%s",
+ domain, username, password,
+ )
+ else:
+ self.log.debug("DENIED %s", reason)
+
+ else:
+ reason = b"No passwords defined"
+ self.log.debug("DENIED (PLAIN) %s", reason)
+
+ return allowed, reason
+
+ def _authenticate_curve(self, domain, client_key):
+ """CURVE ZAP authentication"""
+ allowed = False
+ reason = b""
+ if self.allow_any:
+ allowed = True
+ reason = b"OK"
+ self.log.debug("ALLOWED (CURVE allow any client)")
+ else:
+ # If no explicit domain is specified then use the default domain
+ if not domain:
+ domain = '*'
+
+ if domain in self.certs:
+ # The certs dict stores keys in z85 format, convert binary key to z85 bytes
+ z85_client_key = z85.encode(client_key)
+ if z85_client_key in self.certs[domain] or self.certs[domain] == b'OK':
+ allowed = True
+ reason = b"OK"
+ else:
+ reason = b"Unknown key"
+
+ status = "ALLOWED" if allowed else "DENIED"
+ self.log.debug("%s (CURVE) domain=%s client_key=%s",
+ status, domain, z85_client_key,
+ )
+ else:
+ reason = b"Unknown domain"
+
+ return allowed, reason
+
+ def _send_zap_reply(self, request_id, status_code, status_text, user_id='user'):
+ """Send a ZAP reply to finish the authentication."""
+ user_id = user_id if status_code == b'200' else b''
+ if isinstance(user_id, unicode):
+ user_id = user_id.encode(self.encoding, 'replace')
+ metadata = b'' # not currently used
+ self.log.debug("ZAP reply code=%s text=%s", status_code, status_text)
+ reply = [VERSION, request_id, status_code, status_text, user_id, metadata]
+ self.zap_socket.send_multipart(reply)
+
+__all__ = ['Authenticator', 'CURVE_ALLOW_ANY']
diff --git a/scripts/external_libs/platform/fedora18/zmq/auth/certs.py b/scripts/external_libs/platform/fedora18/zmq/auth/certs.py
new file mode 100644
index 00000000..4d26ad7b
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/auth/certs.py
@@ -0,0 +1,119 @@
+"""0MQ authentication related functions and classes."""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+import datetime
+import glob
+import io
+import os
+import zmq
+from zmq.utils.strtypes import bytes, unicode, b, u
+
+
+_cert_secret_banner = u("""# **** Generated on {0} by pyzmq ****
+# ZeroMQ CURVE **Secret** Certificate
+# DO NOT PROVIDE THIS FILE TO OTHER USERS nor change its permissions.
+
+""")
+
+_cert_public_banner = u("""# **** Generated on {0} by pyzmq ****
+# ZeroMQ CURVE Public Certificate
+# Exchange securely, or use a secure mechanism to verify the contents
+# of this file after exchange. Store public certificates in your home
+# directory, in the .curve subdirectory.
+
+""")
+
+def _write_key_file(key_filename, banner, public_key, secret_key=None, metadata=None, encoding='utf-8'):
+ """Create a certificate file"""
+ if isinstance(public_key, bytes):
+ public_key = public_key.decode(encoding)
+ if isinstance(secret_key, bytes):
+ secret_key = secret_key.decode(encoding)
+ with io.open(key_filename, 'w', encoding='utf8') as f:
+ f.write(banner.format(datetime.datetime.now()))
+
+ f.write(u('metadata\n'))
+ if metadata:
+ for k, v in metadata.items():
+ if isinstance(v, bytes):
+ v = v.decode(encoding)
+ f.write(u(" {0} = {1}\n").format(k, v))
+
+ f.write(u('curve\n'))
+ f.write(u(" public-key = \"{0}\"\n").format(public_key))
+
+ if secret_key:
+ f.write(u(" secret-key = \"{0}\"\n").format(secret_key))
+
+
+def create_certificates(key_dir, name, metadata=None):
+ """Create zmq certificates.
+
+ Returns the file paths to the public and secret certificate files.
+ """
+ public_key, secret_key = zmq.curve_keypair()
+ base_filename = os.path.join(key_dir, name)
+ secret_key_file = "{0}.key_secret".format(base_filename)
+ public_key_file = "{0}.key".format(base_filename)
+ now = datetime.datetime.now()
+
+ _write_key_file(public_key_file,
+ _cert_public_banner.format(now),
+ public_key)
+
+ _write_key_file(secret_key_file,
+ _cert_secret_banner.format(now),
+ public_key,
+ secret_key=secret_key,
+ metadata=metadata)
+
+ return public_key_file, secret_key_file
+
+
+def load_certificate(filename):
+ """Load public and secret key from a zmq certificate.
+
+ Returns (public_key, secret_key)
+
+ If the certificate file only contains the public key,
+ secret_key will be None.
+ """
+ public_key = None
+ secret_key = None
+ if not os.path.exists(filename):
+ raise IOError("Invalid certificate file: {0}".format(filename))
+
+ with open(filename, 'rb') as f:
+ for line in f:
+ line = line.strip()
+ if line.startswith(b'#'):
+ continue
+ if line.startswith(b'public-key'):
+ public_key = line.split(b"=", 1)[1].strip(b' \t\'"')
+ if line.startswith(b'secret-key'):
+ secret_key = line.split(b"=", 1)[1].strip(b' \t\'"')
+ if public_key and secret_key:
+ break
+
+ return public_key, secret_key
+
+
+def load_certificates(directory='.'):
+ """Load public keys from all certificates in a directory"""
+ certs = {}
+ if not os.path.isdir(directory):
+ raise IOError("Invalid certificate directory: {0}".format(directory))
+ # Follow czmq pattern of public keys stored in *.key files.
+ glob_string = os.path.join(directory, "*.key")
+
+ cert_files = glob.glob(glob_string)
+ for cert_file in cert_files:
+ public_key, _ = load_certificate(cert_file)
+ if public_key:
+ certs[public_key] = 'OK'
+ return certs
+
+__all__ = ['create_certificates', 'load_certificate', 'load_certificates']
diff --git a/scripts/external_libs/platform/fedora18/zmq/auth/ioloop.py b/scripts/external_libs/platform/fedora18/zmq/auth/ioloop.py
new file mode 100644
index 00000000..1f448b47
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/auth/ioloop.py
@@ -0,0 +1,34 @@
+"""ZAP Authenticator integrated with the tornado IOLoop.
+
+.. versionadded:: 14.1
+"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+from zmq.eventloop import ioloop, zmqstream
+from .base import Authenticator
+
+
+class IOLoopAuthenticator(Authenticator):
+ """ZAP authentication for use in the tornado IOLoop"""
+
+ def __init__(self, context=None, encoding='utf-8', log=None, io_loop=None):
+ super(IOLoopAuthenticator, self).__init__(context)
+ self.zap_stream = None
+ self.io_loop = io_loop or ioloop.IOLoop.instance()
+
+ def start(self):
+ """Start ZAP authentication"""
+ super(IOLoopAuthenticator, self).start()
+ self.zap_stream = zmqstream.ZMQStream(self.zap_socket, self.io_loop)
+ self.zap_stream.on_recv(self.handle_zap_message)
+
+ def stop(self):
+ """Stop ZAP authentication"""
+ if self.zap_stream:
+ self.zap_stream.close()
+ self.zap_stream = None
+ super(IOLoopAuthenticator, self).stop()
+
+__all__ = ['IOLoopAuthenticator']
diff --git a/scripts/external_libs/platform/fedora18/zmq/auth/thread.py b/scripts/external_libs/platform/fedora18/zmq/auth/thread.py
new file mode 100644
index 00000000..8c3355a9
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/auth/thread.py
@@ -0,0 +1,184 @@
+"""ZAP Authenticator in a Python Thread.
+
+.. versionadded:: 14.1
+"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import logging
+from threading import Thread
+
+import zmq
+from zmq.utils import jsonapi
+from zmq.utils.strtypes import bytes, unicode, b, u
+
+from .base import Authenticator
+
+class AuthenticationThread(Thread):
+ """A Thread for running a zmq Authenticator
+
+ This is run in the background by ThreadedAuthenticator
+ """
+
+ def __init__(self, context, endpoint, encoding='utf-8', log=None):
+ super(AuthenticationThread, self).__init__()
+ self.context = context or zmq.Context.instance()
+ self.encoding = encoding
+ self.log = log = log or logging.getLogger('zmq.auth')
+ self.authenticator = Authenticator(context, encoding=encoding, log=log)
+
+ # create a socket to communicate back to main thread.
+ self.pipe = context.socket(zmq.PAIR)
+ self.pipe.linger = 1
+ self.pipe.connect(endpoint)
+
+ def run(self):
+ """ Start the Authentication Agent thread task """
+ self.authenticator.start()
+ zap = self.authenticator.zap_socket
+ poller = zmq.Poller()
+ poller.register(self.pipe, zmq.POLLIN)
+ poller.register(zap, zmq.POLLIN)
+ while True:
+ try:
+ socks = dict(poller.poll())
+ except zmq.ZMQError:
+ break # interrupted
+
+ if self.pipe in socks and socks[self.pipe] == zmq.POLLIN:
+ terminate = self._handle_pipe()
+ if terminate:
+ break
+
+ if zap in socks and socks[zap] == zmq.POLLIN:
+ self._handle_zap()
+
+ self.pipe.close()
+ self.authenticator.stop()
+
+ def _handle_zap(self):
+ """
+ Handle a message from the ZAP socket.
+ """
+ msg = self.authenticator.zap_socket.recv_multipart()
+ if not msg: return
+ self.authenticator.handle_zap_message(msg)
+
+ def _handle_pipe(self):
+ """
+ Handle a message from front-end API.
+ """
+ terminate = False
+
+ # Get the whole message off the pipe in one go
+ msg = self.pipe.recv_multipart()
+
+ if msg is None:
+ terminate = True
+ return terminate
+
+ command = msg[0]
+ self.log.debug("auth received API command %r", command)
+
+ if command == b'ALLOW':
+ addresses = [u(m, self.encoding) for m in msg[1:]]
+ try:
+ self.authenticator.allow(*addresses)
+ except Exception as e:
+ self.log.exception("Failed to allow %s", addresses)
+
+ elif command == b'DENY':
+ addresses = [u(m, self.encoding) for m in msg[1:]]
+ try:
+ self.authenticator.deny(*addresses)
+ except Exception as e:
+ self.log.exception("Failed to deny %s", addresses)
+
+ elif command == b'PLAIN':
+ domain = u(msg[1], self.encoding)
+ json_passwords = msg[2]
+ self.authenticator.configure_plain(domain, jsonapi.loads(json_passwords))
+
+ elif command == b'CURVE':
+ # For now we don't do anything with domains
+ domain = u(msg[1], self.encoding)
+
+ # If location is CURVE_ALLOW_ANY, allow all clients. Otherwise
+ # treat location as a directory that holds the certificates.
+ location = u(msg[2], self.encoding)
+ self.authenticator.configure_curve(domain, location)
+
+ elif command == b'TERMINATE':
+ terminate = True
+
+ else:
+ self.log.error("Invalid auth command from API: %r", command)
+
+ return terminate
+
+def _inherit_docstrings(cls):
+ """inherit docstrings from Authenticator, so we don't duplicate them"""
+ for name, method in cls.__dict__.items():
+ if name.startswith('_'):
+ continue
+ upstream_method = getattr(Authenticator, name, None)
+ if not method.__doc__:
+ method.__doc__ = upstream_method.__doc__
+ return cls
+
+@_inherit_docstrings
+class ThreadAuthenticator(object):
+ """Run ZAP authentication in a background thread"""
+
+ def __init__(self, context=None, encoding='utf-8', log=None):
+ self.context = context or zmq.Context.instance()
+ self.log = log
+ self.encoding = encoding
+ self.pipe = None
+ self.pipe_endpoint = "inproc://{0}.inproc".format(id(self))
+ self.thread = None
+
+ def allow(self, *addresses):
+ self.pipe.send_multipart([b'ALLOW'] + [b(a, self.encoding) for a in addresses])
+
+ def deny(self, *addresses):
+ self.pipe.send_multipart([b'DENY'] + [b(a, self.encoding) for a in addresses])
+
+ def configure_plain(self, domain='*', passwords=None):
+ self.pipe.send_multipart([b'PLAIN', b(domain, self.encoding), jsonapi.dumps(passwords or {})])
+
+ def configure_curve(self, domain='*', location=''):
+ domain = b(domain, self.encoding)
+ location = b(location, self.encoding)
+ self.pipe.send_multipart([b'CURVE', domain, location])
+
+ def start(self):
+ """Start the authentication thread"""
+ # create a socket to communicate with auth thread.
+ self.pipe = self.context.socket(zmq.PAIR)
+ self.pipe.linger = 1
+ self.pipe.bind(self.pipe_endpoint)
+ self.thread = AuthenticationThread(self.context, self.pipe_endpoint, encoding=self.encoding, log=self.log)
+ self.thread.start()
+
+ def stop(self):
+ """Stop the authentication thread"""
+ if self.pipe:
+ self.pipe.send(b'TERMINATE')
+ if self.is_alive():
+ self.thread.join()
+ self.thread = None
+ self.pipe.close()
+ self.pipe = None
+
+ def is_alive(self):
+ """Is the ZAP thread currently running?"""
+ if self.thread and self.thread.is_alive():
+ return True
+ return False
+
+ def __del__(self):
+ self.stop()
+
+__all__ = ['ThreadAuthenticator']
diff --git a/scripts/external_libs/platform/fedora18/zmq/backend/__init__.py b/scripts/external_libs/platform/fedora18/zmq/backend/__init__.py
new file mode 100644
index 00000000..7cac725c
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/__init__.py
@@ -0,0 +1,45 @@
+"""Import basic exposure of libzmq C API as a backend"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+import os
+import platform
+import sys
+
+from zmq.utils.sixcerpt import reraise
+
+from .select import public_api, select_backend
+
+if 'PYZMQ_BACKEND' in os.environ:
+ backend = os.environ['PYZMQ_BACKEND']
+ if backend in ('cython', 'cffi'):
+ backend = 'zmq.backend.%s' % backend
+ _ns = select_backend(backend)
+else:
+ # default to cython, fallback to cffi
+ # (reverse on PyPy)
+ if platform.python_implementation() == 'PyPy':
+ first, second = ('zmq.backend.cffi', 'zmq.backend.cython')
+ else:
+ first, second = ('zmq.backend.cython', 'zmq.backend.cffi')
+
+ try:
+ _ns = select_backend(first)
+ except Exception:
+ exc_info = sys.exc_info()
+ exc = exc_info[1]
+ try:
+ _ns = select_backend(second)
+ except ImportError:
+ # prevent 'During handling of the above exception...' on py3
+ # can't use `raise ... from` on Python 2
+ if hasattr(exc, '__cause__'):
+ exc.__cause__ = None
+ # raise the *first* error, not the fallback
+ reraise(*exc_info)
+
+globals().update(_ns)
+
+__all__ = public_api
diff --git a/scripts/external_libs/platform/fedora18/zmq/backend/cffi/__init__.py b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/__init__.py
new file mode 100644
index 00000000..ca3164d3
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/__init__.py
@@ -0,0 +1,22 @@
+"""CFFI backend (for PyPY)"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+from zmq.backend.cffi import (constants, error, message, context, socket,
+ _poll, devices, utils)
+
+__all__ = []
+for submod in (constants, error, message, context, socket,
+ _poll, devices, utils):
+ __all__.extend(submod.__all__)
+
+from .constants import *
+from .error import *
+from .message import *
+from .context import *
+from .socket import *
+from .devices import *
+from ._poll import *
+from ._cffi import zmq_version_info, ffi
+from .utils import *
diff --git a/scripts/external_libs/platform/fedora18/zmq/backend/cffi/_cdefs.h b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/_cdefs.h
new file mode 100644
index 00000000..d3300575
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/_cdefs.h
@@ -0,0 +1,68 @@
+void zmq_version(int *major, int *minor, int *patch);
+
+void* zmq_socket(void *context, int type);
+int zmq_close(void *socket);
+
+int zmq_bind(void *socket, const char *endpoint);
+int zmq_connect(void *socket, const char *endpoint);
+
+int zmq_errno(void);
+const char * zmq_strerror(int errnum);
+
+void* zmq_stopwatch_start(void);
+unsigned long zmq_stopwatch_stop(void *watch);
+void zmq_sleep(int seconds_);
+int zmq_device(int device, void *frontend, void *backend);
+
+int zmq_unbind(void *socket, const char *endpoint);
+int zmq_disconnect(void *socket, const char *endpoint);
+void* zmq_ctx_new();
+int zmq_ctx_destroy(void *context);
+int zmq_ctx_get(void *context, int opt);
+int zmq_ctx_set(void *context, int opt, int optval);
+int zmq_proxy(void *frontend, void *backend, void *capture);
+int zmq_socket_monitor(void *socket, const char *addr, int events);
+
+int zmq_curve_keypair (char *z85_public_key, char *z85_secret_key);
+int zmq_has (const char *capability);
+
+typedef struct { ...; } zmq_msg_t;
+typedef ... zmq_free_fn;
+
+int zmq_msg_init(zmq_msg_t *msg);
+int zmq_msg_init_size(zmq_msg_t *msg, size_t size);
+int zmq_msg_init_data(zmq_msg_t *msg,
+ void *data,
+ size_t size,
+ zmq_free_fn *ffn,
+ void *hint);
+
+size_t zmq_msg_size(zmq_msg_t *msg);
+void *zmq_msg_data(zmq_msg_t *msg);
+int zmq_msg_close(zmq_msg_t *msg);
+
+int zmq_msg_send(zmq_msg_t *msg, void *socket, int flags);
+int zmq_msg_recv(zmq_msg_t *msg, void *socket, int flags);
+
+int zmq_getsockopt(void *socket,
+ int option_name,
+ void *option_value,
+ size_t *option_len);
+
+int zmq_setsockopt(void *socket,
+ int option_name,
+ const void *option_value,
+ size_t option_len);
+typedef struct
+{
+ void *socket;
+ int fd;
+ short events;
+ short revents;
+} zmq_pollitem_t;
+
+int zmq_poll(zmq_pollitem_t *items, int nitems, long timeout);
+
+// miscellany
+void * memcpy(void *restrict s1, const void *restrict s2, size_t n);
+int get_ipc_path_max_len(void);
diff --git a/scripts/external_libs/platform/fedora18/zmq/backend/cffi/_cffi.py b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/_cffi.py
new file mode 100644
index 00000000..c73ebf83
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/_cffi.py
@@ -0,0 +1,127 @@
+# coding: utf-8
+"""The main CFFI wrapping of libzmq"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+import json
+import os
+from os.path import dirname, join
+from cffi import FFI
+
+from zmq.utils.constant_names import all_names, no_prefix
+
+
+base_zmq_version = (3,2,2)
+
+def load_compiler_config():
+ """load pyzmq compiler arguments"""
+ import zmq
+ zmq_dir = dirname(zmq.__file__)
+ zmq_parent = dirname(zmq_dir)
+
+ fname = join(zmq_dir, 'utils', 'compiler.json')
+ if os.path.exists(fname):
+ with open(fname) as f:
+ cfg = json.load(f)
+ else:
+ cfg = {}
+
+ cfg.setdefault("include_dirs", [])
+ cfg.setdefault("library_dirs", [])
+ cfg.setdefault("runtime_library_dirs", [])
+ cfg.setdefault("libraries", ["zmq"])
+
+ # cast to str, because cffi can't handle unicode paths (?!)
+ cfg['libraries'] = [str(lib) for lib in cfg['libraries']]
+ for key in ("include_dirs", "library_dirs", "runtime_library_dirs"):
+ # interpret paths relative to parent of zmq (like source tree)
+ abs_paths = []
+ for p in cfg[key]:
+ if p.startswith('zmq'):
+ p = join(zmq_parent, p)
+ abs_paths.append(str(p))
+ cfg[key] = abs_paths
+ return cfg
+
+
+def zmq_version_info():
+ """Get libzmq version as tuple of ints"""
+ major = ffi.new('int*')
+ minor = ffi.new('int*')
+ patch = ffi.new('int*')
+
+ C.zmq_version(major, minor, patch)
+
+ return (int(major[0]), int(minor[0]), int(patch[0]))
+
+
+cfg = load_compiler_config()
+ffi = FFI()
+
+def _make_defines(names):
+ _names = []
+ for name in names:
+ define_line = "#define %s ..." % (name)
+ _names.append(define_line)
+
+ return "\n".join(_names)
+
+c_constant_names = []
+for name in all_names:
+ if no_prefix(name):
+ c_constant_names.append(name)
+ else:
+ c_constant_names.append("ZMQ_" + name)
+
+# load ffi definitions
+here = os.path.dirname(__file__)
+with open(os.path.join(here, '_cdefs.h')) as f:
+ _cdefs = f.read()
+
+with open(os.path.join(here, '_verify.c')) as f:
+ _verify = f.read()
+
+ffi.cdef(_cdefs)
+ffi.cdef(_make_defines(c_constant_names))
+
+try:
+ C = ffi.verify(_verify,
+ modulename='_cffi_ext',
+ libraries=cfg['libraries'],
+ include_dirs=cfg['include_dirs'],
+ library_dirs=cfg['library_dirs'],
+ runtime_library_dirs=cfg['runtime_library_dirs'],
+ )
+ _version_info = zmq_version_info()
+except Exception as e:
+ raise ImportError("PyZMQ CFFI backend couldn't find zeromq: %s\n"
+ "Please check that you have zeromq headers and libraries." % e)
+
+if _version_info < (3,2,2):
+ raise ImportError("PyZMQ CFFI backend requires zeromq >= 3.2.2,"
+ " but found %i.%i.%i" % _version_info
+ )
+
+nsp = new_sizet_pointer = lambda length: ffi.new('size_t*', length)
+
+new_uint64_pointer = lambda: (ffi.new('uint64_t*'),
+ nsp(ffi.sizeof('uint64_t')))
+new_int64_pointer = lambda: (ffi.new('int64_t*'),
+ nsp(ffi.sizeof('int64_t')))
+new_int_pointer = lambda: (ffi.new('int*'),
+ nsp(ffi.sizeof('int')))
+new_binary_data = lambda length: (ffi.new('char[%d]' % (length)),
+ nsp(ffi.sizeof('char') * length))
+
+value_uint64_pointer = lambda val : (ffi.new('uint64_t*', val),
+ ffi.sizeof('uint64_t'))
+value_int64_pointer = lambda val: (ffi.new('int64_t*', val),
+ ffi.sizeof('int64_t'))
+value_int_pointer = lambda val: (ffi.new('int*', val),
+ ffi.sizeof('int'))
+value_binary_data = lambda val, length: (ffi.new('char[%d]' % (length + 1), val),
+ ffi.sizeof('char') * length)
+
+IPC_PATH_MAX_LEN = C.get_ipc_path_max_len()
diff --git a/scripts/external_libs/platform/fedora18/zmq/backend/cffi/_poll.py b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/_poll.py
new file mode 100644
index 00000000..9bca34ca
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/_poll.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+"""zmq poll function"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+from ._cffi import C, ffi, zmq_version_info
+
+from .constants import *
+
+from zmq.error import _check_rc
+
+
+def _make_zmq_pollitem(socket, flags):
+ zmq_socket = socket._zmq_socket
+ zmq_pollitem = ffi.new('zmq_pollitem_t*')
+ zmq_pollitem.socket = zmq_socket
+ zmq_pollitem.fd = 0
+ zmq_pollitem.events = flags
+ zmq_pollitem.revents = 0
+ return zmq_pollitem[0]
+
+def _make_zmq_pollitem_fromfd(socket_fd, flags):
+ zmq_pollitem = ffi.new('zmq_pollitem_t*')
+ zmq_pollitem.socket = ffi.NULL
+ zmq_pollitem.fd = socket_fd
+ zmq_pollitem.events = flags
+ zmq_pollitem.revents = 0
+ return zmq_pollitem[0]
+
+def zmq_poll(sockets, timeout):
+ cffi_pollitem_list = []
+ low_level_to_socket_obj = {}
+ for item in sockets:
+ if isinstance(item[0], int):
+ low_level_to_socket_obj[item[0]] = item
+ cffi_pollitem_list.append(_make_zmq_pollitem_fromfd(item[0], item[1]))
+ else:
+ low_level_to_socket_obj[item[0]._zmq_socket] = item
+ cffi_pollitem_list.append(_make_zmq_pollitem(item[0], item[1]))
+ items = ffi.new('zmq_pollitem_t[]', cffi_pollitem_list)
+ list_length = ffi.cast('int', len(cffi_pollitem_list))
+ c_timeout = ffi.cast('long', timeout)
+ rc = C.zmq_poll(items, list_length, c_timeout)
+ _check_rc(rc)
+ result = []
+ for index in range(len(items)):
+ if not items[index].socket == ffi.NULL:
+ if items[index].revents > 0:
+ result.append((low_level_to_socket_obj[items[index].socket][0],
+ items[index].revents))
+ else:
+ result.append((items[index].fd, items[index].revents))
+ return result
+
+__all__ = ['zmq_poll']
diff --git a/scripts/external_libs/platform/fedora18/zmq/backend/cffi/_verify.c b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/_verify.c
new file mode 100644
index 00000000..547840eb
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/_verify.c
@@ -0,0 +1,12 @@
+#include <stdio.h>
+#include <sys/un.h>
+#include <string.h>
+
+#include <zmq.h>
+#include <zmq_utils.h>
+#include "zmq_compat.h"
+
+int get_ipc_path_max_len(void) {
+ struct sockaddr_un *dummy;
+ return sizeof(dummy->sun_path) - 1;
+}
diff --git a/scripts/external_libs/platform/fedora18/zmq/backend/cffi/constants.py b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/constants.py
new file mode 100644
index 00000000..ee293e74
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/constants.py
@@ -0,0 +1,15 @@
+# coding: utf-8
+"""zmq constants"""
+
+from ._cffi import C, c_constant_names
+from zmq.utils.constant_names import all_names
+
+g = globals()
+for cname in c_constant_names:
+ if cname.startswith("ZMQ_"):
+ name = cname[4:]
+ else:
+ name = cname
+ g[name] = getattr(C, cname)
+
+__all__ = all_names
diff --git a/scripts/external_libs/platform/fedora18/zmq/backend/cffi/context.py b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/context.py
new file mode 100644
index 00000000..16a7b257
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/context.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+"""zmq Context class"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import weakref
+
+from ._cffi import C, ffi
+
+from .socket import *
+from .constants import *
+
+from zmq.error import ZMQError, _check_rc
+
+class Context(object):
+ _zmq_ctx = None
+ _iothreads = None
+ _closed = None
+ _sockets = None
+ _shadow = False
+
+ def __init__(self, io_threads=1, shadow=None):
+
+ if shadow:
+ self._zmq_ctx = ffi.cast("void *", shadow)
+ self._shadow = True
+ else:
+ self._shadow = False
+ if not io_threads >= 0:
+ raise ZMQError(EINVAL)
+
+ self._zmq_ctx = C.zmq_ctx_new()
+ if self._zmq_ctx == ffi.NULL:
+ raise ZMQError(C.zmq_errno())
+ if not shadow:
+ C.zmq_ctx_set(self._zmq_ctx, IO_THREADS, io_threads)
+ self._closed = False
+ self._sockets = set()
+
+ @property
+ def underlying(self):
+ """The address of the underlying libzmq context"""
+ return int(ffi.cast('size_t', self._zmq_ctx))
+
+ @property
+ def closed(self):
+ return self._closed
+
+ def _add_socket(self, socket):
+ ref = weakref.ref(socket)
+ self._sockets.add(ref)
+ return ref
+
+ def _rm_socket(self, ref):
+ if ref in self._sockets:
+ self._sockets.remove(ref)
+
+ def set(self, option, value):
+ """set a context option
+
+ see zmq_ctx_set
+ """
+ rc = C.zmq_ctx_set(self._zmq_ctx, option, value)
+ _check_rc(rc)
+
+ def get(self, option):
+ """get context option
+
+ see zmq_ctx_get
+ """
+ rc = C.zmq_ctx_get(self._zmq_ctx, option)
+ _check_rc(rc)
+ return rc
+
+ def term(self):
+ if self.closed:
+ return
+
+ C.zmq_ctx_destroy(self._zmq_ctx)
+
+ self._zmq_ctx = None
+ self._closed = True
+
+ def destroy(self, linger=None):
+ if self.closed:
+ return
+
+ sockets = self._sockets
+ self._sockets = set()
+ for s in sockets:
+ s = s()
+ if s and not s.closed:
+ if linger:
+ s.setsockopt(LINGER, linger)
+ s.close()
+
+ self.term()
+
+__all__ = ['Context']
diff --git a/scripts/external_libs/platform/fedora18/zmq/backend/cffi/devices.py b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/devices.py
new file mode 100644
index 00000000..c7a514a8
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/devices.py
@@ -0,0 +1,24 @@
+# coding: utf-8
+"""zmq device functions"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+from ._cffi import C, ffi, zmq_version_info
+from .socket import Socket
+from zmq.error import ZMQError, _check_rc
+
+def device(device_type, frontend, backend):
+ rc = C.zmq_proxy(frontend._zmq_socket, backend._zmq_socket, ffi.NULL)
+ _check_rc(rc)
+
+def proxy(frontend, backend, capture=None):
+ if isinstance(capture, Socket):
+ capture = capture._zmq_socket
+ else:
+ capture = ffi.NULL
+
+ rc = C.zmq_proxy(frontend._zmq_socket, backend._zmq_socket, capture)
+ _check_rc(rc)
+
+__all__ = ['device', 'proxy']
diff --git a/scripts/external_libs/platform/fedora18/zmq/backend/cffi/error.py b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/error.py
new file mode 100644
index 00000000..3bb64de0
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/error.py
@@ -0,0 +1,13 @@
+"""zmq error functions"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+from ._cffi import C, ffi
+
+def strerror(errno):
+ return ffi.string(C.zmq_strerror(errno))
+
+zmq_errno = C.zmq_errno
+
+__all__ = ['strerror', 'zmq_errno']
diff --git a/scripts/external_libs/platform/fedora18/zmq/backend/cffi/message.py b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/message.py
new file mode 100644
index 00000000..c35decb6
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/message.py
@@ -0,0 +1,69 @@
+"""Dummy Frame object"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+from ._cffi import ffi, C
+
+import zmq
+from zmq.utils.strtypes import unicode
+
+try:
+ view = memoryview
+except NameError:
+ view = buffer
+
+_content = lambda x: x.tobytes() if type(x) == memoryview else x
+
+class Frame(object):
+ _data = None
+ tracker = None
+ closed = False
+ more = False
+ buffer = None
+
+
+ def __init__(self, data, track=False):
+ try:
+ view(data)
+ except TypeError:
+ raise
+
+ self._data = data
+
+ if isinstance(data, unicode):
+ raise TypeError("Unicode objects not allowed. Only: str/bytes, " +
+ "buffer interfaces.")
+
+ self.more = False
+ self.tracker = None
+ self.closed = False
+ if track:
+ self.tracker = zmq.MessageTracker()
+
+ self.buffer = view(self.bytes)
+
+ @property
+ def bytes(self):
+ data = _content(self._data)
+ return data
+
+ def __len__(self):
+ return len(self.bytes)
+
+ def __eq__(self, other):
+ return self.bytes == _content(other)
+
+ def __str__(self):
+ if str is unicode:
+ return self.bytes.decode()
+ else:
+ return self.bytes
+
+ @property
+ def done(self):
+ return True
+
+Message = Frame
+
+__all__ = ['Frame', 'Message']
diff --git a/scripts/external_libs/platform/fedora18/zmq/backend/cffi/socket.py b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/socket.py
new file mode 100644
index 00000000..3c427739
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/socket.py
@@ -0,0 +1,244 @@
+# coding: utf-8
+"""zmq Socket class"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import random
+import codecs
+
+import errno as errno_mod
+
+from ._cffi import (C, ffi, new_uint64_pointer, new_int64_pointer,
+ new_int_pointer, new_binary_data, value_uint64_pointer,
+ value_int64_pointer, value_int_pointer, value_binary_data,
+ IPC_PATH_MAX_LEN)
+
+from .message import Frame
+from .constants import *
+
+import zmq
+from zmq.error import ZMQError, _check_rc, _check_version
+from zmq.utils.strtypes import unicode
+
+
+def new_pointer_from_opt(option, length=0):
+ from zmq.sugar.constants import (
+ int64_sockopts, bytes_sockopts,
+ )
+ if option in int64_sockopts:
+ return new_int64_pointer()
+ elif option in bytes_sockopts:
+ return new_binary_data(length)
+ else:
+ # default
+ return new_int_pointer()
+
+def value_from_opt_pointer(option, opt_pointer, length=0):
+ from zmq.sugar.constants import (
+ int64_sockopts, bytes_sockopts,
+ )
+ if option in int64_sockopts:
+ return int(opt_pointer[0])
+ elif option in bytes_sockopts:
+ return ffi.buffer(opt_pointer, length)[:]
+ else:
+ return int(opt_pointer[0])
+
+def initialize_opt_pointer(option, value, length=0):
+ from zmq.sugar.constants import (
+ int64_sockopts, bytes_sockopts,
+ )
+ if option in int64_sockopts:
+ return value_int64_pointer(value)
+ elif option in bytes_sockopts:
+ return value_binary_data(value, length)
+ else:
+ return value_int_pointer(value)
+
+
+class Socket(object):
+ context = None
+ socket_type = None
+ _zmq_socket = None
+ _closed = None
+ _ref = None
+ _shadow = False
+
+ def __init__(self, context=None, socket_type=None, shadow=None):
+ self.context = context
+ if shadow is not None:
+ self._zmq_socket = ffi.cast("void *", shadow)
+ self._shadow = True
+ else:
+ self._shadow = False
+ self._zmq_socket = C.zmq_socket(context._zmq_ctx, socket_type)
+ if self._zmq_socket == ffi.NULL:
+ raise ZMQError()
+ self._closed = False
+ if context:
+ self._ref = context._add_socket(self)
+
+ @property
+ def underlying(self):
+ """The address of the underlying libzmq socket"""
+ return int(ffi.cast('size_t', self._zmq_socket))
+
+ @property
+ def closed(self):
+ return self._closed
+
+ def close(self, linger=None):
+ rc = 0
+ if not self._closed and hasattr(self, '_zmq_socket'):
+ if self._zmq_socket is not None:
+ rc = C.zmq_close(self._zmq_socket)
+ self._closed = True
+ if self.context:
+ self.context._rm_socket(self._ref)
+ return rc
+
+ def bind(self, address):
+ if isinstance(address, unicode):
+ address = address.encode('utf8')
+ rc = C.zmq_bind(self._zmq_socket, address)
+ if rc < 0:
+ if IPC_PATH_MAX_LEN and C.zmq_errno() == errno_mod.ENAMETOOLONG:
+ # py3compat: address is bytes, but msg wants str
+ if str is unicode:
+ address = address.decode('utf-8', 'replace')
+ path = address.split('://', 1)[-1]
+ msg = ('ipc path "{0}" is longer than {1} '
+ 'characters (sizeof(sockaddr_un.sun_path)).'
+ .format(path, IPC_PATH_MAX_LEN))
+ raise ZMQError(C.zmq_errno(), msg=msg)
+ else:
+ _check_rc(rc)
+
+ def unbind(self, address):
+ _check_version((3,2), "unbind")
+ if isinstance(address, unicode):
+ address = address.encode('utf8')
+ rc = C.zmq_unbind(self._zmq_socket, address)
+ _check_rc(rc)
+
+ def connect(self, address):
+ if isinstance(address, unicode):
+ address = address.encode('utf8')
+ rc = C.zmq_connect(self._zmq_socket, address)
+ _check_rc(rc)
+
+ def disconnect(self, address):
+ _check_version((3,2), "disconnect")
+ if isinstance(address, unicode):
+ address = address.encode('utf8')
+ rc = C.zmq_disconnect(self._zmq_socket, address)
+ _check_rc(rc)
+
+ def set(self, option, value):
+ length = None
+ if isinstance(value, unicode):
+ raise TypeError("unicode not allowed, use bytes")
+
+ if isinstance(value, bytes):
+ if option not in zmq.constants.bytes_sockopts:
+ raise TypeError("not a bytes sockopt: %s" % option)
+ length = len(value)
+
+ c_data = initialize_opt_pointer(option, value, length)
+
+ c_value_pointer = c_data[0]
+ c_sizet = c_data[1]
+
+ rc = C.zmq_setsockopt(self._zmq_socket,
+ option,
+ ffi.cast('void*', c_value_pointer),
+ c_sizet)
+ _check_rc(rc)
+
+ def get(self, option):
+ c_data = new_pointer_from_opt(option, length=255)
+
+ c_value_pointer = c_data[0]
+ c_sizet_pointer = c_data[1]
+
+ rc = C.zmq_getsockopt(self._zmq_socket,
+ option,
+ c_value_pointer,
+ c_sizet_pointer)
+ _check_rc(rc)
+
+ sz = c_sizet_pointer[0]
+ v = value_from_opt_pointer(option, c_value_pointer, sz)
+ if option != zmq.IDENTITY and option in zmq.constants.bytes_sockopts and v.endswith(b'\0'):
+ v = v[:-1]
+ return v
+
+ def send(self, message, flags=0, copy=False, track=False):
+ if isinstance(message, unicode):
+ raise TypeError("Message must be in bytes, not an unicode Object")
+
+ if isinstance(message, Frame):
+ message = message.bytes
+
+ zmq_msg = ffi.new('zmq_msg_t*')
+ c_message = ffi.new('char[]', message)
+ rc = C.zmq_msg_init_size(zmq_msg, len(message))
+ C.memcpy(C.zmq_msg_data(zmq_msg), c_message, len(message))
+
+ rc = C.zmq_msg_send(zmq_msg, self._zmq_socket, flags)
+ C.zmq_msg_close(zmq_msg)
+ _check_rc(rc)
+
+ if track:
+ return zmq.MessageTracker()
+
+ def recv(self, flags=0, copy=True, track=False):
+ zmq_msg = ffi.new('zmq_msg_t*')
+ C.zmq_msg_init(zmq_msg)
+
+ rc = C.zmq_msg_recv(zmq_msg, self._zmq_socket, flags)
+
+ if rc < 0:
+ C.zmq_msg_close(zmq_msg)
+ _check_rc(rc)
+
+ _buffer = ffi.buffer(C.zmq_msg_data(zmq_msg), C.zmq_msg_size(zmq_msg))
+ value = _buffer[:]
+ C.zmq_msg_close(zmq_msg)
+
+ frame = Frame(value, track=track)
+ frame.more = self.getsockopt(RCVMORE)
+
+ if copy:
+ return frame.bytes
+ else:
+ return frame
+
+ def monitor(self, addr, events=-1):
+ """s.monitor(addr, flags)
+
+ Start publishing socket events on inproc.
+ See libzmq docs for zmq_monitor for details.
+
+ Note: requires libzmq >= 3.2
+
+ Parameters
+ ----------
+ addr : str
+ The inproc url used for monitoring. Passing None as
+ the addr will cause an existing socket monitor to be
+ deregistered.
+ events : int [default: zmq.EVENT_ALL]
+ The zmq event bitmask for which events will be sent to the monitor.
+ """
+
+ _check_version((3,2), "monitor")
+ if events < 0:
+ events = zmq.EVENT_ALL
+ if addr is None:
+ addr = ffi.NULL
+ rc = C.zmq_socket_monitor(self._zmq_socket, addr, events)
+
+
+__all__ = ['Socket', 'IPC_PATH_MAX_LEN']
diff --git a/scripts/external_libs/platform/fedora18/zmq/backend/cffi/utils.py b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/utils.py
new file mode 100644
index 00000000..fde7827b
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cffi/utils.py
@@ -0,0 +1,62 @@
+# coding: utf-8
+"""miscellaneous zmq_utils wrapping"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+from ._cffi import ffi, C
+
+from zmq.error import ZMQError, _check_rc, _check_version
+from zmq.utils.strtypes import unicode
+
+def has(capability):
+ """Check for zmq capability by name (e.g. 'ipc', 'curve')
+
+ .. versionadded:: libzmq-4.1
+ .. versionadded:: 14.1
+ """
+ _check_version((4,1), 'zmq.has')
+ if isinstance(capability, unicode):
+ capability = capability.encode('utf8')
+ return bool(C.zmq_has(capability))
+
+def curve_keypair():
+ """generate a Z85 keypair for use with zmq.CURVE security
+
+ Requires libzmq (≥ 4.0) to have been linked with libsodium.
+
+ Returns
+ -------
+ (public, secret) : two bytestrings
+ The public and private keypair as 40 byte z85-encoded bytestrings.
+ """
+ _check_version((3,2), "monitor")
+ public = ffi.new('char[64]')
+ private = ffi.new('char[64]')
+ rc = C.zmq_curve_keypair(public, private)
+ _check_rc(rc)
+ return ffi.buffer(public)[:40], ffi.buffer(private)[:40]
+
+
+class Stopwatch(object):
+ def __init__(self):
+ self.watch = ffi.NULL
+
+ def start(self):
+ if self.watch == ffi.NULL:
+ self.watch = C.zmq_stopwatch_start()
+ else:
+ raise ZMQError('Stopwatch is already runing.')
+
+ def stop(self):
+ if self.watch == ffi.NULL:
+ raise ZMQError('Must start the Stopwatch before calling stop.')
+ else:
+ time = C.zmq_stopwatch_stop(self.watch)
+ self.watch = ffi.NULL
+ return time
+
+ def sleep(self, seconds):
+ C.zmq_sleep(seconds)
+
+__all__ = ['has', 'curve_keypair', 'Stopwatch']
diff --git a/scripts/external_libs/platform/fedora18/zmq/backend/cython/__init__.py b/scripts/external_libs/platform/fedora18/zmq/backend/cython/__init__.py
new file mode 100644
index 00000000..e5358185
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cython/__init__.py
@@ -0,0 +1,23 @@
+"""Python bindings for core 0MQ objects."""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Lesser GNU Public License (LGPL).
+
+from . import (constants, error, message, context,
+ socket, utils, _poll, _version, _device )
+
+__all__ = []
+for submod in (constants, error, message, context,
+ socket, utils, _poll, _version, _device):
+ __all__.extend(submod.__all__)
+
+from .constants import *
+from .error import *
+from .message import *
+from .context import *
+from .socket import *
+from ._poll import *
+from .utils import *
+from ._device import *
+from ._version import *
+
diff --git a/scripts/external_libs/zmq/backend/cython/_device.py b/scripts/external_libs/platform/fedora18/zmq/backend/cython/_device.py
index 3368ca2c..3368ca2c 100644
--- a/scripts/external_libs/zmq/backend/cython/_device.py
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cython/_device.py
diff --git a/scripts/external_libs/zmq/backend/cython/_poll.py b/scripts/external_libs/platform/fedora18/zmq/backend/cython/_poll.py
index cb1d5d77..cb1d5d77 100644
--- a/scripts/external_libs/zmq/backend/cython/_poll.py
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cython/_poll.py
diff --git a/scripts/external_libs/zmq/backend/cython/_version.py b/scripts/external_libs/platform/fedora18/zmq/backend/cython/_version.py
index 08262706..08262706 100644
--- a/scripts/external_libs/zmq/backend/cython/_version.py
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cython/_version.py
diff --git a/scripts/external_libs/platform/fedora18/zmq/backend/cython/checkrc.pxd b/scripts/external_libs/platform/fedora18/zmq/backend/cython/checkrc.pxd
new file mode 100644
index 00000000..3bf69fc3
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cython/checkrc.pxd
@@ -0,0 +1,23 @@
+from libc.errno cimport EINTR, EAGAIN
+from cpython cimport PyErr_CheckSignals
+from libzmq cimport zmq_errno, ZMQ_ETERM
+
+cdef inline int _check_rc(int rc) except -1:
+ """internal utility for checking zmq return condition
+
+ and raising the appropriate Exception class
+ """
+ cdef int errno = zmq_errno()
+ PyErr_CheckSignals()
+ if rc < 0:
+ if errno == EAGAIN:
+ from zmq.error import Again
+ raise Again(errno)
+ elif errno == ZMQ_ETERM:
+ from zmq.error import ContextTerminated
+ raise ContextTerminated(errno)
+ else:
+ from zmq.error import ZMQError
+ raise ZMQError(errno)
+ # return -1
+ return 0
diff --git a/scripts/external_libs/zmq/backend/cython/constants.py b/scripts/external_libs/platform/fedora18/zmq/backend/cython/constants.py
index ea772ac0..ea772ac0 100644
--- a/scripts/external_libs/zmq/backend/cython/constants.py
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cython/constants.py
diff --git a/scripts/external_libs/platform/fedora18/zmq/backend/cython/context.pxd b/scripts/external_libs/platform/fedora18/zmq/backend/cython/context.pxd
new file mode 100644
index 00000000..9c9267a5
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cython/context.pxd
@@ -0,0 +1,41 @@
+"""0MQ Context class declaration."""
+
+#
+# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
+#
+# This file is part of pyzmq.
+#
+# pyzmq is free software; you can redistribute it and/or modify it under
+# the terms of the Lesser GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# pyzmq is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# Lesser GNU General Public License for more details.
+#
+# You should have received a copy of the Lesser GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+#-----------------------------------------------------------------------------
+# Code
+#-----------------------------------------------------------------------------
+
+cdef class Context:
+
+ cdef object __weakref__ # enable weakref
+ cdef void *handle # The C handle for the underlying zmq object.
+ cdef bint _shadow # whether the Context is a shadow wrapper of another
+ cdef void **_sockets # A C-array containg socket handles
+ cdef size_t _n_sockets # the number of sockets
+ cdef size_t _max_sockets # the size of the _sockets array
+ cdef int _pid # the pid of the process which created me (for fork safety)
+
+ cdef public bint closed # bool property for a closed context.
+ cdef inline int _term(self)
+ # helpers for events on _sockets in Socket.__cinit__()/close()
+ cdef inline void _add_socket(self, void* handle)
+ cdef inline void _remove_socket(self, void* handle)
+
diff --git a/scripts/external_libs/zmq/backend/cython/context.py b/scripts/external_libs/platform/fedora18/zmq/backend/cython/context.py
index 19f8ec7c..19f8ec7c 100644
--- a/scripts/external_libs/zmq/backend/cython/context.py
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cython/context.py
diff --git a/scripts/external_libs/zmq/backend/cython/error.py b/scripts/external_libs/platform/fedora18/zmq/backend/cython/error.py
index d3a4ea0e..d3a4ea0e 100644
--- a/scripts/external_libs/zmq/backend/cython/error.py
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cython/error.py
diff --git a/scripts/external_libs/platform/fedora18/zmq/backend/cython/libzmq.pxd b/scripts/external_libs/platform/fedora18/zmq/backend/cython/libzmq.pxd
new file mode 100644
index 00000000..e42f6d6b
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cython/libzmq.pxd
@@ -0,0 +1,110 @@
+"""All the C imports for 0MQ"""
+
+#
+# Copyright (c) 2010 Brian E. Granger & Min Ragan-Kelley
+#
+# This file is part of pyzmq.
+#
+# pyzmq is free software; you can redistribute it and/or modify it under
+# the terms of the Lesser GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# pyzmq is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# Lesser GNU General Public License for more details.
+#
+# You should have received a copy of the Lesser GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+#-----------------------------------------------------------------------------
+# Imports
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# Import the C header files
+#-----------------------------------------------------------------------------
+
+cdef extern from *:
+ ctypedef void* const_void_ptr "const void *"
+ ctypedef char* const_char_ptr "const char *"
+
+cdef extern from "zmq_compat.h":
+ ctypedef signed long long int64_t "pyzmq_int64_t"
+
+include "constant_enums.pxi"
+
+cdef extern from "zmq.h" nogil:
+
+ void _zmq_version "zmq_version"(int *major, int *minor, int *patch)
+
+ ctypedef int fd_t "ZMQ_FD_T"
+
+ enum: errno
+ char *zmq_strerror (int errnum)
+ int zmq_errno()
+
+ void *zmq_ctx_new ()
+ int zmq_ctx_destroy (void *context)
+ int zmq_ctx_set (void *context, int option, int optval)
+ int zmq_ctx_get (void *context, int option)
+ void *zmq_init (int io_threads)
+ int zmq_term (void *context)
+
+ # blackbox def for zmq_msg_t
+ ctypedef void * zmq_msg_t "zmq_msg_t"
+
+ ctypedef void zmq_free_fn(void *data, void *hint)
+
+ int zmq_msg_init (zmq_msg_t *msg)
+ int zmq_msg_init_size (zmq_msg_t *msg, size_t size)
+ int zmq_msg_init_data (zmq_msg_t *msg, void *data,
+ size_t size, zmq_free_fn *ffn, void *hint)
+ int zmq_msg_send (zmq_msg_t *msg, void *s, int flags)
+ int zmq_msg_recv (zmq_msg_t *msg, void *s, int flags)
+ int zmq_msg_close (zmq_msg_t *msg)
+ int zmq_msg_move (zmq_msg_t *dest, zmq_msg_t *src)
+ int zmq_msg_copy (zmq_msg_t *dest, zmq_msg_t *src)
+ void *zmq_msg_data (zmq_msg_t *msg)
+ size_t zmq_msg_size (zmq_msg_t *msg)
+ int zmq_msg_more (zmq_msg_t *msg)
+ int zmq_msg_get (zmq_msg_t *msg, int option)
+ int zmq_msg_set (zmq_msg_t *msg, int option, int optval)
+ const_char_ptr zmq_msg_gets (zmq_msg_t *msg, const_char_ptr property)
+ int zmq_has (const_char_ptr capability)
+
+ void *zmq_socket (void *context, int type)
+ int zmq_close (void *s)
+ int zmq_setsockopt (void *s, int option, void *optval, size_t optvallen)
+ int zmq_getsockopt (void *s, int option, void *optval, size_t *optvallen)
+ int zmq_bind (void *s, char *addr)
+ int zmq_connect (void *s, char *addr)
+ int zmq_unbind (void *s, char *addr)
+ int zmq_disconnect (void *s, char *addr)
+
+ int zmq_socket_monitor (void *s, char *addr, int flags)
+
+ # send/recv
+ int zmq_sendbuf (void *s, const_void_ptr buf, size_t n, int flags)
+ int zmq_recvbuf (void *s, void *buf, size_t n, int flags)
+
+ ctypedef struct zmq_pollitem_t:
+ void *socket
+ int fd
+ short events
+ short revents
+
+ int zmq_poll (zmq_pollitem_t *items, int nitems, long timeout)
+
+ int zmq_device (int device_, void *insocket_, void *outsocket_)
+ int zmq_proxy (void *frontend, void *backend, void *capture)
+
+cdef extern from "zmq_utils.h" nogil:
+
+ void *zmq_stopwatch_start ()
+ unsigned long zmq_stopwatch_stop (void *watch_)
+ void zmq_sleep (int seconds_)
+ int zmq_curve_keypair (char *z85_public_key, char *z85_secret_key)
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/backend/cython/message.pxd b/scripts/external_libs/platform/fedora18/zmq/backend/cython/message.pxd
new file mode 100644
index 00000000..4781195f
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cython/message.pxd
@@ -0,0 +1,63 @@
+"""0MQ Message related class declarations."""
+
+#
+# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
+#
+# This file is part of pyzmq.
+#
+# pyzmq is free software; you can redistribute it and/or modify it under
+# the terms of the Lesser GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# pyzmq is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# Lesser GNU General Public License for more details.
+#
+# You should have received a copy of the Lesser GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+#-----------------------------------------------------------------------------
+# Imports
+#-----------------------------------------------------------------------------
+
+from cpython cimport PyBytes_FromStringAndSize
+
+from libzmq cimport zmq_msg_t, zmq_msg_data, zmq_msg_size
+
+#-----------------------------------------------------------------------------
+# Code
+#-----------------------------------------------------------------------------
+
+cdef class MessageTracker(object):
+
+ cdef set events # Message Event objects to track.
+ cdef set peers # Other Message or MessageTracker objects.
+
+
+cdef class Frame:
+
+ cdef zmq_msg_t zmq_msg
+ cdef object _data # The actual message data as a Python object.
+ cdef object _buffer # A Python Buffer/View of the message contents
+ cdef object _bytes # A bytes/str copy of the message.
+ cdef bint _failed_init # Flag to handle failed zmq_msg_init
+ cdef public object tracker_event # Event for use with zmq_free_fn.
+ cdef public object tracker # MessageTracker object.
+ cdef public bint more # whether RCVMORE was set
+
+ cdef Frame fast_copy(self) # Create shallow copy of Message object.
+ cdef object _getbuffer(self) # Construct self._buffer.
+
+
+cdef inline object copy_zmq_msg_bytes(zmq_msg_t *zmq_msg):
+ """ Copy the data from a zmq_msg_t """
+ cdef char *data_c = NULL
+ cdef Py_ssize_t data_len_c
+ data_c = <char *>zmq_msg_data(zmq_msg)
+ data_len_c = zmq_msg_size(zmq_msg)
+ return PyBytes_FromStringAndSize(data_c, data_len_c)
+
+
diff --git a/scripts/external_libs/zmq/backend/cython/message.py b/scripts/external_libs/platform/fedora18/zmq/backend/cython/message.py
index 5e423b62..5e423b62 100644
--- a/scripts/external_libs/zmq/backend/cython/message.py
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cython/message.py
diff --git a/scripts/external_libs/platform/fedora18/zmq/backend/cython/socket.pxd b/scripts/external_libs/platform/fedora18/zmq/backend/cython/socket.pxd
new file mode 100644
index 00000000..b8a331e2
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cython/socket.pxd
@@ -0,0 +1,47 @@
+"""0MQ Socket class declaration."""
+
+#
+# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
+#
+# This file is part of pyzmq.
+#
+# pyzmq is free software; you can redistribute it and/or modify it under
+# the terms of the Lesser GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# pyzmq is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# Lesser GNU General Public License for more details.
+#
+# You should have received a copy of the Lesser GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+#-----------------------------------------------------------------------------
+# Imports
+#-----------------------------------------------------------------------------
+
+from context cimport Context
+
+#-----------------------------------------------------------------------------
+# Code
+#-----------------------------------------------------------------------------
+
+
+cdef class Socket:
+
+ cdef object __weakref__ # enable weakref
+ cdef void *handle # The C handle for the underlying zmq object.
+ cdef bint _shadow # whether the Socket is a shadow wrapper of another
+ # Hold on to a reference to the context to make sure it is not garbage
+ # collected until the socket it done with it.
+ cdef public Context context # The zmq Context object that owns this.
+ cdef public bint _closed # bool property for a closed socket.
+ cdef int _pid # the pid of the process which created me (for fork safety)
+
+ # cpdef methods for direct-cython access:
+ cpdef object send(self, object data, int flags=*, copy=*, track=*)
+ cpdef object recv(self, int flags=*, copy=*, track=*)
+
diff --git a/scripts/external_libs/zmq/backend/cython/socket.py b/scripts/external_libs/platform/fedora18/zmq/backend/cython/socket.py
index faef8bee..faef8bee 100644
--- a/scripts/external_libs/zmq/backend/cython/socket.py
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cython/socket.py
diff --git a/scripts/external_libs/platform/fedora18/zmq/backend/cython/utils.pxd b/scripts/external_libs/platform/fedora18/zmq/backend/cython/utils.pxd
new file mode 100644
index 00000000..1d7117f1
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cython/utils.pxd
@@ -0,0 +1,29 @@
+"""Wrap zmq_utils.h"""
+
+#
+# Copyright (c) 2010 Brian E. Granger & Min Ragan-Kelley
+#
+# This file is part of pyzmq.
+#
+# pyzmq is free software; you can redistribute it and/or modify it under
+# the terms of the Lesser GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# pyzmq is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# Lesser GNU General Public License for more details.
+#
+# You should have received a copy of the Lesser GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+#-----------------------------------------------------------------------------
+# Code
+#-----------------------------------------------------------------------------
+
+
+cdef class Stopwatch:
+ cdef void *watch # The C handle for the underlying zmq object
+
diff --git a/scripts/external_libs/zmq/backend/cython/utils.py b/scripts/external_libs/platform/fedora18/zmq/backend/cython/utils.py
index fe928300..fe928300 100644
--- a/scripts/external_libs/zmq/backend/cython/utils.py
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/cython/utils.py
diff --git a/scripts/external_libs/platform/fedora18/zmq/backend/select.py b/scripts/external_libs/platform/fedora18/zmq/backend/select.py
new file mode 100644
index 00000000..0a2e09a2
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/backend/select.py
@@ -0,0 +1,39 @@
+"""Import basic exposure of libzmq C API as a backend"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+public_api = [
+ 'Context',
+ 'Socket',
+ 'Frame',
+ 'Message',
+ 'Stopwatch',
+ 'device',
+ 'proxy',
+ 'zmq_poll',
+ 'strerror',
+ 'zmq_errno',
+ 'has',
+ 'curve_keypair',
+ 'constants',
+ 'zmq_version_info',
+ 'IPC_PATH_MAX_LEN',
+]
+
+def select_backend(name):
+ """Select the pyzmq backend"""
+ try:
+ mod = __import__(name, fromlist=public_api)
+ except ImportError:
+ raise
+ except Exception as e:
+ import sys
+ from zmq.utils.sixcerpt import reraise
+ exc_info = sys.exc_info()
+ reraise(ImportError, ImportError("Importing %s failed with %s" % (name, e)), exc_info[2])
+
+ ns = {}
+ for key in public_api:
+ ns[key] = getattr(mod, key)
+ return ns
diff --git a/scripts/external_libs/platform/fedora18/zmq/devices/__init__.py b/scripts/external_libs/platform/fedora18/zmq/devices/__init__.py
new file mode 100644
index 00000000..23715963
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/devices/__init__.py
@@ -0,0 +1,16 @@
+"""0MQ Device classes for running in background threads or processes."""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+from zmq import device
+from zmq.devices import basedevice, proxydevice, monitoredqueue, monitoredqueuedevice
+
+from zmq.devices.basedevice import *
+from zmq.devices.proxydevice import *
+from zmq.devices.monitoredqueue import *
+from zmq.devices.monitoredqueuedevice import *
+
+__all__ = ['device']
+for submod in (basedevice, proxydevice, monitoredqueue, monitoredqueuedevice):
+ __all__.extend(submod.__all__)
diff --git a/scripts/external_libs/platform/fedora18/zmq/devices/basedevice.py b/scripts/external_libs/platform/fedora18/zmq/devices/basedevice.py
new file mode 100644
index 00000000..7ba1b7ac
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/devices/basedevice.py
@@ -0,0 +1,229 @@
+"""Classes for running 0MQ Devices in the background."""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+import time
+from threading import Thread
+from multiprocessing import Process
+
+from zmq import device, QUEUE, Context, ETERM, ZMQError
+
+
+class Device:
+ """A 0MQ Device to be run in the background.
+
+ You do not pass Socket instances to this, but rather Socket types::
+
+ Device(device_type, in_socket_type, out_socket_type)
+
+ For instance::
+
+ dev = Device(zmq.QUEUE, zmq.DEALER, zmq.ROUTER)
+
+ Similar to zmq.device, but socket types instead of sockets themselves are
+ passed, and the sockets are created in the work thread, to avoid issues
+ with thread safety. As a result, additional bind_{in|out} and
+ connect_{in|out} methods and setsockopt_{in|out} allow users to specify
+ connections for the sockets.
+
+ Parameters
+ ----------
+ device_type : int
+ The 0MQ Device type
+ {in|out}_type : int
+ zmq socket types, to be passed later to context.socket(). e.g.
+ zmq.PUB, zmq.SUB, zmq.REQ. If out_type is < 0, then in_socket is used
+ for both in_socket and out_socket.
+
+ Methods
+ -------
+ bind_{in_out}(iface)
+ passthrough for ``{in|out}_socket.bind(iface)``, to be called in the thread
+ connect_{in_out}(iface)
+ passthrough for ``{in|out}_socket.connect(iface)``, to be called in the
+ thread
+ setsockopt_{in_out}(opt,value)
+ passthrough for ``{in|out}_socket.setsockopt(opt, value)``, to be called in
+ the thread
+
+ Attributes
+ ----------
+ daemon : int
+ sets whether the thread should be run as a daemon
+ Default is true, because if it is false, the thread will not
+ exit unless it is killed
+ context_factory : callable (class attribute)
+ Function for creating the Context. This will be Context.instance
+ in ThreadDevices, and Context in ProcessDevices. The only reason
+ it is not instance() in ProcessDevices is that there may be a stale
+ Context instance already initialized, and the forked environment
+ should *never* try to use it.
+ """
+
+ context_factory = Context.instance
+ """Callable that returns a context. Typically either Context.instance or Context,
+ depending on whether the device should share the global instance or not.
+ """
+
+ def __init__(self, device_type=QUEUE, in_type=None, out_type=None):
+ self.device_type = device_type
+ if in_type is None:
+ raise TypeError("in_type must be specified")
+ if out_type is None:
+ raise TypeError("out_type must be specified")
+ self.in_type = in_type
+ self.out_type = out_type
+ self._in_binds = []
+ self._in_connects = []
+ self._in_sockopts = []
+ self._out_binds = []
+ self._out_connects = []
+ self._out_sockopts = []
+ self.daemon = True
+ self.done = False
+
+ def bind_in(self, addr):
+ """Enqueue ZMQ address for binding on in_socket.
+
+ See zmq.Socket.bind for details.
+ """
+ self._in_binds.append(addr)
+
+ def connect_in(self, addr):
+ """Enqueue ZMQ address for connecting on in_socket.
+
+ See zmq.Socket.connect for details.
+ """
+ self._in_connects.append(addr)
+
+ def setsockopt_in(self, opt, value):
+ """Enqueue setsockopt(opt, value) for in_socket
+
+ See zmq.Socket.setsockopt for details.
+ """
+ self._in_sockopts.append((opt, value))
+
+ def bind_out(self, addr):
+ """Enqueue ZMQ address for binding on out_socket.
+
+ See zmq.Socket.bind for details.
+ """
+ self._out_binds.append(addr)
+
+ def connect_out(self, addr):
+ """Enqueue ZMQ address for connecting on out_socket.
+
+ See zmq.Socket.connect for details.
+ """
+ self._out_connects.append(addr)
+
+ def setsockopt_out(self, opt, value):
+ """Enqueue setsockopt(opt, value) for out_socket
+
+ See zmq.Socket.setsockopt for details.
+ """
+ self._out_sockopts.append((opt, value))
+
+ def _setup_sockets(self):
+ ctx = self.context_factory()
+
+ self._context = ctx
+
+ # create the sockets
+ ins = ctx.socket(self.in_type)
+ if self.out_type < 0:
+ outs = ins
+ else:
+ outs = ctx.socket(self.out_type)
+
+ # set sockopts (must be done first, in case of zmq.IDENTITY)
+ for opt,value in self._in_sockopts:
+ ins.setsockopt(opt, value)
+ for opt,value in self._out_sockopts:
+ outs.setsockopt(opt, value)
+
+ for iface in self._in_binds:
+ ins.bind(iface)
+ for iface in self._out_binds:
+ outs.bind(iface)
+
+ for iface in self._in_connects:
+ ins.connect(iface)
+ for iface in self._out_connects:
+ outs.connect(iface)
+
+ return ins,outs
+
+ def run_device(self):
+ """The runner method.
+
+ Do not call me directly, instead call ``self.start()``, just like a Thread.
+ """
+ ins,outs = self._setup_sockets()
+ device(self.device_type, ins, outs)
+
+ def run(self):
+ """wrap run_device in try/catch ETERM"""
+ try:
+ self.run_device()
+ except ZMQError as e:
+ if e.errno == ETERM:
+ # silence TERM errors, because this should be a clean shutdown
+ pass
+ else:
+ raise
+ finally:
+ self.done = True
+
+ def start(self):
+ """Start the device. Override me in subclass for other launchers."""
+ return self.run()
+
+ def join(self,timeout=None):
+ """wait for me to finish, like Thread.join.
+
+ Reimplemented appropriately by subclasses."""
+ tic = time.time()
+ toc = tic
+ while not self.done and not (timeout is not None and toc-tic > timeout):
+ time.sleep(.001)
+ toc = time.time()
+
+
+class BackgroundDevice(Device):
+ """Base class for launching Devices in background processes and threads."""
+
+ launcher=None
+ _launch_class=None
+
+ def start(self):
+ self.launcher = self._launch_class(target=self.run)
+ self.launcher.daemon = self.daemon
+ return self.launcher.start()
+
+ def join(self, timeout=None):
+ return self.launcher.join(timeout=timeout)
+
+
+class ThreadDevice(BackgroundDevice):
+ """A Device that will be run in a background Thread.
+
+ See Device for details.
+ """
+ _launch_class=Thread
+
+class ProcessDevice(BackgroundDevice):
+ """A Device that will be run in a background Process.
+
+ See Device for details.
+ """
+ _launch_class=Process
+ context_factory = Context
+ """Callable that returns a context. Typically either Context.instance or Context,
+ depending on whether the device should share the global instance or not.
+ """
+
+
+__all__ = ['Device', 'ThreadDevice', 'ProcessDevice']
diff --git a/scripts/external_libs/platform/fedora18/zmq/devices/monitoredqueue.pxd b/scripts/external_libs/platform/fedora18/zmq/devices/monitoredqueue.pxd
new file mode 100644
index 00000000..1e26ed86
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/devices/monitoredqueue.pxd
@@ -0,0 +1,177 @@
+"""MonitoredQueue class declarations.
+
+Authors
+-------
+* MinRK
+* Brian Granger
+"""
+
+#
+# Copyright (c) 2010 Min Ragan-Kelley, Brian Granger
+#
+# This file is part of pyzmq, but is derived and adapted from zmq_queue.cpp
+# originally from libzmq-2.1.6, used under LGPLv3
+#
+# pyzmq is free software; you can redistribute it and/or modify it under
+# the terms of the Lesser GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# pyzmq is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# Lesser GNU General Public License for more details.
+#
+# You should have received a copy of the Lesser GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+#-----------------------------------------------------------------------------
+# Imports
+#-----------------------------------------------------------------------------
+
+from libzmq cimport *
+
+#-----------------------------------------------------------------------------
+# MonitoredQueue C functions
+#-----------------------------------------------------------------------------
+
+cdef inline int _relay(void *insocket_, void *outsocket_, void *sidesocket_,
+ zmq_msg_t msg, zmq_msg_t side_msg, zmq_msg_t id_msg,
+ bint swap_ids) nogil:
+ cdef int rc
+ cdef int64_t flag_2
+ cdef int flag_3
+ cdef int flags
+ cdef bint more
+ cdef size_t flagsz
+ cdef void * flag_ptr
+
+ if ZMQ_VERSION_MAJOR < 3:
+ flagsz = sizeof (int64_t)
+ flag_ptr = &flag_2
+ else:
+ flagsz = sizeof (int)
+ flag_ptr = &flag_3
+
+ if swap_ids:# both router, must send second identity first
+ # recv two ids into msg, id_msg
+ rc = zmq_msg_recv(&msg, insocket_, 0)
+ if rc < 0: return rc
+
+ rc = zmq_msg_recv(&id_msg, insocket_, 0)
+ if rc < 0: return rc
+
+ # send second id (id_msg) first
+ #!!!! always send a copy before the original !!!!
+ rc = zmq_msg_copy(&side_msg, &id_msg)
+ if rc < 0: return rc
+ rc = zmq_msg_send(&side_msg, outsocket_, ZMQ_SNDMORE)
+ if rc < 0: return rc
+ rc = zmq_msg_send(&id_msg, sidesocket_, ZMQ_SNDMORE)
+ if rc < 0: return rc
+ # send first id (msg) second
+ rc = zmq_msg_copy(&side_msg, &msg)
+ if rc < 0: return rc
+ rc = zmq_msg_send(&side_msg, outsocket_, ZMQ_SNDMORE)
+ if rc < 0: return rc
+ rc = zmq_msg_send(&msg, sidesocket_, ZMQ_SNDMORE)
+ if rc < 0: return rc
+ while (True):
+ rc = zmq_msg_recv(&msg, insocket_, 0)
+ if rc < 0: return rc
+ # assert (rc == 0)
+ rc = zmq_getsockopt (insocket_, ZMQ_RCVMORE, flag_ptr, &flagsz)
+ if rc < 0: return rc
+ flags = 0
+ if ZMQ_VERSION_MAJOR < 3:
+ if flag_2:
+ flags |= ZMQ_SNDMORE
+ else:
+ if flag_3:
+ flags |= ZMQ_SNDMORE
+ # LABEL has been removed:
+ # rc = zmq_getsockopt (insocket_, ZMQ_RCVLABEL, flag_ptr, &flagsz)
+ # if flag_3:
+ # flags |= ZMQ_SNDLABEL
+ # assert (rc == 0)
+
+ rc = zmq_msg_copy(&side_msg, &msg)
+ if rc < 0: return rc
+ if flags:
+ rc = zmq_msg_send(&side_msg, outsocket_, flags)
+ if rc < 0: return rc
+ # only SNDMORE for side-socket
+ rc = zmq_msg_send(&msg, sidesocket_, ZMQ_SNDMORE)
+ if rc < 0: return rc
+ else:
+ rc = zmq_msg_send(&side_msg, outsocket_, 0)
+ if rc < 0: return rc
+ rc = zmq_msg_send(&msg, sidesocket_, 0)
+ if rc < 0: return rc
+ break
+ return rc
+
+# the MonitoredQueue C function, adapted from zmq::queue.cpp :
+cdef inline int c_monitored_queue (void *insocket_, void *outsocket_,
+ void *sidesocket_, zmq_msg_t *in_msg_ptr,
+ zmq_msg_t *out_msg_ptr, int swap_ids) nogil:
+ """The actual C function for a monitored queue device.
+
+ See ``monitored_queue()`` for details.
+ """
+
+ cdef zmq_msg_t msg
+ cdef int rc = zmq_msg_init (&msg)
+ cdef zmq_msg_t id_msg
+ rc = zmq_msg_init (&id_msg)
+ if rc < 0: return rc
+ cdef zmq_msg_t side_msg
+ rc = zmq_msg_init (&side_msg)
+ if rc < 0: return rc
+
+ cdef zmq_pollitem_t items [2]
+ items [0].socket = insocket_
+ items [0].fd = 0
+ items [0].events = ZMQ_POLLIN
+ items [0].revents = 0
+ items [1].socket = outsocket_
+ items [1].fd = 0
+ items [1].events = ZMQ_POLLIN
+ items [1].revents = 0
+ # I don't think sidesocket should be polled?
+ # items [2].socket = sidesocket_
+ # items [2].fd = 0
+ # items [2].events = ZMQ_POLLIN
+ # items [2].revents = 0
+
+ while (True):
+
+ # // Wait while there are either requests or replies to process.
+ rc = zmq_poll (&items [0], 2, -1)
+ if rc < 0: return rc
+ # // The algorithm below asumes ratio of request and replies processed
+ # // under full load to be 1:1. Although processing requests replies
+ # // first is tempting it is suspectible to DoS attacks (overloading
+ # // the system with unsolicited replies).
+ #
+ # // Process a request.
+ if (items [0].revents & ZMQ_POLLIN):
+ # send in_prefix to side socket
+ rc = zmq_msg_copy(&side_msg, in_msg_ptr)
+ if rc < 0: return rc
+ rc = zmq_msg_send(&side_msg, sidesocket_, ZMQ_SNDMORE)
+ if rc < 0: return rc
+ # relay the rest of the message
+ rc = _relay(insocket_, outsocket_, sidesocket_, msg, side_msg, id_msg, swap_ids)
+ if rc < 0: return rc
+ if (items [1].revents & ZMQ_POLLIN):
+ # send out_prefix to side socket
+ rc = zmq_msg_copy(&side_msg, out_msg_ptr)
+ if rc < 0: return rc
+ rc = zmq_msg_send(&side_msg, sidesocket_, ZMQ_SNDMORE)
+ if rc < 0: return rc
+ # relay the rest of the message
+ rc = _relay(outsocket_, insocket_, sidesocket_, msg, side_msg, id_msg, swap_ids)
+ if rc < 0: return rc
+ return rc
diff --git a/scripts/external_libs/zmq/devices/monitoredqueue.py b/scripts/external_libs/platform/fedora18/zmq/devices/monitoredqueue.py
index 6d714e51..6d714e51 100644
--- a/scripts/external_libs/zmq/devices/monitoredqueue.py
+++ b/scripts/external_libs/platform/fedora18/zmq/devices/monitoredqueue.py
diff --git a/scripts/external_libs/platform/fedora18/zmq/devices/monitoredqueuedevice.py b/scripts/external_libs/platform/fedora18/zmq/devices/monitoredqueuedevice.py
new file mode 100644
index 00000000..9723f866
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/devices/monitoredqueuedevice.py
@@ -0,0 +1,66 @@
+"""MonitoredQueue classes and functions."""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+from zmq import ZMQError, PUB
+from zmq.devices.proxydevice import ProxyBase, Proxy, ThreadProxy, ProcessProxy
+from zmq.devices.monitoredqueue import monitored_queue
+
+
+class MonitoredQueueBase(ProxyBase):
+ """Base class for overriding methods."""
+
+ _in_prefix = b''
+ _out_prefix = b''
+
+ def __init__(self, in_type, out_type, mon_type=PUB, in_prefix=b'in', out_prefix=b'out'):
+
+ ProxyBase.__init__(self, in_type=in_type, out_type=out_type, mon_type=mon_type)
+
+ self._in_prefix = in_prefix
+ self._out_prefix = out_prefix
+
+ def run_device(self):
+ ins,outs,mons = self._setup_sockets()
+ monitored_queue(ins, outs, mons, self._in_prefix, self._out_prefix)
+
+
+class MonitoredQueue(MonitoredQueueBase, Proxy):
+ """Class for running monitored_queue in the background.
+
+ See zmq.devices.Device for most of the spec. MonitoredQueue differs from Proxy,
+ only in that it adds a ``prefix`` to messages sent on the monitor socket,
+ with a different prefix for each direction.
+
+ MQ also supports ROUTER on both sides, which zmq.proxy does not.
+
+ If a message arrives on `in_sock`, it will be prefixed with `in_prefix` on the monitor socket.
+ If it arrives on out_sock, it will be prefixed with `out_prefix`.
+
+ A PUB socket is the most logical choice for the mon_socket, but it is not required.
+ """
+ pass
+
+
+class ThreadMonitoredQueue(MonitoredQueueBase, ThreadProxy):
+ """Run zmq.monitored_queue in a background thread.
+
+ See MonitoredQueue and Proxy for details.
+ """
+ pass
+
+
+class ProcessMonitoredQueue(MonitoredQueueBase, ProcessProxy):
+ """Run zmq.monitored_queue in a background thread.
+
+ See MonitoredQueue and Proxy for details.
+ """
+
+
+__all__ = [
+ 'MonitoredQueue',
+ 'ThreadMonitoredQueue',
+ 'ProcessMonitoredQueue'
+]
diff --git a/scripts/external_libs/platform/fedora18/zmq/devices/proxydevice.py b/scripts/external_libs/platform/fedora18/zmq/devices/proxydevice.py
new file mode 100644
index 00000000..68be3f15
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/devices/proxydevice.py
@@ -0,0 +1,90 @@
+"""Proxy classes and functions."""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import zmq
+from zmq.devices.basedevice import Device, ThreadDevice, ProcessDevice
+
+
+class ProxyBase(object):
+ """Base class for overriding methods."""
+
+ def __init__(self, in_type, out_type, mon_type=zmq.PUB):
+
+ Device.__init__(self, in_type=in_type, out_type=out_type)
+ self.mon_type = mon_type
+ self._mon_binds = []
+ self._mon_connects = []
+ self._mon_sockopts = []
+
+ def bind_mon(self, addr):
+ """Enqueue ZMQ address for binding on mon_socket.
+
+ See zmq.Socket.bind for details.
+ """
+ self._mon_binds.append(addr)
+
+ def connect_mon(self, addr):
+ """Enqueue ZMQ address for connecting on mon_socket.
+
+ See zmq.Socket.bind for details.
+ """
+ self._mon_connects.append(addr)
+
+ def setsockopt_mon(self, opt, value):
+ """Enqueue setsockopt(opt, value) for mon_socket
+
+ See zmq.Socket.setsockopt for details.
+ """
+ self._mon_sockopts.append((opt, value))
+
+ def _setup_sockets(self):
+ ins,outs = Device._setup_sockets(self)
+ ctx = self._context
+ mons = ctx.socket(self.mon_type)
+
+ # set sockopts (must be done first, in case of zmq.IDENTITY)
+ for opt,value in self._mon_sockopts:
+ mons.setsockopt(opt, value)
+
+ for iface in self._mon_binds:
+ mons.bind(iface)
+
+ for iface in self._mon_connects:
+ mons.connect(iface)
+
+ return ins,outs,mons
+
+ def run_device(self):
+ ins,outs,mons = self._setup_sockets()
+ zmq.proxy(ins, outs, mons)
+
+class Proxy(ProxyBase, Device):
+ """Threadsafe Proxy object.
+
+ See zmq.devices.Device for most of the spec. This subclass adds a
+ <method>_mon version of each <method>_{in|out} method, for configuring the
+ monitor socket.
+
+ A Proxy is a 3-socket ZMQ Device that functions just like a
+ QUEUE, except each message is also sent out on the monitor socket.
+
+ A PUB socket is the most logical choice for the mon_socket, but it is not required.
+ """
+ pass
+
+class ThreadProxy(ProxyBase, ThreadDevice):
+ """Proxy in a Thread. See Proxy for more."""
+ pass
+
+class ProcessProxy(ProxyBase, ProcessDevice):
+ """Proxy in a Process. See Proxy for more."""
+ pass
+
+
+__all__ = [
+ 'Proxy',
+ 'ThreadProxy',
+ 'ProcessProxy',
+]
diff --git a/scripts/external_libs/platform/fedora18/zmq/error.py b/scripts/external_libs/platform/fedora18/zmq/error.py
new file mode 100644
index 00000000..48cdaafa
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/error.py
@@ -0,0 +1,164 @@
+"""0MQ Error classes and functions."""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+class ZMQBaseError(Exception):
+ """Base exception class for 0MQ errors in Python."""
+ pass
+
+class ZMQError(ZMQBaseError):
+ """Wrap an errno style error.
+
+ Parameters
+ ----------
+ errno : int
+ The ZMQ errno or None. If None, then ``zmq_errno()`` is called and
+ used.
+ msg : string
+ Description of the error or None.
+ """
+ errno = None
+
+ def __init__(self, errno=None, msg=None):
+ """Wrap an errno style error.
+
+ Parameters
+ ----------
+ errno : int
+ The ZMQ errno or None. If None, then ``zmq_errno()`` is called and
+ used.
+ msg : string
+ Description of the error or None.
+ """
+ from zmq.backend import strerror, zmq_errno
+ if errno is None:
+ errno = zmq_errno()
+ if isinstance(errno, int):
+ self.errno = errno
+ if msg is None:
+ self.strerror = strerror(errno)
+ else:
+ self.strerror = msg
+ else:
+ if msg is None:
+ self.strerror = str(errno)
+ else:
+ self.strerror = msg
+ # flush signals, because there could be a SIGINT
+ # waiting to pounce, resulting in uncaught exceptions.
+ # Doing this here means getting SIGINT during a blocking
+ # libzmq call will raise a *catchable* KeyboardInterrupt
+ # PyErr_CheckSignals()
+
+ def __str__(self):
+ return self.strerror
+
+ def __repr__(self):
+ return "ZMQError('%s')"%self.strerror
+
+
+class ZMQBindError(ZMQBaseError):
+ """An error for ``Socket.bind_to_random_port()``.
+
+ See Also
+ --------
+ .Socket.bind_to_random_port
+ """
+ pass
+
+
+class NotDone(ZMQBaseError):
+ """Raised when timeout is reached while waiting for 0MQ to finish with a Message
+
+ See Also
+ --------
+ .MessageTracker.wait : object for tracking when ZeroMQ is done
+ """
+ pass
+
+
+class ContextTerminated(ZMQError):
+ """Wrapper for zmq.ETERM
+
+ .. versionadded:: 13.0
+ """
+ pass
+
+
+class Again(ZMQError):
+ """Wrapper for zmq.EAGAIN
+
+ .. versionadded:: 13.0
+ """
+ pass
+
+
+def _check_rc(rc, errno=None):
+ """internal utility for checking zmq return condition
+
+ and raising the appropriate Exception class
+ """
+ if rc < 0:
+ from zmq.backend import zmq_errno
+ if errno is None:
+ errno = zmq_errno()
+ from zmq import EAGAIN, ETERM
+ if errno == EAGAIN:
+ raise Again(errno)
+ elif errno == ETERM:
+ raise ContextTerminated(errno)
+ else:
+ raise ZMQError(errno)
+
+_zmq_version_info = None
+_zmq_version = None
+
+class ZMQVersionError(NotImplementedError):
+ """Raised when a feature is not provided by the linked version of libzmq.
+
+ .. versionadded:: 14.2
+ """
+ min_version = None
+ def __init__(self, min_version, msg='Feature'):
+ global _zmq_version
+ if _zmq_version is None:
+ from zmq import zmq_version
+ _zmq_version = zmq_version()
+ self.msg = msg
+ self.min_version = min_version
+ self.version = _zmq_version
+
+ def __repr__(self):
+ return "ZMQVersionError('%s')" % str(self)
+
+ def __str__(self):
+ return "%s requires libzmq >= %s, have %s" % (self.msg, self.min_version, self.version)
+
+
+def _check_version(min_version_info, msg='Feature'):
+ """Check for libzmq
+
+ raises ZMQVersionError if current zmq version is not at least min_version
+
+ min_version_info is a tuple of integers, and will be compared against zmq.zmq_version_info().
+ """
+ global _zmq_version_info
+ if _zmq_version_info is None:
+ from zmq import zmq_version_info
+ _zmq_version_info = zmq_version_info()
+ if _zmq_version_info < min_version_info:
+ min_version = '.'.join(str(v) for v in min_version_info)
+ raise ZMQVersionError(min_version, msg)
+
+
+__all__ = [
+ 'ZMQBaseError',
+ 'ZMQBindError',
+ 'ZMQError',
+ 'NotDone',
+ 'ContextTerminated',
+ 'Again',
+ 'ZMQVersionError',
+]
diff --git a/scripts/external_libs/platform/fedora18/zmq/eventloop/__init__.py b/scripts/external_libs/platform/fedora18/zmq/eventloop/__init__.py
new file mode 100644
index 00000000..568e8e8d
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/eventloop/__init__.py
@@ -0,0 +1,5 @@
+"""A Tornado based event loop for PyZMQ."""
+
+from zmq.eventloop.ioloop import IOLoop
+
+__all__ = ['IOLoop'] \ No newline at end of file
diff --git a/scripts/external_libs/platform/fedora18/zmq/eventloop/ioloop.py b/scripts/external_libs/platform/fedora18/zmq/eventloop/ioloop.py
new file mode 100644
index 00000000..35f4c418
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/eventloop/ioloop.py
@@ -0,0 +1,193 @@
+# coding: utf-8
+"""tornado IOLoop API with zmq compatibility
+
+If you have tornado ≥ 3.0, this is a subclass of tornado's IOLoop,
+otherwise we ship a minimal subset of tornado in zmq.eventloop.minitornado.
+
+The minimal shipped version of tornado's IOLoop does not include
+support for concurrent futures - this will only be available if you
+have tornado ≥ 3.0.
+"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+from __future__ import absolute_import, division, with_statement
+
+import os
+import time
+import warnings
+
+from zmq import (
+ Poller,
+ POLLIN, POLLOUT, POLLERR,
+ ZMQError, ETERM,
+)
+
+try:
+ import tornado
+ tornado_version = tornado.version_info
+except (ImportError, AttributeError):
+ tornado_version = ()
+
+try:
+ # tornado ≥ 3
+ from tornado.ioloop import PollIOLoop, PeriodicCallback
+ from tornado.log import gen_log
+except ImportError:
+ from .minitornado.ioloop import PollIOLoop, PeriodicCallback
+ from .minitornado.log import gen_log
+
+
+class DelayedCallback(PeriodicCallback):
+ """Schedules the given callback to be called once.
+
+ The callback is called once, after callback_time milliseconds.
+
+ `start` must be called after the DelayedCallback is created.
+
+ The timeout is calculated from when `start` is called.
+ """
+ def __init__(self, callback, callback_time, io_loop=None):
+ # PeriodicCallback require callback_time to be positive
+ warnings.warn("""DelayedCallback is deprecated.
+ Use loop.add_timeout instead.""", DeprecationWarning)
+ callback_time = max(callback_time, 1e-3)
+ super(DelayedCallback, self).__init__(callback, callback_time, io_loop)
+
+ def start(self):
+ """Starts the timer."""
+ self._running = True
+ self._firstrun = True
+ self._next_timeout = time.time() + self.callback_time / 1000.0
+ self.io_loop.add_timeout(self._next_timeout, self._run)
+
+ def _run(self):
+ if not self._running: return
+ self._running = False
+ try:
+ self.callback()
+ except Exception:
+ gen_log.error("Error in delayed callback", exc_info=True)
+
+
+class ZMQPoller(object):
+ """A poller that can be used in the tornado IOLoop.
+
+ This simply wraps a regular zmq.Poller, scaling the timeout
+ by 1000, so that it is in seconds rather than milliseconds.
+ """
+
+ def __init__(self):
+ self._poller = Poller()
+
+ @staticmethod
+ def _map_events(events):
+ """translate IOLoop.READ/WRITE/ERROR event masks into zmq.POLLIN/OUT/ERR"""
+ z_events = 0
+ if events & IOLoop.READ:
+ z_events |= POLLIN
+ if events & IOLoop.WRITE:
+ z_events |= POLLOUT
+ if events & IOLoop.ERROR:
+ z_events |= POLLERR
+ return z_events
+
+ @staticmethod
+ def _remap_events(z_events):
+ """translate zmq.POLLIN/OUT/ERR event masks into IOLoop.READ/WRITE/ERROR"""
+ events = 0
+ if z_events & POLLIN:
+ events |= IOLoop.READ
+ if z_events & POLLOUT:
+ events |= IOLoop.WRITE
+ if z_events & POLLERR:
+ events |= IOLoop.ERROR
+ return events
+
+ def register(self, fd, events):
+ return self._poller.register(fd, self._map_events(events))
+
+ def modify(self, fd, events):
+ return self._poller.modify(fd, self._map_events(events))
+
+ def unregister(self, fd):
+ return self._poller.unregister(fd)
+
+ def poll(self, timeout):
+ """poll in seconds rather than milliseconds.
+
+ Event masks will be IOLoop.READ/WRITE/ERROR
+ """
+ z_events = self._poller.poll(1000*timeout)
+ return [ (fd,self._remap_events(evt)) for (fd,evt) in z_events ]
+
+ def close(self):
+ pass
+
+
+class ZMQIOLoop(PollIOLoop):
+ """ZMQ subclass of tornado's IOLoop"""
+ def initialize(self, impl=None, **kwargs):
+ impl = ZMQPoller() if impl is None else impl
+ super(ZMQIOLoop, self).initialize(impl=impl, **kwargs)
+
+ @staticmethod
+ def instance():
+ """Returns a global `IOLoop` instance.
+
+ Most applications have a single, global `IOLoop` running on the
+ main thread. Use this method to get this instance from
+ another thread. To get the current thread's `IOLoop`, use `current()`.
+ """
+ # install ZMQIOLoop as the active IOLoop implementation
+ # when using tornado 3
+ if tornado_version >= (3,):
+ PollIOLoop.configure(ZMQIOLoop)
+ return PollIOLoop.instance()
+
+ def start(self):
+ try:
+ super(ZMQIOLoop, self).start()
+ except ZMQError as e:
+ if e.errno == ETERM:
+ # quietly return on ETERM
+ pass
+ else:
+ raise e
+
+
+if tornado_version >= (3,0) and tornado_version < (3,1):
+ def backport_close(self, all_fds=False):
+ """backport IOLoop.close to 3.0 from 3.1 (supports fd.close() method)"""
+ from zmq.eventloop.minitornado.ioloop import PollIOLoop as mini_loop
+ return mini_loop.close.__get__(self)(all_fds)
+ ZMQIOLoop.close = backport_close
+
+
+# public API name
+IOLoop = ZMQIOLoop
+
+
+def install():
+ """set the tornado IOLoop instance with the pyzmq IOLoop.
+
+ After calling this function, tornado's IOLoop.instance() and pyzmq's
+ IOLoop.instance() will return the same object.
+
+ An assertion error will be raised if tornado's IOLoop has been initialized
+ prior to calling this function.
+ """
+ from tornado import ioloop
+ # check if tornado's IOLoop is already initialized to something other
+ # than the pyzmq IOLoop instance:
+ assert (not ioloop.IOLoop.initialized()) or \
+ ioloop.IOLoop.instance() is IOLoop.instance(), "tornado IOLoop already initialized"
+
+ if tornado_version >= (3,):
+ # tornado 3 has an official API for registering new defaults, yay!
+ ioloop.IOLoop.configure(ZMQIOLoop)
+ else:
+ # we have to set the global instance explicitly
+ ioloop.IOLoop._instance = IOLoop.instance()
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/__init__.py b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/__init__.py
diff --git a/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/concurrent.py b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/concurrent.py
new file mode 100644
index 00000000..519b23d5
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/concurrent.py
@@ -0,0 +1,11 @@
+"""pyzmq does not ship tornado's futures,
+this just raises informative NotImplementedErrors to avoid having to change too much code.
+"""
+
+class NotImplementedFuture(object):
+ def __init__(self, *args, **kwargs):
+ raise NotImplementedError("pyzmq does not ship tornado's Futures, "
+ "install tornado >= 3.0 for future support."
+ )
+
+Future = TracebackFuture = NotImplementedFuture
diff --git a/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/ioloop.py b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/ioloop.py
new file mode 100644
index 00000000..710a3ecb
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/ioloop.py
@@ -0,0 +1,829 @@
+#!/usr/bin/env python
+#
+# Copyright 2009 Facebook
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+"""An I/O event loop for non-blocking sockets.
+
+Typical applications will use a single `IOLoop` object, in the
+`IOLoop.instance` singleton. The `IOLoop.start` method should usually
+be called at the end of the ``main()`` function. Atypical applications may
+use more than one `IOLoop`, such as one `IOLoop` per thread, or per `unittest`
+case.
+
+In addition to I/O events, the `IOLoop` can also schedule time-based events.
+`IOLoop.add_timeout` is a non-blocking alternative to `time.sleep`.
+"""
+
+from __future__ import absolute_import, division, print_function, with_statement
+
+import datetime
+import errno
+import functools
+import heapq
+import logging
+import numbers
+import os
+import select
+import sys
+import threading
+import time
+import traceback
+
+from .concurrent import Future, TracebackFuture
+from .log import app_log, gen_log
+from . import stack_context
+from .util import Configurable
+
+try:
+ import signal
+except ImportError:
+ signal = None
+
+try:
+ import thread # py2
+except ImportError:
+ import _thread as thread # py3
+
+from .platform.auto import set_close_exec, Waker
+
+
+class TimeoutError(Exception):
+ pass
+
+
+class IOLoop(Configurable):
+ """A level-triggered I/O loop.
+
+ We use ``epoll`` (Linux) or ``kqueue`` (BSD and Mac OS X) if they
+ are available, or else we fall back on select(). If you are
+ implementing a system that needs to handle thousands of
+ simultaneous connections, you should use a system that supports
+ either ``epoll`` or ``kqueue``.
+
+ Example usage for a simple TCP server::
+
+ import errno
+ import functools
+ import ioloop
+ import socket
+
+ def connection_ready(sock, fd, events):
+ while True:
+ try:
+ connection, address = sock.accept()
+ except socket.error, e:
+ if e.args[0] not in (errno.EWOULDBLOCK, errno.EAGAIN):
+ raise
+ return
+ connection.setblocking(0)
+ handle_connection(connection, address)
+
+ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
+ sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+ sock.setblocking(0)
+ sock.bind(("", port))
+ sock.listen(128)
+
+ io_loop = ioloop.IOLoop.instance()
+ callback = functools.partial(connection_ready, sock)
+ io_loop.add_handler(sock.fileno(), callback, io_loop.READ)
+ io_loop.start()
+
+ """
+ # Constants from the epoll module
+ _EPOLLIN = 0x001
+ _EPOLLPRI = 0x002
+ _EPOLLOUT = 0x004
+ _EPOLLERR = 0x008
+ _EPOLLHUP = 0x010
+ _EPOLLRDHUP = 0x2000
+ _EPOLLONESHOT = (1 << 30)
+ _EPOLLET = (1 << 31)
+
+ # Our events map exactly to the epoll events
+ NONE = 0
+ READ = _EPOLLIN
+ WRITE = _EPOLLOUT
+ ERROR = _EPOLLERR | _EPOLLHUP
+
+ # Global lock for creating global IOLoop instance
+ _instance_lock = threading.Lock()
+
+ _current = threading.local()
+
+ @staticmethod
+ def instance():
+ """Returns a global `IOLoop` instance.
+
+ Most applications have a single, global `IOLoop` running on the
+ main thread. Use this method to get this instance from
+ another thread. To get the current thread's `IOLoop`, use `current()`.
+ """
+ if not hasattr(IOLoop, "_instance"):
+ with IOLoop._instance_lock:
+ if not hasattr(IOLoop, "_instance"):
+ # New instance after double check
+ IOLoop._instance = IOLoop()
+ return IOLoop._instance
+
+ @staticmethod
+ def initialized():
+ """Returns true if the singleton instance has been created."""
+ return hasattr(IOLoop, "_instance")
+
+ def install(self):
+ """Installs this `IOLoop` object as the singleton instance.
+
+ This is normally not necessary as `instance()` will create
+ an `IOLoop` on demand, but you may want to call `install` to use
+ a custom subclass of `IOLoop`.
+ """
+ assert not IOLoop.initialized()
+ IOLoop._instance = self
+
+ @staticmethod
+ def current():
+ """Returns the current thread's `IOLoop`.
+
+ If an `IOLoop` is currently running or has been marked as current
+ by `make_current`, returns that instance. Otherwise returns
+ `IOLoop.instance()`, i.e. the main thread's `IOLoop`.
+
+ A common pattern for classes that depend on ``IOLoops`` is to use
+ a default argument to enable programs with multiple ``IOLoops``
+ but not require the argument for simpler applications::
+
+ class MyClass(object):
+ def __init__(self, io_loop=None):
+ self.io_loop = io_loop or IOLoop.current()
+
+ In general you should use `IOLoop.current` as the default when
+ constructing an asynchronous object, and use `IOLoop.instance`
+ when you mean to communicate to the main thread from a different
+ one.
+ """
+ current = getattr(IOLoop._current, "instance", None)
+ if current is None:
+ return IOLoop.instance()
+ return current
+
+ def make_current(self):
+ """Makes this the `IOLoop` for the current thread.
+
+ An `IOLoop` automatically becomes current for its thread
+ when it is started, but it is sometimes useful to call
+ `make_current` explictly before starting the `IOLoop`,
+ so that code run at startup time can find the right
+ instance.
+ """
+ IOLoop._current.instance = self
+
+ @staticmethod
+ def clear_current():
+ IOLoop._current.instance = None
+
+ @classmethod
+ def configurable_base(cls):
+ return IOLoop
+
+ @classmethod
+ def configurable_default(cls):
+ # this is the only patch to IOLoop:
+ from zmq.eventloop.ioloop import ZMQIOLoop
+ return ZMQIOLoop
+ # the remainder of this method is unused,
+ # but left for preservation reasons
+ if hasattr(select, "epoll"):
+ from tornado.platform.epoll import EPollIOLoop
+ return EPollIOLoop
+ if hasattr(select, "kqueue"):
+ # Python 2.6+ on BSD or Mac
+ from tornado.platform.kqueue import KQueueIOLoop
+ return KQueueIOLoop
+ from tornado.platform.select import SelectIOLoop
+ return SelectIOLoop
+
+ def initialize(self):
+ pass
+
+ def close(self, all_fds=False):
+ """Closes the `IOLoop`, freeing any resources used.
+
+ If ``all_fds`` is true, all file descriptors registered on the
+ IOLoop will be closed (not just the ones created by the
+ `IOLoop` itself).
+
+ Many applications will only use a single `IOLoop` that runs for the
+ entire lifetime of the process. In that case closing the `IOLoop`
+ is not necessary since everything will be cleaned up when the
+ process exits. `IOLoop.close` is provided mainly for scenarios
+ such as unit tests, which create and destroy a large number of
+ ``IOLoops``.
+
+ An `IOLoop` must be completely stopped before it can be closed. This
+ means that `IOLoop.stop()` must be called *and* `IOLoop.start()` must
+ be allowed to return before attempting to call `IOLoop.close()`.
+ Therefore the call to `close` will usually appear just after
+ the call to `start` rather than near the call to `stop`.
+
+ .. versionchanged:: 3.1
+ If the `IOLoop` implementation supports non-integer objects
+ for "file descriptors", those objects will have their
+ ``close`` method when ``all_fds`` is true.
+ """
+ raise NotImplementedError()
+
+ def add_handler(self, fd, handler, events):
+ """Registers the given handler to receive the given events for fd.
+
+ The ``events`` argument is a bitwise or of the constants
+ ``IOLoop.READ``, ``IOLoop.WRITE``, and ``IOLoop.ERROR``.
+
+ When an event occurs, ``handler(fd, events)`` will be run.
+ """
+ raise NotImplementedError()
+
+ def update_handler(self, fd, events):
+ """Changes the events we listen for fd."""
+ raise NotImplementedError()
+
+ def remove_handler(self, fd):
+ """Stop listening for events on fd."""
+ raise NotImplementedError()
+
+ def set_blocking_signal_threshold(self, seconds, action):
+ """Sends a signal if the `IOLoop` is blocked for more than
+ ``s`` seconds.
+
+ Pass ``seconds=None`` to disable. Requires Python 2.6 on a unixy
+ platform.
+
+ The action parameter is a Python signal handler. Read the
+ documentation for the `signal` module for more information.
+ If ``action`` is None, the process will be killed if it is
+ blocked for too long.
+ """
+ raise NotImplementedError()
+
+ def set_blocking_log_threshold(self, seconds):
+ """Logs a stack trace if the `IOLoop` is blocked for more than
+ ``s`` seconds.
+
+ Equivalent to ``set_blocking_signal_threshold(seconds,
+ self.log_stack)``
+ """
+ self.set_blocking_signal_threshold(seconds, self.log_stack)
+
+ def log_stack(self, signal, frame):
+ """Signal handler to log the stack trace of the current thread.
+
+ For use with `set_blocking_signal_threshold`.
+ """
+ gen_log.warning('IOLoop blocked for %f seconds in\n%s',
+ self._blocking_signal_threshold,
+ ''.join(traceback.format_stack(frame)))
+
+ def start(self):
+ """Starts the I/O loop.
+
+ The loop will run until one of the callbacks calls `stop()`, which
+ will make the loop stop after the current event iteration completes.
+ """
+ raise NotImplementedError()
+
+ def stop(self):
+ """Stop the I/O loop.
+
+ If the event loop is not currently running, the next call to `start()`
+ will return immediately.
+
+ To use asynchronous methods from otherwise-synchronous code (such as
+ unit tests), you can start and stop the event loop like this::
+
+ ioloop = IOLoop()
+ async_method(ioloop=ioloop, callback=ioloop.stop)
+ ioloop.start()
+
+ ``ioloop.start()`` will return after ``async_method`` has run
+ its callback, whether that callback was invoked before or
+ after ``ioloop.start``.
+
+ Note that even after `stop` has been called, the `IOLoop` is not
+ completely stopped until `IOLoop.start` has also returned.
+ Some work that was scheduled before the call to `stop` may still
+ be run before the `IOLoop` shuts down.
+ """
+ raise NotImplementedError()
+
+ def run_sync(self, func, timeout=None):
+ """Starts the `IOLoop`, runs the given function, and stops the loop.
+
+ If the function returns a `.Future`, the `IOLoop` will run
+ until the future is resolved. If it raises an exception, the
+ `IOLoop` will stop and the exception will be re-raised to the
+ caller.
+
+ The keyword-only argument ``timeout`` may be used to set
+ a maximum duration for the function. If the timeout expires,
+ a `TimeoutError` is raised.
+
+ This method is useful in conjunction with `tornado.gen.coroutine`
+ to allow asynchronous calls in a ``main()`` function::
+
+ @gen.coroutine
+ def main():
+ # do stuff...
+
+ if __name__ == '__main__':
+ IOLoop.instance().run_sync(main)
+ """
+ future_cell = [None]
+
+ def run():
+ try:
+ result = func()
+ except Exception:
+ future_cell[0] = TracebackFuture()
+ future_cell[0].set_exc_info(sys.exc_info())
+ else:
+ if isinstance(result, Future):
+ future_cell[0] = result
+ else:
+ future_cell[0] = Future()
+ future_cell[0].set_result(result)
+ self.add_future(future_cell[0], lambda future: self.stop())
+ self.add_callback(run)
+ if timeout is not None:
+ timeout_handle = self.add_timeout(self.time() + timeout, self.stop)
+ self.start()
+ if timeout is not None:
+ self.remove_timeout(timeout_handle)
+ if not future_cell[0].done():
+ raise TimeoutError('Operation timed out after %s seconds' % timeout)
+ return future_cell[0].result()
+
+ def time(self):
+ """Returns the current time according to the `IOLoop`'s clock.
+
+ The return value is a floating-point number relative to an
+ unspecified time in the past.
+
+ By default, the `IOLoop`'s time function is `time.time`. However,
+ it may be configured to use e.g. `time.monotonic` instead.
+ Calls to `add_timeout` that pass a number instead of a
+ `datetime.timedelta` should use this function to compute the
+ appropriate time, so they can work no matter what time function
+ is chosen.
+ """
+ return time.time()
+
+ def add_timeout(self, deadline, callback):
+ """Runs the ``callback`` at the time ``deadline`` from the I/O loop.
+
+ Returns an opaque handle that may be passed to
+ `remove_timeout` to cancel.
+
+ ``deadline`` may be a number denoting a time (on the same
+ scale as `IOLoop.time`, normally `time.time`), or a
+ `datetime.timedelta` object for a deadline relative to the
+ current time.
+
+ Note that it is not safe to call `add_timeout` from other threads.
+ Instead, you must use `add_callback` to transfer control to the
+ `IOLoop`'s thread, and then call `add_timeout` from there.
+ """
+ raise NotImplementedError()
+
+ def remove_timeout(self, timeout):
+ """Cancels a pending timeout.
+
+ The argument is a handle as returned by `add_timeout`. It is
+ safe to call `remove_timeout` even if the callback has already
+ been run.
+ """
+ raise NotImplementedError()
+
+ def add_callback(self, callback, *args, **kwargs):
+ """Calls the given callback on the next I/O loop iteration.
+
+ It is safe to call this method from any thread at any time,
+ except from a signal handler. Note that this is the **only**
+ method in `IOLoop` that makes this thread-safety guarantee; all
+ other interaction with the `IOLoop` must be done from that
+ `IOLoop`'s thread. `add_callback()` may be used to transfer
+ control from other threads to the `IOLoop`'s thread.
+
+ To add a callback from a signal handler, see
+ `add_callback_from_signal`.
+ """
+ raise NotImplementedError()
+
+ def add_callback_from_signal(self, callback, *args, **kwargs):
+ """Calls the given callback on the next I/O loop iteration.
+
+ Safe for use from a Python signal handler; should not be used
+ otherwise.
+
+ Callbacks added with this method will be run without any
+ `.stack_context`, to avoid picking up the context of the function
+ that was interrupted by the signal.
+ """
+ raise NotImplementedError()
+
+ def add_future(self, future, callback):
+ """Schedules a callback on the ``IOLoop`` when the given
+ `.Future` is finished.
+
+ The callback is invoked with one argument, the
+ `.Future`.
+ """
+ assert isinstance(future, Future)
+ callback = stack_context.wrap(callback)
+ future.add_done_callback(
+ lambda future: self.add_callback(callback, future))
+
+ def _run_callback(self, callback):
+ """Runs a callback with error handling.
+
+ For use in subclasses.
+ """
+ try:
+ callback()
+ except Exception:
+ self.handle_callback_exception(callback)
+
+ def handle_callback_exception(self, callback):
+ """This method is called whenever a callback run by the `IOLoop`
+ throws an exception.
+
+ By default simply logs the exception as an error. Subclasses
+ may override this method to customize reporting of exceptions.
+
+ The exception itself is not passed explicitly, but is available
+ in `sys.exc_info`.
+ """
+ app_log.error("Exception in callback %r", callback, exc_info=True)
+
+
+class PollIOLoop(IOLoop):
+ """Base class for IOLoops built around a select-like function.
+
+ For concrete implementations, see `tornado.platform.epoll.EPollIOLoop`
+ (Linux), `tornado.platform.kqueue.KQueueIOLoop` (BSD and Mac), or
+ `tornado.platform.select.SelectIOLoop` (all platforms).
+ """
+ def initialize(self, impl, time_func=None):
+ super(PollIOLoop, self).initialize()
+ self._impl = impl
+ if hasattr(self._impl, 'fileno'):
+ set_close_exec(self._impl.fileno())
+ self.time_func = time_func or time.time
+ self._handlers = {}
+ self._events = {}
+ self._callbacks = []
+ self._callback_lock = threading.Lock()
+ self._timeouts = []
+ self._cancellations = 0
+ self._running = False
+ self._stopped = False
+ self._closing = False
+ self._thread_ident = None
+ self._blocking_signal_threshold = None
+
+ # Create a pipe that we send bogus data to when we want to wake
+ # the I/O loop when it is idle
+ self._waker = Waker()
+ self.add_handler(self._waker.fileno(),
+ lambda fd, events: self._waker.consume(),
+ self.READ)
+
+ def close(self, all_fds=False):
+ with self._callback_lock:
+ self._closing = True
+ self.remove_handler(self._waker.fileno())
+ if all_fds:
+ for fd in self._handlers.keys():
+ try:
+ close_method = getattr(fd, 'close', None)
+ if close_method is not None:
+ close_method()
+ else:
+ os.close(fd)
+ except Exception:
+ gen_log.debug("error closing fd %s", fd, exc_info=True)
+ self._waker.close()
+ self._impl.close()
+
+ def add_handler(self, fd, handler, events):
+ self._handlers[fd] = stack_context.wrap(handler)
+ self._impl.register(fd, events | self.ERROR)
+
+ def update_handler(self, fd, events):
+ self._impl.modify(fd, events | self.ERROR)
+
+ def remove_handler(self, fd):
+ self._handlers.pop(fd, None)
+ self._events.pop(fd, None)
+ try:
+ self._impl.unregister(fd)
+ except Exception:
+ gen_log.debug("Error deleting fd from IOLoop", exc_info=True)
+
+ def set_blocking_signal_threshold(self, seconds, action):
+ if not hasattr(signal, "setitimer"):
+ gen_log.error("set_blocking_signal_threshold requires a signal module "
+ "with the setitimer method")
+ return
+ self._blocking_signal_threshold = seconds
+ if seconds is not None:
+ signal.signal(signal.SIGALRM,
+ action if action is not None else signal.SIG_DFL)
+
+ def start(self):
+ if not logging.getLogger().handlers:
+ # The IOLoop catches and logs exceptions, so it's
+ # important that log output be visible. However, python's
+ # default behavior for non-root loggers (prior to python
+ # 3.2) is to print an unhelpful "no handlers could be
+ # found" message rather than the actual log entry, so we
+ # must explicitly configure logging if we've made it this
+ # far without anything.
+ logging.basicConfig()
+ if self._stopped:
+ self._stopped = False
+ return
+ old_current = getattr(IOLoop._current, "instance", None)
+ IOLoop._current.instance = self
+ self._thread_ident = thread.get_ident()
+ self._running = True
+
+ # signal.set_wakeup_fd closes a race condition in event loops:
+ # a signal may arrive at the beginning of select/poll/etc
+ # before it goes into its interruptible sleep, so the signal
+ # will be consumed without waking the select. The solution is
+ # for the (C, synchronous) signal handler to write to a pipe,
+ # which will then be seen by select.
+ #
+ # In python's signal handling semantics, this only matters on the
+ # main thread (fortunately, set_wakeup_fd only works on the main
+ # thread and will raise a ValueError otherwise).
+ #
+ # If someone has already set a wakeup fd, we don't want to
+ # disturb it. This is an issue for twisted, which does its
+ # SIGCHILD processing in response to its own wakeup fd being
+ # written to. As long as the wakeup fd is registered on the IOLoop,
+ # the loop will still wake up and everything should work.
+ old_wakeup_fd = None
+ if hasattr(signal, 'set_wakeup_fd') and os.name == 'posix':
+ # requires python 2.6+, unix. set_wakeup_fd exists but crashes
+ # the python process on windows.
+ try:
+ old_wakeup_fd = signal.set_wakeup_fd(self._waker.write_fileno())
+ if old_wakeup_fd != -1:
+ # Already set, restore previous value. This is a little racy,
+ # but there's no clean get_wakeup_fd and in real use the
+ # IOLoop is just started once at the beginning.
+ signal.set_wakeup_fd(old_wakeup_fd)
+ old_wakeup_fd = None
+ except ValueError: # non-main thread
+ pass
+
+ while True:
+ poll_timeout = 3600.0
+
+ # Prevent IO event starvation by delaying new callbacks
+ # to the next iteration of the event loop.
+ with self._callback_lock:
+ callbacks = self._callbacks
+ self._callbacks = []
+ for callback in callbacks:
+ self._run_callback(callback)
+
+ if self._timeouts:
+ now = self.time()
+ while self._timeouts:
+ if self._timeouts[0].callback is None:
+ # the timeout was cancelled
+ heapq.heappop(self._timeouts)
+ self._cancellations -= 1
+ elif self._timeouts[0].deadline <= now:
+ timeout = heapq.heappop(self._timeouts)
+ self._run_callback(timeout.callback)
+ else:
+ seconds = self._timeouts[0].deadline - now
+ poll_timeout = min(seconds, poll_timeout)
+ break
+ if (self._cancellations > 512
+ and self._cancellations > (len(self._timeouts) >> 1)):
+ # Clean up the timeout queue when it gets large and it's
+ # more than half cancellations.
+ self._cancellations = 0
+ self._timeouts = [x for x in self._timeouts
+ if x.callback is not None]
+ heapq.heapify(self._timeouts)
+
+ if self._callbacks:
+ # If any callbacks or timeouts called add_callback,
+ # we don't want to wait in poll() before we run them.
+ poll_timeout = 0.0
+
+ if not self._running:
+ break
+
+ if self._blocking_signal_threshold is not None:
+ # clear alarm so it doesn't fire while poll is waiting for
+ # events.
+ signal.setitimer(signal.ITIMER_REAL, 0, 0)
+
+ try:
+ event_pairs = self._impl.poll(poll_timeout)
+ except Exception as e:
+ # Depending on python version and IOLoop implementation,
+ # different exception types may be thrown and there are
+ # two ways EINTR might be signaled:
+ # * e.errno == errno.EINTR
+ # * e.args is like (errno.EINTR, 'Interrupted system call')
+ if (getattr(e, 'errno', None) == errno.EINTR or
+ (isinstance(getattr(e, 'args', None), tuple) and
+ len(e.args) == 2 and e.args[0] == errno.EINTR)):
+ continue
+ else:
+ raise
+
+ if self._blocking_signal_threshold is not None:
+ signal.setitimer(signal.ITIMER_REAL,
+ self._blocking_signal_threshold, 0)
+
+ # Pop one fd at a time from the set of pending fds and run
+ # its handler. Since that handler may perform actions on
+ # other file descriptors, there may be reentrant calls to
+ # this IOLoop that update self._events
+ self._events.update(event_pairs)
+ while self._events:
+ fd, events = self._events.popitem()
+ try:
+ self._handlers[fd](fd, events)
+ except (OSError, IOError) as e:
+ if e.args[0] == errno.EPIPE:
+ # Happens when the client closes the connection
+ pass
+ else:
+ app_log.error("Exception in I/O handler for fd %s",
+ fd, exc_info=True)
+ except Exception:
+ app_log.error("Exception in I/O handler for fd %s",
+ fd, exc_info=True)
+ # reset the stopped flag so another start/stop pair can be issued
+ self._stopped = False
+ if self._blocking_signal_threshold is not None:
+ signal.setitimer(signal.ITIMER_REAL, 0, 0)
+ IOLoop._current.instance = old_current
+ if old_wakeup_fd is not None:
+ signal.set_wakeup_fd(old_wakeup_fd)
+
+ def stop(self):
+ self._running = False
+ self._stopped = True
+ self._waker.wake()
+
+ def time(self):
+ return self.time_func()
+
+ def add_timeout(self, deadline, callback):
+ timeout = _Timeout(deadline, stack_context.wrap(callback), self)
+ heapq.heappush(self._timeouts, timeout)
+ return timeout
+
+ def remove_timeout(self, timeout):
+ # Removing from a heap is complicated, so just leave the defunct
+ # timeout object in the queue (see discussion in
+ # http://docs.python.org/library/heapq.html).
+ # If this turns out to be a problem, we could add a garbage
+ # collection pass whenever there are too many dead timeouts.
+ timeout.callback = None
+ self._cancellations += 1
+
+ def add_callback(self, callback, *args, **kwargs):
+ with self._callback_lock:
+ if self._closing:
+ raise RuntimeError("IOLoop is closing")
+ list_empty = not self._callbacks
+ self._callbacks.append(functools.partial(
+ stack_context.wrap(callback), *args, **kwargs))
+ if list_empty and thread.get_ident() != self._thread_ident:
+ # If we're in the IOLoop's thread, we know it's not currently
+ # polling. If we're not, and we added the first callback to an
+ # empty list, we may need to wake it up (it may wake up on its
+ # own, but an occasional extra wake is harmless). Waking
+ # up a polling IOLoop is relatively expensive, so we try to
+ # avoid it when we can.
+ self._waker.wake()
+
+ def add_callback_from_signal(self, callback, *args, **kwargs):
+ with stack_context.NullContext():
+ if thread.get_ident() != self._thread_ident:
+ # if the signal is handled on another thread, we can add
+ # it normally (modulo the NullContext)
+ self.add_callback(callback, *args, **kwargs)
+ else:
+ # If we're on the IOLoop's thread, we cannot use
+ # the regular add_callback because it may deadlock on
+ # _callback_lock. Blindly insert into self._callbacks.
+ # This is safe because the GIL makes list.append atomic.
+ # One subtlety is that if the signal interrupted the
+ # _callback_lock block in IOLoop.start, we may modify
+ # either the old or new version of self._callbacks,
+ # but either way will work.
+ self._callbacks.append(functools.partial(
+ stack_context.wrap(callback), *args, **kwargs))
+
+
+class _Timeout(object):
+ """An IOLoop timeout, a UNIX timestamp and a callback"""
+
+ # Reduce memory overhead when there are lots of pending callbacks
+ __slots__ = ['deadline', 'callback']
+
+ def __init__(self, deadline, callback, io_loop):
+ if isinstance(deadline, numbers.Real):
+ self.deadline = deadline
+ elif isinstance(deadline, datetime.timedelta):
+ self.deadline = io_loop.time() + _Timeout.timedelta_to_seconds(deadline)
+ else:
+ raise TypeError("Unsupported deadline %r" % deadline)
+ self.callback = callback
+
+ @staticmethod
+ def timedelta_to_seconds(td):
+ """Equivalent to td.total_seconds() (introduced in python 2.7)."""
+ return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10 ** 6) / float(10 ** 6)
+
+ # Comparison methods to sort by deadline, with object id as a tiebreaker
+ # to guarantee a consistent ordering. The heapq module uses __le__
+ # in python2.5, and __lt__ in 2.6+ (sort() and most other comparisons
+ # use __lt__).
+ def __lt__(self, other):
+ return ((self.deadline, id(self)) <
+ (other.deadline, id(other)))
+
+ def __le__(self, other):
+ return ((self.deadline, id(self)) <=
+ (other.deadline, id(other)))
+
+
+class PeriodicCallback(object):
+ """Schedules the given callback to be called periodically.
+
+ The callback is called every ``callback_time`` milliseconds.
+
+ `start` must be called after the `PeriodicCallback` is created.
+ """
+ def __init__(self, callback, callback_time, io_loop=None):
+ self.callback = callback
+ if callback_time <= 0:
+ raise ValueError("Periodic callback must have a positive callback_time")
+ self.callback_time = callback_time
+ self.io_loop = io_loop or IOLoop.current()
+ self._running = False
+ self._timeout = None
+
+ def start(self):
+ """Starts the timer."""
+ self._running = True
+ self._next_timeout = self.io_loop.time()
+ self._schedule_next()
+
+ def stop(self):
+ """Stops the timer."""
+ self._running = False
+ if self._timeout is not None:
+ self.io_loop.remove_timeout(self._timeout)
+ self._timeout = None
+
+ def _run(self):
+ if not self._running:
+ return
+ try:
+ self.callback()
+ except Exception:
+ app_log.error("Error in periodic callback", exc_info=True)
+ self._schedule_next()
+
+ def _schedule_next(self):
+ if self._running:
+ current_time = self.io_loop.time()
+ while self._next_timeout <= current_time:
+ self._next_timeout += self.callback_time / 1000.0
+ self._timeout = self.io_loop.add_timeout(self._next_timeout, self._run)
diff --git a/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/log.py b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/log.py
new file mode 100644
index 00000000..49051e89
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/log.py
@@ -0,0 +1,6 @@
+"""minimal subset of tornado.log for zmq.eventloop.minitornado"""
+
+import logging
+
+app_log = logging.getLogger("tornado.application")
+gen_log = logging.getLogger("tornado.general")
diff --git a/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/__init__.py b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/__init__.py
diff --git a/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/auto.py b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/auto.py
new file mode 100644
index 00000000..b40ccd94
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/auto.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+#
+# Copyright 2011 Facebook
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+"""Implementation of platform-specific functionality.
+
+For each function or class described in `tornado.platform.interface`,
+the appropriate platform-specific implementation exists in this module.
+Most code that needs access to this functionality should do e.g.::
+
+ from tornado.platform.auto import set_close_exec
+"""
+
+from __future__ import absolute_import, division, print_function, with_statement
+
+import os
+
+if os.name == 'nt':
+ from .common import Waker
+ from .windows import set_close_exec
+else:
+ from .posix import set_close_exec, Waker
+
+try:
+ # monotime monkey-patches the time module to have a monotonic function
+ # in versions of python before 3.3.
+ import monotime
+except ImportError:
+ pass
+try:
+ from time import monotonic as monotonic_time
+except ImportError:
+ monotonic_time = None
diff --git a/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/common.py b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/common.py
new file mode 100644
index 00000000..2d75dc1e
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/common.py
@@ -0,0 +1,91 @@
+"""Lowest-common-denominator implementations of platform functionality."""
+from __future__ import absolute_import, division, print_function, with_statement
+
+import errno
+import socket
+
+from . import interface
+
+
+class Waker(interface.Waker):
+ """Create an OS independent asynchronous pipe.
+
+ For use on platforms that don't have os.pipe() (or where pipes cannot
+ be passed to select()), but do have sockets. This includes Windows
+ and Jython.
+ """
+ def __init__(self):
+ # Based on Zope async.py: http://svn.zope.org/zc.ngi/trunk/src/zc/ngi/async.py
+
+ self.writer = socket.socket()
+ # Disable buffering -- pulling the trigger sends 1 byte,
+ # and we want that sent immediately, to wake up ASAP.
+ self.writer.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
+
+ count = 0
+ while 1:
+ count += 1
+ # Bind to a local port; for efficiency, let the OS pick
+ # a free port for us.
+ # Unfortunately, stress tests showed that we may not
+ # be able to connect to that port ("Address already in
+ # use") despite that the OS picked it. This appears
+ # to be a race bug in the Windows socket implementation.
+ # So we loop until a connect() succeeds (almost always
+ # on the first try). See the long thread at
+ # http://mail.zope.org/pipermail/zope/2005-July/160433.html
+ # for hideous details.
+ a = socket.socket()
+ a.bind(("127.0.0.1", 0))
+ a.listen(1)
+ connect_address = a.getsockname() # assigned (host, port) pair
+ try:
+ self.writer.connect(connect_address)
+ break # success
+ except socket.error as detail:
+ if (not hasattr(errno, 'WSAEADDRINUSE') or
+ detail[0] != errno.WSAEADDRINUSE):
+ # "Address already in use" is the only error
+ # I've seen on two WinXP Pro SP2 boxes, under
+ # Pythons 2.3.5 and 2.4.1.
+ raise
+ # (10048, 'Address already in use')
+ # assert count <= 2 # never triggered in Tim's tests
+ if count >= 10: # I've never seen it go above 2
+ a.close()
+ self.writer.close()
+ raise socket.error("Cannot bind trigger!")
+ # Close `a` and try again. Note: I originally put a short
+ # sleep() here, but it didn't appear to help or hurt.
+ a.close()
+
+ self.reader, addr = a.accept()
+ self.reader.setblocking(0)
+ self.writer.setblocking(0)
+ a.close()
+ self.reader_fd = self.reader.fileno()
+
+ def fileno(self):
+ return self.reader.fileno()
+
+ def write_fileno(self):
+ return self.writer.fileno()
+
+ def wake(self):
+ try:
+ self.writer.send(b"x")
+ except (IOError, socket.error):
+ pass
+
+ def consume(self):
+ try:
+ while True:
+ result = self.reader.recv(1024)
+ if not result:
+ break
+ except (IOError, socket.error):
+ pass
+
+ def close(self):
+ self.reader.close()
+ self.writer.close()
diff --git a/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/interface.py b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/interface.py
new file mode 100644
index 00000000..07da6bab
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/interface.py
@@ -0,0 +1,63 @@
+#!/usr/bin/env python
+#
+# Copyright 2011 Facebook
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+"""Interfaces for platform-specific functionality.
+
+This module exists primarily for documentation purposes and as base classes
+for other tornado.platform modules. Most code should import the appropriate
+implementation from `tornado.platform.auto`.
+"""
+
+from __future__ import absolute_import, division, print_function, with_statement
+
+
+def set_close_exec(fd):
+ """Sets the close-on-exec bit (``FD_CLOEXEC``)for a file descriptor."""
+ raise NotImplementedError()
+
+
+class Waker(object):
+ """A socket-like object that can wake another thread from ``select()``.
+
+ The `~tornado.ioloop.IOLoop` will add the Waker's `fileno()` to
+ its ``select`` (or ``epoll`` or ``kqueue``) calls. When another
+ thread wants to wake up the loop, it calls `wake`. Once it has woken
+ up, it will call `consume` to do any necessary per-wake cleanup. When
+ the ``IOLoop`` is closed, it closes its waker too.
+ """
+ def fileno(self):
+ """Returns the read file descriptor for this waker.
+
+ Must be suitable for use with ``select()`` or equivalent on the
+ local platform.
+ """
+ raise NotImplementedError()
+
+ def write_fileno(self):
+ """Returns the write file descriptor for this waker."""
+ raise NotImplementedError()
+
+ def wake(self):
+ """Triggers activity on the waker's file descriptor."""
+ raise NotImplementedError()
+
+ def consume(self):
+ """Called after the listen has woken up to do any necessary cleanup."""
+ raise NotImplementedError()
+
+ def close(self):
+ """Closes the waker's file descriptor(s)."""
+ raise NotImplementedError()
diff --git a/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/posix.py b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/posix.py
new file mode 100644
index 00000000..ccffbb66
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/posix.py
@@ -0,0 +1,70 @@
+#!/usr/bin/env python
+#
+# Copyright 2011 Facebook
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+"""Posix implementations of platform-specific functionality."""
+
+from __future__ import absolute_import, division, print_function, with_statement
+
+import fcntl
+import os
+
+from . import interface
+
+
+def set_close_exec(fd):
+ flags = fcntl.fcntl(fd, fcntl.F_GETFD)
+ fcntl.fcntl(fd, fcntl.F_SETFD, flags | fcntl.FD_CLOEXEC)
+
+
+def _set_nonblocking(fd):
+ flags = fcntl.fcntl(fd, fcntl.F_GETFL)
+ fcntl.fcntl(fd, fcntl.F_SETFL, flags | os.O_NONBLOCK)
+
+
+class Waker(interface.Waker):
+ def __init__(self):
+ r, w = os.pipe()
+ _set_nonblocking(r)
+ _set_nonblocking(w)
+ set_close_exec(r)
+ set_close_exec(w)
+ self.reader = os.fdopen(r, "rb", 0)
+ self.writer = os.fdopen(w, "wb", 0)
+
+ def fileno(self):
+ return self.reader.fileno()
+
+ def write_fileno(self):
+ return self.writer.fileno()
+
+ def wake(self):
+ try:
+ self.writer.write(b"x")
+ except IOError:
+ pass
+
+ def consume(self):
+ try:
+ while True:
+ result = self.reader.read()
+ if not result:
+ break
+ except IOError:
+ pass
+
+ def close(self):
+ self.reader.close()
+ self.writer.close()
diff --git a/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/windows.py b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/windows.py
new file mode 100644
index 00000000..817bdca1
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/platform/windows.py
@@ -0,0 +1,20 @@
+# NOTE: win32 support is currently experimental, and not recommended
+# for production use.
+
+
+from __future__ import absolute_import, division, print_function, with_statement
+import ctypes
+import ctypes.wintypes
+
+# See: http://msdn.microsoft.com/en-us/library/ms724935(VS.85).aspx
+SetHandleInformation = ctypes.windll.kernel32.SetHandleInformation
+SetHandleInformation.argtypes = (ctypes.wintypes.HANDLE, ctypes.wintypes.DWORD, ctypes.wintypes.DWORD)
+SetHandleInformation.restype = ctypes.wintypes.BOOL
+
+HANDLE_FLAG_INHERIT = 0x00000001
+
+
+def set_close_exec(fd):
+ success = SetHandleInformation(fd, HANDLE_FLAG_INHERIT, 0)
+ if not success:
+ raise ctypes.GetLastError()
diff --git a/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/stack_context.py b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/stack_context.py
new file mode 100644
index 00000000..226d8042
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/stack_context.py
@@ -0,0 +1,376 @@
+#!/usr/bin/env python
+#
+# Copyright 2010 Facebook
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+"""`StackContext` allows applications to maintain threadlocal-like state
+that follows execution as it moves to other execution contexts.
+
+The motivating examples are to eliminate the need for explicit
+``async_callback`` wrappers (as in `tornado.web.RequestHandler`), and to
+allow some additional context to be kept for logging.
+
+This is slightly magic, but it's an extension of the idea that an
+exception handler is a kind of stack-local state and when that stack
+is suspended and resumed in a new context that state needs to be
+preserved. `StackContext` shifts the burden of restoring that state
+from each call site (e.g. wrapping each `.AsyncHTTPClient` callback
+in ``async_callback``) to the mechanisms that transfer control from
+one context to another (e.g. `.AsyncHTTPClient` itself, `.IOLoop`,
+thread pools, etc).
+
+Example usage::
+
+ @contextlib.contextmanager
+ def die_on_error():
+ try:
+ yield
+ except Exception:
+ logging.error("exception in asynchronous operation",exc_info=True)
+ sys.exit(1)
+
+ with StackContext(die_on_error):
+ # Any exception thrown here *or in callback and its desendents*
+ # will cause the process to exit instead of spinning endlessly
+ # in the ioloop.
+ http_client.fetch(url, callback)
+ ioloop.start()
+
+Most applications shouln't have to work with `StackContext` directly.
+Here are a few rules of thumb for when it's necessary:
+
+* If you're writing an asynchronous library that doesn't rely on a
+ stack_context-aware library like `tornado.ioloop` or `tornado.iostream`
+ (for example, if you're writing a thread pool), use
+ `.stack_context.wrap()` before any asynchronous operations to capture the
+ stack context from where the operation was started.
+
+* If you're writing an asynchronous library that has some shared
+ resources (such as a connection pool), create those shared resources
+ within a ``with stack_context.NullContext():`` block. This will prevent
+ ``StackContexts`` from leaking from one request to another.
+
+* If you want to write something like an exception handler that will
+ persist across asynchronous calls, create a new `StackContext` (or
+ `ExceptionStackContext`), and make your asynchronous calls in a ``with``
+ block that references your `StackContext`.
+"""
+
+from __future__ import absolute_import, division, print_function, with_statement
+
+import sys
+import threading
+
+from .util import raise_exc_info
+
+
+class StackContextInconsistentError(Exception):
+ pass
+
+
+class _State(threading.local):
+ def __init__(self):
+ self.contexts = (tuple(), None)
+_state = _State()
+
+
+class StackContext(object):
+ """Establishes the given context as a StackContext that will be transferred.
+
+ Note that the parameter is a callable that returns a context
+ manager, not the context itself. That is, where for a
+ non-transferable context manager you would say::
+
+ with my_context():
+
+ StackContext takes the function itself rather than its result::
+
+ with StackContext(my_context):
+
+ The result of ``with StackContext() as cb:`` is a deactivation
+ callback. Run this callback when the StackContext is no longer
+ needed to ensure that it is not propagated any further (note that
+ deactivating a context does not affect any instances of that
+ context that are currently pending). This is an advanced feature
+ and not necessary in most applications.
+ """
+ def __init__(self, context_factory):
+ self.context_factory = context_factory
+ self.contexts = []
+ self.active = True
+
+ def _deactivate(self):
+ self.active = False
+
+ # StackContext protocol
+ def enter(self):
+ context = self.context_factory()
+ self.contexts.append(context)
+ context.__enter__()
+
+ def exit(self, type, value, traceback):
+ context = self.contexts.pop()
+ context.__exit__(type, value, traceback)
+
+ # Note that some of this code is duplicated in ExceptionStackContext
+ # below. ExceptionStackContext is more common and doesn't need
+ # the full generality of this class.
+ def __enter__(self):
+ self.old_contexts = _state.contexts
+ self.new_contexts = (self.old_contexts[0] + (self,), self)
+ _state.contexts = self.new_contexts
+
+ try:
+ self.enter()
+ except:
+ _state.contexts = self.old_contexts
+ raise
+
+ return self._deactivate
+
+ def __exit__(self, type, value, traceback):
+ try:
+ self.exit(type, value, traceback)
+ finally:
+ final_contexts = _state.contexts
+ _state.contexts = self.old_contexts
+
+ # Generator coroutines and with-statements with non-local
+ # effects interact badly. Check here for signs of
+ # the stack getting out of sync.
+ # Note that this check comes after restoring _state.context
+ # so that if it fails things are left in a (relatively)
+ # consistent state.
+ if final_contexts is not self.new_contexts:
+ raise StackContextInconsistentError(
+ 'stack_context inconsistency (may be caused by yield '
+ 'within a "with StackContext" block)')
+
+ # Break up a reference to itself to allow for faster GC on CPython.
+ self.new_contexts = None
+
+
+class ExceptionStackContext(object):
+ """Specialization of StackContext for exception handling.
+
+ The supplied ``exception_handler`` function will be called in the
+ event of an uncaught exception in this context. The semantics are
+ similar to a try/finally clause, and intended use cases are to log
+ an error, close a socket, or similar cleanup actions. The
+ ``exc_info`` triple ``(type, value, traceback)`` will be passed to the
+ exception_handler function.
+
+ If the exception handler returns true, the exception will be
+ consumed and will not be propagated to other exception handlers.
+ """
+ def __init__(self, exception_handler):
+ self.exception_handler = exception_handler
+ self.active = True
+
+ def _deactivate(self):
+ self.active = False
+
+ def exit(self, type, value, traceback):
+ if type is not None:
+ return self.exception_handler(type, value, traceback)
+
+ def __enter__(self):
+ self.old_contexts = _state.contexts
+ self.new_contexts = (self.old_contexts[0], self)
+ _state.contexts = self.new_contexts
+
+ return self._deactivate
+
+ def __exit__(self, type, value, traceback):
+ try:
+ if type is not None:
+ return self.exception_handler(type, value, traceback)
+ finally:
+ final_contexts = _state.contexts
+ _state.contexts = self.old_contexts
+
+ if final_contexts is not self.new_contexts:
+ raise StackContextInconsistentError(
+ 'stack_context inconsistency (may be caused by yield '
+ 'within a "with StackContext" block)')
+
+ # Break up a reference to itself to allow for faster GC on CPython.
+ self.new_contexts = None
+
+
+class NullContext(object):
+ """Resets the `StackContext`.
+
+ Useful when creating a shared resource on demand (e.g. an
+ `.AsyncHTTPClient`) where the stack that caused the creating is
+ not relevant to future operations.
+ """
+ def __enter__(self):
+ self.old_contexts = _state.contexts
+ _state.contexts = (tuple(), None)
+
+ def __exit__(self, type, value, traceback):
+ _state.contexts = self.old_contexts
+
+
+def _remove_deactivated(contexts):
+ """Remove deactivated handlers from the chain"""
+ # Clean ctx handlers
+ stack_contexts = tuple([h for h in contexts[0] if h.active])
+
+ # Find new head
+ head = contexts[1]
+ while head is not None and not head.active:
+ head = head.old_contexts[1]
+
+ # Process chain
+ ctx = head
+ while ctx is not None:
+ parent = ctx.old_contexts[1]
+
+ while parent is not None:
+ if parent.active:
+ break
+ ctx.old_contexts = parent.old_contexts
+ parent = parent.old_contexts[1]
+
+ ctx = parent
+
+ return (stack_contexts, head)
+
+
+def wrap(fn):
+ """Returns a callable object that will restore the current `StackContext`
+ when executed.
+
+ Use this whenever saving a callback to be executed later in a
+ different execution context (either in a different thread or
+ asynchronously in the same thread).
+ """
+ # Check if function is already wrapped
+ if fn is None or hasattr(fn, '_wrapped'):
+ return fn
+
+ # Capture current stack head
+ # TODO: Any other better way to store contexts and update them in wrapped function?
+ cap_contexts = [_state.contexts]
+
+ def wrapped(*args, **kwargs):
+ ret = None
+ try:
+ # Capture old state
+ current_state = _state.contexts
+
+ # Remove deactivated items
+ cap_contexts[0] = contexts = _remove_deactivated(cap_contexts[0])
+
+ # Force new state
+ _state.contexts = contexts
+
+ # Current exception
+ exc = (None, None, None)
+ top = None
+
+ # Apply stack contexts
+ last_ctx = 0
+ stack = contexts[0]
+
+ # Apply state
+ for n in stack:
+ try:
+ n.enter()
+ last_ctx += 1
+ except:
+ # Exception happened. Record exception info and store top-most handler
+ exc = sys.exc_info()
+ top = n.old_contexts[1]
+
+ # Execute callback if no exception happened while restoring state
+ if top is None:
+ try:
+ ret = fn(*args, **kwargs)
+ except:
+ exc = sys.exc_info()
+ top = contexts[1]
+
+ # If there was exception, try to handle it by going through the exception chain
+ if top is not None:
+ exc = _handle_exception(top, exc)
+ else:
+ # Otherwise take shorter path and run stack contexts in reverse order
+ while last_ctx > 0:
+ last_ctx -= 1
+ c = stack[last_ctx]
+
+ try:
+ c.exit(*exc)
+ except:
+ exc = sys.exc_info()
+ top = c.old_contexts[1]
+ break
+ else:
+ top = None
+
+ # If if exception happened while unrolling, take longer exception handler path
+ if top is not None:
+ exc = _handle_exception(top, exc)
+
+ # If exception was not handled, raise it
+ if exc != (None, None, None):
+ raise_exc_info(exc)
+ finally:
+ _state.contexts = current_state
+ return ret
+
+ wrapped._wrapped = True
+ return wrapped
+
+
+def _handle_exception(tail, exc):
+ while tail is not None:
+ try:
+ if tail.exit(*exc):
+ exc = (None, None, None)
+ except:
+ exc = sys.exc_info()
+
+ tail = tail.old_contexts[1]
+
+ return exc
+
+
+def run_with_stack_context(context, func):
+ """Run a coroutine ``func`` in the given `StackContext`.
+
+ It is not safe to have a ``yield`` statement within a ``with StackContext``
+ block, so it is difficult to use stack context with `.gen.coroutine`.
+ This helper function runs the function in the correct context while
+ keeping the ``yield`` and ``with`` statements syntactically separate.
+
+ Example::
+
+ @gen.coroutine
+ def incorrect():
+ with StackContext(ctx):
+ # ERROR: this will raise StackContextInconsistentError
+ yield other_coroutine()
+
+ @gen.coroutine
+ def correct():
+ yield run_with_stack_context(StackContext(ctx), other_coroutine)
+
+ .. versionadded:: 3.1
+ """
+ with context:
+ return func()
diff --git a/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/util.py b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/util.py
new file mode 100644
index 00000000..c1e2eb95
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/eventloop/minitornado/util.py
@@ -0,0 +1,184 @@
+"""Miscellaneous utility functions and classes.
+
+This module is used internally by Tornado. It is not necessarily expected
+that the functions and classes defined here will be useful to other
+applications, but they are documented here in case they are.
+
+The one public-facing part of this module is the `Configurable` class
+and its `~Configurable.configure` method, which becomes a part of the
+interface of its subclasses, including `.AsyncHTTPClient`, `.IOLoop`,
+and `.Resolver`.
+"""
+
+from __future__ import absolute_import, division, print_function, with_statement
+
+import sys
+
+
+def import_object(name):
+ """Imports an object by name.
+
+ import_object('x') is equivalent to 'import x'.
+ import_object('x.y.z') is equivalent to 'from x.y import z'.
+
+ >>> import tornado.escape
+ >>> import_object('tornado.escape') is tornado.escape
+ True
+ >>> import_object('tornado.escape.utf8') is tornado.escape.utf8
+ True
+ >>> import_object('tornado') is tornado
+ True
+ >>> import_object('tornado.missing_module')
+ Traceback (most recent call last):
+ ...
+ ImportError: No module named missing_module
+ """
+ if name.count('.') == 0:
+ return __import__(name, None, None)
+
+ parts = name.split('.')
+ obj = __import__('.'.join(parts[:-1]), None, None, [parts[-1]], 0)
+ try:
+ return getattr(obj, parts[-1])
+ except AttributeError:
+ raise ImportError("No module named %s" % parts[-1])
+
+
+# Fake unicode literal support: Python 3.2 doesn't have the u'' marker for
+# literal strings, and alternative solutions like "from __future__ import
+# unicode_literals" have other problems (see PEP 414). u() can be applied
+# to ascii strings that include \u escapes (but they must not contain
+# literal non-ascii characters).
+if type('') is not type(b''):
+ def u(s):
+ return s
+ bytes_type = bytes
+ unicode_type = str
+ basestring_type = str
+else:
+ def u(s):
+ return s.decode('unicode_escape')
+ bytes_type = str
+ unicode_type = unicode
+ basestring_type = basestring
+
+
+if sys.version_info > (3,):
+ exec("""
+def raise_exc_info(exc_info):
+ raise exc_info[1].with_traceback(exc_info[2])
+
+def exec_in(code, glob, loc=None):
+ if isinstance(code, str):
+ code = compile(code, '<string>', 'exec', dont_inherit=True)
+ exec(code, glob, loc)
+""")
+else:
+ exec("""
+def raise_exc_info(exc_info):
+ raise exc_info[0], exc_info[1], exc_info[2]
+
+def exec_in(code, glob, loc=None):
+ if isinstance(code, basestring):
+ # exec(string) inherits the caller's future imports; compile
+ # the string first to prevent that.
+ code = compile(code, '<string>', 'exec', dont_inherit=True)
+ exec code in glob, loc
+""")
+
+
+class Configurable(object):
+ """Base class for configurable interfaces.
+
+ A configurable interface is an (abstract) class whose constructor
+ acts as a factory function for one of its implementation subclasses.
+ The implementation subclass as well as optional keyword arguments to
+ its initializer can be set globally at runtime with `configure`.
+
+ By using the constructor as the factory method, the interface
+ looks like a normal class, `isinstance` works as usual, etc. This
+ pattern is most useful when the choice of implementation is likely
+ to be a global decision (e.g. when `~select.epoll` is available,
+ always use it instead of `~select.select`), or when a
+ previously-monolithic class has been split into specialized
+ subclasses.
+
+ Configurable subclasses must define the class methods
+ `configurable_base` and `configurable_default`, and use the instance
+ method `initialize` instead of ``__init__``.
+ """
+ __impl_class = None
+ __impl_kwargs = None
+
+ def __new__(cls, **kwargs):
+ base = cls.configurable_base()
+ args = {}
+ if cls is base:
+ impl = cls.configured_class()
+ if base.__impl_kwargs:
+ args.update(base.__impl_kwargs)
+ else:
+ impl = cls
+ args.update(kwargs)
+ instance = super(Configurable, cls).__new__(impl)
+ # initialize vs __init__ chosen for compatiblity with AsyncHTTPClient
+ # singleton magic. If we get rid of that we can switch to __init__
+ # here too.
+ instance.initialize(**args)
+ return instance
+
+ @classmethod
+ def configurable_base(cls):
+ """Returns the base class of a configurable hierarchy.
+
+ This will normally return the class in which it is defined.
+ (which is *not* necessarily the same as the cls classmethod parameter).
+ """
+ raise NotImplementedError()
+
+ @classmethod
+ def configurable_default(cls):
+ """Returns the implementation class to be used if none is configured."""
+ raise NotImplementedError()
+
+ def initialize(self):
+ """Initialize a `Configurable` subclass instance.
+
+ Configurable classes should use `initialize` instead of ``__init__``.
+ """
+
+ @classmethod
+ def configure(cls, impl, **kwargs):
+ """Sets the class to use when the base class is instantiated.
+
+ Keyword arguments will be saved and added to the arguments passed
+ to the constructor. This can be used to set global defaults for
+ some parameters.
+ """
+ base = cls.configurable_base()
+ if isinstance(impl, (unicode_type, bytes_type)):
+ impl = import_object(impl)
+ if impl is not None and not issubclass(impl, cls):
+ raise ValueError("Invalid subclass of %s" % cls)
+ base.__impl_class = impl
+ base.__impl_kwargs = kwargs
+
+ @classmethod
+ def configured_class(cls):
+ """Returns the currently configured class."""
+ base = cls.configurable_base()
+ if cls.__impl_class is None:
+ base.__impl_class = cls.configurable_default()
+ return base.__impl_class
+
+ @classmethod
+ def _save_configuration(cls):
+ base = cls.configurable_base()
+ return (base.__impl_class, base.__impl_kwargs)
+
+ @classmethod
+ def _restore_configuration(cls, saved):
+ base = cls.configurable_base()
+ base.__impl_class = saved[0]
+ base.__impl_kwargs = saved[1]
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/eventloop/zmqstream.py b/scripts/external_libs/platform/fedora18/zmq/eventloop/zmqstream.py
new file mode 100644
index 00000000..86a97e44
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/eventloop/zmqstream.py
@@ -0,0 +1,529 @@
+#
+# Copyright 2009 Facebook
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+"""A utility class to send to and recv from a non-blocking socket."""
+
+from __future__ import with_statement
+
+import sys
+
+import zmq
+from zmq.utils import jsonapi
+
+try:
+ import cPickle as pickle
+except ImportError:
+ import pickle
+
+from .ioloop import IOLoop
+
+try:
+ # gen_log will only import from >= 3.0
+ from tornado.log import gen_log
+ from tornado import stack_context
+except ImportError:
+ from .minitornado.log import gen_log
+ from .minitornado import stack_context
+
+try:
+ from queue import Queue
+except ImportError:
+ from Queue import Queue
+
+from zmq.utils.strtypes import bytes, unicode, basestring
+
+try:
+ callable
+except NameError:
+ callable = lambda obj: hasattr(obj, '__call__')
+
+
+class ZMQStream(object):
+ """A utility class to register callbacks when a zmq socket sends and receives
+
+ For use with zmq.eventloop.ioloop
+
+ There are three main methods
+
+ Methods:
+
+ * **on_recv(callback, copy=True):**
+ register a callback to be run every time the socket has something to receive
+ * **on_send(callback):**
+ register a callback to be run every time you call send
+ * **send(self, msg, flags=0, copy=False, callback=None):**
+ perform a send that will trigger the callback
+ if callback is passed, on_send is also called.
+
+ There are also send_multipart(), send_json(), send_pyobj()
+
+ Three other methods for deactivating the callbacks:
+
+ * **stop_on_recv():**
+ turn off the recv callback
+ * **stop_on_send():**
+ turn off the send callback
+
+ which simply call ``on_<evt>(None)``.
+
+ The entire socket interface, excluding direct recv methods, is also
+ provided, primarily through direct-linking the methods.
+ e.g.
+
+ >>> stream.bind is stream.socket.bind
+ True
+
+ """
+
+ socket = None
+ io_loop = None
+ poller = None
+
+ def __init__(self, socket, io_loop=None):
+ self.socket = socket
+ self.io_loop = io_loop or IOLoop.instance()
+ self.poller = zmq.Poller()
+
+ self._send_queue = Queue()
+ self._recv_callback = None
+ self._send_callback = None
+ self._close_callback = None
+ self._recv_copy = False
+ self._flushed = False
+
+ self._state = self.io_loop.ERROR
+ self._init_io_state()
+
+ # shortcircuit some socket methods
+ self.bind = self.socket.bind
+ self.bind_to_random_port = self.socket.bind_to_random_port
+ self.connect = self.socket.connect
+ self.setsockopt = self.socket.setsockopt
+ self.getsockopt = self.socket.getsockopt
+ self.setsockopt_string = self.socket.setsockopt_string
+ self.getsockopt_string = self.socket.getsockopt_string
+ self.setsockopt_unicode = self.socket.setsockopt_unicode
+ self.getsockopt_unicode = self.socket.getsockopt_unicode
+
+
+ def stop_on_recv(self):
+ """Disable callback and automatic receiving."""
+ return self.on_recv(None)
+
+ def stop_on_send(self):
+ """Disable callback on sending."""
+ return self.on_send(None)
+
+ def stop_on_err(self):
+ """DEPRECATED, does nothing"""
+ gen_log.warn("on_err does nothing, and will be removed")
+
+ def on_err(self, callback):
+ """DEPRECATED, does nothing"""
+ gen_log.warn("on_err does nothing, and will be removed")
+
+ def on_recv(self, callback, copy=True):
+ """Register a callback for when a message is ready to recv.
+
+ There can be only one callback registered at a time, so each
+ call to `on_recv` replaces previously registered callbacks.
+
+ on_recv(None) disables recv event polling.
+
+ Use on_recv_stream(callback) instead, to register a callback that will receive
+ both this ZMQStream and the message, instead of just the message.
+
+ Parameters
+ ----------
+
+ callback : callable
+ callback must take exactly one argument, which will be a
+ list, as returned by socket.recv_multipart()
+ if callback is None, recv callbacks are disabled.
+ copy : bool
+ copy is passed directly to recv, so if copy is False,
+ callback will receive Message objects. If copy is True,
+ then callback will receive bytes/str objects.
+
+ Returns : None
+ """
+
+ self._check_closed()
+ assert callback is None or callable(callback)
+ self._recv_callback = stack_context.wrap(callback)
+ self._recv_copy = copy
+ if callback is None:
+ self._drop_io_state(self.io_loop.READ)
+ else:
+ self._add_io_state(self.io_loop.READ)
+
+ def on_recv_stream(self, callback, copy=True):
+ """Same as on_recv, but callback will get this stream as first argument
+
+ callback must take exactly two arguments, as it will be called as::
+
+ callback(stream, msg)
+
+ Useful when a single callback should be used with multiple streams.
+ """
+ if callback is None:
+ self.stop_on_recv()
+ else:
+ self.on_recv(lambda msg: callback(self, msg), copy=copy)
+
+ def on_send(self, callback):
+ """Register a callback to be called on each send
+
+ There will be two arguments::
+
+ callback(msg, status)
+
+ * `msg` will be the list of sendable objects that was just sent
+ * `status` will be the return result of socket.send_multipart(msg) -
+ MessageTracker or None.
+
+ Non-copying sends return a MessageTracker object whose
+ `done` attribute will be True when the send is complete.
+ This allows users to track when an object is safe to write to
+ again.
+
+ The second argument will always be None if copy=True
+ on the send.
+
+ Use on_send_stream(callback) to register a callback that will be passed
+ this ZMQStream as the first argument, in addition to the other two.
+
+ on_send(None) disables recv event polling.
+
+ Parameters
+ ----------
+
+ callback : callable
+ callback must take exactly two arguments, which will be
+ the message being sent (always a list),
+ and the return result of socket.send_multipart(msg) -
+ MessageTracker or None.
+
+ if callback is None, send callbacks are disabled.
+ """
+
+ self._check_closed()
+ assert callback is None or callable(callback)
+ self._send_callback = stack_context.wrap(callback)
+
+
+ def on_send_stream(self, callback):
+ """Same as on_send, but callback will get this stream as first argument
+
+ Callback will be passed three arguments::
+
+ callback(stream, msg, status)
+
+ Useful when a single callback should be used with multiple streams.
+ """
+ if callback is None:
+ self.stop_on_send()
+ else:
+ self.on_send(lambda msg, status: callback(self, msg, status))
+
+
+ def send(self, msg, flags=0, copy=True, track=False, callback=None):
+ """Send a message, optionally also register a new callback for sends.
+ See zmq.socket.send for details.
+ """
+ return self.send_multipart([msg], flags=flags, copy=copy, track=track, callback=callback)
+
+ def send_multipart(self, msg, flags=0, copy=True, track=False, callback=None):
+ """Send a multipart message, optionally also register a new callback for sends.
+ See zmq.socket.send_multipart for details.
+ """
+ kwargs = dict(flags=flags, copy=copy, track=track)
+ self._send_queue.put((msg, kwargs))
+ callback = callback or self._send_callback
+ if callback is not None:
+ self.on_send(callback)
+ else:
+ # noop callback
+ self.on_send(lambda *args: None)
+ self._add_io_state(self.io_loop.WRITE)
+
+ def send_string(self, u, flags=0, encoding='utf-8', callback=None):
+ """Send a unicode message with an encoding.
+ See zmq.socket.send_unicode for details.
+ """
+ if not isinstance(u, basestring):
+ raise TypeError("unicode/str objects only")
+ return self.send(u.encode(encoding), flags=flags, callback=callback)
+
+ send_unicode = send_string
+
+ def send_json(self, obj, flags=0, callback=None):
+ """Send json-serialized version of an object.
+ See zmq.socket.send_json for details.
+ """
+ if jsonapi is None:
+ raise ImportError('jsonlib{1,2}, json or simplejson library is required.')
+ else:
+ msg = jsonapi.dumps(obj)
+ return self.send(msg, flags=flags, callback=callback)
+
+ def send_pyobj(self, obj, flags=0, protocol=-1, callback=None):
+ """Send a Python object as a message using pickle to serialize.
+
+ See zmq.socket.send_json for details.
+ """
+ msg = pickle.dumps(obj, protocol)
+ return self.send(msg, flags, callback=callback)
+
+ def _finish_flush(self):
+ """callback for unsetting _flushed flag."""
+ self._flushed = False
+
+ def flush(self, flag=zmq.POLLIN|zmq.POLLOUT, limit=None):
+ """Flush pending messages.
+
+ This method safely handles all pending incoming and/or outgoing messages,
+ bypassing the inner loop, passing them to the registered callbacks.
+
+ A limit can be specified, to prevent blocking under high load.
+
+ flush will return the first time ANY of these conditions are met:
+ * No more events matching the flag are pending.
+ * the total number of events handled reaches the limit.
+
+ Note that if ``flag|POLLIN != 0``, recv events will be flushed even if no callback
+ is registered, unlike normal IOLoop operation. This allows flush to be
+ used to remove *and ignore* incoming messages.
+
+ Parameters
+ ----------
+ flag : int, default=POLLIN|POLLOUT
+ 0MQ poll flags.
+ If flag|POLLIN, recv events will be flushed.
+ If flag|POLLOUT, send events will be flushed.
+ Both flags can be set at once, which is the default.
+ limit : None or int, optional
+ The maximum number of messages to send or receive.
+ Both send and recv count against this limit.
+
+ Returns
+ -------
+ int : count of events handled (both send and recv)
+ """
+ self._check_closed()
+ # unset self._flushed, so callbacks will execute, in case flush has
+ # already been called this iteration
+ already_flushed = self._flushed
+ self._flushed = False
+ # initialize counters
+ count = 0
+ def update_flag():
+ """Update the poll flag, to prevent registering POLLOUT events
+ if we don't have pending sends."""
+ return flag & zmq.POLLIN | (self.sending() and flag & zmq.POLLOUT)
+ flag = update_flag()
+ if not flag:
+ # nothing to do
+ return 0
+ self.poller.register(self.socket, flag)
+ events = self.poller.poll(0)
+ while events and (not limit or count < limit):
+ s,event = events[0]
+ if event & zmq.POLLIN: # receiving
+ self._handle_recv()
+ count += 1
+ if self.socket is None:
+ # break if socket was closed during callback
+ break
+ if event & zmq.POLLOUT and self.sending():
+ self._handle_send()
+ count += 1
+ if self.socket is None:
+ # break if socket was closed during callback
+ break
+
+ flag = update_flag()
+ if flag:
+ self.poller.register(self.socket, flag)
+ events = self.poller.poll(0)
+ else:
+ events = []
+ if count: # only bypass loop if we actually flushed something
+ # skip send/recv callbacks this iteration
+ self._flushed = True
+ # reregister them at the end of the loop
+ if not already_flushed: # don't need to do it again
+ self.io_loop.add_callback(self._finish_flush)
+ elif already_flushed:
+ self._flushed = True
+
+ # update ioloop poll state, which may have changed
+ self._rebuild_io_state()
+ return count
+
+ def set_close_callback(self, callback):
+ """Call the given callback when the stream is closed."""
+ self._close_callback = stack_context.wrap(callback)
+
+ def close(self, linger=None):
+ """Close this stream."""
+ if self.socket is not None:
+ self.io_loop.remove_handler(self.socket)
+ self.socket.close(linger)
+ self.socket = None
+ if self._close_callback:
+ self._run_callback(self._close_callback)
+
+ def receiving(self):
+ """Returns True if we are currently receiving from the stream."""
+ return self._recv_callback is not None
+
+ def sending(self):
+ """Returns True if we are currently sending to the stream."""
+ return not self._send_queue.empty()
+
+ def closed(self):
+ return self.socket is None
+
+ def _run_callback(self, callback, *args, **kwargs):
+ """Wrap running callbacks in try/except to allow us to
+ close our socket."""
+ try:
+ # Use a NullContext to ensure that all StackContexts are run
+ # inside our blanket exception handler rather than outside.
+ with stack_context.NullContext():
+ callback(*args, **kwargs)
+ except:
+ gen_log.error("Uncaught exception, closing connection.",
+ exc_info=True)
+ # Close the socket on an uncaught exception from a user callback
+ # (It would eventually get closed when the socket object is
+ # gc'd, but we don't want to rely on gc happening before we
+ # run out of file descriptors)
+ self.close()
+ # Re-raise the exception so that IOLoop.handle_callback_exception
+ # can see it and log the error
+ raise
+
+ def _handle_events(self, fd, events):
+ """This method is the actual handler for IOLoop, that gets called whenever
+ an event on my socket is posted. It dispatches to _handle_recv, etc."""
+ # print "handling events"
+ if not self.socket:
+ gen_log.warning("Got events for closed stream %s", fd)
+ return
+ try:
+ # dispatch events:
+ if events & IOLoop.ERROR:
+ gen_log.error("got POLLERR event on ZMQStream, which doesn't make sense")
+ return
+ if events & IOLoop.READ:
+ self._handle_recv()
+ if not self.socket:
+ return
+ if events & IOLoop.WRITE:
+ self._handle_send()
+ if not self.socket:
+ return
+
+ # rebuild the poll state
+ self._rebuild_io_state()
+ except:
+ gen_log.error("Uncaught exception, closing connection.",
+ exc_info=True)
+ self.close()
+ raise
+
+ def _handle_recv(self):
+ """Handle a recv event."""
+ if self._flushed:
+ return
+ try:
+ msg = self.socket.recv_multipart(zmq.NOBLOCK, copy=self._recv_copy)
+ except zmq.ZMQError as e:
+ if e.errno == zmq.EAGAIN:
+ # state changed since poll event
+ pass
+ else:
+ gen_log.error("RECV Error: %s"%zmq.strerror(e.errno))
+ else:
+ if self._recv_callback:
+ callback = self._recv_callback
+ # self._recv_callback = None
+ self._run_callback(callback, msg)
+
+ # self.update_state()
+
+
+ def _handle_send(self):
+ """Handle a send event."""
+ if self._flushed:
+ return
+ if not self.sending():
+ gen_log.error("Shouldn't have handled a send event")
+ return
+
+ msg, kwargs = self._send_queue.get()
+ try:
+ status = self.socket.send_multipart(msg, **kwargs)
+ except zmq.ZMQError as e:
+ gen_log.error("SEND Error: %s", e)
+ status = e
+ if self._send_callback:
+ callback = self._send_callback
+ self._run_callback(callback, msg, status)
+
+ # self.update_state()
+
+ def _check_closed(self):
+ if not self.socket:
+ raise IOError("Stream is closed")
+
+ def _rebuild_io_state(self):
+ """rebuild io state based on self.sending() and receiving()"""
+ if self.socket is None:
+ return
+ state = self.io_loop.ERROR
+ if self.receiving():
+ state |= self.io_loop.READ
+ if self.sending():
+ state |= self.io_loop.WRITE
+ if state != self._state:
+ self._state = state
+ self._update_handler(state)
+
+ def _add_io_state(self, state):
+ """Add io_state to poller."""
+ if not self._state & state:
+ self._state = self._state | state
+ self._update_handler(self._state)
+
+ def _drop_io_state(self, state):
+ """Stop poller from watching an io_state."""
+ if self._state & state:
+ self._state = self._state & (~state)
+ self._update_handler(self._state)
+
+ def _update_handler(self, state):
+ """Update IOLoop handler with state."""
+ if self.socket is None:
+ return
+ self.io_loop.update_handler(self.socket, state)
+
+ def _init_io_state(self):
+ """initialize the ioloop event handler"""
+ with stack_context.NullContext():
+ self.io_loop.add_handler(self.socket, self._handle_events, self._state)
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/green/__init__.py b/scripts/external_libs/platform/fedora18/zmq/green/__init__.py
new file mode 100644
index 00000000..ff7e5965
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/green/__init__.py
@@ -0,0 +1,40 @@
+# -*- coding: utf-8 -*-
+#-----------------------------------------------------------------------------
+# Copyright (C) 2011-2012 Travis Cline
+#
+# This file is part of pyzmq
+# It is adapted from upstream project zeromq_gevent under the New BSD License
+#
+# Distributed under the terms of the New BSD License. The full license is in
+# the file COPYING.BSD, distributed as part of this software.
+#-----------------------------------------------------------------------------
+
+"""zmq.green - gevent compatibility with zeromq.
+
+Usage
+-----
+
+Instead of importing zmq directly, do so in the following manner:
+
+..
+
+ import zmq.green as zmq
+
+
+Any calls that would have blocked the current thread will now only block the
+current green thread.
+
+This compatibility is accomplished by ensuring the nonblocking flag is set
+before any blocking operation and the ØMQ file descriptor is polled internally
+to trigger needed events.
+"""
+
+from zmq import *
+from zmq.green.core import _Context, _Socket
+from zmq.green.poll import _Poller
+Context = _Context
+Socket = _Socket
+Poller = _Poller
+
+from zmq.green.device import device
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/green/core.py b/scripts/external_libs/platform/fedora18/zmq/green/core.py
new file mode 100644
index 00000000..9fc73e32
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/green/core.py
@@ -0,0 +1,287 @@
+#-----------------------------------------------------------------------------
+# Copyright (C) 2011-2012 Travis Cline
+#
+# This file is part of pyzmq
+# It is adapted from upstream project zeromq_gevent under the New BSD License
+#
+# Distributed under the terms of the New BSD License. The full license is in
+# the file COPYING.BSD, distributed as part of this software.
+#-----------------------------------------------------------------------------
+
+"""This module wraps the :class:`Socket` and :class:`Context` found in :mod:`pyzmq <zmq>` to be non blocking
+"""
+
+from __future__ import print_function
+
+import sys
+import time
+import warnings
+
+import zmq
+
+from zmq import Context as _original_Context
+from zmq import Socket as _original_Socket
+from .poll import _Poller
+
+import gevent
+from gevent.event import AsyncResult
+from gevent.hub import get_hub
+
+if hasattr(zmq, 'RCVTIMEO'):
+ TIMEOS = (zmq.RCVTIMEO, zmq.SNDTIMEO)
+else:
+ TIMEOS = ()
+
+def _stop(evt):
+ """simple wrapper for stopping an Event, allowing for method rename in gevent 1.0"""
+ try:
+ evt.stop()
+ except AttributeError as e:
+ # gevent<1.0 compat
+ evt.cancel()
+
+class _Socket(_original_Socket):
+ """Green version of :class:`zmq.Socket`
+
+ The following methods are overridden:
+
+ * send
+ * recv
+
+ To ensure that the ``zmq.NOBLOCK`` flag is set and that sending or receiving
+ is deferred to the hub if a ``zmq.EAGAIN`` (retry) error is raised.
+
+ The `__state_changed` method is triggered when the zmq.FD for the socket is
+ marked as readable and triggers the necessary read and write events (which
+ are waited for in the recv and send methods).
+
+ Some double underscore prefixes are used to minimize pollution of
+ :class:`zmq.Socket`'s namespace.
+ """
+ __in_send_multipart = False
+ __in_recv_multipart = False
+ __writable = None
+ __readable = None
+ _state_event = None
+ _gevent_bug_timeout = 11.6 # timeout for not trusting gevent
+ _debug_gevent = False # turn on if you think gevent is missing events
+ _poller_class = _Poller
+
+ def __init__(self, context, socket_type):
+ _original_Socket.__init__(self, context, socket_type)
+ self.__in_send_multipart = False
+ self.__in_recv_multipart = False
+ self.__setup_events()
+
+
+ def __del__(self):
+ self.close()
+
+ def close(self, linger=None):
+ super(_Socket, self).close(linger)
+ self.__cleanup_events()
+
+ def __cleanup_events(self):
+ # close the _state_event event, keeps the number of active file descriptors down
+ if getattr(self, '_state_event', None):
+ _stop(self._state_event)
+ self._state_event = None
+ # if the socket has entered a close state resume any waiting greenlets
+ self.__writable.set()
+ self.__readable.set()
+
+ def __setup_events(self):
+ self.__readable = AsyncResult()
+ self.__writable = AsyncResult()
+ self.__readable.set()
+ self.__writable.set()
+
+ try:
+ self._state_event = get_hub().loop.io(self.getsockopt(zmq.FD), 1) # read state watcher
+ self._state_event.start(self.__state_changed)
+ except AttributeError:
+ # for gevent<1.0 compatibility
+ from gevent.core import read_event
+ self._state_event = read_event(self.getsockopt(zmq.FD), self.__state_changed, persist=True)
+
+ def __state_changed(self, event=None, _evtype=None):
+ if self.closed:
+ self.__cleanup_events()
+ return
+ try:
+ # avoid triggering __state_changed from inside __state_changed
+ events = super(_Socket, self).getsockopt(zmq.EVENTS)
+ except zmq.ZMQError as exc:
+ self.__writable.set_exception(exc)
+ self.__readable.set_exception(exc)
+ else:
+ if events & zmq.POLLOUT:
+ self.__writable.set()
+ if events & zmq.POLLIN:
+ self.__readable.set()
+
+ def _wait_write(self):
+ assert self.__writable.ready(), "Only one greenlet can be waiting on this event"
+ self.__writable = AsyncResult()
+ # timeout is because libzmq cannot be trusted to properly signal a new send event:
+ # this is effectively a maximum poll interval of 1s
+ tic = time.time()
+ dt = self._gevent_bug_timeout
+ if dt:
+ timeout = gevent.Timeout(seconds=dt)
+ else:
+ timeout = None
+ try:
+ if timeout:
+ timeout.start()
+ self.__writable.get(block=True)
+ except gevent.Timeout as t:
+ if t is not timeout:
+ raise
+ toc = time.time()
+ # gevent bug: get can raise timeout even on clean return
+ # don't display zmq bug warning for gevent bug (this is getting ridiculous)
+ if self._debug_gevent and timeout and toc-tic > dt and \
+ self.getsockopt(zmq.EVENTS) & zmq.POLLOUT:
+ print("BUG: gevent may have missed a libzmq send event on %i!" % self.FD, file=sys.stderr)
+ finally:
+ if timeout:
+ timeout.cancel()
+ self.__writable.set()
+
+ def _wait_read(self):
+ assert self.__readable.ready(), "Only one greenlet can be waiting on this event"
+ self.__readable = AsyncResult()
+ # timeout is because libzmq cannot always be trusted to play nice with libevent.
+ # I can only confirm that this actually happens for send, but lets be symmetrical
+ # with our dirty hacks.
+ # this is effectively a maximum poll interval of 1s
+ tic = time.time()
+ dt = self._gevent_bug_timeout
+ if dt:
+ timeout = gevent.Timeout(seconds=dt)
+ else:
+ timeout = None
+ try:
+ if timeout:
+ timeout.start()
+ self.__readable.get(block=True)
+ except gevent.Timeout as t:
+ if t is not timeout:
+ raise
+ toc = time.time()
+ # gevent bug: get can raise timeout even on clean return
+ # don't display zmq bug warning for gevent bug (this is getting ridiculous)
+ if self._debug_gevent and timeout and toc-tic > dt and \
+ self.getsockopt(zmq.EVENTS) & zmq.POLLIN:
+ print("BUG: gevent may have missed a libzmq recv event on %i!" % self.FD, file=sys.stderr)
+ finally:
+ if timeout:
+ timeout.cancel()
+ self.__readable.set()
+
+ def send(self, data, flags=0, copy=True, track=False):
+ """send, which will only block current greenlet
+
+ state_changed always fires exactly once (success or fail) at the
+ end of this method.
+ """
+
+ # if we're given the NOBLOCK flag act as normal and let the EAGAIN get raised
+ if flags & zmq.NOBLOCK:
+ try:
+ msg = super(_Socket, self).send(data, flags, copy, track)
+ finally:
+ if not self.__in_send_multipart:
+ self.__state_changed()
+ return msg
+ # ensure the zmq.NOBLOCK flag is part of flags
+ flags |= zmq.NOBLOCK
+ while True: # Attempt to complete this operation indefinitely, blocking the current greenlet
+ try:
+ # attempt the actual call
+ msg = super(_Socket, self).send(data, flags, copy, track)
+ except zmq.ZMQError as e:
+ # if the raised ZMQError is not EAGAIN, reraise
+ if e.errno != zmq.EAGAIN:
+ if not self.__in_send_multipart:
+ self.__state_changed()
+ raise
+ else:
+ if not self.__in_send_multipart:
+ self.__state_changed()
+ return msg
+ # defer to the event loop until we're notified the socket is writable
+ self._wait_write()
+
+ def recv(self, flags=0, copy=True, track=False):
+ """recv, which will only block current greenlet
+
+ state_changed always fires exactly once (success or fail) at the
+ end of this method.
+ """
+ if flags & zmq.NOBLOCK:
+ try:
+ msg = super(_Socket, self).recv(flags, copy, track)
+ finally:
+ if not self.__in_recv_multipart:
+ self.__state_changed()
+ return msg
+
+ flags |= zmq.NOBLOCK
+ while True:
+ try:
+ msg = super(_Socket, self).recv(flags, copy, track)
+ except zmq.ZMQError as e:
+ if e.errno != zmq.EAGAIN:
+ if not self.__in_recv_multipart:
+ self.__state_changed()
+ raise
+ else:
+ if not self.__in_recv_multipart:
+ self.__state_changed()
+ return msg
+ self._wait_read()
+
+ def send_multipart(self, *args, **kwargs):
+ """wrap send_multipart to prevent state_changed on each partial send"""
+ self.__in_send_multipart = True
+ try:
+ msg = super(_Socket, self).send_multipart(*args, **kwargs)
+ finally:
+ self.__in_send_multipart = False
+ self.__state_changed()
+ return msg
+
+ def recv_multipart(self, *args, **kwargs):
+ """wrap recv_multipart to prevent state_changed on each partial recv"""
+ self.__in_recv_multipart = True
+ try:
+ msg = super(_Socket, self).recv_multipart(*args, **kwargs)
+ finally:
+ self.__in_recv_multipart = False
+ self.__state_changed()
+ return msg
+
+ def get(self, opt):
+ """trigger state_changed on getsockopt(EVENTS)"""
+ if opt in TIMEOS:
+ warnings.warn("TIMEO socket options have no effect in zmq.green", UserWarning)
+ optval = super(_Socket, self).get(opt)
+ if opt == zmq.EVENTS:
+ self.__state_changed()
+ return optval
+
+ def set(self, opt, val):
+ """set socket option"""
+ if opt in TIMEOS:
+ warnings.warn("TIMEO socket options have no effect in zmq.green", UserWarning)
+ return super(_Socket, self).set(opt, val)
+
+
+class _Context(_original_Context):
+ """Replacement for :class:`zmq.Context`
+
+ Ensures that the greened Socket above is used in calls to `socket`.
+ """
+ _socket_class = _Socket
diff --git a/scripts/external_libs/platform/fedora18/zmq/green/device.py b/scripts/external_libs/platform/fedora18/zmq/green/device.py
new file mode 100644
index 00000000..4b070237
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/green/device.py
@@ -0,0 +1,32 @@
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import zmq
+from zmq.green import Poller
+
+def device(device_type, isocket, osocket):
+ """Start a zeromq device (gevent-compatible).
+
+ Unlike the true zmq.device, this does not release the GIL.
+
+ Parameters
+ ----------
+ device_type : (QUEUE, FORWARDER, STREAMER)
+ The type of device to start (ignored).
+ isocket : Socket
+ The Socket instance for the incoming traffic.
+ osocket : Socket
+ The Socket instance for the outbound traffic.
+ """
+ p = Poller()
+ if osocket == -1:
+ osocket = isocket
+ p.register(isocket, zmq.POLLIN)
+ p.register(osocket, zmq.POLLIN)
+
+ while True:
+ events = dict(p.poll())
+ if isocket in events:
+ osocket.send_multipart(isocket.recv_multipart())
+ if osocket in events:
+ isocket.send_multipart(osocket.recv_multipart())
diff --git a/scripts/external_libs/platform/fedora18/zmq/green/eventloop/__init__.py b/scripts/external_libs/platform/fedora18/zmq/green/eventloop/__init__.py
new file mode 100644
index 00000000..c5150efe
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/green/eventloop/__init__.py
@@ -0,0 +1,3 @@
+from zmq.green.eventloop.ioloop import IOLoop
+
+__all__ = ['IOLoop'] \ No newline at end of file
diff --git a/scripts/external_libs/platform/fedora18/zmq/green/eventloop/ioloop.py b/scripts/external_libs/platform/fedora18/zmq/green/eventloop/ioloop.py
new file mode 100644
index 00000000..e12fd5e9
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/green/eventloop/ioloop.py
@@ -0,0 +1,33 @@
+from zmq.eventloop.ioloop import *
+from zmq.green import Poller
+
+RealIOLoop = IOLoop
+RealZMQPoller = ZMQPoller
+
+class IOLoop(RealIOLoop):
+
+ def initialize(self, impl=None):
+ impl = _poll() if impl is None else impl
+ super(IOLoop, self).initialize(impl)
+
+ @staticmethod
+ def instance():
+ """Returns a global `IOLoop` instance.
+
+ Most applications have a single, global `IOLoop` running on the
+ main thread. Use this method to get this instance from
+ another thread. To get the current thread's `IOLoop`, use `current()`.
+ """
+ # install this class as the active IOLoop implementation
+ # when using tornado 3
+ if tornado_version >= (3,):
+ PollIOLoop.configure(IOLoop)
+ return PollIOLoop.instance()
+
+
+class ZMQPoller(RealZMQPoller):
+ """gevent-compatible version of ioloop.ZMQPoller"""
+ def __init__(self):
+ self._poller = Poller()
+
+_poll = ZMQPoller
diff --git a/scripts/external_libs/platform/fedora18/zmq/green/eventloop/zmqstream.py b/scripts/external_libs/platform/fedora18/zmq/green/eventloop/zmqstream.py
new file mode 100644
index 00000000..90fbd1f5
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/green/eventloop/zmqstream.py
@@ -0,0 +1,11 @@
+from zmq.eventloop.zmqstream import *
+
+from zmq.green.eventloop.ioloop import IOLoop
+
+RealZMQStream = ZMQStream
+
+class ZMQStream(RealZMQStream):
+
+ def __init__(self, socket, io_loop=None):
+ io_loop = io_loop or IOLoop.instance()
+ super(ZMQStream, self).__init__(socket, io_loop=io_loop)
diff --git a/scripts/external_libs/platform/fedora18/zmq/green/poll.py b/scripts/external_libs/platform/fedora18/zmq/green/poll.py
new file mode 100644
index 00000000..8f016129
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/green/poll.py
@@ -0,0 +1,95 @@
+import zmq
+import gevent
+from gevent import select
+
+from zmq import Poller as _original_Poller
+
+
+class _Poller(_original_Poller):
+ """Replacement for :class:`zmq.Poller`
+
+ Ensures that the greened Poller below is used in calls to
+ :meth:`zmq.Poller.poll`.
+ """
+ _gevent_bug_timeout = 1.33 # minimum poll interval, for working around gevent bug
+
+ def _get_descriptors(self):
+ """Returns three elements tuple with socket descriptors ready
+ for gevent.select.select
+ """
+ rlist = []
+ wlist = []
+ xlist = []
+
+ for socket, flags in self.sockets:
+ if isinstance(socket, zmq.Socket):
+ rlist.append(socket.getsockopt(zmq.FD))
+ continue
+ elif isinstance(socket, int):
+ fd = socket
+ elif hasattr(socket, 'fileno'):
+ try:
+ fd = int(socket.fileno())
+ except:
+ raise ValueError('fileno() must return an valid integer fd')
+ else:
+ raise TypeError('Socket must be a 0MQ socket, an integer fd '
+ 'or have a fileno() method: %r' % socket)
+
+ if flags & zmq.POLLIN:
+ rlist.append(fd)
+ if flags & zmq.POLLOUT:
+ wlist.append(fd)
+ if flags & zmq.POLLERR:
+ xlist.append(fd)
+
+ return (rlist, wlist, xlist)
+
+ def poll(self, timeout=-1):
+ """Overridden method to ensure that the green version of
+ Poller is used.
+
+ Behaves the same as :meth:`zmq.core.Poller.poll`
+ """
+
+ if timeout is None:
+ timeout = -1
+
+ if timeout < 0:
+ timeout = -1
+
+ rlist = None
+ wlist = None
+ xlist = None
+
+ if timeout > 0:
+ tout = gevent.Timeout.start_new(timeout/1000.0)
+
+ try:
+ # Loop until timeout or events available
+ rlist, wlist, xlist = self._get_descriptors()
+ while True:
+ events = super(_Poller, self).poll(0)
+ if events or timeout == 0:
+ return events
+
+ # wait for activity on sockets in a green way
+ # set a minimum poll frequency,
+ # because gevent < 1.0 cannot be trusted to catch edge-triggered FD events
+ _bug_timeout = gevent.Timeout.start_new(self._gevent_bug_timeout)
+ try:
+ select.select(rlist, wlist, xlist)
+ except gevent.Timeout as t:
+ if t is not _bug_timeout:
+ raise
+ finally:
+ _bug_timeout.cancel()
+
+ except gevent.Timeout as t:
+ if t is not tout:
+ raise
+ return []
+ finally:
+ if timeout > 0:
+ tout.cancel()
+
diff --git a/scripts/external_libs/zmq/libzmq.so b/scripts/external_libs/platform/fedora18/zmq/libzmq.so.3
index 16980c27..16980c27 100644
--- a/scripts/external_libs/zmq/libzmq.so
+++ b/scripts/external_libs/platform/fedora18/zmq/libzmq.so.3
Binary files differ
diff --git a/scripts/external_libs/platform/fedora18/zmq/log/__init__.py b/scripts/external_libs/platform/fedora18/zmq/log/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/log/__init__.py
diff --git a/scripts/external_libs/platform/fedora18/zmq/log/handlers.py b/scripts/external_libs/platform/fedora18/zmq/log/handlers.py
new file mode 100644
index 00000000..5ff21bf3
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/log/handlers.py
@@ -0,0 +1,146 @@
+"""pyzmq logging handlers.
+
+This mainly defines the PUBHandler object for publishing logging messages over
+a zmq.PUB socket.
+
+The PUBHandler can be used with the regular logging module, as in::
+
+ >>> import logging
+ >>> handler = PUBHandler('tcp://127.0.0.1:12345')
+ >>> handler.root_topic = 'foo'
+ >>> logger = logging.getLogger('foobar')
+ >>> logger.setLevel(logging.DEBUG)
+ >>> logger.addHandler(handler)
+
+After this point, all messages logged by ``logger`` will be published on the
+PUB socket.
+
+Code adapted from StarCluster:
+
+ http://github.com/jtriley/StarCluster/blob/master/starcluster/logger.py
+"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+import logging
+from logging import INFO, DEBUG, WARN, ERROR, FATAL
+
+import zmq
+from zmq.utils.strtypes import bytes, unicode, cast_bytes
+
+
+TOPIC_DELIM="::" # delimiter for splitting topics on the receiving end.
+
+
+class PUBHandler(logging.Handler):
+ """A basic logging handler that emits log messages through a PUB socket.
+
+ Takes a PUB socket already bound to interfaces or an interface to bind to.
+
+ Example::
+
+ sock = context.socket(zmq.PUB)
+ sock.bind('inproc://log')
+ handler = PUBHandler(sock)
+
+ Or::
+
+ handler = PUBHandler('inproc://loc')
+
+ These are equivalent.
+
+ Log messages handled by this handler are broadcast with ZMQ topics
+ ``this.root_topic`` comes first, followed by the log level
+ (DEBUG,INFO,etc.), followed by any additional subtopics specified in the
+ message by: log.debug("subtopic.subsub::the real message")
+ """
+ root_topic=""
+ socket = None
+
+ formatters = {
+ logging.DEBUG: logging.Formatter(
+ "%(levelname)s %(filename)s:%(lineno)d - %(message)s\n"),
+ logging.INFO: logging.Formatter("%(message)s\n"),
+ logging.WARN: logging.Formatter(
+ "%(levelname)s %(filename)s:%(lineno)d - %(message)s\n"),
+ logging.ERROR: logging.Formatter(
+ "%(levelname)s %(filename)s:%(lineno)d - %(message)s - %(exc_info)s\n"),
+ logging.CRITICAL: logging.Formatter(
+ "%(levelname)s %(filename)s:%(lineno)d - %(message)s\n")}
+
+ def __init__(self, interface_or_socket, context=None):
+ logging.Handler.__init__(self)
+ if isinstance(interface_or_socket, zmq.Socket):
+ self.socket = interface_or_socket
+ self.ctx = self.socket.context
+ else:
+ self.ctx = context or zmq.Context()
+ self.socket = self.ctx.socket(zmq.PUB)
+ self.socket.bind(interface_or_socket)
+
+ def format(self,record):
+ """Format a record."""
+ return self.formatters[record.levelno].format(record)
+
+ def emit(self, record):
+ """Emit a log message on my socket."""
+ try:
+ topic, record.msg = record.msg.split(TOPIC_DELIM,1)
+ except Exception:
+ topic = ""
+ try:
+ bmsg = cast_bytes(self.format(record))
+ except Exception:
+ self.handleError(record)
+ return
+
+ topic_list = []
+
+ if self.root_topic:
+ topic_list.append(self.root_topic)
+
+ topic_list.append(record.levelname)
+
+ if topic:
+ topic_list.append(topic)
+
+ btopic = b'.'.join(cast_bytes(t) for t in topic_list)
+
+ self.socket.send_multipart([btopic, bmsg])
+
+
+class TopicLogger(logging.Logger):
+ """A simple wrapper that takes an additional argument to log methods.
+
+ All the regular methods exist, but instead of one msg argument, two
+ arguments: topic, msg are passed.
+
+ That is::
+
+ logger.debug('msg')
+
+ Would become::
+
+ logger.debug('topic.sub', 'msg')
+ """
+ def log(self, level, topic, msg, *args, **kwargs):
+ """Log 'msg % args' with level and topic.
+
+ To pass exception information, use the keyword argument exc_info
+ with a True value::
+
+ logger.log(level, "zmq.fun", "We have a %s",
+ "mysterious problem", exc_info=1)
+ """
+ logging.Logger.log(self, level, '%s::%s'%(topic,msg), *args, **kwargs)
+
+# Generate the methods of TopicLogger, since they are just adding a
+# topic prefix to a message.
+for name in "debug warn warning error critical fatal".split():
+ meth = getattr(logging.Logger,name)
+ setattr(TopicLogger, name,
+ lambda self, level, topic, msg, *args, **kwargs:
+ meth(self, level, topic+TOPIC_DELIM+msg,*args, **kwargs))
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/ssh/__init__.py b/scripts/external_libs/platform/fedora18/zmq/ssh/__init__.py
new file mode 100644
index 00000000..57f09568
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/ssh/__init__.py
@@ -0,0 +1 @@
+from zmq.ssh.tunnel import *
diff --git a/scripts/external_libs/platform/fedora18/zmq/ssh/forward.py b/scripts/external_libs/platform/fedora18/zmq/ssh/forward.py
new file mode 100644
index 00000000..2d619462
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/ssh/forward.py
@@ -0,0 +1,91 @@
+#
+# This file is adapted from a paramiko demo, and thus licensed under LGPL 2.1.
+# Original Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
+# Edits Copyright (C) 2010 The IPython Team
+#
+# Paramiko is free software; you can redistribute it and/or modify it under the
+# terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation; either version 2.1 of the License, or (at your option)
+# any later version.
+#
+# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA.
+
+"""
+Sample script showing how to do local port forwarding over paramiko.
+
+This script connects to the requested SSH server and sets up local port
+forwarding (the openssh -L option) from a local port through a tunneled
+connection to a destination reachable from the SSH server machine.
+"""
+
+from __future__ import print_function
+
+import logging
+import select
+try: # Python 3
+ import socketserver
+except ImportError: # Python 2
+ import SocketServer as socketserver
+
+logger = logging.getLogger('ssh')
+
+class ForwardServer (socketserver.ThreadingTCPServer):
+ daemon_threads = True
+ allow_reuse_address = True
+
+
+class Handler (socketserver.BaseRequestHandler):
+
+ def handle(self):
+ try:
+ chan = self.ssh_transport.open_channel('direct-tcpip',
+ (self.chain_host, self.chain_port),
+ self.request.getpeername())
+ except Exception as e:
+ logger.debug('Incoming request to %s:%d failed: %s' % (self.chain_host,
+ self.chain_port,
+ repr(e)))
+ return
+ if chan is None:
+ logger.debug('Incoming request to %s:%d was rejected by the SSH server.' %
+ (self.chain_host, self.chain_port))
+ return
+
+ logger.debug('Connected! Tunnel open %r -> %r -> %r' % (self.request.getpeername(),
+ chan.getpeername(), (self.chain_host, self.chain_port)))
+ while True:
+ r, w, x = select.select([self.request, chan], [], [])
+ if self.request in r:
+ data = self.request.recv(1024)
+ if len(data) == 0:
+ break
+ chan.send(data)
+ if chan in r:
+ data = chan.recv(1024)
+ if len(data) == 0:
+ break
+ self.request.send(data)
+ chan.close()
+ self.request.close()
+ logger.debug('Tunnel closed ')
+
+
+def forward_tunnel(local_port, remote_host, remote_port, transport):
+ # this is a little convoluted, but lets me configure things for the Handler
+ # object. (SocketServer doesn't give Handlers any way to access the outer
+ # server normally.)
+ class SubHander (Handler):
+ chain_host = remote_host
+ chain_port = remote_port
+ ssh_transport = transport
+ ForwardServer(('127.0.0.1', local_port), SubHander).serve_forever()
+
+
+__all__ = ['forward_tunnel']
diff --git a/scripts/external_libs/platform/fedora18/zmq/ssh/tunnel.py b/scripts/external_libs/platform/fedora18/zmq/ssh/tunnel.py
new file mode 100644
index 00000000..5a0c5433
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/ssh/tunnel.py
@@ -0,0 +1,376 @@
+"""Basic ssh tunnel utilities, and convenience functions for tunneling
+zeromq connections.
+"""
+
+# Copyright (C) 2010-2011 IPython Development Team
+# Copyright (C) 2011- PyZMQ Developers
+#
+# Redistributed from IPython under the terms of the BSD License.
+
+
+from __future__ import print_function
+
+import atexit
+import os
+import signal
+import socket
+import sys
+import warnings
+from getpass import getpass, getuser
+from multiprocessing import Process
+
+try:
+ with warnings.catch_warnings():
+ warnings.simplefilter('ignore', DeprecationWarning)
+ import paramiko
+ SSHException = paramiko.ssh_exception.SSHException
+except ImportError:
+ paramiko = None
+ class SSHException(Exception):
+ pass
+else:
+ from .forward import forward_tunnel
+
+try:
+ import pexpect
+except ImportError:
+ pexpect = None
+
+
+_random_ports = set()
+
+def select_random_ports(n):
+ """Selects and return n random ports that are available."""
+ ports = []
+ for i in range(n):
+ sock = socket.socket()
+ sock.bind(('', 0))
+ while sock.getsockname()[1] in _random_ports:
+ sock.close()
+ sock = socket.socket()
+ sock.bind(('', 0))
+ ports.append(sock)
+ for i, sock in enumerate(ports):
+ port = sock.getsockname()[1]
+ sock.close()
+ ports[i] = port
+ _random_ports.add(port)
+ return ports
+
+
+#-----------------------------------------------------------------------------
+# Check for passwordless login
+#-----------------------------------------------------------------------------
+
+def try_passwordless_ssh(server, keyfile, paramiko=None):
+ """Attempt to make an ssh connection without a password.
+ This is mainly used for requiring password input only once
+ when many tunnels may be connected to the same server.
+
+ If paramiko is None, the default for the platform is chosen.
+ """
+ if paramiko is None:
+ paramiko = sys.platform == 'win32'
+ if not paramiko:
+ f = _try_passwordless_openssh
+ else:
+ f = _try_passwordless_paramiko
+ return f(server, keyfile)
+
+def _try_passwordless_openssh(server, keyfile):
+ """Try passwordless login with shell ssh command."""
+ if pexpect is None:
+ raise ImportError("pexpect unavailable, use paramiko")
+ cmd = 'ssh -f '+ server
+ if keyfile:
+ cmd += ' -i ' + keyfile
+ cmd += ' exit'
+
+ # pop SSH_ASKPASS from env
+ env = os.environ.copy()
+ env.pop('SSH_ASKPASS', None)
+
+ ssh_newkey = 'Are you sure you want to continue connecting'
+ p = pexpect.spawn(cmd, env=env)
+ while True:
+ try:
+ i = p.expect([ssh_newkey, '[Pp]assword:'], timeout=.1)
+ if i==0:
+ raise SSHException('The authenticity of the host can\'t be established.')
+ except pexpect.TIMEOUT:
+ continue
+ except pexpect.EOF:
+ return True
+ else:
+ return False
+
+def _try_passwordless_paramiko(server, keyfile):
+ """Try passwordless login with paramiko."""
+ if paramiko is None:
+ msg = "Paramiko unavaliable, "
+ if sys.platform == 'win32':
+ msg += "Paramiko is required for ssh tunneled connections on Windows."
+ else:
+ msg += "use OpenSSH."
+ raise ImportError(msg)
+ username, server, port = _split_server(server)
+ client = paramiko.SSHClient()
+ client.load_system_host_keys()
+ client.set_missing_host_key_policy(paramiko.WarningPolicy())
+ try:
+ client.connect(server, port, username=username, key_filename=keyfile,
+ look_for_keys=True)
+ except paramiko.AuthenticationException:
+ return False
+ else:
+ client.close()
+ return True
+
+
+def tunnel_connection(socket, addr, server, keyfile=None, password=None, paramiko=None, timeout=60):
+ """Connect a socket to an address via an ssh tunnel.
+
+ This is a wrapper for socket.connect(addr), when addr is not accessible
+ from the local machine. It simply creates an ssh tunnel using the remaining args,
+ and calls socket.connect('tcp://localhost:lport') where lport is the randomly
+ selected local port of the tunnel.
+
+ """
+ new_url, tunnel = open_tunnel(addr, server, keyfile=keyfile, password=password, paramiko=paramiko, timeout=timeout)
+ socket.connect(new_url)
+ return tunnel
+
+
+def open_tunnel(addr, server, keyfile=None, password=None, paramiko=None, timeout=60):
+ """Open a tunneled connection from a 0MQ url.
+
+ For use inside tunnel_connection.
+
+ Returns
+ -------
+
+ (url, tunnel) : (str, object)
+ The 0MQ url that has been forwarded, and the tunnel object
+ """
+
+ lport = select_random_ports(1)[0]
+ transport, addr = addr.split('://')
+ ip,rport = addr.split(':')
+ rport = int(rport)
+ if paramiko is None:
+ paramiko = sys.platform == 'win32'
+ if paramiko:
+ tunnelf = paramiko_tunnel
+ else:
+ tunnelf = openssh_tunnel
+
+ tunnel = tunnelf(lport, rport, server, remoteip=ip, keyfile=keyfile, password=password, timeout=timeout)
+ return 'tcp://127.0.0.1:%i'%lport, tunnel
+
+def openssh_tunnel(lport, rport, server, remoteip='127.0.0.1', keyfile=None, password=None, timeout=60):
+ """Create an ssh tunnel using command-line ssh that connects port lport
+ on this machine to localhost:rport on server. The tunnel
+ will automatically close when not in use, remaining open
+ for a minimum of timeout seconds for an initial connection.
+
+ This creates a tunnel redirecting `localhost:lport` to `remoteip:rport`,
+ as seen from `server`.
+
+ keyfile and password may be specified, but ssh config is checked for defaults.
+
+ Parameters
+ ----------
+
+ lport : int
+ local port for connecting to the tunnel from this machine.
+ rport : int
+ port on the remote machine to connect to.
+ server : str
+ The ssh server to connect to. The full ssh server string will be parsed.
+ user@server:port
+ remoteip : str [Default: 127.0.0.1]
+ The remote ip, specifying the destination of the tunnel.
+ Default is localhost, which means that the tunnel would redirect
+ localhost:lport on this machine to localhost:rport on the *server*.
+
+ keyfile : str; path to public key file
+ This specifies a key to be used in ssh login, default None.
+ Regular default ssh keys will be used without specifying this argument.
+ password : str;
+ Your ssh password to the ssh server. Note that if this is left None,
+ you will be prompted for it if passwordless key based login is unavailable.
+ timeout : int [default: 60]
+ The time (in seconds) after which no activity will result in the tunnel
+ closing. This prevents orphaned tunnels from running forever.
+ """
+ if pexpect is None:
+ raise ImportError("pexpect unavailable, use paramiko_tunnel")
+ ssh="ssh "
+ if keyfile:
+ ssh += "-i " + keyfile
+
+ if ':' in server:
+ server, port = server.split(':')
+ ssh += " -p %s" % port
+
+ cmd = "%s -O check %s" % (ssh, server)
+ (output, exitstatus) = pexpect.run(cmd, withexitstatus=True)
+ if not exitstatus:
+ pid = int(output[output.find("(pid=")+5:output.find(")")])
+ cmd = "%s -O forward -L 127.0.0.1:%i:%s:%i %s" % (
+ ssh, lport, remoteip, rport, server)
+ (output, exitstatus) = pexpect.run(cmd, withexitstatus=True)
+ if not exitstatus:
+ atexit.register(_stop_tunnel, cmd.replace("-O forward", "-O cancel", 1))
+ return pid
+ cmd = "%s -f -S none -L 127.0.0.1:%i:%s:%i %s sleep %i" % (
+ ssh, lport, remoteip, rport, server, timeout)
+
+ # pop SSH_ASKPASS from env
+ env = os.environ.copy()
+ env.pop('SSH_ASKPASS', None)
+
+ ssh_newkey = 'Are you sure you want to continue connecting'
+ tunnel = pexpect.spawn(cmd, env=env)
+ failed = False
+ while True:
+ try:
+ i = tunnel.expect([ssh_newkey, '[Pp]assword:'], timeout=.1)
+ if i==0:
+ raise SSHException('The authenticity of the host can\'t be established.')
+ except pexpect.TIMEOUT:
+ continue
+ except pexpect.EOF:
+ if tunnel.exitstatus:
+ print(tunnel.exitstatus)
+ print(tunnel.before)
+ print(tunnel.after)
+ raise RuntimeError("tunnel '%s' failed to start"%(cmd))
+ else:
+ return tunnel.pid
+ else:
+ if failed:
+ print("Password rejected, try again")
+ password=None
+ if password is None:
+ password = getpass("%s's password: "%(server))
+ tunnel.sendline(password)
+ failed = True
+
+def _stop_tunnel(cmd):
+ pexpect.run(cmd)
+
+def _split_server(server):
+ if '@' in server:
+ username,server = server.split('@', 1)
+ else:
+ username = getuser()
+ if ':' in server:
+ server, port = server.split(':')
+ port = int(port)
+ else:
+ port = 22
+ return username, server, port
+
+def paramiko_tunnel(lport, rport, server, remoteip='127.0.0.1', keyfile=None, password=None, timeout=60):
+ """launch a tunner with paramiko in a subprocess. This should only be used
+ when shell ssh is unavailable (e.g. Windows).
+
+ This creates a tunnel redirecting `localhost:lport` to `remoteip:rport`,
+ as seen from `server`.
+
+ If you are familiar with ssh tunnels, this creates the tunnel:
+
+ ssh server -L localhost:lport:remoteip:rport
+
+ keyfile and password may be specified, but ssh config is checked for defaults.
+
+
+ Parameters
+ ----------
+
+ lport : int
+ local port for connecting to the tunnel from this machine.
+ rport : int
+ port on the remote machine to connect to.
+ server : str
+ The ssh server to connect to. The full ssh server string will be parsed.
+ user@server:port
+ remoteip : str [Default: 127.0.0.1]
+ The remote ip, specifying the destination of the tunnel.
+ Default is localhost, which means that the tunnel would redirect
+ localhost:lport on this machine to localhost:rport on the *server*.
+
+ keyfile : str; path to public key file
+ This specifies a key to be used in ssh login, default None.
+ Regular default ssh keys will be used without specifying this argument.
+ password : str;
+ Your ssh password to the ssh server. Note that if this is left None,
+ you will be prompted for it if passwordless key based login is unavailable.
+ timeout : int [default: 60]
+ The time (in seconds) after which no activity will result in the tunnel
+ closing. This prevents orphaned tunnels from running forever.
+
+ """
+ if paramiko is None:
+ raise ImportError("Paramiko not available")
+
+ if password is None:
+ if not _try_passwordless_paramiko(server, keyfile):
+ password = getpass("%s's password: "%(server))
+
+ p = Process(target=_paramiko_tunnel,
+ args=(lport, rport, server, remoteip),
+ kwargs=dict(keyfile=keyfile, password=password))
+ p.daemon=False
+ p.start()
+ atexit.register(_shutdown_process, p)
+ return p
+
+def _shutdown_process(p):
+ if p.is_alive():
+ p.terminate()
+
+def _paramiko_tunnel(lport, rport, server, remoteip, keyfile=None, password=None):
+ """Function for actually starting a paramiko tunnel, to be passed
+ to multiprocessing.Process(target=this), and not called directly.
+ """
+ username, server, port = _split_server(server)
+ client = paramiko.SSHClient()
+ client.load_system_host_keys()
+ client.set_missing_host_key_policy(paramiko.WarningPolicy())
+
+ try:
+ client.connect(server, port, username=username, key_filename=keyfile,
+ look_for_keys=True, password=password)
+# except paramiko.AuthenticationException:
+# if password is None:
+# password = getpass("%s@%s's password: "%(username, server))
+# client.connect(server, port, username=username, password=password)
+# else:
+# raise
+ except Exception as e:
+ print('*** Failed to connect to %s:%d: %r' % (server, port, e))
+ sys.exit(1)
+
+ # Don't let SIGINT kill the tunnel subprocess
+ signal.signal(signal.SIGINT, signal.SIG_IGN)
+
+ try:
+ forward_tunnel(lport, remoteip, rport, client.get_transport())
+ except KeyboardInterrupt:
+ print('SIGINT: Port forwarding stopped cleanly')
+ sys.exit(0)
+ except Exception as e:
+ print("Port forwarding stopped uncleanly: %s"%e)
+ sys.exit(255)
+
+if sys.platform == 'win32':
+ ssh_tunnel = paramiko_tunnel
+else:
+ ssh_tunnel = openssh_tunnel
+
+
+__all__ = ['tunnel_connection', 'ssh_tunnel', 'openssh_tunnel', 'paramiko_tunnel', 'try_passwordless_ssh']
+
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/sugar/.version.py.swp b/scripts/external_libs/platform/fedora18/zmq/sugar/.version.py.swp
new file mode 100644
index 00000000..803e5049
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/sugar/.version.py.swp
Binary files differ
diff --git a/scripts/external_libs/platform/fedora18/zmq/sugar/__init__.py b/scripts/external_libs/platform/fedora18/zmq/sugar/__init__.py
new file mode 100644
index 00000000..d0510a44
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/sugar/__init__.py
@@ -0,0 +1,27 @@
+"""pure-Python sugar wrappers for core 0MQ objects."""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+from zmq.sugar import (
+ constants, context, frame, poll, socket, tracker, version
+)
+from zmq import error
+
+__all__ = ['constants']
+for submod in (
+ constants, context, error, frame, poll, socket, tracker, version
+):
+ __all__.extend(submod.__all__)
+
+from zmq.error import *
+from zmq.sugar.context import *
+from zmq.sugar.tracker import *
+from zmq.sugar.socket import *
+from zmq.sugar.constants import *
+from zmq.sugar.frame import *
+from zmq.sugar.poll import *
+# from zmq.sugar.stopwatch import *
+# from zmq.sugar._device import *
+from zmq.sugar.version import *
diff --git a/scripts/external_libs/platform/fedora18/zmq/sugar/attrsettr.py b/scripts/external_libs/platform/fedora18/zmq/sugar/attrsettr.py
new file mode 100644
index 00000000..4bbd36d6
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/sugar/attrsettr.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+"""Mixin for mapping set/getattr to self.set/get"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+from . import constants
+
+class AttributeSetter(object):
+
+ def __setattr__(self, key, value):
+ """set zmq options by attribute"""
+
+ # regular setattr only allowed for class-defined attributes
+ for obj in [self] + self.__class__.mro():
+ if key in obj.__dict__:
+ object.__setattr__(self, key, value)
+ return
+
+ upper_key = key.upper()
+ try:
+ opt = getattr(constants, upper_key)
+ except AttributeError:
+ raise AttributeError("%s has no such option: %s" % (
+ self.__class__.__name__, upper_key)
+ )
+ else:
+ self._set_attr_opt(upper_key, opt, value)
+
+ def _set_attr_opt(self, name, opt, value):
+ """override if setattr should do something other than call self.set"""
+ self.set(opt, value)
+
+ def __getattr__(self, key):
+ """get zmq options by attribute"""
+ upper_key = key.upper()
+ try:
+ opt = getattr(constants, upper_key)
+ except AttributeError:
+ raise AttributeError("%s has no such option: %s" % (
+ self.__class__.__name__, upper_key)
+ )
+ else:
+ return self._get_attr_opt(upper_key, opt)
+
+ def _get_attr_opt(self, name, opt):
+ """override if getattr should do something other than call self.get"""
+ return self.get(opt)
+
+
+__all__ = ['AttributeSetter']
diff --git a/scripts/external_libs/platform/fedora18/zmq/sugar/constants.py b/scripts/external_libs/platform/fedora18/zmq/sugar/constants.py
new file mode 100644
index 00000000..88281176
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/sugar/constants.py
@@ -0,0 +1,98 @@
+"""0MQ Constants."""
+
+# Copyright (c) PyZMQ Developers.
+# Distributed under the terms of the Modified BSD License.
+
+from zmq.backend import constants
+from zmq.utils.constant_names import (
+ base_names,
+ switched_sockopt_names,
+ int_sockopt_names,
+ int64_sockopt_names,
+ bytes_sockopt_names,
+ fd_sockopt_names,
+ ctx_opt_names,
+ msg_opt_names,
+)
+
+#-----------------------------------------------------------------------------
+# Python module level constants
+#-----------------------------------------------------------------------------
+
+__all__ = [
+ 'int_sockopts',
+ 'int64_sockopts',
+ 'bytes_sockopts',
+ 'ctx_opts',
+ 'ctx_opt_names',
+ ]
+
+int_sockopts = set()
+int64_sockopts = set()
+bytes_sockopts = set()
+fd_sockopts = set()
+ctx_opts = set()
+msg_opts = set()
+
+
+if constants.VERSION < 30000:
+ int64_sockopt_names.extend(switched_sockopt_names)
+else:
+ int_sockopt_names.extend(switched_sockopt_names)
+
+_UNDEFINED = -9999
+
+def _add_constant(name, container=None):
+ """add a constant to be defined
+
+ optionally add it to one of the sets for use in get/setopt checkers
+ """
+ c = getattr(constants, name, _UNDEFINED)
+ if c == _UNDEFINED:
+ return
+ globals()[name] = c
+ __all__.append(name)
+ if container is not None:
+ container.add(c)
+ return c
+
+for name in base_names:
+ _add_constant(name)
+
+for name in int_sockopt_names:
+ _add_constant(name, int_sockopts)
+
+for name in int64_sockopt_names:
+ _add_constant(name, int64_sockopts)
+
+for name in bytes_sockopt_names:
+ _add_constant(name, bytes_sockopts)
+
+for name in fd_sockopt_names:
+ _add_constant(name, fd_sockopts)
+
+for name in ctx_opt_names:
+ _add_constant(name, ctx_opts)
+
+for name in msg_opt_names:
+ _add_constant(name, msg_opts)
+
+# ensure some aliases are always defined
+aliases = [
+ ('DONTWAIT', 'NOBLOCK'),
+ ('XREQ', 'DEALER'),
+ ('XREP', 'ROUTER'),
+]
+for group in aliases:
+ undefined = set()
+ found = None
+ for name in group:
+ value = getattr(constants, name, -1)
+ if value != -1:
+ found = value
+ else:
+ undefined.add(name)
+ if found is not None:
+ for name in undefined:
+ globals()[name] = found
+ __all__.append(name)
diff --git a/scripts/external_libs/platform/fedora18/zmq/sugar/context.py b/scripts/external_libs/platform/fedora18/zmq/sugar/context.py
new file mode 100644
index 00000000..86a9c5dc
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/sugar/context.py
@@ -0,0 +1,192 @@
+# coding: utf-8
+"""Python bindings for 0MQ."""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import atexit
+import weakref
+
+from zmq.backend import Context as ContextBase
+from . import constants
+from .attrsettr import AttributeSetter
+from .constants import ENOTSUP, ctx_opt_names
+from .socket import Socket
+from zmq.error import ZMQError
+
+from zmq.utils.interop import cast_int_addr
+
+
+class Context(ContextBase, AttributeSetter):
+ """Create a zmq Context
+
+ A zmq Context creates sockets via its ``ctx.socket`` method.
+ """
+ sockopts = None
+ _instance = None
+ _shadow = False
+ _exiting = False
+
+ def __init__(self, io_threads=1, **kwargs):
+ super(Context, self).__init__(io_threads=io_threads, **kwargs)
+ if kwargs.get('shadow', False):
+ self._shadow = True
+ else:
+ self._shadow = False
+ self.sockopts = {}
+
+ self._exiting = False
+ if not self._shadow:
+ ctx_ref = weakref.ref(self)
+ def _notify_atexit():
+ ctx = ctx_ref()
+ if ctx is not None:
+ ctx._exiting = True
+ atexit.register(_notify_atexit)
+
+ def __del__(self):
+ """deleting a Context should terminate it, without trying non-threadsafe destroy"""
+ if not self._shadow and not self._exiting:
+ self.term()
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, *args, **kwargs):
+ self.term()
+
+ @classmethod
+ def shadow(cls, address):
+ """Shadow an existing libzmq context
+
+ address is the integer address of the libzmq context
+ or an FFI pointer to it.
+
+ .. versionadded:: 14.1
+ """
+ address = cast_int_addr(address)
+ return cls(shadow=address)
+
+ @classmethod
+ def shadow_pyczmq(cls, ctx):
+ """Shadow an existing pyczmq context
+
+ ctx is the FFI `zctx_t *` pointer
+
+ .. versionadded:: 14.1
+ """
+ from pyczmq import zctx
+
+ underlying = zctx.underlying(ctx)
+ address = cast_int_addr(underlying)
+ return cls(shadow=address)
+
+ # static method copied from tornado IOLoop.instance
+ @classmethod
+ def instance(cls, io_threads=1):
+ """Returns a global Context instance.
+
+ Most single-threaded applications have a single, global Context.
+ Use this method instead of passing around Context instances
+ throughout your code.
+
+ A common pattern for classes that depend on Contexts is to use
+ a default argument to enable programs with multiple Contexts
+ but not require the argument for simpler applications:
+
+ class MyClass(object):
+ def __init__(self, context=None):
+ self.context = context or Context.instance()
+ """
+ if cls._instance is None or cls._instance.closed:
+ cls._instance = cls(io_threads=io_threads)
+ return cls._instance
+
+ #-------------------------------------------------------------------------
+ # Hooks for ctxopt completion
+ #-------------------------------------------------------------------------
+
+ def __dir__(self):
+ keys = dir(self.__class__)
+
+ for collection in (
+ ctx_opt_names,
+ ):
+ keys.extend(collection)
+ return keys
+
+ #-------------------------------------------------------------------------
+ # Creating Sockets
+ #-------------------------------------------------------------------------
+
+ @property
+ def _socket_class(self):
+ return Socket
+
+ def socket(self, socket_type):
+ """Create a Socket associated with this Context.
+
+ Parameters
+ ----------
+ socket_type : int
+ The socket type, which can be any of the 0MQ socket types:
+ REQ, REP, PUB, SUB, PAIR, DEALER, ROUTER, PULL, PUSH, etc.
+ """
+ if self.closed:
+ raise ZMQError(ENOTSUP)
+ s = self._socket_class(self, socket_type)
+ for opt, value in self.sockopts.items():
+ try:
+ s.setsockopt(opt, value)
+ except ZMQError:
+ # ignore ZMQErrors, which are likely for socket options
+ # that do not apply to a particular socket type, e.g.
+ # SUBSCRIBE for non-SUB sockets.
+ pass
+ return s
+
+ def setsockopt(self, opt, value):
+ """set default socket options for new sockets created by this Context
+
+ .. versionadded:: 13.0
+ """
+ self.sockopts[opt] = value
+
+ def getsockopt(self, opt):
+ """get default socket options for new sockets created by this Context
+
+ .. versionadded:: 13.0
+ """
+ return self.sockopts[opt]
+
+ def _set_attr_opt(self, name, opt, value):
+ """set default sockopts as attributes"""
+ if name in constants.ctx_opt_names:
+ return self.set(opt, value)
+ else:
+ self.sockopts[opt] = value
+
+ def _get_attr_opt(self, name, opt):
+ """get default sockopts as attributes"""
+ if name in constants.ctx_opt_names:
+ return self.get(opt)
+ else:
+ if opt not in self.sockopts:
+ raise AttributeError(name)
+ else:
+ return self.sockopts[opt]
+
+ def __delattr__(self, key):
+ """delete default sockopts as attributes"""
+ key = key.upper()
+ try:
+ opt = getattr(constants, key)
+ except AttributeError:
+ raise AttributeError("no such socket option: %s" % key)
+ else:
+ if opt not in self.sockopts:
+ raise AttributeError(key)
+ else:
+ del self.sockopts[opt]
+
+__all__ = ['Context']
diff --git a/scripts/external_libs/platform/fedora18/zmq/sugar/frame.py b/scripts/external_libs/platform/fedora18/zmq/sugar/frame.py
new file mode 100644
index 00000000..9f556c86
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/sugar/frame.py
@@ -0,0 +1,19 @@
+# coding: utf-8
+"""0MQ Frame pure Python methods."""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+from .attrsettr import AttributeSetter
+from zmq.backend import Frame as FrameBase
+
+
+class Frame(FrameBase, AttributeSetter):
+ def __getitem__(self, key):
+ # map Frame['User-Id'] to Frame.get('User-Id')
+ return self.get(key)
+
+# keep deprecated alias
+Message = Frame
+__all__ = ['Frame', 'Message'] \ No newline at end of file
diff --git a/scripts/external_libs/platform/fedora18/zmq/sugar/poll.py b/scripts/external_libs/platform/fedora18/zmq/sugar/poll.py
new file mode 100644
index 00000000..c7b1d1bb
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/sugar/poll.py
@@ -0,0 +1,161 @@
+"""0MQ polling related functions and classes."""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+import zmq
+from zmq.backend import zmq_poll
+from .constants import POLLIN, POLLOUT, POLLERR
+
+#-----------------------------------------------------------------------------
+# Polling related methods
+#-----------------------------------------------------------------------------
+
+
+class Poller(object):
+ """A stateful poll interface that mirrors Python's built-in poll."""
+ sockets = None
+ _map = {}
+
+ def __init__(self):
+ self.sockets = []
+ self._map = {}
+
+ def __contains__(self, socket):
+ return socket in self._map
+
+ def register(self, socket, flags=POLLIN|POLLOUT):
+ """p.register(socket, flags=POLLIN|POLLOUT)
+
+ Register a 0MQ socket or native fd for I/O monitoring.
+
+ register(s,0) is equivalent to unregister(s).
+
+ Parameters
+ ----------
+ socket : zmq.Socket or native socket
+ A zmq.Socket or any Python object having a ``fileno()``
+ method that returns a valid file descriptor.
+ flags : int
+ The events to watch for. Can be POLLIN, POLLOUT or POLLIN|POLLOUT.
+ If `flags=0`, socket will be unregistered.
+ """
+ if flags:
+ if socket in self._map:
+ idx = self._map[socket]
+ self.sockets[idx] = (socket, flags)
+ else:
+ idx = len(self.sockets)
+ self.sockets.append((socket, flags))
+ self._map[socket] = idx
+ elif socket in self._map:
+ # uregister sockets registered with no events
+ self.unregister(socket)
+ else:
+ # ignore new sockets with no events
+ pass
+
+ def modify(self, socket, flags=POLLIN|POLLOUT):
+ """Modify the flags for an already registered 0MQ socket or native fd."""
+ self.register(socket, flags)
+
+ def unregister(self, socket):
+ """Remove a 0MQ socket or native fd for I/O monitoring.
+
+ Parameters
+ ----------
+ socket : Socket
+ The socket instance to stop polling.
+ """
+ idx = self._map.pop(socket)
+ self.sockets.pop(idx)
+ # shift indices after deletion
+ for socket, flags in self.sockets[idx:]:
+ self._map[socket] -= 1
+
+ def poll(self, timeout=None):
+ """Poll the registered 0MQ or native fds for I/O.
+
+ Parameters
+ ----------
+ timeout : float, int
+ The timeout in milliseconds. If None, no `timeout` (infinite). This
+ is in milliseconds to be compatible with ``select.poll()``. The
+ underlying zmq_poll uses microseconds and we convert to that in
+ this function.
+
+ Returns
+ -------
+ events : list of tuples
+ The list of events that are ready to be processed.
+ This is a list of tuples of the form ``(socket, event)``, where the 0MQ Socket
+ or integer fd is the first element, and the poll event mask (POLLIN, POLLOUT) is the second.
+ It is common to call ``events = dict(poller.poll())``,
+ which turns the list of tuples into a mapping of ``socket : event``.
+ """
+ if timeout is None or timeout < 0:
+ timeout = -1
+ elif isinstance(timeout, float):
+ timeout = int(timeout)
+ return zmq_poll(self.sockets, timeout=timeout)
+
+
+def select(rlist, wlist, xlist, timeout=None):
+ """select(rlist, wlist, xlist, timeout=None) -> (rlist, wlist, xlist)
+
+ Return the result of poll as a lists of sockets ready for r/w/exception.
+
+ This has the same interface as Python's built-in ``select.select()`` function.
+
+ Parameters
+ ----------
+ timeout : float, int, optional
+ The timeout in seconds. If None, no timeout (infinite). This is in seconds to be
+ compatible with ``select.select()``. The underlying zmq_poll uses microseconds
+ and we convert to that in this function.
+ rlist : list of sockets/FDs
+ sockets/FDs to be polled for read events
+ wlist : list of sockets/FDs
+ sockets/FDs to be polled for write events
+ xlist : list of sockets/FDs
+ sockets/FDs to be polled for error events
+
+ Returns
+ -------
+ (rlist, wlist, xlist) : tuple of lists of sockets (length 3)
+ Lists correspond to sockets available for read/write/error events respectively.
+ """
+ if timeout is None:
+ timeout = -1
+ # Convert from sec -> us for zmq_poll.
+ # zmq_poll accepts 3.x style timeout in ms
+ timeout = int(timeout*1000.0)
+ if timeout < 0:
+ timeout = -1
+ sockets = []
+ for s in set(rlist + wlist + xlist):
+ flags = 0
+ if s in rlist:
+ flags |= POLLIN
+ if s in wlist:
+ flags |= POLLOUT
+ if s in xlist:
+ flags |= POLLERR
+ sockets.append((s, flags))
+ return_sockets = zmq_poll(sockets, timeout)
+ rlist, wlist, xlist = [], [], []
+ for s, flags in return_sockets:
+ if flags & POLLIN:
+ rlist.append(s)
+ if flags & POLLOUT:
+ wlist.append(s)
+ if flags & POLLERR:
+ xlist.append(s)
+ return rlist, wlist, xlist
+
+#-----------------------------------------------------------------------------
+# Symbols to export
+#-----------------------------------------------------------------------------
+
+__all__ = [ 'Poller', 'select' ]
diff --git a/scripts/external_libs/platform/fedora18/zmq/sugar/socket.py b/scripts/external_libs/platform/fedora18/zmq/sugar/socket.py
new file mode 100644
index 00000000..c91589d7
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/sugar/socket.py
@@ -0,0 +1,495 @@
+# coding: utf-8
+"""0MQ Socket pure Python methods."""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+import codecs
+import random
+import warnings
+
+import zmq
+from zmq.backend import Socket as SocketBase
+from .poll import Poller
+from . import constants
+from .attrsettr import AttributeSetter
+from zmq.error import ZMQError, ZMQBindError
+from zmq.utils import jsonapi
+from zmq.utils.strtypes import bytes,unicode,basestring
+from zmq.utils.interop import cast_int_addr
+
+from .constants import (
+ SNDMORE, ENOTSUP, POLLIN,
+ int64_sockopt_names,
+ int_sockopt_names,
+ bytes_sockopt_names,
+ fd_sockopt_names,
+)
+try:
+ import cPickle
+ pickle = cPickle
+except:
+ cPickle = None
+ import pickle
+
+try:
+ DEFAULT_PROTOCOL = pickle.DEFAULT_PROTOCOL
+except AttributeError:
+ DEFAULT_PROTOCOL = pickle.HIGHEST_PROTOCOL
+
+
+class Socket(SocketBase, AttributeSetter):
+ """The ZMQ socket object
+
+ To create a Socket, first create a Context::
+
+ ctx = zmq.Context.instance()
+
+ then call ``ctx.socket(socket_type)``::
+
+ s = ctx.socket(zmq.ROUTER)
+
+ """
+ _shadow = False
+
+ def __del__(self):
+ if not self._shadow:
+ self.close()
+
+ # socket as context manager:
+ def __enter__(self):
+ """Sockets are context managers
+
+ .. versionadded:: 14.4
+ """
+ return self
+
+ def __exit__(self, *args, **kwargs):
+ self.close()
+
+ #-------------------------------------------------------------------------
+ # Socket creation
+ #-------------------------------------------------------------------------
+
+ @classmethod
+ def shadow(cls, address):
+ """Shadow an existing libzmq socket
+
+ address is the integer address of the libzmq socket
+ or an FFI pointer to it.
+
+ .. versionadded:: 14.1
+ """
+ address = cast_int_addr(address)
+ return cls(shadow=address)
+
+ #-------------------------------------------------------------------------
+ # Deprecated aliases
+ #-------------------------------------------------------------------------
+
+ @property
+ def socket_type(self):
+ warnings.warn("Socket.socket_type is deprecated, use Socket.type",
+ DeprecationWarning
+ )
+ return self.type
+
+ #-------------------------------------------------------------------------
+ # Hooks for sockopt completion
+ #-------------------------------------------------------------------------
+
+ def __dir__(self):
+ keys = dir(self.__class__)
+ for collection in (
+ bytes_sockopt_names,
+ int_sockopt_names,
+ int64_sockopt_names,
+ fd_sockopt_names,
+ ):
+ keys.extend(collection)
+ return keys
+
+ #-------------------------------------------------------------------------
+ # Getting/Setting options
+ #-------------------------------------------------------------------------
+ setsockopt = SocketBase.set
+ getsockopt = SocketBase.get
+
+ def set_string(self, option, optval, encoding='utf-8'):
+ """set socket options with a unicode object
+
+ This is simply a wrapper for setsockopt to protect from encoding ambiguity.
+
+ See the 0MQ documentation for details on specific options.
+
+ Parameters
+ ----------
+ option : int
+ The name of the option to set. Can be any of: SUBSCRIBE,
+ UNSUBSCRIBE, IDENTITY
+ optval : unicode string (unicode on py2, str on py3)
+ The value of the option to set.
+ encoding : str
+ The encoding to be used, default is utf8
+ """
+ if not isinstance(optval, unicode):
+ raise TypeError("unicode strings only")
+ return self.set(option, optval.encode(encoding))
+
+ setsockopt_unicode = setsockopt_string = set_string
+
+ def get_string(self, option, encoding='utf-8'):
+ """get the value of a socket option
+
+ See the 0MQ documentation for details on specific options.
+
+ Parameters
+ ----------
+ option : int
+ The option to retrieve.
+
+ Returns
+ -------
+ optval : unicode string (unicode on py2, str on py3)
+ The value of the option as a unicode string.
+ """
+
+ if option not in constants.bytes_sockopts:
+ raise TypeError("option %i will not return a string to be decoded"%option)
+ return self.getsockopt(option).decode(encoding)
+
+ getsockopt_unicode = getsockopt_string = get_string
+
+ def bind_to_random_port(self, addr, min_port=49152, max_port=65536, max_tries=100):
+ """bind this socket to a random port in a range
+
+ Parameters
+ ----------
+ addr : str
+ The address string without the port to pass to ``Socket.bind()``.
+ min_port : int, optional
+ The minimum port in the range of ports to try (inclusive).
+ max_port : int, optional
+ The maximum port in the range of ports to try (exclusive).
+ max_tries : int, optional
+ The maximum number of bind attempts to make.
+
+ Returns
+ -------
+ port : int
+ The port the socket was bound to.
+
+ Raises
+ ------
+ ZMQBindError
+ if `max_tries` reached before successful bind
+ """
+ for i in range(max_tries):
+ try:
+ port = random.randrange(min_port, max_port)
+ self.bind('%s:%s' % (addr, port))
+ except ZMQError as exception:
+ if not exception.errno == zmq.EADDRINUSE:
+ raise
+ else:
+ return port
+ raise ZMQBindError("Could not bind socket to random port.")
+
+ def get_hwm(self):
+ """get the High Water Mark
+
+ On libzmq ≥ 3, this gets SNDHWM if available, otherwise RCVHWM
+ """
+ major = zmq.zmq_version_info()[0]
+ if major >= 3:
+ # return sndhwm, fallback on rcvhwm
+ try:
+ return self.getsockopt(zmq.SNDHWM)
+ except zmq.ZMQError as e:
+ pass
+
+ return self.getsockopt(zmq.RCVHWM)
+ else:
+ return self.getsockopt(zmq.HWM)
+
+ def set_hwm(self, value):
+ """set the High Water Mark
+
+ On libzmq ≥ 3, this sets both SNDHWM and RCVHWM
+ """
+ major = zmq.zmq_version_info()[0]
+ if major >= 3:
+ raised = None
+ try:
+ self.sndhwm = value
+ except Exception as e:
+ raised = e
+ try:
+ self.rcvhwm = value
+ except Exception:
+ raised = e
+
+ if raised:
+ raise raised
+ else:
+ return self.setsockopt(zmq.HWM, value)
+
+ hwm = property(get_hwm, set_hwm,
+ """property for High Water Mark
+
+ Setting hwm sets both SNDHWM and RCVHWM as appropriate.
+ It gets SNDHWM if available, otherwise RCVHWM.
+ """
+ )
+
+ #-------------------------------------------------------------------------
+ # Sending and receiving messages
+ #-------------------------------------------------------------------------
+
+ def send_multipart(self, msg_parts, flags=0, copy=True, track=False):
+ """send a sequence of buffers as a multipart message
+
+ The zmq.SNDMORE flag is added to all msg parts before the last.
+
+ Parameters
+ ----------
+ msg_parts : iterable
+ A sequence of objects to send as a multipart message. Each element
+ can be any sendable object (Frame, bytes, buffer-providers)
+ flags : int, optional
+ SNDMORE is handled automatically for frames before the last.
+ copy : bool, optional
+ Should the frame(s) be sent in a copying or non-copying manner.
+ track : bool, optional
+ Should the frame(s) be tracked for notification that ZMQ has
+ finished with it (ignored if copy=True).
+
+ Returns
+ -------
+ None : if copy or not track
+ MessageTracker : if track and not copy
+ a MessageTracker object, whose `pending` property will
+ be True until the last send is completed.
+ """
+ for msg in msg_parts[:-1]:
+ self.send(msg, SNDMORE|flags, copy=copy, track=track)
+ # Send the last part without the extra SNDMORE flag.
+ return self.send(msg_parts[-1], flags, copy=copy, track=track)
+
+ def recv_multipart(self, flags=0, copy=True, track=False):
+ """receive a multipart message as a list of bytes or Frame objects
+
+ Parameters
+ ----------
+ flags : int, optional
+ Any supported flag: NOBLOCK. If NOBLOCK is set, this method
+ will raise a ZMQError with EAGAIN if a message is not ready.
+ If NOBLOCK is not set, then this method will block until a
+ message arrives.
+ copy : bool, optional
+ Should the message frame(s) be received in a copying or non-copying manner?
+ If False a Frame object is returned for each part, if True a copy of
+ the bytes is made for each frame.
+ track : bool, optional
+ Should the message frame(s) be tracked for notification that ZMQ has
+ finished with it? (ignored if copy=True)
+
+ Returns
+ -------
+ msg_parts : list
+ A list of frames in the multipart message; either Frames or bytes,
+ depending on `copy`.
+
+ """
+ parts = [self.recv(flags, copy=copy, track=track)]
+ # have first part already, only loop while more to receive
+ while self.getsockopt(zmq.RCVMORE):
+ part = self.recv(flags, copy=copy, track=track)
+ parts.append(part)
+
+ return parts
+
+ def send_string(self, u, flags=0, copy=True, encoding='utf-8'):
+ """send a Python unicode string as a message with an encoding
+
+ 0MQ communicates with raw bytes, so you must encode/decode
+ text (unicode on py2, str on py3) around 0MQ.
+
+ Parameters
+ ----------
+ u : Python unicode string (unicode on py2, str on py3)
+ The unicode string to send.
+ flags : int, optional
+ Any valid send flag.
+ encoding : str [default: 'utf-8']
+ The encoding to be used
+ """
+ if not isinstance(u, basestring):
+ raise TypeError("unicode/str objects only")
+ return self.send(u.encode(encoding), flags=flags, copy=copy)
+
+ send_unicode = send_string
+
+ def recv_string(self, flags=0, encoding='utf-8'):
+ """receive a unicode string, as sent by send_string
+
+ Parameters
+ ----------
+ flags : int
+ Any valid recv flag.
+ encoding : str [default: 'utf-8']
+ The encoding to be used
+
+ Returns
+ -------
+ s : unicode string (unicode on py2, str on py3)
+ The Python unicode string that arrives as encoded bytes.
+ """
+ b = self.recv(flags=flags)
+ return b.decode(encoding)
+
+ recv_unicode = recv_string
+
+ def send_pyobj(self, obj, flags=0, protocol=DEFAULT_PROTOCOL):
+ """send a Python object as a message using pickle to serialize
+
+ Parameters
+ ----------
+ obj : Python object
+ The Python object to send.
+ flags : int
+ Any valid send flag.
+ protocol : int
+ The pickle protocol number to use. The default is pickle.DEFAULT_PROTOCOl
+ where defined, and pickle.HIGHEST_PROTOCOL elsewhere.
+ """
+ msg = pickle.dumps(obj, protocol)
+ return self.send(msg, flags)
+
+ def recv_pyobj(self, flags=0):
+ """receive a Python object as a message using pickle to serialize
+
+ Parameters
+ ----------
+ flags : int
+ Any valid recv flag.
+
+ Returns
+ -------
+ obj : Python object
+ The Python object that arrives as a message.
+ """
+ s = self.recv(flags)
+ return pickle.loads(s)
+
+ def send_json(self, obj, flags=0, **kwargs):
+ """send a Python object as a message using json to serialize
+
+ Keyword arguments are passed on to json.dumps
+
+ Parameters
+ ----------
+ obj : Python object
+ The Python object to send
+ flags : int
+ Any valid send flag
+ """
+ msg = jsonapi.dumps(obj, **kwargs)
+ return self.send(msg, flags)
+
+ def recv_json(self, flags=0, **kwargs):
+ """receive a Python object as a message using json to serialize
+
+ Keyword arguments are passed on to json.loads
+
+ Parameters
+ ----------
+ flags : int
+ Any valid recv flag.
+
+ Returns
+ -------
+ obj : Python object
+ The Python object that arrives as a message.
+ """
+ msg = self.recv(flags)
+ return jsonapi.loads(msg, **kwargs)
+
+ _poller_class = Poller
+
+ def poll(self, timeout=None, flags=POLLIN):
+ """poll the socket for events
+
+ The default is to poll forever for incoming
+ events. Timeout is in milliseconds, if specified.
+
+ Parameters
+ ----------
+ timeout : int [default: None]
+ The timeout (in milliseconds) to wait for an event. If unspecified
+ (or specified None), will wait forever for an event.
+ flags : bitfield (int) [default: POLLIN]
+ The event flags to poll for (any combination of POLLIN|POLLOUT).
+ The default is to check for incoming events (POLLIN).
+
+ Returns
+ -------
+ events : bitfield (int)
+ The events that are ready and waiting. Will be 0 if no events were ready
+ by the time timeout was reached.
+ """
+
+ if self.closed:
+ raise ZMQError(ENOTSUP)
+
+ p = self._poller_class()
+ p.register(self, flags)
+ evts = dict(p.poll(timeout))
+ # return 0 if no events, otherwise return event bitfield
+ return evts.get(self, 0)
+
+ def get_monitor_socket(self, events=None, addr=None):
+ """Return a connected PAIR socket ready to receive the event notifications.
+
+ .. versionadded:: libzmq-4.0
+ .. versionadded:: 14.0
+
+ Parameters
+ ----------
+ events : bitfield (int) [default: ZMQ_EVENTS_ALL]
+ The bitmask defining which events are wanted.
+ addr : string [default: None]
+ The optional endpoint for the monitoring sockets.
+
+ Returns
+ -------
+ socket : (PAIR)
+ The socket is already connected and ready to receive messages.
+ """
+ # safe-guard, method only available on libzmq >= 4
+ if zmq.zmq_version_info() < (4,):
+ raise NotImplementedError("get_monitor_socket requires libzmq >= 4, have %s" % zmq.zmq_version())
+ if addr is None:
+ # create endpoint name from internal fd
+ addr = "inproc://monitor.s-%d" % self.FD
+ if events is None:
+ # use all events
+ events = zmq.EVENT_ALL
+ # attach monitoring socket
+ self.monitor(addr, events)
+ # create new PAIR socket and connect it
+ ret = self.context.socket(zmq.PAIR)
+ ret.connect(addr)
+ return ret
+
+ def disable_monitor(self):
+ """Shutdown the PAIR socket (created using get_monitor_socket)
+ that is serving socket events.
+
+ .. versionadded:: 14.4
+ """
+ self.monitor(None, 0)
+
+
+__all__ = ['Socket']
diff --git a/scripts/external_libs/platform/fedora18/zmq/sugar/tracker.py b/scripts/external_libs/platform/fedora18/zmq/sugar/tracker.py
new file mode 100644
index 00000000..fb8c007f
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/sugar/tracker.py
@@ -0,0 +1,120 @@
+"""Tracker for zero-copy messages with 0MQ."""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import time
+
+try:
+ # below 3.3
+ from threading import _Event as Event
+except (ImportError, AttributeError):
+ # python throws ImportError, cython throws AttributeError
+ from threading import Event
+
+from zmq.error import NotDone
+from zmq.backend import Frame
+
+class MessageTracker(object):
+ """MessageTracker(*towatch)
+
+ A class for tracking if 0MQ is done using one or more messages.
+
+ When you send a 0MQ message, it is not sent immediately. The 0MQ IO thread
+ sends the message at some later time. Often you want to know when 0MQ has
+ actually sent the message though. This is complicated by the fact that
+ a single 0MQ message can be sent multiple times using different sockets.
+ This class allows you to track all of the 0MQ usages of a message.
+
+ Parameters
+ ----------
+ *towatch : tuple of Event, MessageTracker, Message instances.
+ This list of objects to track. This class can track the low-level
+ Events used by the Message class, other MessageTrackers or
+ actual Messages.
+ """
+ events = None
+ peers = None
+
+ def __init__(self, *towatch):
+ """MessageTracker(*towatch)
+
+ Create a message tracker to track a set of mesages.
+
+ Parameters
+ ----------
+ *towatch : tuple of Event, MessageTracker, Message instances.
+ This list of objects to track. This class can track the low-level
+ Events used by the Message class, other MessageTrackers or
+ actual Messages.
+ """
+ self.events = set()
+ self.peers = set()
+ for obj in towatch:
+ if isinstance(obj, Event):
+ self.events.add(obj)
+ elif isinstance(obj, MessageTracker):
+ self.peers.add(obj)
+ elif isinstance(obj, Frame):
+ if not obj.tracker:
+ raise ValueError("Not a tracked message")
+ self.peers.add(obj.tracker)
+ else:
+ raise TypeError("Require Events or Message Frames, not %s"%type(obj))
+
+ @property
+ def done(self):
+ """Is 0MQ completely done with the message(s) being tracked?"""
+ for evt in self.events:
+ if not evt.is_set():
+ return False
+ for pm in self.peers:
+ if not pm.done:
+ return False
+ return True
+
+ def wait(self, timeout=-1):
+ """mt.wait(timeout=-1)
+
+ Wait for 0MQ to be done with the message or until `timeout`.
+
+ Parameters
+ ----------
+ timeout : float [default: -1, wait forever]
+ Maximum time in (s) to wait before raising NotDone.
+
+ Returns
+ -------
+ None
+ if done before `timeout`
+
+ Raises
+ ------
+ NotDone
+ if `timeout` reached before I am done.
+ """
+ tic = time.time()
+ if timeout is False or timeout < 0:
+ remaining = 3600*24*7 # a week
+ else:
+ remaining = timeout
+ done = False
+ for evt in self.events:
+ if remaining < 0:
+ raise NotDone
+ evt.wait(timeout=remaining)
+ if not evt.is_set():
+ raise NotDone
+ toc = time.time()
+ remaining -= (toc-tic)
+ tic = toc
+
+ for peer in self.peers:
+ if remaining < 0:
+ raise NotDone
+ peer.wait(timeout=remaining)
+ toc = time.time()
+ remaining -= (toc-tic)
+ tic = toc
+
+__all__ = ['MessageTracker'] \ No newline at end of file
diff --git a/scripts/external_libs/platform/fedora18/zmq/sugar/version.py b/scripts/external_libs/platform/fedora18/zmq/sugar/version.py
new file mode 100644
index 00000000..ea8fbbc4
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/sugar/version.py
@@ -0,0 +1,48 @@
+"""PyZMQ and 0MQ version functions."""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+from zmq.backend import zmq_version_info
+
+
+VERSION_MAJOR = 14
+VERSION_MINOR = 5
+VERSION_PATCH = 0
+VERSION_EXTRA = ""
+__version__ = '%i.%i.%i' % (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
+
+if VERSION_EXTRA:
+ __version__ = "%s-%s" % (__version__, VERSION_EXTRA)
+ version_info = (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, float('inf'))
+else:
+ version_info = (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
+
+__revision__ = ''
+
+def pyzmq_version():
+ """return the version of pyzmq as a string"""
+ if __revision__:
+ return '@'.join([__version__,__revision__[:6]])
+ else:
+ return __version__
+
+def pyzmq_version_info():
+ """return the pyzmq version as a tuple of at least three numbers
+
+ If pyzmq is a development version, `inf` will be appended after the third integer.
+ """
+ return version_info
+
+
+def zmq_version():
+ """return the version of libzmq as a string"""
+ return "%i.%i.%i" % zmq_version_info()
+
+
+__all__ = ['zmq_version', 'zmq_version_info',
+ 'pyzmq_version','pyzmq_version_info',
+ '__version__', '__revision__'
+]
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/__init__.py b/scripts/external_libs/platform/fedora18/zmq/tests/__init__.py
new file mode 100644
index 00000000..325a3f19
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/__init__.py
@@ -0,0 +1,211 @@
+# Copyright (c) PyZMQ Developers.
+# Distributed under the terms of the Modified BSD License.
+
+import functools
+import sys
+import time
+from threading import Thread
+
+from unittest import TestCase
+
+import zmq
+from zmq.utils import jsonapi
+
+try:
+ import gevent
+ from zmq import green as gzmq
+ have_gevent = True
+except ImportError:
+ have_gevent = False
+
+try:
+ from unittest import SkipTest
+except ImportError:
+ try:
+ from nose import SkipTest
+ except ImportError:
+ class SkipTest(Exception):
+ pass
+
+PYPY = 'PyPy' in sys.version
+
+#-----------------------------------------------------------------------------
+# skip decorators (directly from unittest)
+#-----------------------------------------------------------------------------
+
+_id = lambda x: x
+
+def skip(reason):
+ """
+ Unconditionally skip a test.
+ """
+ def decorator(test_item):
+ if not (isinstance(test_item, type) and issubclass(test_item, TestCase)):
+ @functools.wraps(test_item)
+ def skip_wrapper(*args, **kwargs):
+ raise SkipTest(reason)
+ test_item = skip_wrapper
+
+ test_item.__unittest_skip__ = True
+ test_item.__unittest_skip_why__ = reason
+ return test_item
+ return decorator
+
+def skip_if(condition, reason="Skipped"):
+ """
+ Skip a test if the condition is true.
+ """
+ if condition:
+ return skip(reason)
+ return _id
+
+skip_pypy = skip_if(PYPY, "Doesn't work on PyPy")
+
+#-----------------------------------------------------------------------------
+# Base test class
+#-----------------------------------------------------------------------------
+
+class BaseZMQTestCase(TestCase):
+ green = False
+
+ @property
+ def Context(self):
+ if self.green:
+ return gzmq.Context
+ else:
+ return zmq.Context
+
+ def socket(self, socket_type):
+ s = self.context.socket(socket_type)
+ self.sockets.append(s)
+ return s
+
+ def setUp(self):
+ if self.green and not have_gevent:
+ raise SkipTest("requires gevent")
+ self.context = self.Context.instance()
+ self.sockets = []
+
+ def tearDown(self):
+ contexts = set([self.context])
+ while self.sockets:
+ sock = self.sockets.pop()
+ contexts.add(sock.context) # in case additional contexts are created
+ sock.close(0)
+ for ctx in contexts:
+ t = Thread(target=ctx.term)
+ t.daemon = True
+ t.start()
+ t.join(timeout=2)
+ if t.is_alive():
+ # reset Context.instance, so the failure to term doesn't corrupt subsequent tests
+ zmq.sugar.context.Context._instance = None
+ raise RuntimeError("context could not terminate, open sockets likely remain in test")
+
+ def create_bound_pair(self, type1=zmq.PAIR, type2=zmq.PAIR, interface='tcp://127.0.0.1'):
+ """Create a bound socket pair using a random port."""
+ s1 = self.context.socket(type1)
+ s1.setsockopt(zmq.LINGER, 0)
+ port = s1.bind_to_random_port(interface)
+ s2 = self.context.socket(type2)
+ s2.setsockopt(zmq.LINGER, 0)
+ s2.connect('%s:%s' % (interface, port))
+ self.sockets.extend([s1,s2])
+ return s1, s2
+
+ def ping_pong(self, s1, s2, msg):
+ s1.send(msg)
+ msg2 = s2.recv()
+ s2.send(msg2)
+ msg3 = s1.recv()
+ return msg3
+
+ def ping_pong_json(self, s1, s2, o):
+ if jsonapi.jsonmod is None:
+ raise SkipTest("No json library")
+ s1.send_json(o)
+ o2 = s2.recv_json()
+ s2.send_json(o2)
+ o3 = s1.recv_json()
+ return o3
+
+ def ping_pong_pyobj(self, s1, s2, o):
+ s1.send_pyobj(o)
+ o2 = s2.recv_pyobj()
+ s2.send_pyobj(o2)
+ o3 = s1.recv_pyobj()
+ return o3
+
+ def assertRaisesErrno(self, errno, func, *args, **kwargs):
+ try:
+ func(*args, **kwargs)
+ except zmq.ZMQError as e:
+ self.assertEqual(e.errno, errno, "wrong error raised, expected '%s' \
+got '%s'" % (zmq.ZMQError(errno), zmq.ZMQError(e.errno)))
+ else:
+ self.fail("Function did not raise any error")
+
+ def _select_recv(self, multipart, socket, **kwargs):
+ """call recv[_multipart] in a way that raises if there is nothing to receive"""
+ if zmq.zmq_version_info() >= (3,1,0):
+ # zmq 3.1 has a bug, where poll can return false positives,
+ # so we wait a little bit just in case
+ # See LIBZMQ-280 on JIRA
+ time.sleep(0.1)
+
+ r,w,x = zmq.select([socket], [], [], timeout=5)
+ assert len(r) > 0, "Should have received a message"
+ kwargs['flags'] = zmq.DONTWAIT | kwargs.get('flags', 0)
+
+ recv = socket.recv_multipart if multipart else socket.recv
+ return recv(**kwargs)
+
+ def recv(self, socket, **kwargs):
+ """call recv in a way that raises if there is nothing to receive"""
+ return self._select_recv(False, socket, **kwargs)
+
+ def recv_multipart(self, socket, **kwargs):
+ """call recv_multipart in a way that raises if there is nothing to receive"""
+ return self._select_recv(True, socket, **kwargs)
+
+
+class PollZMQTestCase(BaseZMQTestCase):
+ pass
+
+class GreenTest:
+ """Mixin for making green versions of test classes"""
+ green = True
+
+ def assertRaisesErrno(self, errno, func, *args, **kwargs):
+ if errno == zmq.EAGAIN:
+ raise SkipTest("Skipping because we're green.")
+ try:
+ func(*args, **kwargs)
+ except zmq.ZMQError:
+ e = sys.exc_info()[1]
+ self.assertEqual(e.errno, errno, "wrong error raised, expected '%s' \
+got '%s'" % (zmq.ZMQError(errno), zmq.ZMQError(e.errno)))
+ else:
+ self.fail("Function did not raise any error")
+
+ def tearDown(self):
+ contexts = set([self.context])
+ while self.sockets:
+ sock = self.sockets.pop()
+ contexts.add(sock.context) # in case additional contexts are created
+ sock.close()
+ try:
+ gevent.joinall([gevent.spawn(ctx.term) for ctx in contexts], timeout=2, raise_error=True)
+ except gevent.Timeout:
+ raise RuntimeError("context could not terminate, open sockets likely remain in test")
+
+ def skip_green(self):
+ raise SkipTest("Skipping because we are green")
+
+def skip_green(f):
+ def skipping_test(self, *args, **kwargs):
+ if self.green:
+ raise SkipTest("Skipping because we are green")
+ else:
+ return f(self, *args, **kwargs)
+ return skipping_test
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_auth.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_auth.py
new file mode 100644
index 00000000..d350f61f
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_auth.py
@@ -0,0 +1,431 @@
+# -*- coding: utf8 -*-
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import logging
+import os
+import shutil
+import sys
+import tempfile
+
+import zmq.auth
+from zmq.auth.ioloop import IOLoopAuthenticator
+from zmq.auth.thread import ThreadAuthenticator
+
+from zmq.eventloop import ioloop, zmqstream
+from zmq.tests import (BaseZMQTestCase, SkipTest)
+
+class BaseAuthTestCase(BaseZMQTestCase):
+ def setUp(self):
+ if zmq.zmq_version_info() < (4,0):
+ raise SkipTest("security is new in libzmq 4.0")
+ try:
+ zmq.curve_keypair()
+ except zmq.ZMQError:
+ raise SkipTest("security requires libzmq to be linked against libsodium")
+ super(BaseAuthTestCase, self).setUp()
+ # enable debug logging while we run tests
+ logging.getLogger('zmq.auth').setLevel(logging.DEBUG)
+ self.auth = self.make_auth()
+ self.auth.start()
+ self.base_dir, self.public_keys_dir, self.secret_keys_dir = self.create_certs()
+
+ def make_auth(self):
+ raise NotImplementedError()
+
+ def tearDown(self):
+ if self.auth:
+ self.auth.stop()
+ self.auth = None
+ self.remove_certs(self.base_dir)
+ super(BaseAuthTestCase, self).tearDown()
+
+ def create_certs(self):
+ """Create CURVE certificates for a test"""
+
+ # Create temporary CURVE keypairs for this test run. We create all keys in a
+ # temp directory and then move them into the appropriate private or public
+ # directory.
+
+ base_dir = tempfile.mkdtemp()
+ keys_dir = os.path.join(base_dir, 'certificates')
+ public_keys_dir = os.path.join(base_dir, 'public_keys')
+ secret_keys_dir = os.path.join(base_dir, 'private_keys')
+
+ os.mkdir(keys_dir)
+ os.mkdir(public_keys_dir)
+ os.mkdir(secret_keys_dir)
+
+ server_public_file, server_secret_file = zmq.auth.create_certificates(keys_dir, "server")
+ client_public_file, client_secret_file = zmq.auth.create_certificates(keys_dir, "client")
+
+ for key_file in os.listdir(keys_dir):
+ if key_file.endswith(".key"):
+ shutil.move(os.path.join(keys_dir, key_file),
+ os.path.join(public_keys_dir, '.'))
+
+ for key_file in os.listdir(keys_dir):
+ if key_file.endswith(".key_secret"):
+ shutil.move(os.path.join(keys_dir, key_file),
+ os.path.join(secret_keys_dir, '.'))
+
+ return (base_dir, public_keys_dir, secret_keys_dir)
+
+ def remove_certs(self, base_dir):
+ """Remove certificates for a test"""
+ shutil.rmtree(base_dir)
+
+ def load_certs(self, secret_keys_dir):
+ """Return server and client certificate keys"""
+ server_secret_file = os.path.join(secret_keys_dir, "server.key_secret")
+ client_secret_file = os.path.join(secret_keys_dir, "client.key_secret")
+
+ server_public, server_secret = zmq.auth.load_certificate(server_secret_file)
+ client_public, client_secret = zmq.auth.load_certificate(client_secret_file)
+
+ return server_public, server_secret, client_public, client_secret
+
+
+class TestThreadAuthentication(BaseAuthTestCase):
+ """Test authentication running in a thread"""
+
+ def make_auth(self):
+ return ThreadAuthenticator(self.context)
+
+ def can_connect(self, server, client):
+ """Check if client can connect to server using tcp transport"""
+ result = False
+ iface = 'tcp://127.0.0.1'
+ port = server.bind_to_random_port(iface)
+ client.connect("%s:%i" % (iface, port))
+ msg = [b"Hello World"]
+ server.send_multipart(msg)
+ if client.poll(1000):
+ rcvd_msg = client.recv_multipart()
+ self.assertEqual(rcvd_msg, msg)
+ result = True
+ return result
+
+ def test_null(self):
+ """threaded auth - NULL"""
+ # A default NULL connection should always succeed, and not
+ # go through our authentication infrastructure at all.
+ self.auth.stop()
+ self.auth = None
+
+ server = self.socket(zmq.PUSH)
+ client = self.socket(zmq.PULL)
+ self.assertTrue(self.can_connect(server, client))
+
+ # By setting a domain we switch on authentication for NULL sockets,
+ # though no policies are configured yet. The client connection
+ # should still be allowed.
+ server = self.socket(zmq.PUSH)
+ server.zap_domain = b'global'
+ client = self.socket(zmq.PULL)
+ self.assertTrue(self.can_connect(server, client))
+
+ def test_blacklist(self):
+ """threaded auth - Blacklist"""
+ # Blacklist 127.0.0.1, connection should fail
+ self.auth.deny('127.0.0.1')
+ server = self.socket(zmq.PUSH)
+ # By setting a domain we switch on authentication for NULL sockets,
+ # though no policies are configured yet.
+ server.zap_domain = b'global'
+ client = self.socket(zmq.PULL)
+ self.assertFalse(self.can_connect(server, client))
+
+ def test_whitelist(self):
+ """threaded auth - Whitelist"""
+ # Whitelist 127.0.0.1, connection should pass"
+ self.auth.allow('127.0.0.1')
+ server = self.socket(zmq.PUSH)
+ # By setting a domain we switch on authentication for NULL sockets,
+ # though no policies are configured yet.
+ server.zap_domain = b'global'
+ client = self.socket(zmq.PULL)
+ self.assertTrue(self.can_connect(server, client))
+
+ def test_plain(self):
+ """threaded auth - PLAIN"""
+
+ # Try PLAIN authentication - without configuring server, connection should fail
+ server = self.socket(zmq.PUSH)
+ server.plain_server = True
+ client = self.socket(zmq.PULL)
+ client.plain_username = b'admin'
+ client.plain_password = b'Password'
+ self.assertFalse(self.can_connect(server, client))
+
+ # Try PLAIN authentication - with server configured, connection should pass
+ server = self.socket(zmq.PUSH)
+ server.plain_server = True
+ client = self.socket(zmq.PULL)
+ client.plain_username = b'admin'
+ client.plain_password = b'Password'
+ self.auth.configure_plain(domain='*', passwords={'admin': 'Password'})
+ self.assertTrue(self.can_connect(server, client))
+
+ # Try PLAIN authentication - with bogus credentials, connection should fail
+ server = self.socket(zmq.PUSH)
+ server.plain_server = True
+ client = self.socket(zmq.PULL)
+ client.plain_username = b'admin'
+ client.plain_password = b'Bogus'
+ self.assertFalse(self.can_connect(server, client))
+
+ # Remove authenticator and check that a normal connection works
+ self.auth.stop()
+ self.auth = None
+
+ server = self.socket(zmq.PUSH)
+ client = self.socket(zmq.PULL)
+ self.assertTrue(self.can_connect(server, client))
+ client.close()
+ server.close()
+
+ def test_curve(self):
+ """threaded auth - CURVE"""
+ self.auth.allow('127.0.0.1')
+ certs = self.load_certs(self.secret_keys_dir)
+ server_public, server_secret, client_public, client_secret = certs
+
+ #Try CURVE authentication - without configuring server, connection should fail
+ server = self.socket(zmq.PUSH)
+ server.curve_publickey = server_public
+ server.curve_secretkey = server_secret
+ server.curve_server = True
+ client = self.socket(zmq.PULL)
+ client.curve_publickey = client_public
+ client.curve_secretkey = client_secret
+ client.curve_serverkey = server_public
+ self.assertFalse(self.can_connect(server, client))
+
+ #Try CURVE authentication - with server configured to CURVE_ALLOW_ANY, connection should pass
+ self.auth.configure_curve(domain='*', location=zmq.auth.CURVE_ALLOW_ANY)
+ server = self.socket(zmq.PUSH)
+ server.curve_publickey = server_public
+ server.curve_secretkey = server_secret
+ server.curve_server = True
+ client = self.socket(zmq.PULL)
+ client.curve_publickey = client_public
+ client.curve_secretkey = client_secret
+ client.curve_serverkey = server_public
+ self.assertTrue(self.can_connect(server, client))
+
+ # Try CURVE authentication - with server configured, connection should pass
+ self.auth.configure_curve(domain='*', location=self.public_keys_dir)
+ server = self.socket(zmq.PUSH)
+ server.curve_publickey = server_public
+ server.curve_secretkey = server_secret
+ server.curve_server = True
+ client = self.socket(zmq.PULL)
+ client.curve_publickey = client_public
+ client.curve_secretkey = client_secret
+ client.curve_serverkey = server_public
+ self.assertTrue(self.can_connect(server, client))
+
+ # Remove authenticator and check that a normal connection works
+ self.auth.stop()
+ self.auth = None
+
+ # Try connecting using NULL and no authentication enabled, connection should pass
+ server = self.socket(zmq.PUSH)
+ client = self.socket(zmq.PULL)
+ self.assertTrue(self.can_connect(server, client))
+
+
+def with_ioloop(method, expect_success=True):
+ """decorator for running tests with an IOLoop"""
+ def test_method(self):
+ r = method(self)
+
+ loop = self.io_loop
+ if expect_success:
+ self.pullstream.on_recv(self.on_message_succeed)
+ else:
+ self.pullstream.on_recv(self.on_message_fail)
+
+ t = loop.time()
+ loop.add_callback(self.attempt_connection)
+ loop.add_callback(self.send_msg)
+ if expect_success:
+ loop.add_timeout(t + 1, self.on_test_timeout_fail)
+ else:
+ loop.add_timeout(t + 1, self.on_test_timeout_succeed)
+
+ loop.start()
+ if self.fail_msg:
+ self.fail(self.fail_msg)
+
+ return r
+ return test_method
+
+def should_auth(method):
+ return with_ioloop(method, True)
+
+def should_not_auth(method):
+ return with_ioloop(method, False)
+
+class TestIOLoopAuthentication(BaseAuthTestCase):
+ """Test authentication running in ioloop"""
+
+ def setUp(self):
+ self.fail_msg = None
+ self.io_loop = ioloop.IOLoop()
+ super(TestIOLoopAuthentication, self).setUp()
+ self.server = self.socket(zmq.PUSH)
+ self.client = self.socket(zmq.PULL)
+ self.pushstream = zmqstream.ZMQStream(self.server, self.io_loop)
+ self.pullstream = zmqstream.ZMQStream(self.client, self.io_loop)
+
+ def make_auth(self):
+ return IOLoopAuthenticator(self.context, io_loop=self.io_loop)
+
+ def tearDown(self):
+ if self.auth:
+ self.auth.stop()
+ self.auth = None
+ self.io_loop.close(all_fds=True)
+ super(TestIOLoopAuthentication, self).tearDown()
+
+ def attempt_connection(self):
+ """Check if client can connect to server using tcp transport"""
+ iface = 'tcp://127.0.0.1'
+ port = self.server.bind_to_random_port(iface)
+ self.client.connect("%s:%i" % (iface, port))
+
+ def send_msg(self):
+ """Send a message from server to a client"""
+ msg = [b"Hello World"]
+ self.pushstream.send_multipart(msg)
+
+ def on_message_succeed(self, frames):
+ """A message was received, as expected."""
+ if frames != [b"Hello World"]:
+ self.fail_msg = "Unexpected message received"
+ self.io_loop.stop()
+
+ def on_message_fail(self, frames):
+ """A message was received, unexpectedly."""
+ self.fail_msg = 'Received messaged unexpectedly, security failed'
+ self.io_loop.stop()
+
+ def on_test_timeout_succeed(self):
+ """Test timer expired, indicates test success"""
+ self.io_loop.stop()
+
+ def on_test_timeout_fail(self):
+ """Test timer expired, indicates test failure"""
+ self.fail_msg = 'Test timed out'
+ self.io_loop.stop()
+
+ @should_auth
+ def test_none(self):
+ """ioloop auth - NONE"""
+ # A default NULL connection should always succeed, and not
+ # go through our authentication infrastructure at all.
+ # no auth should be running
+ self.auth.stop()
+ self.auth = None
+
+ @should_auth
+ def test_null(self):
+ """ioloop auth - NULL"""
+ # By setting a domain we switch on authentication for NULL sockets,
+ # though no policies are configured yet. The client connection
+ # should still be allowed.
+ self.server.zap_domain = b'global'
+
+ @should_not_auth
+ def test_blacklist(self):
+ """ioloop auth - Blacklist"""
+ # Blacklist 127.0.0.1, connection should fail
+ self.auth.deny('127.0.0.1')
+ self.server.zap_domain = b'global'
+
+ @should_auth
+ def test_whitelist(self):
+ """ioloop auth - Whitelist"""
+ # Whitelist 127.0.0.1, which overrides the blacklist, connection should pass"
+ self.auth.allow('127.0.0.1')
+
+ self.server.setsockopt(zmq.ZAP_DOMAIN, b'global')
+
+ @should_not_auth
+ def test_plain_unconfigured_server(self):
+ """ioloop auth - PLAIN, unconfigured server"""
+ self.client.plain_username = b'admin'
+ self.client.plain_password = b'Password'
+ # Try PLAIN authentication - without configuring server, connection should fail
+ self.server.plain_server = True
+
+ @should_auth
+ def test_plain_configured_server(self):
+ """ioloop auth - PLAIN, configured server"""
+ self.client.plain_username = b'admin'
+ self.client.plain_password = b'Password'
+ # Try PLAIN authentication - with server configured, connection should pass
+ self.server.plain_server = True
+ self.auth.configure_plain(domain='*', passwords={'admin': 'Password'})
+
+ @should_not_auth
+ def test_plain_bogus_credentials(self):
+ """ioloop auth - PLAIN, bogus credentials"""
+ self.client.plain_username = b'admin'
+ self.client.plain_password = b'Bogus'
+ self.server.plain_server = True
+
+ self.auth.configure_plain(domain='*', passwords={'admin': 'Password'})
+
+ @should_not_auth
+ def test_curve_unconfigured_server(self):
+ """ioloop auth - CURVE, unconfigured server"""
+ certs = self.load_certs(self.secret_keys_dir)
+ server_public, server_secret, client_public, client_secret = certs
+
+ self.auth.allow('127.0.0.1')
+
+ self.server.curve_publickey = server_public
+ self.server.curve_secretkey = server_secret
+ self.server.curve_server = True
+
+ self.client.curve_publickey = client_public
+ self.client.curve_secretkey = client_secret
+ self.client.curve_serverkey = server_public
+
+ @should_auth
+ def test_curve_allow_any(self):
+ """ioloop auth - CURVE, CURVE_ALLOW_ANY"""
+ certs = self.load_certs(self.secret_keys_dir)
+ server_public, server_secret, client_public, client_secret = certs
+
+ self.auth.allow('127.0.0.1')
+ self.auth.configure_curve(domain='*', location=zmq.auth.CURVE_ALLOW_ANY)
+
+ self.server.curve_publickey = server_public
+ self.server.curve_secretkey = server_secret
+ self.server.curve_server = True
+
+ self.client.curve_publickey = client_public
+ self.client.curve_secretkey = client_secret
+ self.client.curve_serverkey = server_public
+
+ @should_auth
+ def test_curve_configured_server(self):
+ """ioloop auth - CURVE, configured server"""
+ self.auth.allow('127.0.0.1')
+ certs = self.load_certs(self.secret_keys_dir)
+ server_public, server_secret, client_public, client_secret = certs
+
+ self.auth.configure_curve(domain='*', location=self.public_keys_dir)
+
+ self.server.curve_publickey = server_public
+ self.server.curve_secretkey = server_secret
+ self.server.curve_server = True
+
+ self.client.curve_publickey = client_public
+ self.client.curve_secretkey = client_secret
+ self.client.curve_serverkey = server_public
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_cffi_backend.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_cffi_backend.py
new file mode 100644
index 00000000..1f85eebf
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_cffi_backend.py
@@ -0,0 +1,310 @@
+# -*- coding: utf8 -*-
+
+import sys
+import time
+
+from unittest import TestCase
+
+from zmq.tests import BaseZMQTestCase, SkipTest
+
+try:
+ from zmq.backend.cffi import (
+ zmq_version_info,
+ PUSH, PULL, IDENTITY,
+ REQ, REP, POLLIN, POLLOUT,
+ )
+ from zmq.backend.cffi._cffi import ffi, C
+ have_ffi_backend = True
+except ImportError:
+ have_ffi_backend = False
+
+
+class TestCFFIBackend(TestCase):
+
+ def setUp(self):
+ if not have_ffi_backend or not 'PyPy' in sys.version:
+ raise SkipTest('PyPy Tests Only')
+
+ def test_zmq_version_info(self):
+ version = zmq_version_info()
+
+ assert version[0] in range(2,11)
+
+ def test_zmq_ctx_new_destroy(self):
+ ctx = C.zmq_ctx_new()
+
+ assert ctx != ffi.NULL
+ assert 0 == C.zmq_ctx_destroy(ctx)
+
+ def test_zmq_socket_open_close(self):
+ ctx = C.zmq_ctx_new()
+ socket = C.zmq_socket(ctx, PUSH)
+
+ assert ctx != ffi.NULL
+ assert ffi.NULL != socket
+ assert 0 == C.zmq_close(socket)
+ assert 0 == C.zmq_ctx_destroy(ctx)
+
+ def test_zmq_setsockopt(self):
+ ctx = C.zmq_ctx_new()
+ socket = C.zmq_socket(ctx, PUSH)
+
+ identity = ffi.new('char[3]', 'zmq')
+ ret = C.zmq_setsockopt(socket, IDENTITY, ffi.cast('void*', identity), 3)
+
+ assert ret == 0
+ assert ctx != ffi.NULL
+ assert ffi.NULL != socket
+ assert 0 == C.zmq_close(socket)
+ assert 0 == C.zmq_ctx_destroy(ctx)
+
+ def test_zmq_getsockopt(self):
+ ctx = C.zmq_ctx_new()
+ socket = C.zmq_socket(ctx, PUSH)
+
+ identity = ffi.new('char[]', 'zmq')
+ ret = C.zmq_setsockopt(socket, IDENTITY, ffi.cast('void*', identity), 3)
+ assert ret == 0
+
+ option_len = ffi.new('size_t*', 3)
+ option = ffi.new('char*')
+ ret = C.zmq_getsockopt(socket,
+ IDENTITY,
+ ffi.cast('void*', option),
+ option_len)
+
+ assert ret == 0
+ assert ffi.string(ffi.cast('char*', option))[0] == "z"
+ assert ffi.string(ffi.cast('char*', option))[1] == "m"
+ assert ffi.string(ffi.cast('char*', option))[2] == "q"
+ assert ctx != ffi.NULL
+ assert ffi.NULL != socket
+ assert 0 == C.zmq_close(socket)
+ assert 0 == C.zmq_ctx_destroy(ctx)
+
+ def test_zmq_bind(self):
+ ctx = C.zmq_ctx_new()
+ socket = C.zmq_socket(ctx, 8)
+
+ assert 0 == C.zmq_bind(socket, 'tcp://*:4444')
+ assert ctx != ffi.NULL
+ assert ffi.NULL != socket
+ assert 0 == C.zmq_close(socket)
+ assert 0 == C.zmq_ctx_destroy(ctx)
+
+ def test_zmq_bind_connect(self):
+ ctx = C.zmq_ctx_new()
+
+ socket1 = C.zmq_socket(ctx, PUSH)
+ socket2 = C.zmq_socket(ctx, PULL)
+
+ assert 0 == C.zmq_bind(socket1, 'tcp://*:4444')
+ assert 0 == C.zmq_connect(socket2, 'tcp://127.0.0.1:4444')
+ assert ctx != ffi.NULL
+ assert ffi.NULL != socket1
+ assert ffi.NULL != socket2
+ assert 0 == C.zmq_close(socket1)
+ assert 0 == C.zmq_close(socket2)
+ assert 0 == C.zmq_ctx_destroy(ctx)
+
+ def test_zmq_msg_init_close(self):
+ zmq_msg = ffi.new('zmq_msg_t*')
+
+ assert ffi.NULL != zmq_msg
+ assert 0 == C.zmq_msg_init(zmq_msg)
+ assert 0 == C.zmq_msg_close(zmq_msg)
+
+ def test_zmq_msg_init_size(self):
+ zmq_msg = ffi.new('zmq_msg_t*')
+
+ assert ffi.NULL != zmq_msg
+ assert 0 == C.zmq_msg_init_size(zmq_msg, 10)
+ assert 0 == C.zmq_msg_close(zmq_msg)
+
+ def test_zmq_msg_init_data(self):
+ zmq_msg = ffi.new('zmq_msg_t*')
+ message = ffi.new('char[5]', 'Hello')
+
+ assert 0 == C.zmq_msg_init_data(zmq_msg,
+ ffi.cast('void*', message),
+ 5,
+ ffi.NULL,
+ ffi.NULL)
+
+ assert ffi.NULL != zmq_msg
+ assert 0 == C.zmq_msg_close(zmq_msg)
+
+ def test_zmq_msg_data(self):
+ zmq_msg = ffi.new('zmq_msg_t*')
+ message = ffi.new('char[]', 'Hello')
+ assert 0 == C.zmq_msg_init_data(zmq_msg,
+ ffi.cast('void*', message),
+ 5,
+ ffi.NULL,
+ ffi.NULL)
+
+ data = C.zmq_msg_data(zmq_msg)
+
+ assert ffi.NULL != zmq_msg
+ assert ffi.string(ffi.cast("char*", data)) == 'Hello'
+ assert 0 == C.zmq_msg_close(zmq_msg)
+
+
+ def test_zmq_send(self):
+ ctx = C.zmq_ctx_new()
+
+ sender = C.zmq_socket(ctx, REQ)
+ receiver = C.zmq_socket(ctx, REP)
+
+ assert 0 == C.zmq_bind(receiver, 'tcp://*:7777')
+ assert 0 == C.zmq_connect(sender, 'tcp://127.0.0.1:7777')
+
+ time.sleep(0.1)
+
+ zmq_msg = ffi.new('zmq_msg_t*')
+ message = ffi.new('char[5]', 'Hello')
+
+ C.zmq_msg_init_data(zmq_msg,
+ ffi.cast('void*', message),
+ ffi.cast('size_t', 5),
+ ffi.NULL,
+ ffi.NULL)
+
+ assert 5 == C.zmq_msg_send(zmq_msg, sender, 0)
+ assert 0 == C.zmq_msg_close(zmq_msg)
+ assert C.zmq_close(sender) == 0
+ assert C.zmq_close(receiver) == 0
+ assert C.zmq_ctx_destroy(ctx) == 0
+
+ def test_zmq_recv(self):
+ ctx = C.zmq_ctx_new()
+
+ sender = C.zmq_socket(ctx, REQ)
+ receiver = C.zmq_socket(ctx, REP)
+
+ assert 0 == C.zmq_bind(receiver, 'tcp://*:2222')
+ assert 0 == C.zmq_connect(sender, 'tcp://127.0.0.1:2222')
+
+ time.sleep(0.1)
+
+ zmq_msg = ffi.new('zmq_msg_t*')
+ message = ffi.new('char[5]', 'Hello')
+
+ C.zmq_msg_init_data(zmq_msg,
+ ffi.cast('void*', message),
+ ffi.cast('size_t', 5),
+ ffi.NULL,
+ ffi.NULL)
+
+ zmq_msg2 = ffi.new('zmq_msg_t*')
+ C.zmq_msg_init(zmq_msg2)
+
+ assert 5 == C.zmq_msg_send(zmq_msg, sender, 0)
+ assert 5 == C.zmq_msg_recv(zmq_msg2, receiver, 0)
+ assert 5 == C.zmq_msg_size(zmq_msg2)
+ assert b"Hello" == ffi.buffer(C.zmq_msg_data(zmq_msg2),
+ C.zmq_msg_size(zmq_msg2))[:]
+ assert C.zmq_close(sender) == 0
+ assert C.zmq_close(receiver) == 0
+ assert C.zmq_ctx_destroy(ctx) == 0
+
+ def test_zmq_poll(self):
+ ctx = C.zmq_ctx_new()
+
+ sender = C.zmq_socket(ctx, REQ)
+ receiver = C.zmq_socket(ctx, REP)
+
+ r1 = C.zmq_bind(receiver, 'tcp://*:3333')
+ r2 = C.zmq_connect(sender, 'tcp://127.0.0.1:3333')
+
+ zmq_msg = ffi.new('zmq_msg_t*')
+ message = ffi.new('char[5]', 'Hello')
+
+ C.zmq_msg_init_data(zmq_msg,
+ ffi.cast('void*', message),
+ ffi.cast('size_t', 5),
+ ffi.NULL,
+ ffi.NULL)
+
+ receiver_pollitem = ffi.new('zmq_pollitem_t*')
+ receiver_pollitem.socket = receiver
+ receiver_pollitem.fd = 0
+ receiver_pollitem.events = POLLIN | POLLOUT
+ receiver_pollitem.revents = 0
+
+ ret = C.zmq_poll(ffi.NULL, 0, 0)
+ assert ret == 0
+
+ ret = C.zmq_poll(receiver_pollitem, 1, 0)
+ assert ret == 0
+
+ ret = C.zmq_msg_send(zmq_msg, sender, 0)
+ print(ffi.string(C.zmq_strerror(C.zmq_errno())))
+ assert ret == 5
+
+ time.sleep(0.2)
+
+ ret = C.zmq_poll(receiver_pollitem, 1, 0)
+ assert ret == 1
+
+ assert int(receiver_pollitem.revents) & POLLIN
+ assert not int(receiver_pollitem.revents) & POLLOUT
+
+ zmq_msg2 = ffi.new('zmq_msg_t*')
+ C.zmq_msg_init(zmq_msg2)
+
+ ret_recv = C.zmq_msg_recv(zmq_msg2, receiver, 0)
+ assert ret_recv == 5
+
+ assert 5 == C.zmq_msg_size(zmq_msg2)
+ assert b"Hello" == ffi.buffer(C.zmq_msg_data(zmq_msg2),
+ C.zmq_msg_size(zmq_msg2))[:]
+
+ sender_pollitem = ffi.new('zmq_pollitem_t*')
+ sender_pollitem.socket = sender
+ sender_pollitem.fd = 0
+ sender_pollitem.events = POLLIN | POLLOUT
+ sender_pollitem.revents = 0
+
+ ret = C.zmq_poll(sender_pollitem, 1, 0)
+ assert ret == 0
+
+ zmq_msg_again = ffi.new('zmq_msg_t*')
+ message_again = ffi.new('char[11]', 'Hello Again')
+
+ C.zmq_msg_init_data(zmq_msg_again,
+ ffi.cast('void*', message_again),
+ ffi.cast('size_t', 11),
+ ffi.NULL,
+ ffi.NULL)
+
+ assert 11 == C.zmq_msg_send(zmq_msg_again, receiver, 0)
+
+ time.sleep(0.2)
+
+ assert 0 <= C.zmq_poll(sender_pollitem, 1, 0)
+ assert int(sender_pollitem.revents) & POLLIN
+ assert 11 == C.zmq_msg_recv(zmq_msg2, sender, 0)
+ assert 11 == C.zmq_msg_size(zmq_msg2)
+ assert b"Hello Again" == ffi.buffer(C.zmq_msg_data(zmq_msg2),
+ int(C.zmq_msg_size(zmq_msg2)))[:]
+ assert 0 == C.zmq_close(sender)
+ assert 0 == C.zmq_close(receiver)
+ assert 0 == C.zmq_ctx_destroy(ctx)
+ assert 0 == C.zmq_msg_close(zmq_msg)
+ assert 0 == C.zmq_msg_close(zmq_msg2)
+ assert 0 == C.zmq_msg_close(zmq_msg_again)
+
+ def test_zmq_stopwatch_functions(self):
+ stopwatch = C.zmq_stopwatch_start()
+ ret = C.zmq_stopwatch_stop(stopwatch)
+
+ assert ffi.NULL != stopwatch
+ assert 0 < int(ret)
+
+ def test_zmq_sleep(self):
+ try:
+ C.zmq_sleep(1)
+ except Exception as e:
+ raise AssertionError("Error executing zmq_sleep(int)")
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_constants.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_constants.py
new file mode 100644
index 00000000..d32b2b48
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_constants.py
@@ -0,0 +1,104 @@
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import json
+from unittest import TestCase
+
+import zmq
+
+from zmq.utils import constant_names
+from zmq.sugar import constants as sugar_constants
+from zmq.backend import constants as backend_constants
+
+all_set = set(constant_names.all_names)
+
+class TestConstants(TestCase):
+
+ def _duplicate_test(self, namelist, listname):
+ """test that a given list has no duplicates"""
+ dupes = {}
+ for name in set(namelist):
+ cnt = namelist.count(name)
+ if cnt > 1:
+ dupes[name] = cnt
+ if dupes:
+ self.fail("The following names occur more than once in %s: %s" % (listname, json.dumps(dupes, indent=2)))
+
+ def test_duplicate_all(self):
+ return self._duplicate_test(constant_names.all_names, "all_names")
+
+ def _change_key(self, change, version):
+ """return changed-in key"""
+ return "%s-in %d.%d.%d" % tuple([change] + list(version))
+
+ def test_duplicate_changed(self):
+ all_changed = []
+ for change in ("new", "removed"):
+ d = getattr(constant_names, change + "_in")
+ for version, namelist in d.items():
+ all_changed.extend(namelist)
+ self._duplicate_test(namelist, self._change_key(change, version))
+
+ self._duplicate_test(all_changed, "all-changed")
+
+ def test_changed_in_all(self):
+ missing = {}
+ for change in ("new", "removed"):
+ d = getattr(constant_names, change + "_in")
+ for version, namelist in d.items():
+ key = self._change_key(change, version)
+ for name in namelist:
+ if name not in all_set:
+ if key not in missing:
+ missing[key] = []
+ missing[key].append(name)
+
+ if missing:
+ self.fail(
+ "The following names are missing in `all_names`: %s" % json.dumps(missing, indent=2)
+ )
+
+ def test_no_negative_constants(self):
+ for name in sugar_constants.__all__:
+ self.assertNotEqual(getattr(zmq, name), sugar_constants._UNDEFINED)
+
+ def test_undefined_constants(self):
+ all_aliases = []
+ for alias_group in sugar_constants.aliases:
+ all_aliases.extend(alias_group)
+
+ for name in all_set.difference(all_aliases):
+ raw = getattr(backend_constants, name)
+ if raw == sugar_constants._UNDEFINED:
+ self.assertRaises(AttributeError, getattr, zmq, name)
+ else:
+ self.assertEqual(getattr(zmq, name), raw)
+
+ def test_new(self):
+ zmq_version = zmq.zmq_version_info()
+ for version, new_names in constant_names.new_in.items():
+ should_have = zmq_version >= version
+ for name in new_names:
+ try:
+ value = getattr(zmq, name)
+ except AttributeError:
+ if should_have:
+ self.fail("AttributeError: zmq.%s" % name)
+ else:
+ if not should_have:
+ self.fail("Shouldn't have: zmq.%s=%s" % (name, value))
+
+ def test_removed(self):
+ zmq_version = zmq.zmq_version_info()
+ for version, new_names in constant_names.removed_in.items():
+ should_have = zmq_version < version
+ for name in new_names:
+ try:
+ value = getattr(zmq, name)
+ except AttributeError:
+ if should_have:
+ self.fail("AttributeError: zmq.%s" % name)
+ else:
+ if not should_have:
+ self.fail("Shouldn't have: zmq.%s=%s" % (name, value))
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_context.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_context.py
new file mode 100644
index 00000000..e3280778
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_context.py
@@ -0,0 +1,257 @@
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import gc
+import sys
+import time
+from threading import Thread, Event
+
+import zmq
+from zmq.tests import (
+ BaseZMQTestCase, have_gevent, GreenTest, skip_green, PYPY, SkipTest,
+)
+
+
+class TestContext(BaseZMQTestCase):
+
+ def test_init(self):
+ c1 = self.Context()
+ self.assert_(isinstance(c1, self.Context))
+ del c1
+ c2 = self.Context()
+ self.assert_(isinstance(c2, self.Context))
+ del c2
+ c3 = self.Context()
+ self.assert_(isinstance(c3, self.Context))
+ del c3
+
+ def test_dir(self):
+ ctx = self.Context()
+ self.assertTrue('socket' in dir(ctx))
+ if zmq.zmq_version_info() > (3,):
+ self.assertTrue('IO_THREADS' in dir(ctx))
+ ctx.term()
+
+ def test_term(self):
+ c = self.Context()
+ c.term()
+ self.assert_(c.closed)
+
+ def test_context_manager(self):
+ with self.Context() as c:
+ pass
+ self.assert_(c.closed)
+
+ def test_fail_init(self):
+ self.assertRaisesErrno(zmq.EINVAL, self.Context, -1)
+
+ def test_term_hang(self):
+ rep,req = self.create_bound_pair(zmq.ROUTER, zmq.DEALER)
+ req.setsockopt(zmq.LINGER, 0)
+ req.send(b'hello', copy=False)
+ req.close()
+ rep.close()
+ self.context.term()
+
+ def test_instance(self):
+ ctx = self.Context.instance()
+ c2 = self.Context.instance(io_threads=2)
+ self.assertTrue(c2 is ctx)
+ c2.term()
+ c3 = self.Context.instance()
+ c4 = self.Context.instance()
+ self.assertFalse(c3 is c2)
+ self.assertFalse(c3.closed)
+ self.assertTrue(c3 is c4)
+
+ def test_many_sockets(self):
+ """opening and closing many sockets shouldn't cause problems"""
+ ctx = self.Context()
+ for i in range(16):
+ sockets = [ ctx.socket(zmq.REP) for i in range(65) ]
+ [ s.close() for s in sockets ]
+ # give the reaper a chance
+ time.sleep(1e-2)
+ ctx.term()
+
+ def test_sockopts(self):
+ """setting socket options with ctx attributes"""
+ ctx = self.Context()
+ ctx.linger = 5
+ self.assertEqual(ctx.linger, 5)
+ s = ctx.socket(zmq.REQ)
+ self.assertEqual(s.linger, 5)
+ self.assertEqual(s.getsockopt(zmq.LINGER), 5)
+ s.close()
+ # check that subscribe doesn't get set on sockets that don't subscribe:
+ ctx.subscribe = b''
+ s = ctx.socket(zmq.REQ)
+ s.close()
+
+ ctx.term()
+
+
+ def test_destroy(self):
+ """Context.destroy should close sockets"""
+ ctx = self.Context()
+ sockets = [ ctx.socket(zmq.REP) for i in range(65) ]
+
+ # close half of the sockets
+ [ s.close() for s in sockets[::2] ]
+
+ ctx.destroy()
+ # reaper is not instantaneous
+ time.sleep(1e-2)
+ for s in sockets:
+ self.assertTrue(s.closed)
+
+ def test_destroy_linger(self):
+ """Context.destroy should set linger on closing sockets"""
+ req,rep = self.create_bound_pair(zmq.REQ, zmq.REP)
+ req.send(b'hi')
+ time.sleep(1e-2)
+ self.context.destroy(linger=0)
+ # reaper is not instantaneous
+ time.sleep(1e-2)
+ for s in (req,rep):
+ self.assertTrue(s.closed)
+
+ def test_term_noclose(self):
+ """Context.term won't close sockets"""
+ ctx = self.Context()
+ s = ctx.socket(zmq.REQ)
+ self.assertFalse(s.closed)
+ t = Thread(target=ctx.term)
+ t.start()
+ t.join(timeout=0.1)
+ self.assertTrue(t.is_alive(), "Context should be waiting")
+ s.close()
+ t.join(timeout=0.1)
+ self.assertFalse(t.is_alive(), "Context should have closed")
+
+ def test_gc(self):
+ """test close&term by garbage collection alone"""
+ if PYPY:
+ raise SkipTest("GC doesn't work ")
+
+ # test credit @dln (GH #137):
+ def gcf():
+ def inner():
+ ctx = self.Context()
+ s = ctx.socket(zmq.PUSH)
+ inner()
+ gc.collect()
+ t = Thread(target=gcf)
+ t.start()
+ t.join(timeout=1)
+ self.assertFalse(t.is_alive(), "Garbage collection should have cleaned up context")
+
+ def test_cyclic_destroy(self):
+ """ctx.destroy should succeed when cyclic ref prevents gc"""
+ # test credit @dln (GH #137):
+ class CyclicReference(object):
+ def __init__(self, parent=None):
+ self.parent = parent
+
+ def crash(self, sock):
+ self.sock = sock
+ self.child = CyclicReference(self)
+
+ def crash_zmq():
+ ctx = self.Context()
+ sock = ctx.socket(zmq.PULL)
+ c = CyclicReference()
+ c.crash(sock)
+ ctx.destroy()
+
+ crash_zmq()
+
+ def test_term_thread(self):
+ """ctx.term should not crash active threads (#139)"""
+ ctx = self.Context()
+ evt = Event()
+ evt.clear()
+
+ def block():
+ s = ctx.socket(zmq.REP)
+ s.bind_to_random_port('tcp://127.0.0.1')
+ evt.set()
+ try:
+ s.recv()
+ except zmq.ZMQError as e:
+ self.assertEqual(e.errno, zmq.ETERM)
+ return
+ finally:
+ s.close()
+ self.fail("recv should have been interrupted with ETERM")
+ t = Thread(target=block)
+ t.start()
+
+ evt.wait(1)
+ self.assertTrue(evt.is_set(), "sync event never fired")
+ time.sleep(0.01)
+ ctx.term()
+ t.join(timeout=1)
+ self.assertFalse(t.is_alive(), "term should have interrupted s.recv()")
+
+ def test_destroy_no_sockets(self):
+ ctx = self.Context()
+ s = ctx.socket(zmq.PUB)
+ s.bind_to_random_port('tcp://127.0.0.1')
+ s.close()
+ ctx.destroy()
+ assert s.closed
+ assert ctx.closed
+
+ def test_ctx_opts(self):
+ if zmq.zmq_version_info() < (3,):
+ raise SkipTest("context options require libzmq 3")
+ ctx = self.Context()
+ ctx.set(zmq.MAX_SOCKETS, 2)
+ self.assertEqual(ctx.get(zmq.MAX_SOCKETS), 2)
+ ctx.max_sockets = 100
+ self.assertEqual(ctx.max_sockets, 100)
+ self.assertEqual(ctx.get(zmq.MAX_SOCKETS), 100)
+
+ def test_shadow(self):
+ ctx = self.Context()
+ ctx2 = self.Context.shadow(ctx.underlying)
+ self.assertEqual(ctx.underlying, ctx2.underlying)
+ s = ctx.socket(zmq.PUB)
+ s.close()
+ del ctx2
+ self.assertFalse(ctx.closed)
+ s = ctx.socket(zmq.PUB)
+ ctx2 = self.Context.shadow(ctx.underlying)
+ s2 = ctx2.socket(zmq.PUB)
+ s.close()
+ s2.close()
+ ctx.term()
+ self.assertRaisesErrno(zmq.EFAULT, ctx2.socket, zmq.PUB)
+ del ctx2
+
+ def test_shadow_pyczmq(self):
+ try:
+ from pyczmq import zctx, zsocket, zstr
+ except Exception:
+ raise SkipTest("Requires pyczmq")
+
+ ctx = zctx.new()
+ a = zsocket.new(ctx, zmq.PUSH)
+ zsocket.bind(a, "inproc://a")
+ ctx2 = self.Context.shadow_pyczmq(ctx)
+ b = ctx2.socket(zmq.PULL)
+ b.connect("inproc://a")
+ zstr.send(a, b'hi')
+ rcvd = self.recv(b)
+ self.assertEqual(rcvd, b'hi')
+ b.close()
+
+
+if False: # disable green context tests
+ class TestContextGreen(GreenTest, TestContext):
+ """gevent subclass of context tests"""
+ # skip tests that use real threads:
+ test_gc = GreenTest.skip_green
+ test_term_thread = GreenTest.skip_green
+ test_destroy_linger = GreenTest.skip_green
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_device.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_device.py
new file mode 100644
index 00000000..f8305074
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_device.py
@@ -0,0 +1,146 @@
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import time
+
+import zmq
+from zmq import devices
+from zmq.tests import BaseZMQTestCase, SkipTest, have_gevent, GreenTest, PYPY
+from zmq.utils.strtypes import (bytes,unicode,basestring)
+
+if PYPY:
+ # cleanup of shared Context doesn't work on PyPy
+ devices.Device.context_factory = zmq.Context
+
+class TestDevice(BaseZMQTestCase):
+
+ def test_device_types(self):
+ for devtype in (zmq.STREAMER, zmq.FORWARDER, zmq.QUEUE):
+ dev = devices.Device(devtype, zmq.PAIR, zmq.PAIR)
+ self.assertEqual(dev.device_type, devtype)
+ del dev
+
+ def test_device_attributes(self):
+ dev = devices.Device(zmq.QUEUE, zmq.SUB, zmq.PUB)
+ self.assertEqual(dev.in_type, zmq.SUB)
+ self.assertEqual(dev.out_type, zmq.PUB)
+ self.assertEqual(dev.device_type, zmq.QUEUE)
+ self.assertEqual(dev.daemon, True)
+ del dev
+
+ def test_tsdevice_attributes(self):
+ dev = devices.Device(zmq.QUEUE, zmq.SUB, zmq.PUB)
+ self.assertEqual(dev.in_type, zmq.SUB)
+ self.assertEqual(dev.out_type, zmq.PUB)
+ self.assertEqual(dev.device_type, zmq.QUEUE)
+ self.assertEqual(dev.daemon, True)
+ del dev
+
+
+ def test_single_socket_forwarder_connect(self):
+ dev = devices.ThreadDevice(zmq.QUEUE, zmq.REP, -1)
+ req = self.context.socket(zmq.REQ)
+ port = req.bind_to_random_port('tcp://127.0.0.1')
+ dev.connect_in('tcp://127.0.0.1:%i'%port)
+ dev.start()
+ time.sleep(.25)
+ msg = b'hello'
+ req.send(msg)
+ self.assertEqual(msg, self.recv(req))
+ del dev
+ req.close()
+ dev = devices.ThreadDevice(zmq.QUEUE, zmq.REP, -1)
+ req = self.context.socket(zmq.REQ)
+ port = req.bind_to_random_port('tcp://127.0.0.1')
+ dev.connect_out('tcp://127.0.0.1:%i'%port)
+ dev.start()
+ time.sleep(.25)
+ msg = b'hello again'
+ req.send(msg)
+ self.assertEqual(msg, self.recv(req))
+ del dev
+ req.close()
+
+ def test_single_socket_forwarder_bind(self):
+ dev = devices.ThreadDevice(zmq.QUEUE, zmq.REP, -1)
+ # select random port:
+ binder = self.context.socket(zmq.REQ)
+ port = binder.bind_to_random_port('tcp://127.0.0.1')
+ binder.close()
+ time.sleep(0.1)
+ req = self.context.socket(zmq.REQ)
+ req.connect('tcp://127.0.0.1:%i'%port)
+ dev.bind_in('tcp://127.0.0.1:%i'%port)
+ dev.start()
+ time.sleep(.25)
+ msg = b'hello'
+ req.send(msg)
+ self.assertEqual(msg, self.recv(req))
+ del dev
+ req.close()
+ dev = devices.ThreadDevice(zmq.QUEUE, zmq.REP, -1)
+ # select random port:
+ binder = self.context.socket(zmq.REQ)
+ port = binder.bind_to_random_port('tcp://127.0.0.1')
+ binder.close()
+ time.sleep(0.1)
+ req = self.context.socket(zmq.REQ)
+ req.connect('tcp://127.0.0.1:%i'%port)
+ dev.bind_in('tcp://127.0.0.1:%i'%port)
+ dev.start()
+ time.sleep(.25)
+ msg = b'hello again'
+ req.send(msg)
+ self.assertEqual(msg, self.recv(req))
+ del dev
+ req.close()
+
+ def test_proxy(self):
+ if zmq.zmq_version_info() < (3,2):
+ raise SkipTest("Proxies only in libzmq >= 3")
+ dev = devices.ThreadProxy(zmq.PULL, zmq.PUSH, zmq.PUSH)
+ binder = self.context.socket(zmq.REQ)
+ iface = 'tcp://127.0.0.1'
+ port = binder.bind_to_random_port(iface)
+ port2 = binder.bind_to_random_port(iface)
+ port3 = binder.bind_to_random_port(iface)
+ binder.close()
+ time.sleep(0.1)
+ dev.bind_in("%s:%i" % (iface, port))
+ dev.bind_out("%s:%i" % (iface, port2))
+ dev.bind_mon("%s:%i" % (iface, port3))
+ dev.start()
+ time.sleep(0.25)
+ msg = b'hello'
+ push = self.context.socket(zmq.PUSH)
+ push.connect("%s:%i" % (iface, port))
+ pull = self.context.socket(zmq.PULL)
+ pull.connect("%s:%i" % (iface, port2))
+ mon = self.context.socket(zmq.PULL)
+ mon.connect("%s:%i" % (iface, port3))
+ push.send(msg)
+ self.sockets.extend([push, pull, mon])
+ self.assertEqual(msg, self.recv(pull))
+ self.assertEqual(msg, self.recv(mon))
+
+if have_gevent:
+ import gevent
+ import zmq.green
+
+ class TestDeviceGreen(GreenTest, BaseZMQTestCase):
+
+ def test_green_device(self):
+ rep = self.context.socket(zmq.REP)
+ req = self.context.socket(zmq.REQ)
+ self.sockets.extend([req, rep])
+ port = rep.bind_to_random_port('tcp://127.0.0.1')
+ g = gevent.spawn(zmq.green.device, zmq.QUEUE, rep, rep)
+ req.connect('tcp://127.0.0.1:%i' % port)
+ req.send(b'hi')
+ timeout = gevent.Timeout(3)
+ timeout.start()
+ receiver = gevent.spawn(req.recv)
+ self.assertEqual(receiver.get(2), b'hi')
+ timeout.cancel()
+ g.kill(block=True)
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_error.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_error.py
new file mode 100644
index 00000000..a2eee14a
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_error.py
@@ -0,0 +1,43 @@
+# -*- coding: utf8 -*-
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import sys
+import time
+
+import zmq
+from zmq import ZMQError, strerror, Again, ContextTerminated
+from zmq.tests import BaseZMQTestCase
+
+if sys.version_info[0] >= 3:
+ long = int
+
+class TestZMQError(BaseZMQTestCase):
+
+ def test_strerror(self):
+ """test that strerror gets the right type."""
+ for i in range(10):
+ e = strerror(i)
+ self.assertTrue(isinstance(e, str))
+
+ def test_zmqerror(self):
+ for errno in range(10):
+ e = ZMQError(errno)
+ self.assertEqual(e.errno, errno)
+ self.assertEqual(str(e), strerror(errno))
+
+ def test_again(self):
+ s = self.context.socket(zmq.REP)
+ self.assertRaises(Again, s.recv, zmq.NOBLOCK)
+ self.assertRaisesErrno(zmq.EAGAIN, s.recv, zmq.NOBLOCK)
+ s.close()
+
+ def atest_ctxterm(self):
+ s = self.context.socket(zmq.REP)
+ t = Thread(target=self.context.term)
+ t.start()
+ self.assertRaises(ContextTerminated, s.recv, zmq.NOBLOCK)
+ self.assertRaisesErrno(zmq.TERM, s.recv, zmq.NOBLOCK)
+ s.close()
+ t.join()
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_etc.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_etc.py
new file mode 100644
index 00000000..ad224064
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_etc.py
@@ -0,0 +1,15 @@
+# Copyright (c) PyZMQ Developers.
+# Distributed under the terms of the Modified BSD License.
+
+import sys
+
+import zmq
+
+from . import skip_if
+
+@skip_if(zmq.zmq_version_info() < (4,1), "libzmq < 4.1")
+def test_has():
+ assert not zmq.has('something weird')
+ has_ipc = zmq.has('ipc')
+ not_windows = not sys.platform.startswith('win')
+ assert has_ipc == not_windows
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_imports.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_imports.py
new file mode 100644
index 00000000..c0ddfaac
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_imports.py
@@ -0,0 +1,62 @@
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import sys
+from unittest import TestCase
+
+class TestImports(TestCase):
+ """Test Imports - the quickest test to ensure that we haven't
+ introduced version-incompatible syntax errors."""
+
+ def test_toplevel(self):
+ """test toplevel import"""
+ import zmq
+
+ def test_core(self):
+ """test core imports"""
+ from zmq import Context
+ from zmq import Socket
+ from zmq import Poller
+ from zmq import Frame
+ from zmq import constants
+ from zmq import device, proxy
+ from zmq import Stopwatch
+ from zmq import (
+ zmq_version,
+ zmq_version_info,
+ pyzmq_version,
+ pyzmq_version_info,
+ )
+
+ def test_devices(self):
+ """test device imports"""
+ import zmq.devices
+ from zmq.devices import basedevice
+ from zmq.devices import monitoredqueue
+ from zmq.devices import monitoredqueuedevice
+
+ def test_log(self):
+ """test log imports"""
+ import zmq.log
+ from zmq.log import handlers
+
+ def test_eventloop(self):
+ """test eventloop imports"""
+ import zmq.eventloop
+ from zmq.eventloop import ioloop
+ from zmq.eventloop import zmqstream
+ from zmq.eventloop.minitornado.platform import auto
+ from zmq.eventloop.minitornado import ioloop
+
+ def test_utils(self):
+ """test util imports"""
+ import zmq.utils
+ from zmq.utils import strtypes
+ from zmq.utils import jsonapi
+
+ def test_ssh(self):
+ """test ssh imports"""
+ from zmq.ssh import tunnel
+
+
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_ioloop.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_ioloop.py
new file mode 100644
index 00000000..2a8b1153
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_ioloop.py
@@ -0,0 +1,113 @@
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import time
+import os
+import threading
+
+import zmq
+from zmq.tests import BaseZMQTestCase
+from zmq.eventloop import ioloop
+from zmq.eventloop.minitornado.ioloop import _Timeout
+try:
+ from tornado.ioloop import PollIOLoop, IOLoop as BaseIOLoop
+except ImportError:
+ from zmq.eventloop.minitornado.ioloop import IOLoop as BaseIOLoop
+
+
+def printer():
+ os.system("say hello")
+ raise Exception
+ print (time.time())
+
+
+class Delay(threading.Thread):
+ def __init__(self, f, delay=1):
+ self.f=f
+ self.delay=delay
+ self.aborted=False
+ self.cond=threading.Condition()
+ super(Delay, self).__init__()
+
+ def run(self):
+ self.cond.acquire()
+ self.cond.wait(self.delay)
+ self.cond.release()
+ if not self.aborted:
+ self.f()
+
+ def abort(self):
+ self.aborted=True
+ self.cond.acquire()
+ self.cond.notify()
+ self.cond.release()
+
+
+class TestIOLoop(BaseZMQTestCase):
+
+ def test_simple(self):
+ """simple IOLoop creation test"""
+ loop = ioloop.IOLoop()
+ dc = ioloop.PeriodicCallback(loop.stop, 200, loop)
+ pc = ioloop.PeriodicCallback(lambda : None, 10, loop)
+ pc.start()
+ dc.start()
+ t = Delay(loop.stop,1)
+ t.start()
+ loop.start()
+ if t.isAlive():
+ t.abort()
+ else:
+ self.fail("IOLoop failed to exit")
+
+ def test_timeout_compare(self):
+ """test timeout comparisons"""
+ loop = ioloop.IOLoop()
+ t = _Timeout(1, 2, loop)
+ t2 = _Timeout(1, 3, loop)
+ self.assertEqual(t < t2, id(t) < id(t2))
+ t2 = _Timeout(2,1, loop)
+ self.assertTrue(t < t2)
+
+ def test_poller_events(self):
+ """Tornado poller implementation maps events correctly"""
+ req,rep = self.create_bound_pair(zmq.REQ, zmq.REP)
+ poller = ioloop.ZMQPoller()
+ poller.register(req, ioloop.IOLoop.READ)
+ poller.register(rep, ioloop.IOLoop.READ)
+ events = dict(poller.poll(0))
+ self.assertEqual(events.get(rep), None)
+ self.assertEqual(events.get(req), None)
+
+ poller.register(req, ioloop.IOLoop.WRITE)
+ poller.register(rep, ioloop.IOLoop.WRITE)
+ events = dict(poller.poll(1))
+ self.assertEqual(events.get(req), ioloop.IOLoop.WRITE)
+ self.assertEqual(events.get(rep), None)
+
+ poller.register(rep, ioloop.IOLoop.READ)
+ req.send(b'hi')
+ events = dict(poller.poll(1))
+ self.assertEqual(events.get(rep), ioloop.IOLoop.READ)
+ self.assertEqual(events.get(req), None)
+
+ def test_instance(self):
+ """Test IOLoop.instance returns the right object"""
+ loop = ioloop.IOLoop.instance()
+ self.assertEqual(loop.__class__, ioloop.IOLoop)
+ loop = BaseIOLoop.instance()
+ self.assertEqual(loop.__class__, ioloop.IOLoop)
+
+ def test_close_all(self):
+ """Test close(all_fds=True)"""
+ loop = ioloop.IOLoop.instance()
+ req,rep = self.create_bound_pair(zmq.REQ, zmq.REP)
+ loop.add_handler(req, lambda msg: msg, ioloop.IOLoop.READ)
+ loop.add_handler(rep, lambda msg: msg, ioloop.IOLoop.READ)
+ self.assertEqual(req.closed, False)
+ self.assertEqual(rep.closed, False)
+ loop.close(all_fds=True)
+ self.assertEqual(req.closed, True)
+ self.assertEqual(rep.closed, True)
+
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_log.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_log.py
new file mode 100644
index 00000000..9206f095
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_log.py
@@ -0,0 +1,116 @@
+# encoding: utf-8
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+import logging
+import time
+from unittest import TestCase
+
+import zmq
+from zmq.log import handlers
+from zmq.utils.strtypes import b, u
+from zmq.tests import BaseZMQTestCase
+
+
+class TestPubLog(BaseZMQTestCase):
+
+ iface = 'inproc://zmqlog'
+ topic= 'zmq'
+
+ @property
+ def logger(self):
+ # print dir(self)
+ logger = logging.getLogger('zmqtest')
+ logger.setLevel(logging.DEBUG)
+ return logger
+
+ def connect_handler(self, topic=None):
+ topic = self.topic if topic is None else topic
+ logger = self.logger
+ pub,sub = self.create_bound_pair(zmq.PUB, zmq.SUB)
+ handler = handlers.PUBHandler(pub)
+ handler.setLevel(logging.DEBUG)
+ handler.root_topic = topic
+ logger.addHandler(handler)
+ sub.setsockopt(zmq.SUBSCRIBE, b(topic))
+ time.sleep(0.1)
+ return logger, handler, sub
+
+ def test_init_iface(self):
+ logger = self.logger
+ ctx = self.context
+ handler = handlers.PUBHandler(self.iface)
+ self.assertFalse(handler.ctx is ctx)
+ self.sockets.append(handler.socket)
+ # handler.ctx.term()
+ handler = handlers.PUBHandler(self.iface, self.context)
+ self.sockets.append(handler.socket)
+ self.assertTrue(handler.ctx is ctx)
+ handler.setLevel(logging.DEBUG)
+ handler.root_topic = self.topic
+ logger.addHandler(handler)
+ sub = ctx.socket(zmq.SUB)
+ self.sockets.append(sub)
+ sub.setsockopt(zmq.SUBSCRIBE, b(self.topic))
+ sub.connect(self.iface)
+ import time; time.sleep(0.25)
+ msg1 = 'message'
+ logger.info(msg1)
+
+ (topic, msg2) = sub.recv_multipart()
+ self.assertEqual(topic, b'zmq.INFO')
+ self.assertEqual(msg2, b(msg1)+b'\n')
+ logger.removeHandler(handler)
+
+ def test_init_socket(self):
+ pub,sub = self.create_bound_pair(zmq.PUB, zmq.SUB)
+ logger = self.logger
+ handler = handlers.PUBHandler(pub)
+ handler.setLevel(logging.DEBUG)
+ handler.root_topic = self.topic
+ logger.addHandler(handler)
+
+ self.assertTrue(handler.socket is pub)
+ self.assertTrue(handler.ctx is pub.context)
+ self.assertTrue(handler.ctx is self.context)
+ sub.setsockopt(zmq.SUBSCRIBE, b(self.topic))
+ import time; time.sleep(0.1)
+ msg1 = 'message'
+ logger.info(msg1)
+
+ (topic, msg2) = sub.recv_multipart()
+ self.assertEqual(topic, b'zmq.INFO')
+ self.assertEqual(msg2, b(msg1)+b'\n')
+ logger.removeHandler(handler)
+
+ def test_root_topic(self):
+ logger, handler, sub = self.connect_handler()
+ handler.socket.bind(self.iface)
+ sub2 = sub.context.socket(zmq.SUB)
+ self.sockets.append(sub2)
+ sub2.connect(self.iface)
+ sub2.setsockopt(zmq.SUBSCRIBE, b'')
+ handler.root_topic = b'twoonly'
+ msg1 = 'ignored'
+ logger.info(msg1)
+ self.assertRaisesErrno(zmq.EAGAIN, sub.recv, zmq.NOBLOCK)
+ topic,msg2 = sub2.recv_multipart()
+ self.assertEqual(topic, b'twoonly.INFO')
+ self.assertEqual(msg2, b(msg1)+b'\n')
+
+ logger.removeHandler(handler)
+
+ def test_unicode_message(self):
+ logger, handler, sub = self.connect_handler()
+ base_topic = b(self.topic + '.INFO')
+ for msg, expected in [
+ (u('hello'), [base_topic, b('hello\n')]),
+ (u('héllo'), [base_topic, b('héllo\n')]),
+ (u('tøpic::héllo'), [base_topic + b('.tøpic'), b('héllo\n')]),
+ ]:
+ logger.info(msg)
+ received = sub.recv_multipart()
+ self.assertEqual(received, expected)
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_message.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_message.py
new file mode 100644
index 00000000..d8770bdf
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_message.py
@@ -0,0 +1,362 @@
+# -*- coding: utf8 -*-
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+import copy
+import sys
+try:
+ from sys import getrefcount as grc
+except ImportError:
+ grc = None
+
+import time
+from pprint import pprint
+from unittest import TestCase
+
+import zmq
+from zmq.tests import BaseZMQTestCase, SkipTest, skip_pypy, PYPY
+from zmq.utils.strtypes import unicode, bytes, b, u
+
+
+# some useful constants:
+
+x = b'x'
+
+try:
+ view = memoryview
+except NameError:
+ view = buffer
+
+if grc:
+ rc0 = grc(x)
+ v = view(x)
+ view_rc = grc(x) - rc0
+
+def await_gc(obj, rc):
+ """wait for refcount on an object to drop to an expected value
+
+ Necessary because of the zero-copy gc thread,
+ which can take some time to receive its DECREF message.
+ """
+ for i in range(50):
+ # rc + 2 because of the refs in this function
+ if grc(obj) <= rc + 2:
+ return
+ time.sleep(0.05)
+
+class TestFrame(BaseZMQTestCase):
+
+ @skip_pypy
+ def test_above_30(self):
+ """Message above 30 bytes are never copied by 0MQ."""
+ for i in range(5, 16): # 32, 64,..., 65536
+ s = (2**i)*x
+ self.assertEqual(grc(s), 2)
+ m = zmq.Frame(s)
+ self.assertEqual(grc(s), 4)
+ del m
+ await_gc(s, 2)
+ self.assertEqual(grc(s), 2)
+ del s
+
+ def test_str(self):
+ """Test the str representations of the Frames."""
+ for i in range(16):
+ s = (2**i)*x
+ m = zmq.Frame(s)
+ m_str = str(m)
+ m_str_b = b(m_str) # py3compat
+ self.assertEqual(s, m_str_b)
+
+ def test_bytes(self):
+ """Test the Frame.bytes property."""
+ for i in range(1,16):
+ s = (2**i)*x
+ m = zmq.Frame(s)
+ b = m.bytes
+ self.assertEqual(s, m.bytes)
+ if not PYPY:
+ # check that it copies
+ self.assert_(b is not s)
+ # check that it copies only once
+ self.assert_(b is m.bytes)
+
+ def test_unicode(self):
+ """Test the unicode representations of the Frames."""
+ s = u('asdf')
+ self.assertRaises(TypeError, zmq.Frame, s)
+ for i in range(16):
+ s = (2**i)*u('§')
+ m = zmq.Frame(s.encode('utf8'))
+ self.assertEqual(s, unicode(m.bytes,'utf8'))
+
+ def test_len(self):
+ """Test the len of the Frames."""
+ for i in range(16):
+ s = (2**i)*x
+ m = zmq.Frame(s)
+ self.assertEqual(len(s), len(m))
+
+ @skip_pypy
+ def test_lifecycle1(self):
+ """Run through a ref counting cycle with a copy."""
+ for i in range(5, 16): # 32, 64,..., 65536
+ s = (2**i)*x
+ rc = 2
+ self.assertEqual(grc(s), rc)
+ m = zmq.Frame(s)
+ rc += 2
+ self.assertEqual(grc(s), rc)
+ m2 = copy.copy(m)
+ rc += 1
+ self.assertEqual(grc(s), rc)
+ buf = m2.buffer
+
+ rc += view_rc
+ self.assertEqual(grc(s), rc)
+
+ self.assertEqual(s, b(str(m)))
+ self.assertEqual(s, bytes(m2))
+ self.assertEqual(s, m.bytes)
+ # self.assert_(s is str(m))
+ # self.assert_(s is str(m2))
+ del m2
+ rc -= 1
+ self.assertEqual(grc(s), rc)
+ rc -= view_rc
+ del buf
+ self.assertEqual(grc(s), rc)
+ del m
+ rc -= 2
+ await_gc(s, rc)
+ self.assertEqual(grc(s), rc)
+ self.assertEqual(rc, 2)
+ del s
+
+ @skip_pypy
+ def test_lifecycle2(self):
+ """Run through a different ref counting cycle with a copy."""
+ for i in range(5, 16): # 32, 64,..., 65536
+ s = (2**i)*x
+ rc = 2
+ self.assertEqual(grc(s), rc)
+ m = zmq.Frame(s)
+ rc += 2
+ self.assertEqual(grc(s), rc)
+ m2 = copy.copy(m)
+ rc += 1
+ self.assertEqual(grc(s), rc)
+ buf = m.buffer
+ rc += view_rc
+ self.assertEqual(grc(s), rc)
+ self.assertEqual(s, b(str(m)))
+ self.assertEqual(s, bytes(m2))
+ self.assertEqual(s, m2.bytes)
+ self.assertEqual(s, m.bytes)
+ # self.assert_(s is str(m))
+ # self.assert_(s is str(m2))
+ del buf
+ self.assertEqual(grc(s), rc)
+ del m
+ # m.buffer is kept until m is del'd
+ rc -= view_rc
+ rc -= 1
+ self.assertEqual(grc(s), rc)
+ del m2
+ rc -= 2
+ await_gc(s, rc)
+ self.assertEqual(grc(s), rc)
+ self.assertEqual(rc, 2)
+ del s
+
+ @skip_pypy
+ def test_tracker(self):
+ m = zmq.Frame(b'asdf', track=True)
+ self.assertFalse(m.tracker.done)
+ pm = zmq.MessageTracker(m)
+ self.assertFalse(pm.done)
+ del m
+ for i in range(10):
+ if pm.done:
+ break
+ time.sleep(0.1)
+ self.assertTrue(pm.done)
+
+ def test_no_tracker(self):
+ m = zmq.Frame(b'asdf', track=False)
+ self.assertEqual(m.tracker, None)
+ m2 = copy.copy(m)
+ self.assertEqual(m2.tracker, None)
+ self.assertRaises(ValueError, zmq.MessageTracker, m)
+
+ @skip_pypy
+ def test_multi_tracker(self):
+ m = zmq.Frame(b'asdf', track=True)
+ m2 = zmq.Frame(b'whoda', track=True)
+ mt = zmq.MessageTracker(m,m2)
+ self.assertFalse(m.tracker.done)
+ self.assertFalse(mt.done)
+ self.assertRaises(zmq.NotDone, mt.wait, 0.1)
+ del m
+ time.sleep(0.1)
+ self.assertRaises(zmq.NotDone, mt.wait, 0.1)
+ self.assertFalse(mt.done)
+ del m2
+ self.assertTrue(mt.wait() is None)
+ self.assertTrue(mt.done)
+
+
+ def test_buffer_in(self):
+ """test using a buffer as input"""
+ ins = b("§§¶•ªº˜µ¬˚…∆˙åß∂©œ∑´†≈ç√")
+ m = zmq.Frame(view(ins))
+
+ def test_bad_buffer_in(self):
+ """test using a bad object"""
+ self.assertRaises(TypeError, zmq.Frame, 5)
+ self.assertRaises(TypeError, zmq.Frame, object())
+
+ def test_buffer_out(self):
+ """receiving buffered output"""
+ ins = b("§§¶•ªº˜µ¬˚…∆˙åß∂©œ∑´†≈ç√")
+ m = zmq.Frame(ins)
+ outb = m.buffer
+ self.assertTrue(isinstance(outb, view))
+ self.assert_(outb is m.buffer)
+ self.assert_(m.buffer is m.buffer)
+
+ def test_multisend(self):
+ """ensure that a message remains intact after multiple sends"""
+ a,b = self.create_bound_pair(zmq.PAIR, zmq.PAIR)
+ s = b"message"
+ m = zmq.Frame(s)
+ self.assertEqual(s, m.bytes)
+
+ a.send(m, copy=False)
+ time.sleep(0.1)
+ self.assertEqual(s, m.bytes)
+ a.send(m, copy=False)
+ time.sleep(0.1)
+ self.assertEqual(s, m.bytes)
+ a.send(m, copy=True)
+ time.sleep(0.1)
+ self.assertEqual(s, m.bytes)
+ a.send(m, copy=True)
+ time.sleep(0.1)
+ self.assertEqual(s, m.bytes)
+ for i in range(4):
+ r = b.recv()
+ self.assertEqual(s,r)
+ self.assertEqual(s, m.bytes)
+
+ def test_buffer_numpy(self):
+ """test non-copying numpy array messages"""
+ try:
+ import numpy
+ except ImportError:
+ raise SkipTest("numpy required")
+ rand = numpy.random.randint
+ shapes = [ rand(2,16) for i in range(5) ]
+ for i in range(1,len(shapes)+1):
+ shape = shapes[:i]
+ A = numpy.random.random(shape)
+ m = zmq.Frame(A)
+ if view.__name__ == 'buffer':
+ self.assertEqual(A.data, m.buffer)
+ B = numpy.frombuffer(m.buffer,dtype=A.dtype).reshape(A.shape)
+ else:
+ self.assertEqual(memoryview(A), m.buffer)
+ B = numpy.array(m.buffer,dtype=A.dtype).reshape(A.shape)
+ self.assertEqual((A==B).all(), True)
+
+ def test_memoryview(self):
+ """test messages from memoryview"""
+ major,minor = sys.version_info[:2]
+ if not (major >= 3 or (major == 2 and minor >= 7)):
+ raise SkipTest("memoryviews only in python >= 2.7")
+
+ s = b'carrotjuice'
+ v = memoryview(s)
+ m = zmq.Frame(s)
+ buf = m.buffer
+ s2 = buf.tobytes()
+ self.assertEqual(s2,s)
+ self.assertEqual(m.bytes,s)
+
+ def test_noncopying_recv(self):
+ """check for clobbering message buffers"""
+ null = b'\0'*64
+ sa,sb = self.create_bound_pair(zmq.PAIR, zmq.PAIR)
+ for i in range(32):
+ # try a few times
+ sb.send(null, copy=False)
+ m = sa.recv(copy=False)
+ mb = m.bytes
+ # buf = view(m)
+ buf = m.buffer
+ del m
+ for i in range(5):
+ ff=b'\xff'*(40 + i*10)
+ sb.send(ff, copy=False)
+ m2 = sa.recv(copy=False)
+ if view.__name__ == 'buffer':
+ b = bytes(buf)
+ else:
+ b = buf.tobytes()
+ self.assertEqual(b, null)
+ self.assertEqual(mb, null)
+ self.assertEqual(m2.bytes, ff)
+
+ @skip_pypy
+ def test_buffer_numpy(self):
+ """test non-copying numpy array messages"""
+ try:
+ import numpy
+ except ImportError:
+ raise SkipTest("requires numpy")
+ if sys.version_info < (2,7):
+ raise SkipTest("requires new-style buffer interface (py >= 2.7)")
+ rand = numpy.random.randint
+ shapes = [ rand(2,5) for i in range(5) ]
+ a,b = self.create_bound_pair(zmq.PAIR, zmq.PAIR)
+ dtypes = [int, float, '>i4', 'B']
+ for i in range(1,len(shapes)+1):
+ shape = shapes[:i]
+ for dt in dtypes:
+ A = numpy.empty(shape, dtype=dt)
+ while numpy.isnan(A).any():
+ # don't let nan sneak in
+ A = numpy.ndarray(shape, dtype=dt)
+ a.send(A, copy=False)
+ msg = b.recv(copy=False)
+
+ B = numpy.frombuffer(msg, A.dtype).reshape(A.shape)
+ self.assertEqual(A.shape, B.shape)
+ self.assertTrue((A==B).all())
+ A = numpy.empty(shape, dtype=[('a', int), ('b', float), ('c', 'a32')])
+ A['a'] = 1024
+ A['b'] = 1e9
+ A['c'] = 'hello there'
+ a.send(A, copy=False)
+ msg = b.recv(copy=False)
+
+ B = numpy.frombuffer(msg, A.dtype).reshape(A.shape)
+ self.assertEqual(A.shape, B.shape)
+ self.assertTrue((A==B).all())
+
+ def test_frame_more(self):
+ """test Frame.more attribute"""
+ frame = zmq.Frame(b"hello")
+ self.assertFalse(frame.more)
+ sa,sb = self.create_bound_pair(zmq.PAIR, zmq.PAIR)
+ sa.send_multipart([b'hi', b'there'])
+ frame = self.recv(sb, copy=False)
+ self.assertTrue(frame.more)
+ if zmq.zmq_version_info()[0] >= 3 and not PYPY:
+ self.assertTrue(frame.get(zmq.MORE))
+ frame = self.recv(sb, copy=False)
+ self.assertFalse(frame.more)
+ if zmq.zmq_version_info()[0] >= 3 and not PYPY:
+ self.assertFalse(frame.get(zmq.MORE))
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_monitor.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_monitor.py
new file mode 100644
index 00000000..4f035388
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_monitor.py
@@ -0,0 +1,71 @@
+# -*- coding: utf-8 -*-
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+import sys
+import time
+import struct
+
+from unittest import TestCase
+
+import zmq
+from zmq.tests import BaseZMQTestCase, skip_if, skip_pypy
+from zmq.utils.monitor import recv_monitor_message
+
+skip_lt_4 = skip_if(zmq.zmq_version_info() < (4,), "requires zmq >= 4")
+
+class TestSocketMonitor(BaseZMQTestCase):
+
+ @skip_lt_4
+ def test_monitor(self):
+ """Test monitoring interface for sockets."""
+ s_rep = self.context.socket(zmq.REP)
+ s_req = self.context.socket(zmq.REQ)
+ self.sockets.extend([s_rep, s_req])
+ s_req.bind("tcp://127.0.0.1:6666")
+ # try monitoring the REP socket
+
+ s_rep.monitor("inproc://monitor.rep", zmq.EVENT_ALL)
+ # create listening socket for monitor
+ s_event = self.context.socket(zmq.PAIR)
+ self.sockets.append(s_event)
+ s_event.connect("inproc://monitor.rep")
+ s_event.linger = 0
+ # test receive event for connect event
+ s_rep.connect("tcp://127.0.0.1:6666")
+ m = recv_monitor_message(s_event)
+ if m['event'] == zmq.EVENT_CONNECT_DELAYED:
+ self.assertEqual(m['endpoint'], b"tcp://127.0.0.1:6666")
+ # test receive event for connected event
+ m = recv_monitor_message(s_event)
+ self.assertEqual(m['event'], zmq.EVENT_CONNECTED)
+ self.assertEqual(m['endpoint'], b"tcp://127.0.0.1:6666")
+
+ # test monitor can be disabled.
+ s_rep.disable_monitor()
+ m = recv_monitor_message(s_event)
+ self.assertEqual(m['event'], zmq.EVENT_MONITOR_STOPPED)
+
+
+ @skip_lt_4
+ def test_monitor_connected(self):
+ """Test connected monitoring socket."""
+ s_rep = self.context.socket(zmq.REP)
+ s_req = self.context.socket(zmq.REQ)
+ self.sockets.extend([s_rep, s_req])
+ s_req.bind("tcp://127.0.0.1:6667")
+ # try monitoring the REP socket
+ # create listening socket for monitor
+ s_event = s_rep.get_monitor_socket()
+ s_event.linger = 0
+ self.sockets.append(s_event)
+ # test receive event for connect event
+ s_rep.connect("tcp://127.0.0.1:6667")
+ m = recv_monitor_message(s_event)
+ if m['event'] == zmq.EVENT_CONNECT_DELAYED:
+ self.assertEqual(m['endpoint'], b"tcp://127.0.0.1:6667")
+ # test receive event for connected event
+ m = recv_monitor_message(s_event)
+ self.assertEqual(m['event'], zmq.EVENT_CONNECTED)
+ self.assertEqual(m['endpoint'], b"tcp://127.0.0.1:6667")
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_monqueue.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_monqueue.py
new file mode 100644
index 00000000..e855602e
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_monqueue.py
@@ -0,0 +1,227 @@
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import time
+from unittest import TestCase
+
+import zmq
+from zmq import devices
+
+from zmq.tests import BaseZMQTestCase, SkipTest, PYPY
+from zmq.utils.strtypes import unicode
+
+
+if PYPY or zmq.zmq_version_info() >= (4,1):
+ # cleanup of shared Context doesn't work on PyPy
+ # there also seems to be a bug in cleanup in libzmq-4.1 (zeromq/libzmq#1052)
+ devices.Device.context_factory = zmq.Context
+
+
+class TestMonitoredQueue(BaseZMQTestCase):
+
+ sockets = []
+
+ def build_device(self, mon_sub=b"", in_prefix=b'in', out_prefix=b'out'):
+ self.device = devices.ThreadMonitoredQueue(zmq.PAIR, zmq.PAIR, zmq.PUB,
+ in_prefix, out_prefix)
+ alice = self.context.socket(zmq.PAIR)
+ bob = self.context.socket(zmq.PAIR)
+ mon = self.context.socket(zmq.SUB)
+
+ aport = alice.bind_to_random_port('tcp://127.0.0.1')
+ bport = bob.bind_to_random_port('tcp://127.0.0.1')
+ mport = mon.bind_to_random_port('tcp://127.0.0.1')
+ mon.setsockopt(zmq.SUBSCRIBE, mon_sub)
+
+ self.device.connect_in("tcp://127.0.0.1:%i"%aport)
+ self.device.connect_out("tcp://127.0.0.1:%i"%bport)
+ self.device.connect_mon("tcp://127.0.0.1:%i"%mport)
+ self.device.start()
+ time.sleep(.2)
+ try:
+ # this is currenlty necessary to ensure no dropped monitor messages
+ # see LIBZMQ-248 for more info
+ mon.recv_multipart(zmq.NOBLOCK)
+ except zmq.ZMQError:
+ pass
+ self.sockets.extend([alice, bob, mon])
+ return alice, bob, mon
+
+
+ def teardown_device(self):
+ for socket in self.sockets:
+ socket.close()
+ del socket
+ del self.device
+
+ def test_reply(self):
+ alice, bob, mon = self.build_device()
+ alices = b"hello bob".split()
+ alice.send_multipart(alices)
+ bobs = self.recv_multipart(bob)
+ self.assertEqual(alices, bobs)
+ bobs = b"hello alice".split()
+ bob.send_multipart(bobs)
+ alices = self.recv_multipart(alice)
+ self.assertEqual(alices, bobs)
+ self.teardown_device()
+
+ def test_queue(self):
+ alice, bob, mon = self.build_device()
+ alices = b"hello bob".split()
+ alice.send_multipart(alices)
+ alices2 = b"hello again".split()
+ alice.send_multipart(alices2)
+ alices3 = b"hello again and again".split()
+ alice.send_multipart(alices3)
+ bobs = self.recv_multipart(bob)
+ self.assertEqual(alices, bobs)
+ bobs = self.recv_multipart(bob)
+ self.assertEqual(alices2, bobs)
+ bobs = self.recv_multipart(bob)
+ self.assertEqual(alices3, bobs)
+ bobs = b"hello alice".split()
+ bob.send_multipart(bobs)
+ alices = self.recv_multipart(alice)
+ self.assertEqual(alices, bobs)
+ self.teardown_device()
+
+ def test_monitor(self):
+ alice, bob, mon = self.build_device()
+ alices = b"hello bob".split()
+ alice.send_multipart(alices)
+ alices2 = b"hello again".split()
+ alice.send_multipart(alices2)
+ alices3 = b"hello again and again".split()
+ alice.send_multipart(alices3)
+ bobs = self.recv_multipart(bob)
+ self.assertEqual(alices, bobs)
+ mons = self.recv_multipart(mon)
+ self.assertEqual([b'in']+bobs, mons)
+ bobs = self.recv_multipart(bob)
+ self.assertEqual(alices2, bobs)
+ bobs = self.recv_multipart(bob)
+ self.assertEqual(alices3, bobs)
+ mons = self.recv_multipart(mon)
+ self.assertEqual([b'in']+alices2, mons)
+ bobs = b"hello alice".split()
+ bob.send_multipart(bobs)
+ alices = self.recv_multipart(alice)
+ self.assertEqual(alices, bobs)
+ mons = self.recv_multipart(mon)
+ self.assertEqual([b'in']+alices3, mons)
+ mons = self.recv_multipart(mon)
+ self.assertEqual([b'out']+bobs, mons)
+ self.teardown_device()
+
+ def test_prefix(self):
+ alice, bob, mon = self.build_device(b"", b'foo', b'bar')
+ alices = b"hello bob".split()
+ alice.send_multipart(alices)
+ alices2 = b"hello again".split()
+ alice.send_multipart(alices2)
+ alices3 = b"hello again and again".split()
+ alice.send_multipart(alices3)
+ bobs = self.recv_multipart(bob)
+ self.assertEqual(alices, bobs)
+ mons = self.recv_multipart(mon)
+ self.assertEqual([b'foo']+bobs, mons)
+ bobs = self.recv_multipart(bob)
+ self.assertEqual(alices2, bobs)
+ bobs = self.recv_multipart(bob)
+ self.assertEqual(alices3, bobs)
+ mons = self.recv_multipart(mon)
+ self.assertEqual([b'foo']+alices2, mons)
+ bobs = b"hello alice".split()
+ bob.send_multipart(bobs)
+ alices = self.recv_multipart(alice)
+ self.assertEqual(alices, bobs)
+ mons = self.recv_multipart(mon)
+ self.assertEqual([b'foo']+alices3, mons)
+ mons = self.recv_multipart(mon)
+ self.assertEqual([b'bar']+bobs, mons)
+ self.teardown_device()
+
+ def test_monitor_subscribe(self):
+ alice, bob, mon = self.build_device(b"out")
+ alices = b"hello bob".split()
+ alice.send_multipart(alices)
+ alices2 = b"hello again".split()
+ alice.send_multipart(alices2)
+ alices3 = b"hello again and again".split()
+ alice.send_multipart(alices3)
+ bobs = self.recv_multipart(bob)
+ self.assertEqual(alices, bobs)
+ bobs = self.recv_multipart(bob)
+ self.assertEqual(alices2, bobs)
+ bobs = self.recv_multipart(bob)
+ self.assertEqual(alices3, bobs)
+ bobs = b"hello alice".split()
+ bob.send_multipart(bobs)
+ alices = self.recv_multipart(alice)
+ self.assertEqual(alices, bobs)
+ mons = self.recv_multipart(mon)
+ self.assertEqual([b'out']+bobs, mons)
+ self.teardown_device()
+
+ def test_router_router(self):
+ """test router-router MQ devices"""
+ dev = devices.ThreadMonitoredQueue(zmq.ROUTER, zmq.ROUTER, zmq.PUB, b'in', b'out')
+ self.device = dev
+ dev.setsockopt_in(zmq.LINGER, 0)
+ dev.setsockopt_out(zmq.LINGER, 0)
+ dev.setsockopt_mon(zmq.LINGER, 0)
+
+ binder = self.context.socket(zmq.DEALER)
+ porta = binder.bind_to_random_port('tcp://127.0.0.1')
+ portb = binder.bind_to_random_port('tcp://127.0.0.1')
+ binder.close()
+ time.sleep(0.1)
+ a = self.context.socket(zmq.DEALER)
+ a.identity = b'a'
+ b = self.context.socket(zmq.DEALER)
+ b.identity = b'b'
+ self.sockets.extend([a, b])
+
+ a.connect('tcp://127.0.0.1:%i'%porta)
+ dev.bind_in('tcp://127.0.0.1:%i'%porta)
+ b.connect('tcp://127.0.0.1:%i'%portb)
+ dev.bind_out('tcp://127.0.0.1:%i'%portb)
+ dev.start()
+ time.sleep(0.2)
+ if zmq.zmq_version_info() >= (3,1,0):
+ # flush erroneous poll state, due to LIBZMQ-280
+ ping_msg = [ b'ping', b'pong' ]
+ for s in (a,b):
+ s.send_multipart(ping_msg)
+ try:
+ s.recv(zmq.NOBLOCK)
+ except zmq.ZMQError:
+ pass
+ msg = [ b'hello', b'there' ]
+ a.send_multipart([b'b']+msg)
+ bmsg = self.recv_multipart(b)
+ self.assertEqual(bmsg, [b'a']+msg)
+ b.send_multipart(bmsg)
+ amsg = self.recv_multipart(a)
+ self.assertEqual(amsg, [b'b']+msg)
+ self.teardown_device()
+
+ def test_default_mq_args(self):
+ self.device = dev = devices.ThreadMonitoredQueue(zmq.ROUTER, zmq.DEALER, zmq.PUB)
+ dev.setsockopt_in(zmq.LINGER, 0)
+ dev.setsockopt_out(zmq.LINGER, 0)
+ dev.setsockopt_mon(zmq.LINGER, 0)
+ # this will raise if default args are wrong
+ dev.start()
+ self.teardown_device()
+
+ def test_mq_check_prefix(self):
+ ins = self.context.socket(zmq.ROUTER)
+ outs = self.context.socket(zmq.DEALER)
+ mons = self.context.socket(zmq.PUB)
+ self.sockets.extend([ins, outs, mons])
+
+ ins = unicode('in')
+ outs = unicode('out')
+ self.assertRaises(TypeError, devices.monitoredqueue, ins, outs, mons)
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_multipart.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_multipart.py
new file mode 100644
index 00000000..24d41be0
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_multipart.py
@@ -0,0 +1,35 @@
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+import zmq
+
+
+from zmq.tests import BaseZMQTestCase, SkipTest, have_gevent, GreenTest
+
+
+class TestMultipart(BaseZMQTestCase):
+
+ def test_router_dealer(self):
+ router, dealer = self.create_bound_pair(zmq.ROUTER, zmq.DEALER)
+
+ msg1 = b'message1'
+ dealer.send(msg1)
+ ident = self.recv(router)
+ more = router.rcvmore
+ self.assertEqual(more, True)
+ msg2 = self.recv(router)
+ self.assertEqual(msg1, msg2)
+ more = router.rcvmore
+ self.assertEqual(more, False)
+
+ def test_basic_multipart(self):
+ a,b = self.create_bound_pair(zmq.PAIR, zmq.PAIR)
+ msg = [ b'hi', b'there', b'b']
+ a.send_multipart(msg)
+ recvd = b.recv_multipart()
+ self.assertEqual(msg, recvd)
+
+if have_gevent:
+ class TestMultipartGreen(GreenTest, TestMultipart):
+ pass
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_pair.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_pair.py
new file mode 100644
index 00000000..e88c1e8b
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_pair.py
@@ -0,0 +1,53 @@
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+import zmq
+
+
+from zmq.tests import BaseZMQTestCase, have_gevent, GreenTest
+
+
+x = b' '
+class TestPair(BaseZMQTestCase):
+
+ def test_basic(self):
+ s1, s2 = self.create_bound_pair(zmq.PAIR, zmq.PAIR)
+
+ msg1 = b'message1'
+ msg2 = self.ping_pong(s1, s2, msg1)
+ self.assertEqual(msg1, msg2)
+
+ def test_multiple(self):
+ s1, s2 = self.create_bound_pair(zmq.PAIR, zmq.PAIR)
+
+ for i in range(10):
+ msg = i*x
+ s1.send(msg)
+
+ for i in range(10):
+ msg = i*x
+ s2.send(msg)
+
+ for i in range(10):
+ msg = s1.recv()
+ self.assertEqual(msg, i*x)
+
+ for i in range(10):
+ msg = s2.recv()
+ self.assertEqual(msg, i*x)
+
+ def test_json(self):
+ s1, s2 = self.create_bound_pair(zmq.PAIR, zmq.PAIR)
+ o = dict(a=10,b=list(range(10)))
+ o2 = self.ping_pong_json(s1, s2, o)
+
+ def test_pyobj(self):
+ s1, s2 = self.create_bound_pair(zmq.PAIR, zmq.PAIR)
+ o = dict(a=10,b=range(10))
+ o2 = self.ping_pong_pyobj(s1, s2, o)
+
+if have_gevent:
+ class TestReqRepGreen(GreenTest, TestPair):
+ pass
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_poll.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_poll.py
new file mode 100644
index 00000000..57346c89
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_poll.py
@@ -0,0 +1,229 @@
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+import time
+from unittest import TestCase
+
+import zmq
+
+from zmq.tests import PollZMQTestCase, have_gevent, GreenTest
+
+def wait():
+ time.sleep(.25)
+
+
+class TestPoll(PollZMQTestCase):
+
+ Poller = zmq.Poller
+
+ # This test is failing due to this issue:
+ # http://github.com/sustrik/zeromq2/issues#issue/26
+ def test_pair(self):
+ s1, s2 = self.create_bound_pair(zmq.PAIR, zmq.PAIR)
+
+ # Sleep to allow sockets to connect.
+ wait()
+
+ poller = self.Poller()
+ poller.register(s1, zmq.POLLIN|zmq.POLLOUT)
+ poller.register(s2, zmq.POLLIN|zmq.POLLOUT)
+ # Poll result should contain both sockets
+ socks = dict(poller.poll())
+ # Now make sure that both are send ready.
+ self.assertEqual(socks[s1], zmq.POLLOUT)
+ self.assertEqual(socks[s2], zmq.POLLOUT)
+ # Now do a send on both, wait and test for zmq.POLLOUT|zmq.POLLIN
+ s1.send(b'msg1')
+ s2.send(b'msg2')
+ wait()
+ socks = dict(poller.poll())
+ self.assertEqual(socks[s1], zmq.POLLOUT|zmq.POLLIN)
+ self.assertEqual(socks[s2], zmq.POLLOUT|zmq.POLLIN)
+ # Make sure that both are in POLLOUT after recv.
+ s1.recv()
+ s2.recv()
+ socks = dict(poller.poll())
+ self.assertEqual(socks[s1], zmq.POLLOUT)
+ self.assertEqual(socks[s2], zmq.POLLOUT)
+
+ poller.unregister(s1)
+ poller.unregister(s2)
+
+ # Wait for everything to finish.
+ wait()
+
+ def test_reqrep(self):
+ s1, s2 = self.create_bound_pair(zmq.REP, zmq.REQ)
+
+ # Sleep to allow sockets to connect.
+ wait()
+
+ poller = self.Poller()
+ poller.register(s1, zmq.POLLIN|zmq.POLLOUT)
+ poller.register(s2, zmq.POLLIN|zmq.POLLOUT)
+
+ # Make sure that s1 is in state 0 and s2 is in POLLOUT
+ socks = dict(poller.poll())
+ self.assertEqual(s1 in socks, 0)
+ self.assertEqual(socks[s2], zmq.POLLOUT)
+
+ # Make sure that s2 goes immediately into state 0 after send.
+ s2.send(b'msg1')
+ socks = dict(poller.poll())
+ self.assertEqual(s2 in socks, 0)
+
+ # Make sure that s1 goes into POLLIN state after a time.sleep().
+ time.sleep(0.5)
+ socks = dict(poller.poll())
+ self.assertEqual(socks[s1], zmq.POLLIN)
+
+ # Make sure that s1 goes into POLLOUT after recv.
+ s1.recv()
+ socks = dict(poller.poll())
+ self.assertEqual(socks[s1], zmq.POLLOUT)
+
+ # Make sure s1 goes into state 0 after send.
+ s1.send(b'msg2')
+ socks = dict(poller.poll())
+ self.assertEqual(s1 in socks, 0)
+
+ # Wait and then see that s2 is in POLLIN.
+ time.sleep(0.5)
+ socks = dict(poller.poll())
+ self.assertEqual(socks[s2], zmq.POLLIN)
+
+ # Make sure that s2 is in POLLOUT after recv.
+ s2.recv()
+ socks = dict(poller.poll())
+ self.assertEqual(socks[s2], zmq.POLLOUT)
+
+ poller.unregister(s1)
+ poller.unregister(s2)
+
+ # Wait for everything to finish.
+ wait()
+
+ def test_no_events(self):
+ s1, s2 = self.create_bound_pair(zmq.PAIR, zmq.PAIR)
+ poller = self.Poller()
+ poller.register(s1, zmq.POLLIN|zmq.POLLOUT)
+ poller.register(s2, 0)
+ self.assertTrue(s1 in poller)
+ self.assertFalse(s2 in poller)
+ poller.register(s1, 0)
+ self.assertFalse(s1 in poller)
+
+ def test_pubsub(self):
+ s1, s2 = self.create_bound_pair(zmq.PUB, zmq.SUB)
+ s2.setsockopt(zmq.SUBSCRIBE, b'')
+
+ # Sleep to allow sockets to connect.
+ wait()
+
+ poller = self.Poller()
+ poller.register(s1, zmq.POLLIN|zmq.POLLOUT)
+ poller.register(s2, zmq.POLLIN)
+
+ # Now make sure that both are send ready.
+ socks = dict(poller.poll())
+ self.assertEqual(socks[s1], zmq.POLLOUT)
+ self.assertEqual(s2 in socks, 0)
+ # Make sure that s1 stays in POLLOUT after a send.
+ s1.send(b'msg1')
+ socks = dict(poller.poll())
+ self.assertEqual(socks[s1], zmq.POLLOUT)
+
+ # Make sure that s2 is POLLIN after waiting.
+ wait()
+ socks = dict(poller.poll())
+ self.assertEqual(socks[s2], zmq.POLLIN)
+
+ # Make sure that s2 goes into 0 after recv.
+ s2.recv()
+ socks = dict(poller.poll())
+ self.assertEqual(s2 in socks, 0)
+
+ poller.unregister(s1)
+ poller.unregister(s2)
+
+ # Wait for everything to finish.
+ wait()
+ def test_timeout(self):
+ """make sure Poller.poll timeout has the right units (milliseconds)."""
+ s1, s2 = self.create_bound_pair(zmq.PAIR, zmq.PAIR)
+ poller = self.Poller()
+ poller.register(s1, zmq.POLLIN)
+ tic = time.time()
+ evt = poller.poll(.005)
+ toc = time.time()
+ self.assertTrue(toc-tic < 0.1)
+ tic = time.time()
+ evt = poller.poll(5)
+ toc = time.time()
+ self.assertTrue(toc-tic < 0.1)
+ self.assertTrue(toc-tic > .001)
+ tic = time.time()
+ evt = poller.poll(500)
+ toc = time.time()
+ self.assertTrue(toc-tic < 1)
+ self.assertTrue(toc-tic > 0.1)
+
+class TestSelect(PollZMQTestCase):
+
+ def test_pair(self):
+ s1, s2 = self.create_bound_pair(zmq.PAIR, zmq.PAIR)
+
+ # Sleep to allow sockets to connect.
+ wait()
+
+ rlist, wlist, xlist = zmq.select([s1, s2], [s1, s2], [s1, s2])
+ self.assert_(s1 in wlist)
+ self.assert_(s2 in wlist)
+ self.assert_(s1 not in rlist)
+ self.assert_(s2 not in rlist)
+
+ def test_timeout(self):
+ """make sure select timeout has the right units (seconds)."""
+ s1, s2 = self.create_bound_pair(zmq.PAIR, zmq.PAIR)
+ tic = time.time()
+ r,w,x = zmq.select([s1,s2],[],[],.005)
+ toc = time.time()
+ self.assertTrue(toc-tic < 1)
+ self.assertTrue(toc-tic > 0.001)
+ tic = time.time()
+ r,w,x = zmq.select([s1,s2],[],[],.25)
+ toc = time.time()
+ self.assertTrue(toc-tic < 1)
+ self.assertTrue(toc-tic > 0.1)
+
+
+if have_gevent:
+ import gevent
+ from zmq import green as gzmq
+
+ class TestPollGreen(GreenTest, TestPoll):
+ Poller = gzmq.Poller
+
+ def test_wakeup(self):
+ s1, s2 = self.create_bound_pair(zmq.PAIR, zmq.PAIR)
+ poller = self.Poller()
+ poller.register(s2, zmq.POLLIN)
+
+ tic = time.time()
+ r = gevent.spawn(lambda: poller.poll(10000))
+ s = gevent.spawn(lambda: s1.send(b'msg1'))
+ r.join()
+ toc = time.time()
+ self.assertTrue(toc-tic < 1)
+
+ def test_socket_poll(self):
+ s1, s2 = self.create_bound_pair(zmq.PAIR, zmq.PAIR)
+
+ tic = time.time()
+ r = gevent.spawn(lambda: s2.poll(10000))
+ s = gevent.spawn(lambda: s1.send(b'msg1'))
+ r.join()
+ toc = time.time()
+ self.assertTrue(toc-tic < 1)
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_pubsub.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_pubsub.py
new file mode 100644
index 00000000..a3ee22aa
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_pubsub.py
@@ -0,0 +1,41 @@
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+import time
+from unittest import TestCase
+
+import zmq
+
+from zmq.tests import BaseZMQTestCase, have_gevent, GreenTest
+
+
+class TestPubSub(BaseZMQTestCase):
+
+ pass
+
+ # We are disabling this test while an issue is being resolved.
+ def test_basic(self):
+ s1, s2 = self.create_bound_pair(zmq.PUB, zmq.SUB)
+ s2.setsockopt(zmq.SUBSCRIBE,b'')
+ time.sleep(0.1)
+ msg1 = b'message'
+ s1.send(msg1)
+ msg2 = s2.recv() # This is blocking!
+ self.assertEqual(msg1, msg2)
+
+ def test_topic(self):
+ s1, s2 = self.create_bound_pair(zmq.PUB, zmq.SUB)
+ s2.setsockopt(zmq.SUBSCRIBE, b'x')
+ time.sleep(0.1)
+ msg1 = b'message'
+ s1.send(msg1)
+ self.assertRaisesErrno(zmq.EAGAIN, s2.recv, zmq.NOBLOCK)
+ msg1 = b'xmessage'
+ s1.send(msg1)
+ msg2 = s2.recv()
+ self.assertEqual(msg1, msg2)
+
+if have_gevent:
+ class TestPubSubGreen(GreenTest, TestPubSub):
+ pass
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_reqrep.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_reqrep.py
new file mode 100644
index 00000000..de17f2b3
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_reqrep.py
@@ -0,0 +1,62 @@
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+from unittest import TestCase
+
+import zmq
+from zmq.tests import BaseZMQTestCase, have_gevent, GreenTest
+
+
+class TestReqRep(BaseZMQTestCase):
+
+ def test_basic(self):
+ s1, s2 = self.create_bound_pair(zmq.REQ, zmq.REP)
+
+ msg1 = b'message 1'
+ msg2 = self.ping_pong(s1, s2, msg1)
+ self.assertEqual(msg1, msg2)
+
+ def test_multiple(self):
+ s1, s2 = self.create_bound_pair(zmq.REQ, zmq.REP)
+
+ for i in range(10):
+ msg1 = i*b' '
+ msg2 = self.ping_pong(s1, s2, msg1)
+ self.assertEqual(msg1, msg2)
+
+ def test_bad_send_recv(self):
+ s1, s2 = self.create_bound_pair(zmq.REQ, zmq.REP)
+
+ if zmq.zmq_version() != '2.1.8':
+ # this doesn't work on 2.1.8
+ for copy in (True,False):
+ self.assertRaisesErrno(zmq.EFSM, s1.recv, copy=copy)
+ self.assertRaisesErrno(zmq.EFSM, s2.send, b'asdf', copy=copy)
+
+ # I have to have this or we die on an Abort trap.
+ msg1 = b'asdf'
+ msg2 = self.ping_pong(s1, s2, msg1)
+ self.assertEqual(msg1, msg2)
+
+ def test_json(self):
+ s1, s2 = self.create_bound_pair(zmq.REQ, zmq.REP)
+ o = dict(a=10,b=list(range(10)))
+ o2 = self.ping_pong_json(s1, s2, o)
+
+ def test_pyobj(self):
+ s1, s2 = self.create_bound_pair(zmq.REQ, zmq.REP)
+ o = dict(a=10,b=range(10))
+ o2 = self.ping_pong_pyobj(s1, s2, o)
+
+ def test_large_msg(self):
+ s1, s2 = self.create_bound_pair(zmq.REQ, zmq.REP)
+ msg1 = 10000*b'X'
+
+ for i in range(10):
+ msg2 = self.ping_pong(s1, s2, msg1)
+ self.assertEqual(msg1, msg2)
+
+if have_gevent:
+ class TestReqRepGreen(GreenTest, TestReqRep):
+ pass
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_security.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_security.py
new file mode 100644
index 00000000..687b7e0f
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_security.py
@@ -0,0 +1,212 @@
+"""Test libzmq security (libzmq >= 3.3.0)"""
+# -*- coding: utf8 -*-
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import os
+from threading import Thread
+
+import zmq
+from zmq.tests import (
+ BaseZMQTestCase, SkipTest, PYPY
+)
+from zmq.utils import z85
+
+
+USER = b"admin"
+PASS = b"password"
+
+class TestSecurity(BaseZMQTestCase):
+
+ def setUp(self):
+ if zmq.zmq_version_info() < (4,0):
+ raise SkipTest("security is new in libzmq 4.0")
+ try:
+ zmq.curve_keypair()
+ except zmq.ZMQError:
+ raise SkipTest("security requires libzmq to be linked against libsodium")
+ super(TestSecurity, self).setUp()
+
+
+ def zap_handler(self):
+ socket = self.context.socket(zmq.REP)
+ socket.bind("inproc://zeromq.zap.01")
+ try:
+ msg = self.recv_multipart(socket)
+
+ version, sequence, domain, address, identity, mechanism = msg[:6]
+ if mechanism == b'PLAIN':
+ username, password = msg[6:]
+ elif mechanism == b'CURVE':
+ key = msg[6]
+
+ self.assertEqual(version, b"1.0")
+ self.assertEqual(identity, b"IDENT")
+ reply = [version, sequence]
+ if mechanism == b'CURVE' or \
+ (mechanism == b'PLAIN' and username == USER and password == PASS) or \
+ (mechanism == b'NULL'):
+ reply.extend([
+ b"200",
+ b"OK",
+ b"anonymous",
+ b"\5Hello\0\0\0\5World",
+ ])
+ else:
+ reply.extend([
+ b"400",
+ b"Invalid username or password",
+ b"",
+ b"",
+ ])
+ socket.send_multipart(reply)
+ finally:
+ socket.close()
+
+ def start_zap(self):
+ self.zap_thread = Thread(target=self.zap_handler)
+ self.zap_thread.start()
+
+ def stop_zap(self):
+ self.zap_thread.join()
+
+ def bounce(self, server, client, test_metadata=True):
+ msg = [os.urandom(64), os.urandom(64)]
+ client.send_multipart(msg)
+ frames = self.recv_multipart(server, copy=False)
+ recvd = list(map(lambda x: x.bytes, frames))
+
+ try:
+ if test_metadata and not PYPY:
+ for frame in frames:
+ self.assertEqual(frame.get('User-Id'), 'anonymous')
+ self.assertEqual(frame.get('Hello'), 'World')
+ self.assertEqual(frame['Socket-Type'], 'DEALER')
+ except zmq.ZMQVersionError:
+ pass
+
+ self.assertEqual(recvd, msg)
+ server.send_multipart(recvd)
+ msg2 = self.recv_multipart(client)
+ self.assertEqual(msg2, msg)
+
+ def test_null(self):
+ """test NULL (default) security"""
+ server = self.socket(zmq.DEALER)
+ client = self.socket(zmq.DEALER)
+ self.assertEqual(client.MECHANISM, zmq.NULL)
+ self.assertEqual(server.mechanism, zmq.NULL)
+ self.assertEqual(client.plain_server, 0)
+ self.assertEqual(server.plain_server, 0)
+ iface = 'tcp://127.0.0.1'
+ port = server.bind_to_random_port(iface)
+ client.connect("%s:%i" % (iface, port))
+ self.bounce(server, client, False)
+
+ def test_plain(self):
+ """test PLAIN authentication"""
+ server = self.socket(zmq.DEALER)
+ server.identity = b'IDENT'
+ client = self.socket(zmq.DEALER)
+ self.assertEqual(client.plain_username, b'')
+ self.assertEqual(client.plain_password, b'')
+ client.plain_username = USER
+ client.plain_password = PASS
+ self.assertEqual(client.getsockopt(zmq.PLAIN_USERNAME), USER)
+ self.assertEqual(client.getsockopt(zmq.PLAIN_PASSWORD), PASS)
+ self.assertEqual(client.plain_server, 0)
+ self.assertEqual(server.plain_server, 0)
+ server.plain_server = True
+ self.assertEqual(server.mechanism, zmq.PLAIN)
+ self.assertEqual(client.mechanism, zmq.PLAIN)
+
+ assert not client.plain_server
+ assert server.plain_server
+
+ self.start_zap()
+
+ iface = 'tcp://127.0.0.1'
+ port = server.bind_to_random_port(iface)
+ client.connect("%s:%i" % (iface, port))
+ self.bounce(server, client)
+ self.stop_zap()
+
+ def skip_plain_inauth(self):
+ """test PLAIN failed authentication"""
+ server = self.socket(zmq.DEALER)
+ server.identity = b'IDENT'
+ client = self.socket(zmq.DEALER)
+ self.sockets.extend([server, client])
+ client.plain_username = USER
+ client.plain_password = b'incorrect'
+ server.plain_server = True
+ self.assertEqual(server.mechanism, zmq.PLAIN)
+ self.assertEqual(client.mechanism, zmq.PLAIN)
+
+ self.start_zap()
+
+ iface = 'tcp://127.0.0.1'
+ port = server.bind_to_random_port(iface)
+ client.connect("%s:%i" % (iface, port))
+ client.send(b'ping')
+ server.rcvtimeo = 250
+ self.assertRaisesErrno(zmq.EAGAIN, server.recv)
+ self.stop_zap()
+
+ def test_keypair(self):
+ """test curve_keypair"""
+ try:
+ public, secret = zmq.curve_keypair()
+ except zmq.ZMQError:
+ raise SkipTest("CURVE unsupported")
+
+ self.assertEqual(type(secret), bytes)
+ self.assertEqual(type(public), bytes)
+ self.assertEqual(len(secret), 40)
+ self.assertEqual(len(public), 40)
+
+ # verify that it is indeed Z85
+ bsecret, bpublic = [ z85.decode(key) for key in (public, secret) ]
+ self.assertEqual(type(bsecret), bytes)
+ self.assertEqual(type(bpublic), bytes)
+ self.assertEqual(len(bsecret), 32)
+ self.assertEqual(len(bpublic), 32)
+
+
+ def test_curve(self):
+ """test CURVE encryption"""
+ server = self.socket(zmq.DEALER)
+ server.identity = b'IDENT'
+ client = self.socket(zmq.DEALER)
+ self.sockets.extend([server, client])
+ try:
+ server.curve_server = True
+ except zmq.ZMQError as e:
+ # will raise EINVAL if not linked against libsodium
+ if e.errno == zmq.EINVAL:
+ raise SkipTest("CURVE unsupported")
+
+ server_public, server_secret = zmq.curve_keypair()
+ client_public, client_secret = zmq.curve_keypair()
+
+ server.curve_secretkey = server_secret
+ server.curve_publickey = server_public
+ client.curve_serverkey = server_public
+ client.curve_publickey = client_public
+ client.curve_secretkey = client_secret
+
+ self.assertEqual(server.mechanism, zmq.CURVE)
+ self.assertEqual(client.mechanism, zmq.CURVE)
+
+ self.assertEqual(server.get(zmq.CURVE_SERVER), True)
+ self.assertEqual(client.get(zmq.CURVE_SERVER), False)
+
+ self.start_zap()
+
+ iface = 'tcp://127.0.0.1'
+ port = server.bind_to_random_port(iface)
+ client.connect("%s:%i" % (iface, port))
+ self.bounce(server, client)
+ self.stop_zap()
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_socket.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_socket.py
new file mode 100644
index 00000000..5c842edc
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_socket.py
@@ -0,0 +1,450 @@
+# -*- coding: utf8 -*-
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import time
+import warnings
+
+import zmq
+from zmq.tests import (
+ BaseZMQTestCase, SkipTest, have_gevent, GreenTest, skip_pypy, skip_if
+)
+from zmq.utils.strtypes import bytes, unicode
+
+
+class TestSocket(BaseZMQTestCase):
+
+ def test_create(self):
+ ctx = self.Context()
+ s = ctx.socket(zmq.PUB)
+ # Superluminal protocol not yet implemented
+ self.assertRaisesErrno(zmq.EPROTONOSUPPORT, s.bind, 'ftl://a')
+ self.assertRaisesErrno(zmq.EPROTONOSUPPORT, s.connect, 'ftl://a')
+ self.assertRaisesErrno(zmq.EINVAL, s.bind, 'tcp://')
+ s.close()
+ del ctx
+
+ def test_context_manager(self):
+ url = 'inproc://a'
+ with self.Context() as ctx:
+ with ctx.socket(zmq.PUSH) as a:
+ a.bind(url)
+ with ctx.socket(zmq.PULL) as b:
+ b.connect(url)
+ msg = b'hi'
+ a.send(msg)
+ rcvd = self.recv(b)
+ self.assertEqual(rcvd, msg)
+ self.assertEqual(b.closed, True)
+ self.assertEqual(a.closed, True)
+ self.assertEqual(ctx.closed, True)
+
+ def test_dir(self):
+ ctx = self.Context()
+ s = ctx.socket(zmq.PUB)
+ self.assertTrue('send' in dir(s))
+ self.assertTrue('IDENTITY' in dir(s))
+ self.assertTrue('AFFINITY' in dir(s))
+ self.assertTrue('FD' in dir(s))
+ s.close()
+ ctx.term()
+
+ def test_bind_unicode(self):
+ s = self.socket(zmq.PUB)
+ p = s.bind_to_random_port(unicode("tcp://*"))
+
+ def test_connect_unicode(self):
+ s = self.socket(zmq.PUB)
+ s.connect(unicode("tcp://127.0.0.1:5555"))
+
+ def test_bind_to_random_port(self):
+ # Check that bind_to_random_port do not hide usefull exception
+ ctx = self.Context()
+ c = ctx.socket(zmq.PUB)
+ # Invalid format
+ try:
+ c.bind_to_random_port('tcp:*')
+ except zmq.ZMQError as e:
+ self.assertEqual(e.errno, zmq.EINVAL)
+ # Invalid protocol
+ try:
+ c.bind_to_random_port('rand://*')
+ except zmq.ZMQError as e:
+ self.assertEqual(e.errno, zmq.EPROTONOSUPPORT)
+
+ def test_identity(self):
+ s = self.context.socket(zmq.PULL)
+ self.sockets.append(s)
+ ident = b'identity\0\0'
+ s.identity = ident
+ self.assertEqual(s.get(zmq.IDENTITY), ident)
+
+ def test_unicode_sockopts(self):
+ """test setting/getting sockopts with unicode strings"""
+ topic = "tést"
+ if str is not unicode:
+ topic = topic.decode('utf8')
+ p,s = self.create_bound_pair(zmq.PUB, zmq.SUB)
+ self.assertEqual(s.send_unicode, s.send_unicode)
+ self.assertEqual(p.recv_unicode, p.recv_unicode)
+ self.assertRaises(TypeError, s.setsockopt, zmq.SUBSCRIBE, topic)
+ self.assertRaises(TypeError, s.setsockopt, zmq.IDENTITY, topic)
+ s.setsockopt_unicode(zmq.IDENTITY, topic, 'utf16')
+ self.assertRaises(TypeError, s.setsockopt, zmq.AFFINITY, topic)
+ s.setsockopt_unicode(zmq.SUBSCRIBE, topic)
+ self.assertRaises(TypeError, s.getsockopt_unicode, zmq.AFFINITY)
+ self.assertRaisesErrno(zmq.EINVAL, s.getsockopt_unicode, zmq.SUBSCRIBE)
+
+ identb = s.getsockopt(zmq.IDENTITY)
+ identu = identb.decode('utf16')
+ identu2 = s.getsockopt_unicode(zmq.IDENTITY, 'utf16')
+ self.assertEqual(identu, identu2)
+ time.sleep(0.1) # wait for connection/subscription
+ p.send_unicode(topic,zmq.SNDMORE)
+ p.send_unicode(topic*2, encoding='latin-1')
+ self.assertEqual(topic, s.recv_unicode())
+ self.assertEqual(topic*2, s.recv_unicode(encoding='latin-1'))
+
+ def test_int_sockopts(self):
+ "test integer sockopts"
+ v = zmq.zmq_version_info()
+ if v < (3,0):
+ default_hwm = 0
+ else:
+ default_hwm = 1000
+ p,s = self.create_bound_pair(zmq.PUB, zmq.SUB)
+ p.setsockopt(zmq.LINGER, 0)
+ self.assertEqual(p.getsockopt(zmq.LINGER), 0)
+ p.setsockopt(zmq.LINGER, -1)
+ self.assertEqual(p.getsockopt(zmq.LINGER), -1)
+ self.assertEqual(p.hwm, default_hwm)
+ p.hwm = 11
+ self.assertEqual(p.hwm, 11)
+ # p.setsockopt(zmq.EVENTS, zmq.POLLIN)
+ self.assertEqual(p.getsockopt(zmq.EVENTS), zmq.POLLOUT)
+ self.assertRaisesErrno(zmq.EINVAL, p.setsockopt,zmq.EVENTS, 2**7-1)
+ self.assertEqual(p.getsockopt(zmq.TYPE), p.socket_type)
+ self.assertEqual(p.getsockopt(zmq.TYPE), zmq.PUB)
+ self.assertEqual(s.getsockopt(zmq.TYPE), s.socket_type)
+ self.assertEqual(s.getsockopt(zmq.TYPE), zmq.SUB)
+
+ # check for overflow / wrong type:
+ errors = []
+ backref = {}
+ constants = zmq.constants
+ for name in constants.__all__:
+ value = getattr(constants, name)
+ if isinstance(value, int):
+ backref[value] = name
+ for opt in zmq.constants.int_sockopts.union(zmq.constants.int64_sockopts):
+ sopt = backref[opt]
+ if sopt.startswith((
+ 'ROUTER', 'XPUB', 'TCP', 'FAIL',
+ 'REQ_', 'CURVE_', 'PROBE_ROUTER',
+ 'IPC_FILTER', 'GSSAPI',
+ )):
+ # some sockopts are write-only
+ continue
+ try:
+ n = p.getsockopt(opt)
+ except zmq.ZMQError as e:
+ errors.append("getsockopt(zmq.%s) raised '%s'."%(sopt, e))
+ else:
+ if n > 2**31:
+ errors.append("getsockopt(zmq.%s) returned a ridiculous value."
+ " It is probably the wrong type."%sopt)
+ if errors:
+ self.fail('\n'.join([''] + errors))
+
+ def test_bad_sockopts(self):
+ """Test that appropriate errors are raised on bad socket options"""
+ s = self.context.socket(zmq.PUB)
+ self.sockets.append(s)
+ s.setsockopt(zmq.LINGER, 0)
+ # unrecognized int sockopts pass through to libzmq, and should raise EINVAL
+ self.assertRaisesErrno(zmq.EINVAL, s.setsockopt, 9999, 5)
+ self.assertRaisesErrno(zmq.EINVAL, s.getsockopt, 9999)
+ # but only int sockopts are allowed through this way, otherwise raise a TypeError
+ self.assertRaises(TypeError, s.setsockopt, 9999, b"5")
+ # some sockopts are valid in general, but not on every socket:
+ self.assertRaisesErrno(zmq.EINVAL, s.setsockopt, zmq.SUBSCRIBE, b'hi')
+
+ def test_sockopt_roundtrip(self):
+ "test set/getsockopt roundtrip."
+ p = self.context.socket(zmq.PUB)
+ self.sockets.append(p)
+ p.setsockopt(zmq.LINGER, 11)
+ self.assertEqual(p.getsockopt(zmq.LINGER), 11)
+
+ def test_send_unicode(self):
+ "test sending unicode objects"
+ a,b = self.create_bound_pair(zmq.PAIR, zmq.PAIR)
+ self.sockets.extend([a,b])
+ u = "çπ§"
+ if str is not unicode:
+ u = u.decode('utf8')
+ self.assertRaises(TypeError, a.send, u,copy=False)
+ self.assertRaises(TypeError, a.send, u,copy=True)
+ a.send_unicode(u)
+ s = b.recv()
+ self.assertEqual(s,u.encode('utf8'))
+ self.assertEqual(s.decode('utf8'),u)
+ a.send_unicode(u,encoding='utf16')
+ s = b.recv_unicode(encoding='utf16')
+ self.assertEqual(s,u)
+
+ @skip_pypy
+ def test_tracker(self):
+ "test the MessageTracker object for tracking when zmq is done with a buffer"
+ addr = 'tcp://127.0.0.1'
+ a = self.context.socket(zmq.PUB)
+ port = a.bind_to_random_port(addr)
+ a.close()
+ iface = "%s:%i"%(addr,port)
+ a = self.context.socket(zmq.PAIR)
+ # a.setsockopt(zmq.IDENTITY, b"a")
+ b = self.context.socket(zmq.PAIR)
+ self.sockets.extend([a,b])
+ a.connect(iface)
+ time.sleep(0.1)
+ p1 = a.send(b'something', copy=False, track=True)
+ self.assertTrue(isinstance(p1, zmq.MessageTracker))
+ self.assertFalse(p1.done)
+ p2 = a.send_multipart([b'something', b'else'], copy=False, track=True)
+ self.assert_(isinstance(p2, zmq.MessageTracker))
+ self.assertEqual(p2.done, False)
+ self.assertEqual(p1.done, False)
+
+ b.bind(iface)
+ msg = b.recv_multipart()
+ for i in range(10):
+ if p1.done:
+ break
+ time.sleep(0.1)
+ self.assertEqual(p1.done, True)
+ self.assertEqual(msg, [b'something'])
+ msg = b.recv_multipart()
+ for i in range(10):
+ if p2.done:
+ break
+ time.sleep(0.1)
+ self.assertEqual(p2.done, True)
+ self.assertEqual(msg, [b'something', b'else'])
+ m = zmq.Frame(b"again", track=True)
+ self.assertEqual(m.tracker.done, False)
+ p1 = a.send(m, copy=False)
+ p2 = a.send(m, copy=False)
+ self.assertEqual(m.tracker.done, False)
+ self.assertEqual(p1.done, False)
+ self.assertEqual(p2.done, False)
+ msg = b.recv_multipart()
+ self.assertEqual(m.tracker.done, False)
+ self.assertEqual(msg, [b'again'])
+ msg = b.recv_multipart()
+ self.assertEqual(m.tracker.done, False)
+ self.assertEqual(msg, [b'again'])
+ self.assertEqual(p1.done, False)
+ self.assertEqual(p2.done, False)
+ pm = m.tracker
+ del m
+ for i in range(10):
+ if p1.done:
+ break
+ time.sleep(0.1)
+ self.assertEqual(p1.done, True)
+ self.assertEqual(p2.done, True)
+ m = zmq.Frame(b'something', track=False)
+ self.assertRaises(ValueError, a.send, m, copy=False, track=True)
+
+
+ def test_close(self):
+ ctx = self.Context()
+ s = ctx.socket(zmq.PUB)
+ s.close()
+ self.assertRaisesErrno(zmq.ENOTSOCK, s.bind, b'')
+ self.assertRaisesErrno(zmq.ENOTSOCK, s.connect, b'')
+ self.assertRaisesErrno(zmq.ENOTSOCK, s.setsockopt, zmq.SUBSCRIBE, b'')
+ self.assertRaisesErrno(zmq.ENOTSOCK, s.send, b'asdf')
+ self.assertRaisesErrno(zmq.ENOTSOCK, s.recv)
+ del ctx
+
+ def test_attr(self):
+ """set setting/getting sockopts as attributes"""
+ s = self.context.socket(zmq.DEALER)
+ self.sockets.append(s)
+ linger = 10
+ s.linger = linger
+ self.assertEqual(linger, s.linger)
+ self.assertEqual(linger, s.getsockopt(zmq.LINGER))
+ self.assertEqual(s.fd, s.getsockopt(zmq.FD))
+
+ def test_bad_attr(self):
+ s = self.context.socket(zmq.DEALER)
+ self.sockets.append(s)
+ try:
+ s.apple='foo'
+ except AttributeError:
+ pass
+ else:
+ self.fail("bad setattr should have raised AttributeError")
+ try:
+ s.apple
+ except AttributeError:
+ pass
+ else:
+ self.fail("bad getattr should have raised AttributeError")
+
+ def test_subclass(self):
+ """subclasses can assign attributes"""
+ class S(zmq.Socket):
+ a = None
+ def __init__(self, *a, **kw):
+ self.a=-1
+ super(S, self).__init__(*a, **kw)
+
+ s = S(self.context, zmq.REP)
+ self.sockets.append(s)
+ self.assertEqual(s.a, -1)
+ s.a=1
+ self.assertEqual(s.a, 1)
+ a=s.a
+ self.assertEqual(a, 1)
+
+ def test_recv_multipart(self):
+ a,b = self.create_bound_pair()
+ msg = b'hi'
+ for i in range(3):
+ a.send(msg)
+ time.sleep(0.1)
+ for i in range(3):
+ self.assertEqual(b.recv_multipart(), [msg])
+
+ def test_close_after_destroy(self):
+ """s.close() after ctx.destroy() should be fine"""
+ ctx = self.Context()
+ s = ctx.socket(zmq.REP)
+ ctx.destroy()
+ # reaper is not instantaneous
+ time.sleep(1e-2)
+ s.close()
+ self.assertTrue(s.closed)
+
+ def test_poll(self):
+ a,b = self.create_bound_pair()
+ tic = time.time()
+ evt = a.poll(50)
+ self.assertEqual(evt, 0)
+ evt = a.poll(50, zmq.POLLOUT)
+ self.assertEqual(evt, zmq.POLLOUT)
+ msg = b'hi'
+ a.send(msg)
+ evt = b.poll(50)
+ self.assertEqual(evt, zmq.POLLIN)
+ msg2 = self.recv(b)
+ evt = b.poll(50)
+ self.assertEqual(evt, 0)
+ self.assertEqual(msg2, msg)
+
+ def test_ipc_path_max_length(self):
+ """IPC_PATH_MAX_LEN is a sensible value"""
+ if zmq.IPC_PATH_MAX_LEN == 0:
+ raise SkipTest("IPC_PATH_MAX_LEN undefined")
+
+ msg = "Surprising value for IPC_PATH_MAX_LEN: %s" % zmq.IPC_PATH_MAX_LEN
+ self.assertTrue(zmq.IPC_PATH_MAX_LEN > 30, msg)
+ self.assertTrue(zmq.IPC_PATH_MAX_LEN < 1025, msg)
+
+ def test_ipc_path_max_length_msg(self):
+ if zmq.IPC_PATH_MAX_LEN == 0:
+ raise SkipTest("IPC_PATH_MAX_LEN undefined")
+
+ s = self.context.socket(zmq.PUB)
+ self.sockets.append(s)
+ try:
+ s.bind('ipc://{0}'.format('a' * (zmq.IPC_PATH_MAX_LEN + 1)))
+ except zmq.ZMQError as e:
+ self.assertTrue(str(zmq.IPC_PATH_MAX_LEN) in e.strerror)
+
+ def test_hwm(self):
+ zmq3 = zmq.zmq_version_info()[0] >= 3
+ for stype in (zmq.PUB, zmq.ROUTER, zmq.SUB, zmq.REQ, zmq.DEALER):
+ s = self.context.socket(stype)
+ s.hwm = 100
+ self.assertEqual(s.hwm, 100)
+ if zmq3:
+ try:
+ self.assertEqual(s.sndhwm, 100)
+ except AttributeError:
+ pass
+ try:
+ self.assertEqual(s.rcvhwm, 100)
+ except AttributeError:
+ pass
+ s.close()
+
+ def test_shadow(self):
+ p = self.socket(zmq.PUSH)
+ p.bind("tcp://127.0.0.1:5555")
+ p2 = zmq.Socket.shadow(p.underlying)
+ self.assertEqual(p.underlying, p2.underlying)
+ s = self.socket(zmq.PULL)
+ s2 = zmq.Socket.shadow(s.underlying)
+ self.assertNotEqual(s.underlying, p.underlying)
+ self.assertEqual(s.underlying, s2.underlying)
+ s2.connect("tcp://127.0.0.1:5555")
+ sent = b'hi'
+ p2.send(sent)
+ rcvd = self.recv(s2)
+ self.assertEqual(rcvd, sent)
+
+ def test_shadow_pyczmq(self):
+ try:
+ from pyczmq import zctx, zsocket
+ except Exception:
+ raise SkipTest("Requires pyczmq")
+
+ ctx = zctx.new()
+ ca = zsocket.new(ctx, zmq.PUSH)
+ cb = zsocket.new(ctx, zmq.PULL)
+ a = zmq.Socket.shadow(ca)
+ b = zmq.Socket.shadow(cb)
+ a.bind("inproc://a")
+ b.connect("inproc://a")
+ a.send(b'hi')
+ rcvd = self.recv(b)
+ self.assertEqual(rcvd, b'hi')
+
+
+if have_gevent:
+ import gevent
+
+ class TestSocketGreen(GreenTest, TestSocket):
+ test_bad_attr = GreenTest.skip_green
+ test_close_after_destroy = GreenTest.skip_green
+
+ def test_timeout(self):
+ a,b = self.create_bound_pair()
+ g = gevent.spawn_later(0.5, lambda: a.send(b'hi'))
+ timeout = gevent.Timeout(0.1)
+ timeout.start()
+ self.assertRaises(gevent.Timeout, b.recv)
+ g.kill()
+
+ @skip_if(not hasattr(zmq, 'RCVTIMEO'))
+ def test_warn_set_timeo(self):
+ s = self.context.socket(zmq.REQ)
+ with warnings.catch_warnings(record=True) as w:
+ s.rcvtimeo = 5
+ s.close()
+ self.assertEqual(len(w), 1)
+ self.assertEqual(w[0].category, UserWarning)
+
+
+ @skip_if(not hasattr(zmq, 'SNDTIMEO'))
+ def test_warn_get_timeo(self):
+ s = self.context.socket(zmq.REQ)
+ with warnings.catch_warnings(record=True) as w:
+ s.sndtimeo
+ s.close()
+ self.assertEqual(len(w), 1)
+ self.assertEqual(w[0].category, UserWarning)
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_stopwatch.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_stopwatch.py
new file mode 100644
index 00000000..49fb79f2
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_stopwatch.py
@@ -0,0 +1,42 @@
+# -*- coding: utf8 -*-
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+import sys
+import time
+
+from unittest import TestCase
+
+from zmq import Stopwatch, ZMQError
+
+if sys.version_info[0] >= 3:
+ long = int
+
+class TestStopWatch(TestCase):
+
+ def test_stop_long(self):
+ """Ensure stop returns a long int."""
+ watch = Stopwatch()
+ watch.start()
+ us = watch.stop()
+ self.assertTrue(isinstance(us, long))
+
+ def test_stop_microseconds(self):
+ """Test that stop/sleep have right units."""
+ watch = Stopwatch()
+ watch.start()
+ tic = time.time()
+ watch.sleep(1)
+ us = watch.stop()
+ toc = time.time()
+ self.assertAlmostEqual(us/1e6,(toc-tic),places=0)
+
+ def test_double_stop(self):
+ """Test error raised on multiple calls to stop."""
+ watch = Stopwatch()
+ watch.start()
+ watch.stop()
+ self.assertRaises(ZMQError, watch.stop)
+ self.assertRaises(ZMQError, watch.stop)
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_version.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_version.py
new file mode 100644
index 00000000..6ebebf30
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_version.py
@@ -0,0 +1,44 @@
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+from unittest import TestCase
+import zmq
+from zmq.sugar import version
+
+
+class TestVersion(TestCase):
+
+ def test_pyzmq_version(self):
+ vs = zmq.pyzmq_version()
+ vs2 = zmq.__version__
+ self.assertTrue(isinstance(vs, str))
+ if zmq.__revision__:
+ self.assertEqual(vs, '@'.join(vs2, zmq.__revision__))
+ else:
+ self.assertEqual(vs, vs2)
+ if version.VERSION_EXTRA:
+ self.assertTrue(version.VERSION_EXTRA in vs)
+ self.assertTrue(version.VERSION_EXTRA in vs2)
+
+ def test_pyzmq_version_info(self):
+ info = zmq.pyzmq_version_info()
+ self.assertTrue(isinstance(info, tuple))
+ for n in info[:3]:
+ self.assertTrue(isinstance(n, int))
+ if version.VERSION_EXTRA:
+ self.assertEqual(len(info), 4)
+ self.assertEqual(info[-1], float('inf'))
+ else:
+ self.assertEqual(len(info), 3)
+
+ def test_zmq_version_info(self):
+ info = zmq.zmq_version_info()
+ self.assertTrue(isinstance(info, tuple))
+ for n in info[:3]:
+ self.assertTrue(isinstance(n, int))
+
+ def test_zmq_version(self):
+ v = zmq.zmq_version()
+ self.assertTrue(isinstance(v, str))
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_win32_shim.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_win32_shim.py
new file mode 100644
index 00000000..55657bda
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_win32_shim.py
@@ -0,0 +1,56 @@
+from __future__ import print_function
+
+import os
+
+from functools import wraps
+from zmq.tests import BaseZMQTestCase
+from zmq.utils.win32 import allow_interrupt
+
+
+def count_calls(f):
+ @wraps(f)
+ def _(*args, **kwds):
+ try:
+ return f(*args, **kwds)
+ finally:
+ _.__calls__ += 1
+ _.__calls__ = 0
+ return _
+
+
+class TestWindowsConsoleControlHandler(BaseZMQTestCase):
+
+ def test_handler(self):
+ @count_calls
+ def interrupt_polling():
+ print('Caught CTRL-C!')
+
+ if os.name == 'nt':
+ from ctypes import windll
+ from ctypes.wintypes import BOOL, DWORD
+
+ kernel32 = windll.LoadLibrary('kernel32')
+
+ # <http://msdn.microsoft.com/en-us/library/ms683155.aspx>
+ GenerateConsoleCtrlEvent = kernel32.GenerateConsoleCtrlEvent
+ GenerateConsoleCtrlEvent.argtypes = (DWORD, DWORD)
+ GenerateConsoleCtrlEvent.restype = BOOL
+
+ try:
+ # Simulate CTRL-C event while handler is active.
+ with allow_interrupt(interrupt_polling):
+ result = GenerateConsoleCtrlEvent(0, 0)
+ if result == 0:
+ raise WindowsError
+ except KeyboardInterrupt:
+ pass
+ else:
+ self.fail('Expecting `KeyboardInterrupt` exception!')
+
+ # Make sure our handler was called.
+ self.assertEqual(interrupt_polling.__calls__, 1)
+ else:
+ # On non-Windows systems, this utility is just a no-op!
+ with allow_interrupt(interrupt_polling):
+ pass
+ self.assertEqual(interrupt_polling.__calls__, 0)
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_z85.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_z85.py
new file mode 100644
index 00000000..8a73cb4d
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_z85.py
@@ -0,0 +1,63 @@
+# -*- coding: utf8 -*-
+"""Test Z85 encoding
+
+confirm values and roundtrip with test values from the reference implementation.
+"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+from unittest import TestCase
+from zmq.utils import z85
+
+
+class TestZ85(TestCase):
+
+ def test_client_public(self):
+ client_public = \
+ b"\xBB\x88\x47\x1D\x65\xE2\x65\x9B" \
+ b"\x30\xC5\x5A\x53\x21\xCE\xBB\x5A" \
+ b"\xAB\x2B\x70\xA3\x98\x64\x5C\x26" \
+ b"\xDC\xA2\xB2\xFC\xB4\x3F\xC5\x18"
+ encoded = z85.encode(client_public)
+
+ self.assertEqual(encoded, b"Yne@$w-vo<fVvi]a<NY6T1ed:M$fCG*[IaLV{hID")
+ decoded = z85.decode(encoded)
+ self.assertEqual(decoded, client_public)
+
+ def test_client_secret(self):
+ client_secret = \
+ b"\x7B\xB8\x64\xB4\x89\xAF\xA3\x67" \
+ b"\x1F\xBE\x69\x10\x1F\x94\xB3\x89" \
+ b"\x72\xF2\x48\x16\xDF\xB0\x1B\x51" \
+ b"\x65\x6B\x3F\xEC\x8D\xFD\x08\x88"
+ encoded = z85.encode(client_secret)
+
+ self.assertEqual(encoded, b"D:)Q[IlAW!ahhC2ac:9*A}h:p?([4%wOTJ%JR%cs")
+ decoded = z85.decode(encoded)
+ self.assertEqual(decoded, client_secret)
+
+ def test_server_public(self):
+ server_public = \
+ b"\x54\xFC\xBA\x24\xE9\x32\x49\x96" \
+ b"\x93\x16\xFB\x61\x7C\x87\x2B\xB0" \
+ b"\xC1\xD1\xFF\x14\x80\x04\x27\xC5" \
+ b"\x94\xCB\xFA\xCF\x1B\xC2\xD6\x52"
+ encoded = z85.encode(server_public)
+
+ self.assertEqual(encoded, b"rq:rM>}U?@Lns47E1%kR.o@n%FcmmsL/@{H8]yf7")
+ decoded = z85.decode(encoded)
+ self.assertEqual(decoded, server_public)
+
+ def test_server_secret(self):
+ server_secret = \
+ b"\x8E\x0B\xDD\x69\x76\x28\xB9\x1D" \
+ b"\x8F\x24\x55\x87\xEE\x95\xC5\xB0" \
+ b"\x4D\x48\x96\x3F\x79\x25\x98\x77" \
+ b"\xB4\x9C\xD9\x06\x3A\xEA\xD3\xB7"
+ encoded = z85.encode(server_secret)
+
+ self.assertEqual(encoded, b"JTKVSB%%)wK0E.X)V>+}o?pNmC{O&4W4b!Ni{Lh6")
+ decoded = z85.decode(encoded)
+ self.assertEqual(decoded, server_secret)
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/tests/test_zmqstream.py b/scripts/external_libs/platform/fedora18/zmq/tests/test_zmqstream.py
new file mode 100644
index 00000000..cdb3a171
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/tests/test_zmqstream.py
@@ -0,0 +1,34 @@
+# -*- coding: utf8 -*-
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+import sys
+import time
+
+from unittest import TestCase
+
+import zmq
+from zmq.eventloop import ioloop, zmqstream
+
+class TestZMQStream(TestCase):
+
+ def setUp(self):
+ self.context = zmq.Context()
+ self.socket = self.context.socket(zmq.REP)
+ self.loop = ioloop.IOLoop.instance()
+ self.stream = zmqstream.ZMQStream(self.socket)
+
+ def tearDown(self):
+ self.socket.close()
+ self.context.term()
+
+ def test_callable_check(self):
+ """Ensure callable check works (py3k)."""
+
+ self.stream.on_send(lambda *args: None)
+ self.stream.on_recv(lambda *args: None)
+ self.assertRaises(AssertionError, self.stream.on_recv, 1)
+ self.assertRaises(AssertionError, self.stream.on_send, 1)
+ self.assertRaises(AssertionError, self.stream.on_recv, zmq)
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/utils/__init__.py b/scripts/external_libs/platform/fedora18/zmq/utils/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/utils/__init__.py
diff --git a/scripts/external_libs/platform/fedora18/zmq/utils/buffers.pxd b/scripts/external_libs/platform/fedora18/zmq/utils/buffers.pxd
new file mode 100644
index 00000000..998aa551
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/utils/buffers.pxd
@@ -0,0 +1,313 @@
+"""Python version-independent methods for C/Python buffers.
+
+This file was copied and adapted from mpi4py.
+
+Authors
+-------
+* MinRK
+"""
+
+#-----------------------------------------------------------------------------
+# Copyright (c) 2010 Lisandro Dalcin
+# All rights reserved.
+# Used under BSD License: http://www.opensource.org/licenses/bsd-license.php
+#
+# Retrieval:
+# Jul 23, 2010 18:00 PST (r539)
+# http://code.google.com/p/mpi4py/source/browse/trunk/src/MPI/asbuffer.pxi
+#
+# Modifications from original:
+# Copyright (c) 2010-2012 Brian Granger, Min Ragan-Kelley
+#
+# Distributed under the terms of the New BSD License. The full license is in
+# the file COPYING.BSD, distributed as part of this software.
+#-----------------------------------------------------------------------------
+
+
+#-----------------------------------------------------------------------------
+# Python includes.
+#-----------------------------------------------------------------------------
+
+# get version-independent aliases:
+cdef extern from "pyversion_compat.h":
+ pass
+
+# Python 3 buffer interface (PEP 3118)
+cdef extern from "Python.h":
+ int PY_MAJOR_VERSION
+ int PY_MINOR_VERSION
+ ctypedef int Py_ssize_t
+ ctypedef struct PyMemoryViewObject:
+ pass
+ ctypedef struct Py_buffer:
+ void *buf
+ Py_ssize_t len
+ int readonly
+ char *format
+ int ndim
+ Py_ssize_t *shape
+ Py_ssize_t *strides
+ Py_ssize_t *suboffsets
+ Py_ssize_t itemsize
+ void *internal
+ cdef enum:
+ PyBUF_SIMPLE
+ PyBUF_WRITABLE
+ PyBUF_FORMAT
+ PyBUF_ANY_CONTIGUOUS
+ int PyObject_CheckBuffer(object)
+ int PyObject_GetBuffer(object, Py_buffer *, int) except -1
+ void PyBuffer_Release(Py_buffer *)
+
+ int PyBuffer_FillInfo(Py_buffer *view, object obj, void *buf,
+ Py_ssize_t len, int readonly, int infoflags) except -1
+ object PyMemoryView_FromBuffer(Py_buffer *info)
+
+ object PyMemoryView_FromObject(object)
+
+# Python 2 buffer interface (legacy)
+cdef extern from "Python.h":
+ ctypedef void const_void "const void"
+ Py_ssize_t Py_END_OF_BUFFER
+ int PyObject_CheckReadBuffer(object)
+ int PyObject_AsReadBuffer (object, const_void **, Py_ssize_t *) except -1
+ int PyObject_AsWriteBuffer(object, void **, Py_ssize_t *) except -1
+
+ object PyBuffer_FromMemory(void *ptr, Py_ssize_t s)
+ object PyBuffer_FromReadWriteMemory(void *ptr, Py_ssize_t s)
+
+ object PyBuffer_FromObject(object, Py_ssize_t offset, Py_ssize_t size)
+ object PyBuffer_FromReadWriteObject(object, Py_ssize_t offset, Py_ssize_t size)
+
+
+#-----------------------------------------------------------------------------
+# asbuffer: C buffer from python object
+#-----------------------------------------------------------------------------
+
+
+cdef inline int memoryview_available():
+ return PY_MAJOR_VERSION >= 3 or (PY_MAJOR_VERSION >=2 and PY_MINOR_VERSION >= 7)
+
+cdef inline int oldstyle_available():
+ return PY_MAJOR_VERSION < 3
+
+
+cdef inline int check_buffer(object ob):
+ """Version independent check for whether an object is a buffer.
+
+ Parameters
+ ----------
+ object : object
+ Any Python object
+
+ Returns
+ -------
+ int : 0 if no buffer interface, 3 if newstyle buffer interface, 2 if oldstyle.
+ """
+ if PyObject_CheckBuffer(ob):
+ return 3
+ if oldstyle_available():
+ return PyObject_CheckReadBuffer(ob) and 2
+ return 0
+
+
+cdef inline object asbuffer(object ob, int writable, int format,
+ void **base, Py_ssize_t *size,
+ Py_ssize_t *itemsize):
+ """Turn an object into a C buffer in a Python version-independent way.
+
+ Parameters
+ ----------
+ ob : object
+ The object to be turned into a buffer.
+ Must provide a Python Buffer interface
+ writable : int
+ Whether the resulting buffer should be allowed to write
+ to the object.
+ format : int
+ The format of the buffer. See Python buffer docs.
+ base : void **
+ The pointer that will be used to store the resulting C buffer.
+ size : Py_ssize_t *
+ The size of the buffer(s).
+ itemsize : Py_ssize_t *
+ The size of an item, if the buffer is non-contiguous.
+
+ Returns
+ -------
+ An object describing the buffer format. Generally a str, such as 'B'.
+ """
+
+ cdef void *bptr = NULL
+ cdef Py_ssize_t blen = 0, bitemlen = 0
+ cdef Py_buffer view
+ cdef int flags = PyBUF_SIMPLE
+ cdef int mode = 0
+
+ bfmt = None
+
+ mode = check_buffer(ob)
+ if mode == 0:
+ raise TypeError("%r does not provide a buffer interface."%ob)
+
+ if mode == 3:
+ flags = PyBUF_ANY_CONTIGUOUS
+ if writable:
+ flags |= PyBUF_WRITABLE
+ if format:
+ flags |= PyBUF_FORMAT
+ PyObject_GetBuffer(ob, &view, flags)
+ bptr = view.buf
+ blen = view.len
+ if format:
+ if view.format != NULL:
+ bfmt = view.format
+ bitemlen = view.itemsize
+ PyBuffer_Release(&view)
+ else: # oldstyle
+ if writable:
+ PyObject_AsWriteBuffer(ob, &bptr, &blen)
+ else:
+ PyObject_AsReadBuffer(ob, <const_void **>&bptr, &blen)
+ if format:
+ try: # numpy.ndarray
+ dtype = ob.dtype
+ bfmt = dtype.char
+ bitemlen = dtype.itemsize
+ except AttributeError:
+ try: # array.array
+ bfmt = ob.typecode
+ bitemlen = ob.itemsize
+ except AttributeError:
+ if isinstance(ob, bytes):
+ bfmt = b"B"
+ bitemlen = 1
+ else:
+ # nothing found
+ bfmt = None
+ bitemlen = 0
+ if base: base[0] = <void *>bptr
+ if size: size[0] = <Py_ssize_t>blen
+ if itemsize: itemsize[0] = <Py_ssize_t>bitemlen
+
+ if PY_MAJOR_VERSION >= 3 and bfmt is not None:
+ return bfmt.decode('ascii')
+ return bfmt
+
+
+cdef inline object asbuffer_r(object ob, void **base, Py_ssize_t *size):
+ """Wrapper for standard calls to asbuffer with a readonly buffer."""
+ asbuffer(ob, 0, 0, base, size, NULL)
+ return ob
+
+
+cdef inline object asbuffer_w(object ob, void **base, Py_ssize_t *size):
+ """Wrapper for standard calls to asbuffer with a writable buffer."""
+ asbuffer(ob, 1, 0, base, size, NULL)
+ return ob
+
+#------------------------------------------------------------------------------
+# frombuffer: python buffer/view from C buffer
+#------------------------------------------------------------------------------
+
+
+cdef inline object frombuffer_3(void *ptr, Py_ssize_t s, int readonly):
+ """Python 3 version of frombuffer.
+
+ This is the Python 3 model, but will work on Python >= 2.6. Currently,
+ we use it only on >= 3.0.
+ """
+ cdef Py_buffer pybuf
+ cdef Py_ssize_t *shape = [s]
+ cdef str astr=""
+ PyBuffer_FillInfo(&pybuf, astr, ptr, s, readonly, PyBUF_SIMPLE)
+ pybuf.format = "B"
+ pybuf.shape = shape
+ return PyMemoryView_FromBuffer(&pybuf)
+
+
+cdef inline object frombuffer_2(void *ptr, Py_ssize_t s, int readonly):
+ """Python 2 version of frombuffer.
+
+ This must be used for Python <= 2.6, but we use it for all Python < 3.
+ """
+
+ if oldstyle_available():
+ if readonly:
+ return PyBuffer_FromMemory(ptr, s)
+ else:
+ return PyBuffer_FromReadWriteMemory(ptr, s)
+ else:
+ raise NotImplementedError("Old style buffers not available.")
+
+
+cdef inline object frombuffer(void *ptr, Py_ssize_t s, int readonly):
+ """Create a Python Buffer/View of a C array.
+
+ Parameters
+ ----------
+ ptr : void *
+ Pointer to the array to be copied.
+ s : size_t
+ Length of the buffer.
+ readonly : int
+ whether the resulting object should be allowed to write to the buffer.
+
+ Returns
+ -------
+ Python Buffer/View of the C buffer.
+ """
+ # oldstyle first priority for now
+ if oldstyle_available():
+ return frombuffer_2(ptr, s, readonly)
+ else:
+ return frombuffer_3(ptr, s, readonly)
+
+
+cdef inline object frombuffer_r(void *ptr, Py_ssize_t s):
+ """Wrapper for readonly view frombuffer."""
+ return frombuffer(ptr, s, 1)
+
+
+cdef inline object frombuffer_w(void *ptr, Py_ssize_t s):
+ """Wrapper for writable view frombuffer."""
+ return frombuffer(ptr, s, 0)
+
+#------------------------------------------------------------------------------
+# viewfromobject: python buffer/view from python object, refcounts intact
+# frombuffer(asbuffer(obj)) would lose track of refs
+#------------------------------------------------------------------------------
+
+cdef inline object viewfromobject(object obj, int readonly):
+ """Construct a Python Buffer/View object from another Python object.
+
+ This work in a Python version independent manner.
+
+ Parameters
+ ----------
+ obj : object
+ The input object to be cast as a buffer
+ readonly : int
+ Whether the result should be prevented from overwriting the original.
+
+ Returns
+ -------
+ Buffer/View of the original object.
+ """
+ if not memoryview_available():
+ if readonly:
+ return PyBuffer_FromObject(obj, 0, Py_END_OF_BUFFER)
+ else:
+ return PyBuffer_FromReadWriteObject(obj, 0, Py_END_OF_BUFFER)
+ else:
+ return PyMemoryView_FromObject(obj)
+
+
+cdef inline object viewfromobject_r(object obj):
+ """Wrapper for readonly viewfromobject."""
+ return viewfromobject(obj, 1)
+
+
+cdef inline object viewfromobject_w(object obj):
+ """Wrapper for writable viewfromobject."""
+ return viewfromobject(obj, 0)
diff --git a/scripts/external_libs/zmq/utils/compiler.json b/scripts/external_libs/platform/fedora18/zmq/utils/compiler.json
index e58fc130..e58fc130 100644
--- a/scripts/external_libs/zmq/utils/compiler.json
+++ b/scripts/external_libs/platform/fedora18/zmq/utils/compiler.json
diff --git a/scripts/external_libs/zmq/utils/config.json b/scripts/external_libs/platform/fedora18/zmq/utils/config.json
index 1e4611f9..1e4611f9 100644
--- a/scripts/external_libs/zmq/utils/config.json
+++ b/scripts/external_libs/platform/fedora18/zmq/utils/config.json
diff --git a/scripts/external_libs/platform/fedora18/zmq/utils/constant_names.py b/scripts/external_libs/platform/fedora18/zmq/utils/constant_names.py
new file mode 100644
index 00000000..47da9dc2
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/utils/constant_names.py
@@ -0,0 +1,365 @@
+"""0MQ Constant names"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+# dictionaries of constants new or removed in particular versions
+
+new_in = {
+ (2,2,0) : [
+ 'RCVTIMEO',
+ 'SNDTIMEO',
+ ],
+ (3,2,2) : [
+ # errnos
+ 'EMSGSIZE',
+ 'EAFNOSUPPORT',
+ 'ENETUNREACH',
+ 'ECONNABORTED',
+ 'ECONNRESET',
+ 'ENOTCONN',
+ 'ETIMEDOUT',
+ 'EHOSTUNREACH',
+ 'ENETRESET',
+
+ # ctx opts
+ 'IO_THREADS',
+ 'MAX_SOCKETS',
+ 'IO_THREADS_DFLT',
+ 'MAX_SOCKETS_DFLT',
+
+ # socket opts
+ 'ROUTER_BEHAVIOR',
+ 'ROUTER_MANDATORY',
+ 'FAIL_UNROUTABLE',
+ 'TCP_KEEPALIVE',
+ 'TCP_KEEPALIVE_CNT',
+ 'TCP_KEEPALIVE_IDLE',
+ 'TCP_KEEPALIVE_INTVL',
+ 'DELAY_ATTACH_ON_CONNECT',
+ 'XPUB_VERBOSE',
+
+ # msg opts
+ 'MORE',
+
+ 'EVENT_CONNECTED',
+ 'EVENT_CONNECT_DELAYED',
+ 'EVENT_CONNECT_RETRIED',
+ 'EVENT_LISTENING',
+ 'EVENT_BIND_FAILED',
+ 'EVENT_ACCEPTED',
+ 'EVENT_ACCEPT_FAILED',
+ 'EVENT_CLOSED',
+ 'EVENT_CLOSE_FAILED',
+ 'EVENT_DISCONNECTED',
+ 'EVENT_ALL',
+ ],
+ (4,0,0) : [
+ # socket types
+ 'STREAM',
+
+ # socket opts
+ 'IMMEDIATE',
+ 'ROUTER_RAW',
+ 'IPV6',
+ 'MECHANISM',
+ 'PLAIN_SERVER',
+ 'PLAIN_USERNAME',
+ 'PLAIN_PASSWORD',
+ 'CURVE_SERVER',
+ 'CURVE_PUBLICKEY',
+ 'CURVE_SECRETKEY',
+ 'CURVE_SERVERKEY',
+ 'PROBE_ROUTER',
+ 'REQ_RELAXED',
+ 'REQ_CORRELATE',
+ 'CONFLATE',
+ 'ZAP_DOMAIN',
+
+ # security
+ 'NULL',
+ 'PLAIN',
+ 'CURVE',
+
+ # events
+ 'EVENT_MONITOR_STOPPED',
+ ],
+ (4,1,0) : [
+ # ctx opts
+ 'SOCKET_LIMIT',
+ 'THREAD_PRIORITY',
+ 'THREAD_PRIORITY_DFLT',
+ 'THREAD_SCHED_POLICY',
+ 'THREAD_SCHED_POLICY_DFLT',
+
+ # socket opts
+ 'ROUTER_HANDOVER',
+ 'TOS',
+ 'IPC_FILTER_PID',
+ 'IPC_FILTER_UID',
+ 'IPC_FILTER_GID',
+ 'CONNECT_RID',
+ 'GSSAPI_SERVER',
+ 'GSSAPI_PRINCIPAL',
+ 'GSSAPI_SERVICE_PRINCIPAL',
+ 'GSSAPI_PLAINTEXT',
+ 'HANDSHAKE_IVL',
+ 'IDENTITY_FD',
+ 'XPUB_NODROP',
+ 'SOCKS_PROXY',
+
+ # msg opts
+ 'SRCFD',
+ 'SHARED',
+
+ # security
+ 'GSSAPI',
+
+ ],
+}
+
+
+removed_in = {
+ (3,2,2) : [
+ 'UPSTREAM',
+ 'DOWNSTREAM',
+
+ 'HWM',
+ 'SWAP',
+ 'MCAST_LOOP',
+ 'RECOVERY_IVL_MSEC',
+ ]
+}
+
+# collections of zmq constant names based on their role
+# base names have no specific use
+# opt names are validated in get/set methods of various objects
+
+base_names = [
+ # base
+ 'VERSION',
+ 'VERSION_MAJOR',
+ 'VERSION_MINOR',
+ 'VERSION_PATCH',
+ 'NOBLOCK',
+ 'DONTWAIT',
+
+ 'POLLIN',
+ 'POLLOUT',
+ 'POLLERR',
+
+ 'SNDMORE',
+
+ 'STREAMER',
+ 'FORWARDER',
+ 'QUEUE',
+
+ 'IO_THREADS_DFLT',
+ 'MAX_SOCKETS_DFLT',
+ 'POLLITEMS_DFLT',
+ 'THREAD_PRIORITY_DFLT',
+ 'THREAD_SCHED_POLICY_DFLT',
+
+ # socktypes
+ 'PAIR',
+ 'PUB',
+ 'SUB',
+ 'REQ',
+ 'REP',
+ 'DEALER',
+ 'ROUTER',
+ 'XREQ',
+ 'XREP',
+ 'PULL',
+ 'PUSH',
+ 'XPUB',
+ 'XSUB',
+ 'UPSTREAM',
+ 'DOWNSTREAM',
+ 'STREAM',
+
+ # events
+ 'EVENT_CONNECTED',
+ 'EVENT_CONNECT_DELAYED',
+ 'EVENT_CONNECT_RETRIED',
+ 'EVENT_LISTENING',
+ 'EVENT_BIND_FAILED',
+ 'EVENT_ACCEPTED',
+ 'EVENT_ACCEPT_FAILED',
+ 'EVENT_CLOSED',
+ 'EVENT_CLOSE_FAILED',
+ 'EVENT_DISCONNECTED',
+ 'EVENT_ALL',
+ 'EVENT_MONITOR_STOPPED',
+
+ # security
+ 'NULL',
+ 'PLAIN',
+ 'CURVE',
+ 'GSSAPI',
+
+ ## ERRNO
+ # Often used (these are alse in errno.)
+ 'EAGAIN',
+ 'EINVAL',
+ 'EFAULT',
+ 'ENOMEM',
+ 'ENODEV',
+ 'EMSGSIZE',
+ 'EAFNOSUPPORT',
+ 'ENETUNREACH',
+ 'ECONNABORTED',
+ 'ECONNRESET',
+ 'ENOTCONN',
+ 'ETIMEDOUT',
+ 'EHOSTUNREACH',
+ 'ENETRESET',
+
+ # For Windows compatability
+ 'HAUSNUMERO',
+ 'ENOTSUP',
+ 'EPROTONOSUPPORT',
+ 'ENOBUFS',
+ 'ENETDOWN',
+ 'EADDRINUSE',
+ 'EADDRNOTAVAIL',
+ 'ECONNREFUSED',
+ 'EINPROGRESS',
+ 'ENOTSOCK',
+
+ # 0MQ Native
+ 'EFSM',
+ 'ENOCOMPATPROTO',
+ 'ETERM',
+ 'EMTHREAD',
+]
+
+int64_sockopt_names = [
+ 'AFFINITY',
+ 'MAXMSGSIZE',
+
+ # sockopts removed in 3.0.0
+ 'HWM',
+ 'SWAP',
+ 'MCAST_LOOP',
+ 'RECOVERY_IVL_MSEC',
+]
+
+bytes_sockopt_names = [
+ 'IDENTITY',
+ 'SUBSCRIBE',
+ 'UNSUBSCRIBE',
+ 'LAST_ENDPOINT',
+ 'TCP_ACCEPT_FILTER',
+
+ 'PLAIN_USERNAME',
+ 'PLAIN_PASSWORD',
+
+ 'CURVE_PUBLICKEY',
+ 'CURVE_SECRETKEY',
+ 'CURVE_SERVERKEY',
+ 'ZAP_DOMAIN',
+ 'CONNECT_RID',
+ 'GSSAPI_PRINCIPAL',
+ 'GSSAPI_SERVICE_PRINCIPAL',
+ 'SOCKS_PROXY',
+]
+
+fd_sockopt_names = [
+ 'FD',
+ 'IDENTITY_FD',
+]
+
+int_sockopt_names = [
+ # sockopts
+ 'RECONNECT_IVL_MAX',
+
+ # sockopts new in 2.2.0
+ 'SNDTIMEO',
+ 'RCVTIMEO',
+
+ # new in 3.x
+ 'SNDHWM',
+ 'RCVHWM',
+ 'MULTICAST_HOPS',
+ 'IPV4ONLY',
+
+ 'ROUTER_BEHAVIOR',
+ 'TCP_KEEPALIVE',
+ 'TCP_KEEPALIVE_CNT',
+ 'TCP_KEEPALIVE_IDLE',
+ 'TCP_KEEPALIVE_INTVL',
+ 'DELAY_ATTACH_ON_CONNECT',
+ 'XPUB_VERBOSE',
+
+ 'EVENTS',
+ 'TYPE',
+ 'LINGER',
+ 'RECONNECT_IVL',
+ 'BACKLOG',
+
+ 'ROUTER_MANDATORY',
+ 'FAIL_UNROUTABLE',
+
+ 'ROUTER_RAW',
+ 'IMMEDIATE',
+ 'IPV6',
+ 'MECHANISM',
+ 'PLAIN_SERVER',
+ 'CURVE_SERVER',
+ 'PROBE_ROUTER',
+ 'REQ_RELAXED',
+ 'REQ_CORRELATE',
+ 'CONFLATE',
+ 'ROUTER_HANDOVER',
+ 'TOS',
+ 'IPC_FILTER_PID',
+ 'IPC_FILTER_UID',
+ 'IPC_FILTER_GID',
+ 'GSSAPI_SERVER',
+ 'GSSAPI_PLAINTEXT',
+ 'HANDSHAKE_IVL',
+ 'XPUB_NODROP',
+]
+
+switched_sockopt_names = [
+ 'RATE',
+ 'RECOVERY_IVL',
+ 'SNDBUF',
+ 'RCVBUF',
+ 'RCVMORE',
+]
+
+ctx_opt_names = [
+ 'IO_THREADS',
+ 'MAX_SOCKETS',
+ 'SOCKET_LIMIT',
+ 'THREAD_PRIORITY',
+ 'THREAD_SCHED_POLICY',
+]
+
+msg_opt_names = [
+ 'MORE',
+ 'SRCFD',
+ 'SHARED',
+]
+
+from itertools import chain
+
+all_names = list(chain(
+ base_names,
+ ctx_opt_names,
+ bytes_sockopt_names,
+ fd_sockopt_names,
+ int_sockopt_names,
+ int64_sockopt_names,
+ switched_sockopt_names,
+ msg_opt_names,
+))
+
+del chain
+
+def no_prefix(name):
+ """does the given constant have a ZMQ_ prefix?"""
+ return name.startswith('E') and not name.startswith('EVENT')
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/utils/garbage.py b/scripts/external_libs/platform/fedora18/zmq/utils/garbage.py
new file mode 100644
index 00000000..80a8725a
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/utils/garbage.py
@@ -0,0 +1,180 @@
+"""Garbage collection thread for representing zmq refcount of Python objects
+used in zero-copy sends.
+"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+import atexit
+import struct
+
+from os import getpid
+from collections import namedtuple
+from threading import Thread, Event, Lock
+import warnings
+
+import zmq
+
+
+gcref = namedtuple('gcref', ['obj', 'event'])
+
+class GarbageCollectorThread(Thread):
+ """Thread in which garbage collection actually happens."""
+ def __init__(self, gc):
+ super(GarbageCollectorThread, self).__init__()
+ self.gc = gc
+ self.daemon = True
+ self.pid = getpid()
+ self.ready = Event()
+
+ def run(self):
+ # detect fork at begining of the thread
+ if getpid is None or getpid() != self.pid:
+ self.ready.set()
+ return
+ try:
+ s = self.gc.context.socket(zmq.PULL)
+ s.linger = 0
+ s.bind(self.gc.url)
+ finally:
+ self.ready.set()
+
+ while True:
+ # detect fork
+ if getpid is None or getpid() != self.pid:
+ return
+ msg = s.recv()
+ if msg == b'DIE':
+ break
+ fmt = 'L' if len(msg) == 4 else 'Q'
+ key = struct.unpack(fmt, msg)[0]
+ tup = self.gc.refs.pop(key, None)
+ if tup and tup.event:
+ tup.event.set()
+ del tup
+ s.close()
+
+
+class GarbageCollector(object):
+ """PyZMQ Garbage Collector
+
+ Used for representing the reference held by libzmq during zero-copy sends.
+ This object holds a dictionary, keyed by Python id,
+ of the Python objects whose memory are currently in use by zeromq.
+
+ When zeromq is done with the memory, it sends a message on an inproc PUSH socket
+ containing the packed size_t (32 or 64-bit unsigned int),
+ which is the key in the dict.
+ When the PULL socket in the gc thread receives that message,
+ the reference is popped from the dict,
+ and any tracker events that should be signaled fire.
+ """
+
+ refs = None
+ _context = None
+ _lock = None
+ url = "inproc://pyzmq.gc.01"
+
+ def __init__(self, context=None):
+ super(GarbageCollector, self).__init__()
+ self.refs = {}
+ self.pid = None
+ self.thread = None
+ self._context = context
+ self._lock = Lock()
+ self._stay_down = False
+ atexit.register(self._atexit)
+
+ @property
+ def context(self):
+ if self._context is None:
+ self._context = zmq.Context()
+ return self._context
+
+ @context.setter
+ def context(self, ctx):
+ if self.is_alive():
+ if self.refs:
+ warnings.warn("Replacing gc context while gc is running", RuntimeWarning)
+ self.stop()
+ self._context = ctx
+
+ def _atexit(self):
+ """atexit callback
+
+ sets _stay_down flag so that gc doesn't try to start up again in other atexit handlers
+ """
+ self._stay_down = True
+ self.stop()
+
+ def stop(self):
+ """stop the garbage-collection thread"""
+ if not self.is_alive():
+ return
+ self._stop()
+
+ def _stop(self):
+ push = self.context.socket(zmq.PUSH)
+ push.connect(self.url)
+ push.send(b'DIE')
+ push.close()
+ self.thread.join()
+ self.context.term()
+ self.refs.clear()
+ self.context = None
+
+ def start(self):
+ """Start a new garbage collection thread.
+
+ Creates a new zmq Context used for garbage collection.
+ Under most circumstances, this will only be called once per process.
+ """
+ if self.thread is not None and self.pid != getpid():
+ # It's re-starting, must free earlier thread's context
+ # since a fork probably broke it
+ self._stop()
+ self.pid = getpid()
+ self.refs = {}
+ self.thread = GarbageCollectorThread(self)
+ self.thread.start()
+ self.thread.ready.wait()
+
+ def is_alive(self):
+ """Is the garbage collection thread currently running?
+
+ Includes checks for process shutdown or fork.
+ """
+ if (getpid is None or
+ getpid() != self.pid or
+ self.thread is None or
+ not self.thread.is_alive()
+ ):
+ return False
+ return True
+
+ def store(self, obj, event=None):
+ """store an object and (optionally) event for zero-copy"""
+ if not self.is_alive():
+ if self._stay_down:
+ return 0
+ # safely start the gc thread
+ # use lock and double check,
+ # so we don't start multiple threads
+ with self._lock:
+ if not self.is_alive():
+ self.start()
+ tup = gcref(obj, event)
+ theid = id(tup)
+ self.refs[theid] = tup
+ return theid
+
+ def __del__(self):
+ if not self.is_alive():
+ return
+ try:
+ self.stop()
+ except Exception as e:
+ raise (e)
+
+gc = GarbageCollector()
diff --git a/scripts/external_libs/platform/fedora18/zmq/utils/getpid_compat.h b/scripts/external_libs/platform/fedora18/zmq/utils/getpid_compat.h
new file mode 100644
index 00000000..47ce90fa
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/utils/getpid_compat.h
@@ -0,0 +1,6 @@
+#ifdef _WIN32
+ #include <process.h>
+ #define getpid _getpid
+#else
+ #include <unistd.h>
+#endif
diff --git a/scripts/external_libs/platform/fedora18/zmq/utils/interop.py b/scripts/external_libs/platform/fedora18/zmq/utils/interop.py
new file mode 100644
index 00000000..26c01969
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/utils/interop.py
@@ -0,0 +1,33 @@
+"""Utils for interoperability with other libraries.
+
+Just CFFI pointer casting for now.
+"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+
+try:
+ long
+except NameError:
+ long = int # Python 3
+
+
+def cast_int_addr(n):
+ """Cast an address to a Python int
+
+ This could be a Python integer or a CFFI pointer
+ """
+ if isinstance(n, (int, long)):
+ return n
+ try:
+ import cffi
+ except ImportError:
+ pass
+ else:
+ # from pyzmq, this is an FFI void *
+ ffi = cffi.FFI()
+ if isinstance(n, ffi.CData):
+ return int(ffi.cast("size_t", n))
+
+ raise ValueError("Cannot cast %r to int" % n)
diff --git a/scripts/external_libs/platform/fedora18/zmq/utils/ipcmaxlen.h b/scripts/external_libs/platform/fedora18/zmq/utils/ipcmaxlen.h
new file mode 100644
index 00000000..7218db78
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/utils/ipcmaxlen.h
@@ -0,0 +1,21 @@
+/*
+
+Platform-independant detection of IPC path max length
+
+Copyright (c) 2012 Godefroid Chapelle
+
+Distributed under the terms of the New BSD License. The full license is in
+the file COPYING.BSD, distributed as part of this software.
+ */
+
+#if defined(HAVE_SYS_UN_H)
+#include "sys/un.h"
+int get_ipc_path_max_len(void) {
+ struct sockaddr_un *dummy;
+ return sizeof(dummy->sun_path) - 1;
+}
+#else
+int get_ipc_path_max_len(void) {
+ return 0;
+}
+#endif
diff --git a/scripts/external_libs/platform/fedora18/zmq/utils/jsonapi.py b/scripts/external_libs/platform/fedora18/zmq/utils/jsonapi.py
new file mode 100644
index 00000000..865ca6d5
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/utils/jsonapi.py
@@ -0,0 +1,59 @@
+"""Priority based json library imports.
+
+Always serializes to bytes instead of unicode for zeromq compatibility
+on Python 2 and 3.
+
+Use ``jsonapi.loads()`` and ``jsonapi.dumps()`` for guaranteed symmetry.
+
+Priority: ``simplejson`` > ``jsonlib2`` > stdlib ``json``
+
+``jsonapi.loads/dumps`` provide kwarg-compatibility with stdlib json.
+
+``jsonapi.jsonmod`` will be the module of the actual underlying implementation.
+"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+from zmq.utils.strtypes import bytes, unicode
+
+jsonmod = None
+
+priority = ['simplejson', 'jsonlib2', 'json']
+for mod in priority:
+ try:
+ jsonmod = __import__(mod)
+ except ImportError:
+ pass
+ else:
+ break
+
+def dumps(o, **kwargs):
+ """Serialize object to JSON bytes (utf-8).
+
+ See jsonapi.jsonmod.dumps for details on kwargs.
+ """
+
+ if 'separators' not in kwargs:
+ kwargs['separators'] = (',', ':')
+
+ s = jsonmod.dumps(o, **kwargs)
+
+ if isinstance(s, unicode):
+ s = s.encode('utf8')
+
+ return s
+
+def loads(s, **kwargs):
+ """Load object from JSON bytes (utf-8).
+
+ See jsonapi.jsonmod.loads for details on kwargs.
+ """
+
+ if str is unicode and isinstance(s, bytes):
+ s = s.decode('utf8')
+
+ return jsonmod.loads(s, **kwargs)
+
+__all__ = ['jsonmod', 'dumps', 'loads']
+
diff --git a/scripts/external_libs/platform/fedora18/zmq/utils/monitor.py b/scripts/external_libs/platform/fedora18/zmq/utils/monitor.py
new file mode 100644
index 00000000..734d54b1
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/utils/monitor.py
@@ -0,0 +1,68 @@
+# -*- coding: utf-8 -*-
+"""Module holding utility and convenience functions for zmq event monitoring."""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import struct
+import zmq
+from zmq.error import _check_version
+
+def parse_monitor_message(msg):
+ """decode zmq_monitor event messages.
+
+ Parameters
+ ----------
+ msg : list(bytes)
+ zmq multipart message that has arrived on a monitor PAIR socket.
+
+ First frame is::
+
+ 16 bit event id
+ 32 bit event value
+ no padding
+
+ Second frame is the endpoint as a bytestring
+
+ Returns
+ -------
+ event : dict
+ event description as dict with the keys `event`, `value`, and `endpoint`.
+ """
+
+ if len(msg) != 2 or len(msg[0]) != 6:
+ raise RuntimeError("Invalid event message format: %s" % msg)
+ event = {}
+ event['event'], event['value'] = struct.unpack("=hi", msg[0])
+ event['endpoint'] = msg[1]
+ return event
+
+def recv_monitor_message(socket, flags=0):
+ """Receive and decode the given raw message from the monitoring socket and return a dict.
+
+ Requires libzmq ≥ 4.0
+
+ The returned dict will have the following entries:
+ event : int, the event id as described in libzmq.zmq_socket_monitor
+ value : int, the event value associated with the event, see libzmq.zmq_socket_monitor
+ endpoint : string, the affected endpoint
+
+ Parameters
+ ----------
+ socket : zmq PAIR socket
+ The PAIR socket (created by other.get_monitor_socket()) on which to recv the message
+ flags : bitfield (int)
+ standard zmq recv flags
+
+ Returns
+ -------
+ event : dict
+ event description as dict with the keys `event`, `value`, and `endpoint`.
+ """
+ _check_version((4,0), 'libzmq event API')
+ # will always return a list
+ msg = socket.recv_multipart(flags)
+ # 4.0-style event API
+ return parse_monitor_message(msg)
+
+__all__ = ['parse_monitor_message', 'recv_monitor_message']
diff --git a/scripts/external_libs/platform/fedora18/zmq/utils/pyversion_compat.h b/scripts/external_libs/platform/fedora18/zmq/utils/pyversion_compat.h
new file mode 100644
index 00000000..fac09046
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/utils/pyversion_compat.h
@@ -0,0 +1,25 @@
+#include "Python.h"
+
+#if PY_VERSION_HEX < 0x02070000
+ #define PyMemoryView_FromBuffer(info) (PyErr_SetString(PyExc_NotImplementedError, \
+ "new buffer interface is not available"), (PyObject *)NULL)
+ #define PyMemoryView_FromObject(object) (PyErr_SetString(PyExc_NotImplementedError, \
+ "new buffer interface is not available"), (PyObject *)NULL)
+#endif
+
+#if PY_VERSION_HEX >= 0x03000000
+ // for buffers
+ #define Py_END_OF_BUFFER ((Py_ssize_t) 0)
+
+ #define PyObject_CheckReadBuffer(object) (0)
+
+ #define PyBuffer_FromMemory(ptr, s) (PyErr_SetString(PyExc_NotImplementedError, \
+ "old buffer interface is not available"), (PyObject *)NULL)
+ #define PyBuffer_FromReadWriteMemory(ptr, s) (PyErr_SetString(PyExc_NotImplementedError, \
+ "old buffer interface is not available"), (PyObject *)NULL)
+ #define PyBuffer_FromObject(object, offset, size) (PyErr_SetString(PyExc_NotImplementedError, \
+ "old buffer interface is not available"), (PyObject *)NULL)
+ #define PyBuffer_FromReadWriteObject(object, offset, size) (PyErr_SetString(PyExc_NotImplementedError, \
+ "old buffer interface is not available"), (PyObject *)NULL)
+
+#endif
diff --git a/scripts/external_libs/platform/fedora18/zmq/utils/sixcerpt.py b/scripts/external_libs/platform/fedora18/zmq/utils/sixcerpt.py
new file mode 100644
index 00000000..5492fd59
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/utils/sixcerpt.py
@@ -0,0 +1,52 @@
+"""Excerpts of six.py"""
+
+# Copyright (C) 2010-2014 Benjamin Peterson
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+import sys
+
+# Useful for very coarse version differentiation.
+PY2 = sys.version_info[0] == 2
+PY3 = sys.version_info[0] == 3
+
+if PY3:
+
+ def reraise(tp, value, tb=None):
+ if value.__traceback__ is not tb:
+ raise value.with_traceback(tb)
+ raise value
+
+else:
+ def exec_(_code_, _globs_=None, _locs_=None):
+ """Execute code in a namespace."""
+ if _globs_ is None:
+ frame = sys._getframe(1)
+ _globs_ = frame.f_globals
+ if _locs_ is None:
+ _locs_ = frame.f_locals
+ del frame
+ elif _locs_ is None:
+ _locs_ = _globs_
+ exec("""exec _code_ in _globs_, _locs_""")
+
+
+ exec_("""def reraise(tp, value, tb=None):
+ raise tp, value, tb
+""")
diff --git a/scripts/external_libs/platform/fedora18/zmq/utils/strtypes.py b/scripts/external_libs/platform/fedora18/zmq/utils/strtypes.py
new file mode 100644
index 00000000..548410dc
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/utils/strtypes.py
@@ -0,0 +1,45 @@
+"""Declare basic string types unambiguously for various Python versions.
+
+Authors
+-------
+* MinRK
+"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import sys
+
+if sys.version_info[0] >= 3:
+ bytes = bytes
+ unicode = str
+ basestring = (bytes, unicode)
+else:
+ unicode = unicode
+ bytes = str
+ basestring = basestring
+
+def cast_bytes(s, encoding='utf8', errors='strict'):
+ """cast unicode or bytes to bytes"""
+ if isinstance(s, bytes):
+ return s
+ elif isinstance(s, unicode):
+ return s.encode(encoding, errors)
+ else:
+ raise TypeError("Expected unicode or bytes, got %r" % s)
+
+def cast_unicode(s, encoding='utf8', errors='strict'):
+ """cast bytes or unicode to unicode"""
+ if isinstance(s, bytes):
+ return s.decode(encoding, errors)
+ elif isinstance(s, unicode):
+ return s
+ else:
+ raise TypeError("Expected unicode or bytes, got %r" % s)
+
+# give short 'b' alias for cast_bytes, so that we can use fake b('stuff')
+# to simulate b'stuff'
+b = asbytes = cast_bytes
+u = cast_unicode
+
+__all__ = ['asbytes', 'bytes', 'unicode', 'basestring', 'b', 'u', 'cast_bytes', 'cast_unicode']
diff --git a/scripts/external_libs/platform/fedora18/zmq/utils/win32.py b/scripts/external_libs/platform/fedora18/zmq/utils/win32.py
new file mode 100644
index 00000000..ea758299
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/utils/win32.py
@@ -0,0 +1,132 @@
+"""Win32 compatibility utilities."""
+
+#-----------------------------------------------------------------------------
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+#-----------------------------------------------------------------------------
+
+import os
+
+# No-op implementation for other platforms.
+class _allow_interrupt(object):
+ """Utility for fixing CTRL-C events on Windows.
+
+ On Windows, the Python interpreter intercepts CTRL-C events in order to
+ translate them into ``KeyboardInterrupt`` exceptions. It (presumably)
+ does this by setting a flag in its "control control handler" and
+ checking it later at a convenient location in the interpreter.
+
+ However, when the Python interpreter is blocked waiting for the ZMQ
+ poll operation to complete, it must wait for ZMQ's ``select()``
+ operation to complete before translating the CTRL-C event into the
+ ``KeyboardInterrupt`` exception.
+
+ The only way to fix this seems to be to add our own "console control
+ handler" and perform some application-defined operation that will
+ unblock the ZMQ polling operation in order to force ZMQ to pass control
+ back to the Python interpreter.
+
+ This context manager performs all that Windows-y stuff, providing you
+ with a hook that is called when a CTRL-C event is intercepted. This
+ hook allows you to unblock your ZMQ poll operation immediately, which
+ will then result in the expected ``KeyboardInterrupt`` exception.
+
+ Without this context manager, your ZMQ-based application will not
+ respond normally to CTRL-C events on Windows. If a CTRL-C event occurs
+ while blocked on ZMQ socket polling, the translation to a
+ ``KeyboardInterrupt`` exception will be delayed until the I/O completes
+ and control returns to the Python interpreter (this may never happen if
+ you use an infinite timeout).
+
+ A no-op implementation is provided on non-Win32 systems to avoid the
+ application from having to conditionally use it.
+
+ Example usage:
+
+ .. sourcecode:: python
+
+ def stop_my_application():
+ # ...
+
+ with allow_interrupt(stop_my_application):
+ # main polling loop.
+
+ In a typical ZMQ application, you would use the "self pipe trick" to
+ send message to a ``PAIR`` socket in order to interrupt your blocking
+ socket polling operation.
+
+ In a Tornado event loop, you can use the ``IOLoop.stop`` method to
+ unblock your I/O loop.
+ """
+
+ def __init__(self, action=None):
+ """Translate ``action`` into a CTRL-C handler.
+
+ ``action`` is a callable that takes no arguments and returns no
+ value (returned value is ignored). It must *NEVER* raise an
+ exception.
+
+ If unspecified, a no-op will be used.
+ """
+ self._init_action(action)
+
+ def _init_action(self, action):
+ pass
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, *args):
+ return
+
+if os.name == 'nt':
+ from ctypes import WINFUNCTYPE, windll
+ from ctypes.wintypes import BOOL, DWORD
+
+ kernel32 = windll.LoadLibrary('kernel32')
+
+ # <http://msdn.microsoft.com/en-us/library/ms686016.aspx>
+ PHANDLER_ROUTINE = WINFUNCTYPE(BOOL, DWORD)
+ SetConsoleCtrlHandler = kernel32.SetConsoleCtrlHandler
+ SetConsoleCtrlHandler.argtypes = (PHANDLER_ROUTINE, BOOL)
+ SetConsoleCtrlHandler.restype = BOOL
+
+ class allow_interrupt(_allow_interrupt):
+ __doc__ = _allow_interrupt.__doc__
+
+ def _init_action(self, action):
+ if action is None:
+ action = lambda: None
+ self.action = action
+ @PHANDLER_ROUTINE
+ def handle(event):
+ if event == 0: # CTRL_C_EVENT
+ action()
+ # Typical C implementations would return 1 to indicate that
+ # the event was processed and other control handlers in the
+ # stack should not be executed. However, that would
+ # prevent the Python interpreter's handler from translating
+ # CTRL-C to a `KeyboardInterrupt` exception, so we pretend
+ # that we didn't handle it.
+ return 0
+ self.handle = handle
+
+ def __enter__(self):
+ """Install the custom CTRL-C handler."""
+ result = SetConsoleCtrlHandler(self.handle, 1)
+ if result == 0:
+ # Have standard library automatically call `GetLastError()` and
+ # `FormatMessage()` into a nice exception object :-)
+ raise WindowsError()
+
+ def __exit__(self, *args):
+ """Remove the custom CTRL-C handler."""
+ result = SetConsoleCtrlHandler(self.handle, 0)
+ if result == 0:
+ # Have standard library automatically call `GetLastError()` and
+ # `FormatMessage()` into a nice exception object :-)
+ raise WindowsError()
+else:
+ class allow_interrupt(_allow_interrupt):
+ __doc__ = _allow_interrupt.__doc__
+ pass
diff --git a/scripts/external_libs/platform/fedora18/zmq/utils/z85.py b/scripts/external_libs/platform/fedora18/zmq/utils/z85.py
new file mode 100644
index 00000000..1bb1784e
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/utils/z85.py
@@ -0,0 +1,56 @@
+"""Python implementation of Z85 85-bit encoding
+
+Z85 encoding is a plaintext encoding for a bytestring interpreted as 32bit integers.
+Since the chunks are 32bit, a bytestring must be a multiple of 4 bytes.
+See ZMQ RFC 32 for details.
+
+
+"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import sys
+import struct
+
+PY3 = sys.version_info[0] >= 3
+# Z85CHARS is the base 85 symbol table
+Z85CHARS = b"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-:+=^!/*?&<>()[]{}@%$#"
+# Z85MAP maps integers in [0,84] to the appropriate character in Z85CHARS
+Z85MAP = dict([(c, idx) for idx, c in enumerate(Z85CHARS)])
+
+_85s = [ 85**i for i in range(5) ][::-1]
+
+def encode(rawbytes):
+ """encode raw bytes into Z85"""
+ # Accepts only byte arrays bounded to 4 bytes
+ if len(rawbytes) % 4:
+ raise ValueError("length must be multiple of 4, not %i" % len(rawbytes))
+
+ nvalues = len(rawbytes) / 4
+
+ values = struct.unpack('>%dI' % nvalues, rawbytes)
+ encoded = []
+ for v in values:
+ for offset in _85s:
+ encoded.append(Z85CHARS[(v // offset) % 85])
+
+ # In Python 3, encoded is a list of integers (obviously?!)
+ if PY3:
+ return bytes(encoded)
+ else:
+ return b''.join(encoded)
+
+def decode(z85bytes):
+ """decode Z85 bytes to raw bytes"""
+ if len(z85bytes) % 5:
+ raise ValueError("Z85 length must be multiple of 5, not %i" % len(z85bytes))
+
+ nvalues = len(z85bytes) / 5
+ values = []
+ for i in range(0, len(z85bytes), 5):
+ value = 0
+ for j, offset in enumerate(_85s):
+ value += Z85MAP[z85bytes[i+j]] * offset
+ values.append(value)
+ return struct.pack('>%dI' % nvalues, *values)
diff --git a/scripts/external_libs/platform/fedora18/zmq/utils/zmq_compat.h b/scripts/external_libs/platform/fedora18/zmq/utils/zmq_compat.h
new file mode 100644
index 00000000..81c57b69
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/utils/zmq_compat.h
@@ -0,0 +1,80 @@
+//-----------------------------------------------------------------------------
+// Copyright (c) 2010 Brian Granger, Min Ragan-Kelley
+//
+// Distributed under the terms of the New BSD License. The full license is in
+// the file COPYING.BSD, distributed as part of this software.
+//-----------------------------------------------------------------------------
+
+#if defined(_MSC_VER)
+#define pyzmq_int64_t __int64
+#else
+#include <stdint.h>
+#define pyzmq_int64_t int64_t
+#endif
+
+
+#include "zmq.h"
+// version compatibility for constants:
+#include "zmq_constants.h"
+
+#define _missing (-1)
+
+
+// define fd type (from libzmq's fd.hpp)
+#ifdef _WIN32
+ #ifdef _MSC_VER && _MSC_VER <= 1400
+ #define ZMQ_FD_T UINT_PTR
+ #else
+ #define ZMQ_FD_T SOCKET
+ #endif
+#else
+ #define ZMQ_FD_T int
+#endif
+
+// use unambiguous aliases for zmq_send/recv functions
+
+#if ZMQ_VERSION_MAJOR >= 4
+// nothing to remove
+#else
+ #define zmq_curve_keypair(z85_public_key, z85_secret_key) _missing
+#endif
+
+#if ZMQ_VERSION_MAJOR >= 4 && ZMQ_VERSION_MINOR >= 1
+// nothing to remove
+#else
+ #define zmq_msg_gets(msg, prop) _missing
+ #define zmq_has(capability) _missing
+#endif
+
+#if ZMQ_VERSION_MAJOR >= 3
+ #define zmq_sendbuf zmq_send
+ #define zmq_recvbuf zmq_recv
+
+ // 3.x deprecations - these symbols haven't been removed,
+ // but let's protect against their planned removal
+ #define zmq_device(device_type, isocket, osocket) _missing
+ #define zmq_init(io_threads) ((void*)NULL)
+ #define zmq_term zmq_ctx_destroy
+#else
+ #define zmq_ctx_set(ctx, opt, val) _missing
+ #define zmq_ctx_get(ctx, opt) _missing
+ #define zmq_ctx_destroy zmq_term
+ #define zmq_ctx_new() ((void*)NULL)
+
+ #define zmq_proxy(a,b,c) _missing
+
+ #define zmq_disconnect(s, addr) _missing
+ #define zmq_unbind(s, addr) _missing
+
+ #define zmq_msg_more(msg) _missing
+ #define zmq_msg_get(msg, opt) _missing
+ #define zmq_msg_set(msg, opt, val) _missing
+ #define zmq_msg_send(msg, s, flags) zmq_send(s, msg, flags)
+ #define zmq_msg_recv(msg, s, flags) zmq_recv(s, msg, flags)
+
+ #define zmq_sendbuf(s, buf, len, flags) _missing
+ #define zmq_recvbuf(s, buf, len, flags) _missing
+
+ #define zmq_socket_monitor(s, addr, flags) _missing
+
+#endif
diff --git a/scripts/external_libs/platform/fedora18/zmq/utils/zmq_constants.h b/scripts/external_libs/platform/fedora18/zmq/utils/zmq_constants.h
new file mode 100644
index 00000000..97683022
--- /dev/null
+++ b/scripts/external_libs/platform/fedora18/zmq/utils/zmq_constants.h
@@ -0,0 +1,622 @@
+#ifndef _PYZMQ_CONSTANT_DEFS
+#define _PYZMQ_CONSTANT_DEFS
+
+#define _PYZMQ_UNDEFINED (-9999)
+#ifndef ZMQ_VERSION
+ #define ZMQ_VERSION (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_VERSION_MAJOR
+ #define ZMQ_VERSION_MAJOR (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_VERSION_MINOR
+ #define ZMQ_VERSION_MINOR (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_VERSION_PATCH
+ #define ZMQ_VERSION_PATCH (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_NOBLOCK
+ #define ZMQ_NOBLOCK (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_DONTWAIT
+ #define ZMQ_DONTWAIT (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_POLLIN
+ #define ZMQ_POLLIN (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_POLLOUT
+ #define ZMQ_POLLOUT (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_POLLERR
+ #define ZMQ_POLLERR (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_SNDMORE
+ #define ZMQ_SNDMORE (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_STREAMER
+ #define ZMQ_STREAMER (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_FORWARDER
+ #define ZMQ_FORWARDER (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_QUEUE
+ #define ZMQ_QUEUE (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_IO_THREADS_DFLT
+ #define ZMQ_IO_THREADS_DFLT (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_MAX_SOCKETS_DFLT
+ #define ZMQ_MAX_SOCKETS_DFLT (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_POLLITEMS_DFLT
+ #define ZMQ_POLLITEMS_DFLT (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_THREAD_PRIORITY_DFLT
+ #define ZMQ_THREAD_PRIORITY_DFLT (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_THREAD_SCHED_POLICY_DFLT
+ #define ZMQ_THREAD_SCHED_POLICY_DFLT (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_PAIR
+ #define ZMQ_PAIR (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_PUB
+ #define ZMQ_PUB (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_SUB
+ #define ZMQ_SUB (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_REQ
+ #define ZMQ_REQ (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_REP
+ #define ZMQ_REP (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_DEALER
+ #define ZMQ_DEALER (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_ROUTER
+ #define ZMQ_ROUTER (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_XREQ
+ #define ZMQ_XREQ (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_XREP
+ #define ZMQ_XREP (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_PULL
+ #define ZMQ_PULL (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_PUSH
+ #define ZMQ_PUSH (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_XPUB
+ #define ZMQ_XPUB (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_XSUB
+ #define ZMQ_XSUB (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_UPSTREAM
+ #define ZMQ_UPSTREAM (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_DOWNSTREAM
+ #define ZMQ_DOWNSTREAM (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_STREAM
+ #define ZMQ_STREAM (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_EVENT_CONNECTED
+ #define ZMQ_EVENT_CONNECTED (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_EVENT_CONNECT_DELAYED
+ #define ZMQ_EVENT_CONNECT_DELAYED (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_EVENT_CONNECT_RETRIED
+ #define ZMQ_EVENT_CONNECT_RETRIED (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_EVENT_LISTENING
+ #define ZMQ_EVENT_LISTENING (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_EVENT_BIND_FAILED
+ #define ZMQ_EVENT_BIND_FAILED (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_EVENT_ACCEPTED
+ #define ZMQ_EVENT_ACCEPTED (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_EVENT_ACCEPT_FAILED
+ #define ZMQ_EVENT_ACCEPT_FAILED (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_EVENT_CLOSED
+ #define ZMQ_EVENT_CLOSED (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_EVENT_CLOSE_FAILED
+ #define ZMQ_EVENT_CLOSE_FAILED (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_EVENT_DISCONNECTED
+ #define ZMQ_EVENT_DISCONNECTED (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_EVENT_ALL
+ #define ZMQ_EVENT_ALL (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_EVENT_MONITOR_STOPPED
+ #define ZMQ_EVENT_MONITOR_STOPPED (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_NULL
+ #define ZMQ_NULL (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_PLAIN
+ #define ZMQ_PLAIN (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_CURVE
+ #define ZMQ_CURVE (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_GSSAPI
+ #define ZMQ_GSSAPI (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef EAGAIN
+ #define EAGAIN (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef EINVAL
+ #define EINVAL (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef EFAULT
+ #define EFAULT (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ENOMEM
+ #define ENOMEM (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ENODEV
+ #define ENODEV (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef EMSGSIZE
+ #define EMSGSIZE (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef EAFNOSUPPORT
+ #define EAFNOSUPPORT (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ENETUNREACH
+ #define ENETUNREACH (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ECONNABORTED
+ #define ECONNABORTED (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ECONNRESET
+ #define ECONNRESET (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ENOTCONN
+ #define ENOTCONN (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ETIMEDOUT
+ #define ETIMEDOUT (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef EHOSTUNREACH
+ #define EHOSTUNREACH (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ENETRESET
+ #define ENETRESET (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_HAUSNUMERO
+ #define ZMQ_HAUSNUMERO (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ENOTSUP
+ #define ENOTSUP (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef EPROTONOSUPPORT
+ #define EPROTONOSUPPORT (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ENOBUFS
+ #define ENOBUFS (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ENETDOWN
+ #define ENETDOWN (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef EADDRINUSE
+ #define EADDRINUSE (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef EADDRNOTAVAIL
+ #define EADDRNOTAVAIL (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ECONNREFUSED
+ #define ECONNREFUSED (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef EINPROGRESS
+ #define EINPROGRESS (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ENOTSOCK
+ #define ENOTSOCK (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef EFSM
+ #define EFSM (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ENOCOMPATPROTO
+ #define ENOCOMPATPROTO (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ETERM
+ #define ETERM (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef EMTHREAD
+ #define EMTHREAD (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_IO_THREADS
+ #define ZMQ_IO_THREADS (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_MAX_SOCKETS
+ #define ZMQ_MAX_SOCKETS (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_SOCKET_LIMIT
+ #define ZMQ_SOCKET_LIMIT (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_THREAD_PRIORITY
+ #define ZMQ_THREAD_PRIORITY (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_THREAD_SCHED_POLICY
+ #define ZMQ_THREAD_SCHED_POLICY (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_IDENTITY
+ #define ZMQ_IDENTITY (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_SUBSCRIBE
+ #define ZMQ_SUBSCRIBE (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_UNSUBSCRIBE
+ #define ZMQ_UNSUBSCRIBE (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_LAST_ENDPOINT
+ #define ZMQ_LAST_ENDPOINT (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_TCP_ACCEPT_FILTER
+ #define ZMQ_TCP_ACCEPT_FILTER (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_PLAIN_USERNAME
+ #define ZMQ_PLAIN_USERNAME (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_PLAIN_PASSWORD
+ #define ZMQ_PLAIN_PASSWORD (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_CURVE_PUBLICKEY
+ #define ZMQ_CURVE_PUBLICKEY (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_CURVE_SECRETKEY
+ #define ZMQ_CURVE_SECRETKEY (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_CURVE_SERVERKEY
+ #define ZMQ_CURVE_SERVERKEY (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_ZAP_DOMAIN
+ #define ZMQ_ZAP_DOMAIN (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_CONNECT_RID
+ #define ZMQ_CONNECT_RID (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_GSSAPI_PRINCIPAL
+ #define ZMQ_GSSAPI_PRINCIPAL (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_GSSAPI_SERVICE_PRINCIPAL
+ #define ZMQ_GSSAPI_SERVICE_PRINCIPAL (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_SOCKS_PROXY
+ #define ZMQ_SOCKS_PROXY (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_FD
+ #define ZMQ_FD (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_IDENTITY_FD
+ #define ZMQ_IDENTITY_FD (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_RECONNECT_IVL_MAX
+ #define ZMQ_RECONNECT_IVL_MAX (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_SNDTIMEO
+ #define ZMQ_SNDTIMEO (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_RCVTIMEO
+ #define ZMQ_RCVTIMEO (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_SNDHWM
+ #define ZMQ_SNDHWM (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_RCVHWM
+ #define ZMQ_RCVHWM (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_MULTICAST_HOPS
+ #define ZMQ_MULTICAST_HOPS (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_IPV4ONLY
+ #define ZMQ_IPV4ONLY (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_ROUTER_BEHAVIOR
+ #define ZMQ_ROUTER_BEHAVIOR (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_TCP_KEEPALIVE
+ #define ZMQ_TCP_KEEPALIVE (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_TCP_KEEPALIVE_CNT
+ #define ZMQ_TCP_KEEPALIVE_CNT (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_TCP_KEEPALIVE_IDLE
+ #define ZMQ_TCP_KEEPALIVE_IDLE (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_TCP_KEEPALIVE_INTVL
+ #define ZMQ_TCP_KEEPALIVE_INTVL (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_DELAY_ATTACH_ON_CONNECT
+ #define ZMQ_DELAY_ATTACH_ON_CONNECT (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_XPUB_VERBOSE
+ #define ZMQ_XPUB_VERBOSE (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_EVENTS
+ #define ZMQ_EVENTS (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_TYPE
+ #define ZMQ_TYPE (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_LINGER
+ #define ZMQ_LINGER (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_RECONNECT_IVL
+ #define ZMQ_RECONNECT_IVL (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_BACKLOG
+ #define ZMQ_BACKLOG (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_ROUTER_MANDATORY
+ #define ZMQ_ROUTER_MANDATORY (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_FAIL_UNROUTABLE
+ #define ZMQ_FAIL_UNROUTABLE (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_ROUTER_RAW
+ #define ZMQ_ROUTER_RAW (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_IMMEDIATE
+ #define ZMQ_IMMEDIATE (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_IPV6
+ #define ZMQ_IPV6 (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_MECHANISM
+ #define ZMQ_MECHANISM (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_PLAIN_SERVER
+ #define ZMQ_PLAIN_SERVER (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_CURVE_SERVER
+ #define ZMQ_CURVE_SERVER (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_PROBE_ROUTER
+ #define ZMQ_PROBE_ROUTER (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_REQ_RELAXED
+ #define ZMQ_REQ_RELAXED (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_REQ_CORRELATE
+ #define ZMQ_REQ_CORRELATE (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_CONFLATE
+ #define ZMQ_CONFLATE (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_ROUTER_HANDOVER
+ #define ZMQ_ROUTER_HANDOVER (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_TOS
+ #define ZMQ_TOS (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_IPC_FILTER_PID
+ #define ZMQ_IPC_FILTER_PID (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_IPC_FILTER_UID
+ #define ZMQ_IPC_FILTER_UID (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_IPC_FILTER_GID
+ #define ZMQ_IPC_FILTER_GID (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_GSSAPI_SERVER
+ #define ZMQ_GSSAPI_SERVER (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_GSSAPI_PLAINTEXT
+ #define ZMQ_GSSAPI_PLAINTEXT (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_HANDSHAKE_IVL
+ #define ZMQ_HANDSHAKE_IVL (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_XPUB_NODROP
+ #define ZMQ_XPUB_NODROP (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_AFFINITY
+ #define ZMQ_AFFINITY (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_MAXMSGSIZE
+ #define ZMQ_MAXMSGSIZE (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_HWM
+ #define ZMQ_HWM (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_SWAP
+ #define ZMQ_SWAP (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_MCAST_LOOP
+ #define ZMQ_MCAST_LOOP (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_RECOVERY_IVL_MSEC
+ #define ZMQ_RECOVERY_IVL_MSEC (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_RATE
+ #define ZMQ_RATE (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_RECOVERY_IVL
+ #define ZMQ_RECOVERY_IVL (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_SNDBUF
+ #define ZMQ_SNDBUF (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_RCVBUF
+ #define ZMQ_RCVBUF (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_RCVMORE
+ #define ZMQ_RCVMORE (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_MORE
+ #define ZMQ_MORE (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_SRCFD
+ #define ZMQ_SRCFD (_PYZMQ_UNDEFINED)
+#endif
+
+#ifndef ZMQ_SHARED
+ #define ZMQ_SHARED (_PYZMQ_UNDEFINED)
+#endif
+
+
+#endif // ifndef _PYZMQ_CONSTANT_DEFS
diff --git a/scripts/external_libs/zmq/backend/cython/_device.so b/scripts/external_libs/zmq/backend/cython/_device.so
deleted file mode 100644
index 5957f8e0..00000000
--- a/scripts/external_libs/zmq/backend/cython/_device.so
+++ /dev/null
Binary files differ
diff --git a/scripts/external_libs/zmq/backend/cython/_poll.so b/scripts/external_libs/zmq/backend/cython/_poll.so
deleted file mode 100644
index d93d0f10..00000000
--- a/scripts/external_libs/zmq/backend/cython/_poll.so
+++ /dev/null
Binary files differ
diff --git a/scripts/external_libs/zmq/backend/cython/_version.so b/scripts/external_libs/zmq/backend/cython/_version.so
deleted file mode 100644
index 40dd3dc8..00000000
--- a/scripts/external_libs/zmq/backend/cython/_version.so
+++ /dev/null
Binary files differ
diff --git a/scripts/external_libs/zmq/backend/cython/constants.so b/scripts/external_libs/zmq/backend/cython/constants.so
deleted file mode 100644
index cf44c07e..00000000
--- a/scripts/external_libs/zmq/backend/cython/constants.so
+++ /dev/null
Binary files differ
diff --git a/scripts/external_libs/zmq/backend/cython/context.so b/scripts/external_libs/zmq/backend/cython/context.so
deleted file mode 100644
index ef9b9699..00000000
--- a/scripts/external_libs/zmq/backend/cython/context.so
+++ /dev/null
Binary files differ
diff --git a/scripts/external_libs/zmq/backend/cython/error.so b/scripts/external_libs/zmq/backend/cython/error.so
deleted file mode 100644
index 360da9dd..00000000
--- a/scripts/external_libs/zmq/backend/cython/error.so
+++ /dev/null
Binary files differ
diff --git a/scripts/external_libs/zmq/backend/cython/message.so b/scripts/external_libs/zmq/backend/cython/message.so
deleted file mode 100644
index f674489f..00000000
--- a/scripts/external_libs/zmq/backend/cython/message.so
+++ /dev/null
Binary files differ
diff --git a/scripts/external_libs/zmq/backend/cython/socket.so b/scripts/external_libs/zmq/backend/cython/socket.so
deleted file mode 100644
index 1c927042..00000000
--- a/scripts/external_libs/zmq/backend/cython/socket.so
+++ /dev/null
Binary files differ
diff --git a/scripts/external_libs/zmq/backend/cython/utils.so b/scripts/external_libs/zmq/backend/cython/utils.so
deleted file mode 100644
index b4e5b283..00000000
--- a/scripts/external_libs/zmq/backend/cython/utils.so
+++ /dev/null
Binary files differ
diff --git a/scripts/external_libs/zmq/devices/monitoredqueue.so b/scripts/external_libs/zmq/devices/monitoredqueue.so
deleted file mode 100644
index edca8a4b..00000000
--- a/scripts/external_libs/zmq/devices/monitoredqueue.so
+++ /dev/null
Binary files differ