From bd04c082e678fb803939bacea9f41a711a3164b5 Mon Sep 17 00:00:00 2001 From: Nick Joyce Date: Mon, 7 Feb 2011 12:06:55 +1000 Subject: [PATCH] - Switch away from setuptools to distribute. - Remove cpyamf/*.c files and autogenerate the code when needed. Include the .c for sdist so that Cython is not a hard dependancy. - Refactored setup.py to only include required meta data. All all other logic has been moved to setuptools.py - Removed the need for duplicate versions - the master is now in setup.py and pyamf receives an autogenerated file. Fixes: #682, #824 --- .gitignore | 4 + CHANGES.txt | 6 +- MANIFEST.in | 8 +- cpyamf/amf0.c | 9321 -------------- cpyamf/amf3.c | 14665 ---------------------- cpyamf/codec.c | 11818 ----------------- cpyamf/util.c | 12458 ------------------ distribute_setup.py | 485 + ez_setup.py | 276 - fake_pyrex/Pyrex/Distutils/__init__.py | 1 + fake_pyrex/Pyrex/Distutils/build_ext.py | 2 + fake_pyrex/Pyrex/__init__.py | 1 + pyamf/__init__.py | 4 +- setup.cfg | 4 - setup.py | 259 +- setupinfo.py | 305 + 16 files changed, 880 insertions(+), 48737 deletions(-) delete mode 100644 cpyamf/amf0.c delete mode 100644 cpyamf/amf3.c delete mode 100644 cpyamf/codec.c delete mode 100644 cpyamf/util.c create mode 100644 distribute_setup.py delete mode 100644 ez_setup.py create mode 100644 fake_pyrex/Pyrex/Distutils/__init__.py create mode 100644 fake_pyrex/Pyrex/Distutils/build_ext.py create mode 100644 fake_pyrex/Pyrex/__init__.py create mode 100644 setupinfo.py diff --git a/.gitignore b/.gitignore index 7a555d27..a595a216 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.pyc *.class +*.c PyAMF.egg-info/ _trial_temp/ build/ @@ -11,3 +12,6 @@ doc/themes cpyamf/amf3.pyd cpyamf/codec.pyd cpyamf/util.pyd +dist +file_model +pyamf/_version.py \ No newline at end of file diff --git a/CHANGES.txt b/CHANGES.txt index e4c30d52..a4ee9f73 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -7,8 +7,10 @@ versions of PyAMF. .. contents:: -Next version ------------- +0.6.1 (Unreleased) +---------------- + +- Switched to Distribute as the future of Python packaging (Ticket:682) 0.6 (21-10-2010) diff --git a/MANIFEST.in b/MANIFEST.in index b79b9ba7..dff40b21 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,7 @@ graft doc -include ez_setup.py -include CHANGES.txt \ No newline at end of file +prune doc/build +prune doc/_build +include distribute_setup.py +include *.txt +recursive-include cpyamf *.pxd +global-exclude *.swf diff --git a/cpyamf/amf0.c b/cpyamf/amf0.c deleted file mode 100644 index c888784d..00000000 --- a/cpyamf/amf0.c +++ /dev/null @@ -1,9321 +0,0 @@ -/* Generated by Cython 0.13 on Thu Nov 25 19:27:10 2010 */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#else - -#include /* For offsetof */ -#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 - -#if PY_VERSION_HEX < 0x02040000 - #define METH_COEXIST 0 - #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) - #define PyDict_Contains(d,o) PySequence_Contains(d,o) -#endif - -#if PY_VERSION_HEX < 0x02050000 - typedef int Py_ssize_t; - #define PY_SSIZE_T_MAX INT_MAX - #define PY_SSIZE_T_MIN INT_MIN - #define PY_FORMAT_SIZE_T "" - #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) PyInt_AsLong(o) - #define PyNumber_Index(o) PyNumber_Int(o) - #define PyIndex_Check(o) PyNumber_Check(o) - #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - -#endif - -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" -#endif - -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif - -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#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_VERSION_HEX < 0x02060000 - #define PyBytesObject PyStringObject - #define PyBytes_Type PyString_Type - #define PyBytes_Check PyString_Check - #define PyBytes_CheckExact PyString_CheckExact - #define PyBytes_FromString PyString_FromString - #define PyBytes_FromStringAndSize PyString_FromStringAndSize - #define PyBytes_FromFormat PyString_FromFormat - #define PyBytes_DecodeEscape PyString_DecodeEscape - #define PyBytes_AsString PyString_AsString - #define PyBytes_AsStringAndSize PyString_AsStringAndSize - #define PyBytes_Size PyString_Size - #define PyBytes_AS_STRING PyString_AS_STRING - #define PyBytes_GET_SIZE PyString_GET_SIZE - #define PyBytes_Repr PyString_Repr - #define PyBytes_Concat PyString_Concat - #define PyBytes_ConcatAndDel PyString_ConcatAndDel - #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) - #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) -#endif - -#ifndef PySet_CheckExact -# define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif - -#if PY_MAJOR_VERSION >= 3 - #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 -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#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 - -#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) - #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) - #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) -#else - #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) - #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) -#else - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_NAMESTR(n) ((char *)(n)) - #define __Pyx_DOCSTR(n) ((char *)(n)) -#else - #define __Pyx_NAMESTR(n) (n) - #define __Pyx_DOCSTR(n) (n) -#endif - -#ifdef __cplusplus -#define __PYX_EXTERN_C extern "C" -#else -#define __PYX_EXTERN_C extern -#endif - -#if defined(WIN32) || defined(MS_WINDOWS) -#define _USE_MATH_DEFINES -#endif -#include -#define __PYX_HAVE_API__cpyamf__amf0 -#include "stdio.h" -#include "pythread.h" -#include "stdlib.h" -#include "string.h" -#include "math.h" - -/* inline attribute */ -#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 - -/* unused attribute */ -#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) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif - -typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ - - -/* Type Conversion Predeclarations */ - -#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) - -#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); -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); - -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) - - -#ifdef __GNUC__ -/* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else /* __GNUC__ > 2 ... */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -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[] = { - "amf0.pyx", - "bool.pxd", - "util.pxd", - "codec.pxd", - "amf3.pxd", -}; - -/* Type declarations */ - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pxd":28 - * cpdef bint at_eof(self) except -1 - * cpdef inline Py_ssize_t remaining(self) except -1 - * cpdef int seek(self, Py_ssize_t pos, int mode=*) except -1 # <<<<<<<<<<<<<< - * cpdef object getvalue(self) - * cdef Py_ssize_t peek(self, char **buf, Py_ssize_t size) except -1 - */ - -struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_seek { - int __pyx_n; - int mode; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pxd":31 - * cpdef object getvalue(self) - * cdef Py_ssize_t peek(self, char **buf, Py_ssize_t size) except -1 - * cpdef int truncate(self, Py_ssize_t size=?) except -1 # <<<<<<<<<<<<<< - * cpdef int consume(self) except -1 - * cdef int unpack_int(self, unsigned int num_bytes, void *ret) except -1 - */ - -struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_truncate { - int __pyx_n; - Py_ssize_t size; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":102 - * cdef int writeDate(self, object o) except -1 - * cdef int writeXML(self, object o) except -1 - * cpdef int writeList(self, object o, bint is_proxy=?) except -1 # <<<<<<<<<<<<<< - * cdef int writeTuple(self, object o) except -1 - * cdef int writeSequence(self, object iterable) except -1 - */ - -struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeList { - int __pyx_n; - int is_proxy; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":105 - * cdef int writeTuple(self, object o) except -1 - * cdef int writeSequence(self, object iterable) except -1 - * cpdef int writeObject(self, object o, bint is_proxy=?) except -1 # <<<<<<<<<<<<<< - * cdef int writeDict(self, dict o) except -1 - * cdef int writeMixedArray(self, object o) except -1 - */ - -struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeObject { - int __pyx_n; - int is_proxy; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pxd":51 - * - * cdef object readBytes(self) - * cdef object readInteger(self, int signed=?) # <<<<<<<<<<<<<< - * cdef object readByteArray(self) - * cdef object readProxy(self, obj) - */ - -struct __pyx_opt_args_6cpyamf_4amf3_7Decoder_readInteger { - int __pyx_n; - int __pyx_signed; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":230 - * return d - * - * cdef object readLongString(self, bint bytes=0): # <<<<<<<<<<<<<< - * cdef unsigned long l - * cdef char *b = NULL - */ - -struct __pyx_opt_args_6cpyamf_4amf0_7Decoder_readLongString { - int __pyx_n; - int bytes; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":351 - * return self.writeType(TYPE_NULL) - * - * cpdef int writeList(self, object a, bint is_proxy=0) except -1: # <<<<<<<<<<<<<< - * """ - * Write array to the stream. - */ - -struct __pyx_opt_args_6cpyamf_4amf0_7Encoder_writeList { - int __pyx_n; - int is_proxy; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":512 - * return self.stream.write('\x00\x00\x09', 3) - * - * cpdef int writeObject(self, o, bint is_proxy=0) except -1: # <<<<<<<<<<<<<< - * """ - * Write a Python object to the stream. - */ - -struct __pyx_opt_args_6cpyamf_4amf0_7Encoder_writeObject { - int __pyx_n; - int is_proxy; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":54 - * - * - * cdef class Codec(object): # <<<<<<<<<<<<<< - * """ - * Base class for Encoder/Decoder classes. Provides base functionality for - */ - -struct __pyx_obj_6cpyamf_5codec_Codec { - PyObject_HEAD - struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *stream; - int strict; - PyObject *timezone_offset; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":65 - * - * - * cdef class Decoder(Codec): # <<<<<<<<<<<<<< - * cdef object readDate(self) - * cpdef object readString(self) - */ - -struct __pyx_obj_6cpyamf_5codec_Decoder { - struct __pyx_obj_6cpyamf_5codec_Codec __pyx_base; - struct __pyx_vtabstruct_6cpyamf_5codec_Decoder *__pyx_vtab; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":32 - * - * - * cdef class Context(object): # <<<<<<<<<<<<<< - * """ - * C based version of ``pyamf.BaseContext`` - */ - -struct __pyx_obj_6cpyamf_5codec_Context { - PyObject_HEAD - struct __pyx_vtabstruct_6cpyamf_5codec_Context *__pyx_vtab; - PyObject *class_aliases; - struct __pyx_obj_6cpyamf_5codec_IndexedCollection *objects; - PyObject *unicodes; - PyObject *_strings; - PyObject *extra; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":47 - * - * - * cdef class Context(codec.Context): # <<<<<<<<<<<<<< - * cdef amf3.Context amf3_context - * - */ - -struct __pyx_obj_6cpyamf_4amf0_Context { - struct __pyx_obj_6cpyamf_5codec_Context __pyx_base; - struct __pyx_obj_6cpyamf_4amf3_Context *amf3_context; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pxd":5 - * - * - * cdef class cBufferedByteStream: # <<<<<<<<<<<<<< - * """ - * The c version of BufferedByteStream. - */ - -struct __pyx_obj_6cpyamf_4util_cBufferedByteStream { - PyObject_HEAD - struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *__pyx_vtab; - char endian; - char *buffer; - int closed; - Py_ssize_t pos; - Py_ssize_t size; - Py_ssize_t length; - Py_ssize_t min_buf_size; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pxd":61 - * - * - * cdef class BufferedByteStream(cBufferedByteStream): # <<<<<<<<<<<<<< - * """ - * A file like object that mimics StringIO with some extra helper methods. - */ - -struct __pyx_obj_6cpyamf_4util_BufferedByteStream { - struct __pyx_obj_6cpyamf_4util_cBufferedByteStream __pyx_base; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":81 - * - * - * cdef class Encoder(Codec): # <<<<<<<<<<<<<< - * """ - * """ - */ - -struct __pyx_obj_6cpyamf_5codec_Encoder { - struct __pyx_obj_6cpyamf_5codec_Codec __pyx_base; - struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *__pyx_vtab; - PyObject *func_cache; - PyObject *use_write_object; - PyObject *bucket; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":299 - * - * - * cdef class Encoder(codec.Encoder): # <<<<<<<<<<<<<< - * """ - * The AMF0 Encoder. - */ - -struct __pyx_obj_6cpyamf_4amf0_Encoder { - struct __pyx_obj_6cpyamf_5codec_Encoder __pyx_base; - int use_amf3; - struct __pyx_obj_6cpyamf_4amf0_Context *context; - struct __pyx_obj_6cpyamf_4amf3_Encoder *amf3_encoder; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":59 - * - * - * cdef class Decoder(codec.Decoder): # <<<<<<<<<<<<<< - * """ - * """ - */ - -struct __pyx_obj_6cpyamf_4amf0_Decoder { - struct __pyx_obj_6cpyamf_5codec_Decoder __pyx_base; - int use_amf3; - struct __pyx_obj_6cpyamf_4amf0_Context *context; - struct __pyx_obj_6cpyamf_4amf3_Decoder *amf3_decoder; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pxd":42 - * - * - * cdef class Decoder(codec.Decoder): # <<<<<<<<<<<<<< - * cdef public bint use_proxies - * cdef readonly Context context - */ - -struct __pyx_obj_6cpyamf_4amf3_Decoder { - struct __pyx_obj_6cpyamf_5codec_Decoder __pyx_base; - int use_proxies; - struct __pyx_obj_6cpyamf_4amf3_Context *context; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":11 - * from cpyamf cimport util - * - * cdef class IndexedCollection(object): # <<<<<<<<<<<<<< - * """ - * Provides reference functionality for amf contexts. - */ - -struct __pyx_obj_6cpyamf_5codec_IndexedCollection { - PyObject_HEAD - struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *__pyx_vtab; - int use_hash; - PyObject **data; - PyObject *refs; - Py_ssize_t size; - Py_ssize_t length; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pxd":56 - * - * - * cdef class Encoder(codec.Encoder): # <<<<<<<<<<<<<< - * cdef public bint use_proxies - * cdef readonly Context context - */ - -struct __pyx_obj_6cpyamf_4amf3_Encoder { - struct __pyx_obj_6cpyamf_5codec_Encoder __pyx_base; - int use_proxies; - struct __pyx_obj_6cpyamf_4amf3_Context *context; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pxd":22 - * - * - * cdef class Context(codec.Context): # <<<<<<<<<<<<<< - * cdef codec.IndexedCollection strings - * cdef dict classes - */ - -struct __pyx_obj_6cpyamf_4amf3_Context { - struct __pyx_obj_6cpyamf_5codec_Context __pyx_base; - struct __pyx_obj_6cpyamf_5codec_IndexedCollection *strings; - PyObject *classes; - PyObject *class_ref; - PyObject *proxied_objects; - Py_ssize_t class_idx; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pxd":4 - * - * - * cdef class ClassDefinition(object): # <<<<<<<<<<<<<< - * """ - * Holds transient class trait info for an individual encode/decode. - */ - -struct __pyx_obj_6cpyamf_4amf3_ClassDefinition { - PyObject_HEAD - struct __pyx_vtabstruct_6cpyamf_4amf3_ClassDefinition *__pyx_vtab; - PyObject *alias; - Py_ssize_t ref; - Py_ssize_t attr_len; - int encoding; - char *encoded_ref; - Py_ssize_t encoded_ref_size; - PyObject *static_properties; -}; - - -struct __pyx_vtabstruct_6cpyamf_4amf3_ClassDefinition { - int (*writeReference)(struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *, struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *); -}; -static struct __pyx_vtabstruct_6cpyamf_4amf3_ClassDefinition *__pyx_vtabptr_6cpyamf_4amf3_ClassDefinition; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":32 - * - * - * cdef class Context(object): # <<<<<<<<<<<<<< - * """ - * C based version of ``pyamf.BaseContext`` - */ - -struct __pyx_vtabstruct_6cpyamf_5codec_Context { - int (*clear)(struct __pyx_obj_6cpyamf_5codec_Context *, int __pyx_skip_dispatch); - PyObject *(*getClassAlias)(struct __pyx_obj_6cpyamf_5codec_Context *, PyObject *, int __pyx_skip_dispatch); - PyObject *(*getObject)(struct __pyx_obj_6cpyamf_5codec_Context *, Py_ssize_t, int __pyx_skip_dispatch); - Py_ssize_t (*getObjectReference)(struct __pyx_obj_6cpyamf_5codec_Context *, PyObject *, int __pyx_skip_dispatch); - Py_ssize_t (*addObject)(struct __pyx_obj_6cpyamf_5codec_Context *, PyObject *, int __pyx_skip_dispatch); - PyObject *(*getStringForBytes)(struct __pyx_obj_6cpyamf_5codec_Context *, PyObject *, int __pyx_skip_dispatch); - PyObject *(*getBytesForString)(struct __pyx_obj_6cpyamf_5codec_Context *, PyObject *, int __pyx_skip_dispatch); -}; -static struct __pyx_vtabstruct_6cpyamf_5codec_Context *__pyx_vtabptr_6cpyamf_5codec_Context; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":65 - * - * - * cdef class Decoder(Codec): # <<<<<<<<<<<<<< - * cdef object readDate(self) - * cpdef object readString(self) - */ - -struct __pyx_vtabstruct_6cpyamf_5codec_Decoder { - PyObject *(*readDate)(struct __pyx_obj_6cpyamf_5codec_Decoder *); - PyObject *(*readString)(struct __pyx_obj_6cpyamf_5codec_Decoder *, int __pyx_skip_dispatch); - PyObject *(*readObject)(struct __pyx_obj_6cpyamf_5codec_Decoder *); - PyObject *(*readNumber)(struct __pyx_obj_6cpyamf_5codec_Decoder *); - PyObject *(*readNull)(struct __pyx_obj_6cpyamf_5codec_Decoder *); - PyObject *(*readUndefined)(struct __pyx_obj_6cpyamf_5codec_Decoder *); - PyObject *(*readList)(struct __pyx_obj_6cpyamf_5codec_Decoder *); - PyObject *(*readXML)(struct __pyx_obj_6cpyamf_5codec_Decoder *); - PyObject *(*readElement)(struct __pyx_obj_6cpyamf_5codec_Decoder *, int __pyx_skip_dispatch); - PyObject *(*readConcreteElement)(struct __pyx_obj_6cpyamf_5codec_Decoder *, char); - int (*send)(struct __pyx_obj_6cpyamf_5codec_Decoder *, PyObject *, int __pyx_skip_dispatch); -}; -static struct __pyx_vtabstruct_6cpyamf_5codec_Decoder *__pyx_vtabptr_6cpyamf_5codec_Decoder; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":47 - * - * - * cdef class Context(codec.Context): # <<<<<<<<<<<<<< - * cdef amf3.Context amf3_context - * - */ - -struct __pyx_vtabstruct_6cpyamf_4amf0_Context { - struct __pyx_vtabstruct_6cpyamf_5codec_Context __pyx_base; -}; -static struct __pyx_vtabstruct_6cpyamf_4amf0_Context *__pyx_vtabptr_6cpyamf_4amf0_Context; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pxd":22 - * - * - * cdef class Context(codec.Context): # <<<<<<<<<<<<<< - * cdef codec.IndexedCollection strings - * cdef dict classes - */ - -struct __pyx_vtabstruct_6cpyamf_4amf3_Context { - struct __pyx_vtabstruct_6cpyamf_5codec_Context __pyx_base; - PyObject *(*getString)(struct __pyx_obj_6cpyamf_4amf3_Context *, Py_ssize_t, int __pyx_skip_dispatch); - Py_ssize_t (*getStringReference)(struct __pyx_obj_6cpyamf_4amf3_Context *, PyObject *, int __pyx_skip_dispatch); - Py_ssize_t (*addString)(struct __pyx_obj_6cpyamf_4amf3_Context *, PyObject *, int __pyx_skip_dispatch); - int (*addProxyObject)(struct __pyx_obj_6cpyamf_4amf3_Context *, PyObject *, PyObject *, int __pyx_skip_dispatch); - PyObject *(*getProxyForObject)(struct __pyx_obj_6cpyamf_4amf3_Context *, PyObject *, int __pyx_skip_dispatch); - PyObject *(*getObjectForProxy)(struct __pyx_obj_6cpyamf_4amf3_Context *, PyObject *, int __pyx_skip_dispatch); - PyObject *(*getClassByReference)(struct __pyx_obj_6cpyamf_4amf3_Context *, Py_ssize_t, int __pyx_skip_dispatch); - struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *(*getClass)(struct __pyx_obj_6cpyamf_4amf3_Context *, PyObject *, int __pyx_skip_dispatch); - Py_ssize_t (*addClass)(struct __pyx_obj_6cpyamf_4amf3_Context *, struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *, PyObject *, int __pyx_skip_dispatch); -}; -static struct __pyx_vtabstruct_6cpyamf_4amf3_Context *__pyx_vtabptr_6cpyamf_4amf3_Context; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":81 - * - * - * cdef class Encoder(Codec): # <<<<<<<<<<<<<< - * """ - * """ - */ - -struct __pyx_vtabstruct_6cpyamf_5codec_Encoder { - int (*serialiseString)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch); - int (*writeType)(struct __pyx_obj_6cpyamf_5codec_Encoder *, char); - int (*writeNull)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeUndefined)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeString)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeBytes)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeBoolean)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeInt)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeLong)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeNumber)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeDateTime)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeDate)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeXML)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeList)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeList *__pyx_optional_args); - int (*writeTuple)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeSequence)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeObject)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeObject *__pyx_optional_args); - int (*writeDict)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeMixedArray)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeGenerator)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*handleBasicTypes)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, PyObject *); - int (*checkBadTypes)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, PyObject *); - int (*writeElement)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch); - int (*send)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch); -}; -static struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *__pyx_vtabptr_6cpyamf_5codec_Encoder; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pxd":56 - * - * - * cdef class Encoder(codec.Encoder): # <<<<<<<<<<<<<< - * cdef public bint use_proxies - * cdef readonly Context context - */ - -struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder { - struct __pyx_vtabstruct_6cpyamf_5codec_Encoder __pyx_base; - int (*writeByteArray)(struct __pyx_obj_6cpyamf_4amf3_Encoder *, PyObject *); - int (*writeProxy)(struct __pyx_obj_6cpyamf_4amf3_Encoder *, PyObject *); -}; -static struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *__pyx_vtabptr_6cpyamf_4amf3_Encoder; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pxd":5 - * - * - * cdef class cBufferedByteStream: # <<<<<<<<<<<<<< - * """ - * The c version of BufferedByteStream. - */ - -struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream { - Py_ssize_t (*tell)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - int (*write)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, char *, Py_ssize_t); - int (*_init_buffer)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *); - int (*_actually_increase_buffer)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t); - int (*_increase_buffer)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t); - int (*has_available)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t); - int (*read)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, char **, Py_ssize_t); - int (*at_eof)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - Py_ssize_t (*remaining)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - int (*seek)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_seek *__pyx_optional_args); - PyObject *(*getvalue)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - Py_ssize_t (*peek)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, char **, Py_ssize_t); - int (*truncate)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_truncate *__pyx_optional_args); - int (*consume)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - int (*unpack_int)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned int, void *); - int (*pack_int)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int, long); - int (*pack_uint)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int, unsigned long); - unsigned char (*read_uchar)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - char (*read_char)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - unsigned short (*read_ushort)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - short (*read_short)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - unsigned long (*read_24bit_uint)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - long (*read_24bit_int)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - unsigned long (*read_ulong)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - long (*read_long)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - int (*write_uchar)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned char, int __pyx_skip_dispatch); - int (*write_char)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, char, int __pyx_skip_dispatch); - int (*write_ushort)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned short, int __pyx_skip_dispatch); - int (*write_short)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, short, int __pyx_skip_dispatch); - int (*write_24bit_uint)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned long, int __pyx_skip_dispatch); - int (*write_24bit_int)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, long, int __pyx_skip_dispatch); - int (*write_ulong)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned long, int __pyx_skip_dispatch); - int (*write_long)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, long, int __pyx_skip_dispatch); - PyObject *(*read_utf8_string)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t, int __pyx_skip_dispatch); - int (*write_utf8_string)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, PyObject *, int __pyx_skip_dispatch); - int (*read_double)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, double *); - int (*write_double)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, double, int __pyx_skip_dispatch); - int (*read_float)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, float *); - int (*write_float)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, float, int __pyx_skip_dispatch); - int (*append)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, PyObject *, int __pyx_skip_dispatch); -}; -static struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *__pyx_vtabptr_6cpyamf_4util_cBufferedByteStream; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pxd":42 - * - * - * cdef class Decoder(codec.Decoder): # <<<<<<<<<<<<<< - * cdef public bint use_proxies - * cdef readonly Context context - */ - -struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder { - struct __pyx_vtabstruct_6cpyamf_5codec_Decoder __pyx_base; - struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *(*_getClassDefinition)(struct __pyx_obj_6cpyamf_4amf3_Decoder *, long); - int (*_readStatic)(struct __pyx_obj_6cpyamf_4amf3_Decoder *, struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *, PyObject *); - int (*_readDynamic)(struct __pyx_obj_6cpyamf_4amf3_Decoder *, struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *, PyObject *); - PyObject *(*readBytes)(struct __pyx_obj_6cpyamf_4amf3_Decoder *); - PyObject *(*readInteger)(struct __pyx_obj_6cpyamf_4amf3_Decoder *, struct __pyx_opt_args_6cpyamf_4amf3_7Decoder_readInteger *__pyx_optional_args); - PyObject *(*readByteArray)(struct __pyx_obj_6cpyamf_4amf3_Decoder *); - PyObject *(*readProxy)(struct __pyx_obj_6cpyamf_4amf3_Decoder *, PyObject *); -}; -static struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *__pyx_vtabptr_6cpyamf_4amf3_Decoder; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":11 - * from cpyamf cimport util - * - * cdef class IndexedCollection(object): # <<<<<<<<<<<<<< - * """ - * Provides reference functionality for amf contexts. - */ - -struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection { - int (*_actually_increase_size)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *); - int (*_increase_size)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *); - void (*_clear)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *); - int (*clear)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *, int __pyx_skip_dispatch); - PyObject *(*_ref)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *, PyObject *); - PyObject *(*getByReference)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *, Py_ssize_t, int __pyx_skip_dispatch); - Py_ssize_t (*getReferenceTo)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *, PyObject *, int __pyx_skip_dispatch); - Py_ssize_t (*append)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *, PyObject *, int __pyx_skip_dispatch); -}; -static struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *__pyx_vtabptr_6cpyamf_5codec_IndexedCollection; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":59 - * - * - * cdef class Decoder(codec.Decoder): # <<<<<<<<<<<<<< - * """ - * """ - */ - -struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder { - struct __pyx_vtabstruct_6cpyamf_5codec_Decoder __pyx_base; - PyObject *(*readBoolean)(struct __pyx_obj_6cpyamf_4amf0_Decoder *); - PyObject *(*readBytes)(struct __pyx_obj_6cpyamf_4amf0_Decoder *); - PyObject *(*readObjectAttributes)(struct __pyx_obj_6cpyamf_4amf0_Decoder *, PyObject *); - PyObject *(*readTypedObject)(struct __pyx_obj_6cpyamf_4amf0_Decoder *); - PyObject *(*readReference)(struct __pyx_obj_6cpyamf_4amf0_Decoder *); - PyObject *(*readMixedArray)(struct __pyx_obj_6cpyamf_4amf0_Decoder *); - PyObject *(*readLongString)(struct __pyx_obj_6cpyamf_4amf0_Decoder *, struct __pyx_opt_args_6cpyamf_4amf0_7Decoder_readLongString *__pyx_optional_args); - PyObject *(*readAMF3)(struct __pyx_obj_6cpyamf_4amf0_Decoder *); -}; -static struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *__pyx_vtabptr_6cpyamf_4amf0_Decoder; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":299 - * - * - * cdef class Encoder(codec.Encoder): # <<<<<<<<<<<<<< - * """ - * The AMF0 Encoder. - */ - -struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder { - struct __pyx_vtabstruct_6cpyamf_5codec_Encoder __pyx_base; - int (*writeReference)(struct __pyx_obj_6cpyamf_4amf0_Encoder *, PyObject *); - int (*_writeDict)(struct __pyx_obj_6cpyamf_4amf0_Encoder *, PyObject *); - int (*_writeEndObject)(struct __pyx_obj_6cpyamf_4amf0_Encoder *); - int (*writeAMF3)(struct __pyx_obj_6cpyamf_4amf0_Encoder *, PyObject *); -}; -static struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *__pyx_vtabptr_6cpyamf_4amf0_Encoder; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pxd":61 - * - * - * cdef class BufferedByteStream(cBufferedByteStream): # <<<<<<<<<<<<<< - * """ - * A file like object that mimics StringIO with some extra helper methods. - */ - -struct __pyx_vtabstruct_6cpyamf_4util_BufferedByteStream { - struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream __pyx_base; -}; -static struct __pyx_vtabstruct_6cpyamf_4util_BufferedByteStream *__pyx_vtabptr_6cpyamf_4util_BufferedByteStream; - -#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) { - 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; - } - #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) - #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_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0) -#else - #define __Pyx_RefNannySetupContext(name) - #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_XDECREF(r) Py_XDECREF(r) -#endif /* CYTHON_REFNANNY */ -#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) -#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - -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); /*proto*/ - -static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, - const char* function_name, int kw_allowed); /*proto*/ - -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ - -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, PyObject* kw_name); /*proto*/ - -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ - - -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; -} - - -#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_List_Fast(o, i) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) { - if (likely(o != Py_None)) { - if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) { - PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i); - Py_INCREF(r); - return r; - } - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - -#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Tuple_Fast(o, i) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) { - if (likely(o != Py_None)) { - if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) { - PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i); - Py_INCREF(r); - return r; - } - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - - -#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Fast(o, i) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) { - PyObject *r; - if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { - r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - } - else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - } - else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) { - r = PySequence_GetItem(o, i); - } - else { - r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); - } - return r; -} - -static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ -static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); - -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict); /*proto*/ - -static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ - -static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/ - -static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ - -static void __Pyx_AddTraceback(const char *funcname); /*proto*/ - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*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.stdio */ - -/* Module declarations from cpython.object */ - -/* Module declarations from cpython.sequence */ - -/* Module declarations from cpython.mapping */ - -/* Module declarations from cpython.iterator */ - -/* Module declarations from cpython.type */ - -/* 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 cpython.complex */ - -/* 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.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 libc.stdlib */ - -/* Module declarations from libc.string */ - -/* Module declarations from cpyamf */ - -/* Module declarations from cpyamf.util */ - -static PyTypeObject *__pyx_ptype_6cpyamf_4util_cBufferedByteStream = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_4util_BufferedByteStream = 0; -/* Module declarations from cpyamf.codec */ - -static PyTypeObject *__pyx_ptype_6cpyamf_5codec_IndexedCollection = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_5codec_Context = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_5codec_Codec = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_5codec_Decoder = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_5codec_Encoder = 0; -/* Module declarations from cpyamf.amf3 */ - -static PyTypeObject *__pyx_ptype_6cpyamf_4amf3_ClassDefinition = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_4amf3_Context = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_4amf3_Decoder = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_4amf3_Encoder = 0; -/* Module declarations from cpyamf.amf0 */ - -static PyTypeObject *__pyx_ptype_6cpyamf_4amf0_Context = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_4amf0_Decoder = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_4amf0_Encoder = 0; -static char __pyx_v_6cpyamf_4amf0_TYPE_NUMBER; -static char __pyx_v_6cpyamf_4amf0_TYPE_BOOL; -static char __pyx_v_6cpyamf_4amf0_TYPE_STRING; -static char __pyx_v_6cpyamf_4amf0_TYPE_OBJECT; -static char __pyx_v_6cpyamf_4amf0_TYPE_MOVIECLIP; -static char __pyx_v_6cpyamf_4amf0_TYPE_NULL; -static char __pyx_v_6cpyamf_4amf0_TYPE_UNDEFINED; -static char __pyx_v_6cpyamf_4amf0_TYPE_REFERENCE; -static char __pyx_v_6cpyamf_4amf0_TYPE_MIXEDARRAY; -static char __pyx_v_6cpyamf_4amf0_TYPE_OBJECTTERM; -static char __pyx_v_6cpyamf_4amf0_TYPE_ARRAY; -static char __pyx_v_6cpyamf_4amf0_TYPE_DATE; -static char __pyx_v_6cpyamf_4amf0_TYPE_LONGSTRING; -static char __pyx_v_6cpyamf_4amf0_TYPE_UNSUPPORTED; -static char __pyx_v_6cpyamf_4amf0_TYPE_RECORDSET; -static char __pyx_v_6cpyamf_4amf0_TYPE_XML; -static char __pyx_v_6cpyamf_4amf0_TYPE_TYPEDOBJECT; -static char __pyx_v_6cpyamf_4amf0_TYPE_AMF3; -static PyObject *__pyx_v_6cpyamf_4amf0_ASObject = 0; -static PyObject *__pyx_v_6cpyamf_4amf0_UnknownClassAlias = 0; -#define __Pyx_MODULE_NAME "cpyamf.amf0" -int __pyx_module_is_main_cpyamf__amf0 = 0; - -/* Implementation of cpyamf.amf0 */ -static PyObject *__pyx_builtin_OverflowError; -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_TypeError; -static PyObject *__pyx_builtin_max; -static char __pyx_k_3[] = "Bad boolean read from stream"; -static char __pyx_k_5[] = "\000\000\t"; -static char __pyx_k_6[] = "readObjectAttributes"; -static char __pyx_k_7[] = "TypedObjectClassAlias"; -static char __pyx_k_8[] = "Unknown reference %d"; -static char __pyx_k_9[] = "Unsupported ActionScript type"; -static char __pyx_k_13[] = "utf-8"; -static char __pyx_k_15[] = "expected str from xml.tostring"; -static char __pyx_k_17[] = "\000\000"; -static char __pyx_k_18[] = "getEncodableAttributes"; -static char __pyx_k_19[] = "\nC-extension for L{pyamf.amf3} Python module in L{PyAMF}.\n\n:since: 0.6\n"; -static char __pyx_k__a[] = "a"; -static char __pyx_k__o[] = "o"; -static char __pyx_k__max[] = "max"; -static char __pyx_k__pop[] = "pop"; -static char __pyx_k__xml[] = "xml"; -static char __pyx_k__amf3[] = "amf3"; -static char __pyx_k__peek[] = "peek"; -static char __pyx_k__read[] = "read"; -static char __pyx_k__seek[] = "seek"; -static char __pyx_k__util[] = "util"; -static char __pyx_k__alias[] = "alias"; -static char __pyx_k__clear[] = "clear"; -static char __pyx_k__codec[] = "codec"; -static char __pyx_k__items[] = "items"; -static char __pyx_k__pyamf[] = "pyamf"; -static char __pyx_k__write[] = "write"; -static char __pyx_k__encode[] = "encode"; -static char __pyx_k__stream[] = "stream"; -static char __pyx_k__strict[] = "strict"; -static char __pyx_k__compile[] = "compile"; -static char __pyx_k__context[] = "context"; -static char __pyx_k__readXML[] = "readXML"; -static char __pyx_k__ASObject[] = "ASObject"; -static char __pyx_k____init__[] = "__init__"; -static char __pyx_k____main__[] = "__main__"; -static char __pyx_k____test__[] = "__test__"; -static char __pyx_k__is_proxy[] = "is_proxy"; -static char __pyx_k__readAMF3[] = "readAMF3"; -static char __pyx_k__readDate[] = "readDate"; -static char __pyx_k__readList[] = "readList"; -static char __pyx_k__readNull[] = "readNull"; -static char __pyx_k__tostring[] = "tostring"; -static char __pyx_k__use_amf3[] = "use_amf3"; -static char __pyx_k__TypeError[] = "TypeError"; -static char __pyx_k____class__[] = "__class__"; -static char __pyx_k__addObject[] = "addObject"; -static char __pyx_k__anonymous[] = "anonymous"; -static char __pyx_k__getObject[] = "getObject"; -static char __pyx_k__readBytes[] = "readBytes"; -static char __pyx_k__writeAMF3[] = "writeAMF3"; -static char __pyx_k__writeList[] = "writeList"; -static char __pyx_k__writeType[] = "writeType"; -static char __pyx_k__MixedArray[] = "MixedArray"; -static char __pyx_k__ValueError[] = "ValueError"; -static char __pyx_k___writeDict[] = "_writeDict"; -static char __pyx_k__fromstring[] = "fromstring"; -static char __pyx_k__readNumber[] = "readNumber"; -static char __pyx_k__readObject[] = "readObject"; -static char __pyx_k__readString[] = "readString"; -static char __pyx_k__read_short[] = "read_short"; -static char __pyx_k__read_uchar[] = "read_uchar"; -static char __pyx_k__read_ulong[] = "read_ulong"; -static char __pyx_k__writeBytes[] = "writeBytes"; -static char __pyx_k__DecodeError[] = "DecodeError"; -static char __pyx_k__readBoolean[] = "readBoolean"; -static char __pyx_k__readElement[] = "readElement"; -static char __pyx_k__read_double[] = "read_double"; -static char __pyx_k__read_ushort[] = "read_ushort"; -static char __pyx_k__writeObject[] = "writeObject"; -static char __pyx_k__write_ulong[] = "write_ulong"; -static char __pyx_k__amf3_context[] = "amf3_context"; -static char __pyx_k__amf3_decoder[] = "amf3_decoder"; -static char __pyx_k__amf3_encoder[] = "amf3_encoder"; -static char __pyx_k__get_datetime[] = "get_datetime"; -static char __pyx_k__static_attrs[] = "static_attrs"; -static char __pyx_k__writeElement[] = "writeElement"; -static char __pyx_k__write_double[] = "write_double"; -static char __pyx_k__write_ushort[] = "write_ushort"; -static char __pyx_k__OverflowError[] = "OverflowError"; -static char __pyx_k__getClassAlias[] = "getClassAlias"; -static char __pyx_k__get_timestamp[] = "get_timestamp"; -static char __pyx_k__readReference[] = "readReference"; -static char __pyx_k__readUndefined[] = "readUndefined"; -static char __pyx_k__ReferenceError[] = "ReferenceError"; -static char __pyx_k__createInstance[] = "createInstance"; -static char __pyx_k__readLongString[] = "readLongString"; -static char __pyx_k__readMixedArray[] = "readMixedArray"; -static char __pyx_k__writeReference[] = "writeReference"; -static char __pyx_k___writeEndObject[] = "_writeEndObject"; -static char __pyx_k__applyAttributes[] = "applyAttributes"; -static char __pyx_k__readTypedObject[] = "readTypedObject"; -static char __pyx_k__serialiseString[] = "serialiseString"; -static char __pyx_k__timezone_offset[] = "timezone_offset"; -static char __pyx_k__UnknownClassAlias[] = "UnknownClassAlias"; -static char __pyx_k__getBytesForString[] = "getBytesForString"; -static char __pyx_k__getStringForBytes[] = "getStringForBytes"; -static char __pyx_k__getObjectReference[] = "getObjectReference"; -static PyObject *__pyx_kp_s_13; -static PyObject *__pyx_kp_s_15; -static PyObject *__pyx_n_s_18; -static PyObject *__pyx_kp_s_3; -static PyObject *__pyx_n_s_6; -static PyObject *__pyx_n_s_7; -static PyObject *__pyx_kp_s_8; -static PyObject *__pyx_kp_s_9; -static PyObject *__pyx_n_s__ASObject; -static PyObject *__pyx_n_s__DecodeError; -static PyObject *__pyx_n_s__MixedArray; -static PyObject *__pyx_n_s__OverflowError; -static PyObject *__pyx_n_s__ReferenceError; -static PyObject *__pyx_n_s__TypeError; -static PyObject *__pyx_n_s__UnknownClassAlias; -static PyObject *__pyx_n_s__ValueError; -static PyObject *__pyx_n_s____class__; -static PyObject *__pyx_n_s____init__; -static PyObject *__pyx_n_s____main__; -static PyObject *__pyx_n_s____test__; -static PyObject *__pyx_n_s___writeDict; -static PyObject *__pyx_n_s___writeEndObject; -static PyObject *__pyx_n_s__a; -static PyObject *__pyx_n_s__addObject; -static PyObject *__pyx_n_s__alias; -static PyObject *__pyx_n_s__amf3; -static PyObject *__pyx_n_s__amf3_context; -static PyObject *__pyx_n_s__amf3_decoder; -static PyObject *__pyx_n_s__amf3_encoder; -static PyObject *__pyx_n_s__anonymous; -static PyObject *__pyx_n_s__applyAttributes; -static PyObject *__pyx_n_s__clear; -static PyObject *__pyx_n_s__codec; -static PyObject *__pyx_n_s__compile; -static PyObject *__pyx_n_s__context; -static PyObject *__pyx_n_s__createInstance; -static PyObject *__pyx_n_s__encode; -static PyObject *__pyx_n_s__fromstring; -static PyObject *__pyx_n_s__getBytesForString; -static PyObject *__pyx_n_s__getClassAlias; -static PyObject *__pyx_n_s__getObject; -static PyObject *__pyx_n_s__getObjectReference; -static PyObject *__pyx_n_s__getStringForBytes; -static PyObject *__pyx_n_s__get_datetime; -static PyObject *__pyx_n_s__get_timestamp; -static PyObject *__pyx_n_s__is_proxy; -static PyObject *__pyx_n_s__items; -static PyObject *__pyx_n_s__max; -static PyObject *__pyx_n_s__o; -static PyObject *__pyx_n_s__peek; -static PyObject *__pyx_n_s__pop; -static PyObject *__pyx_n_s__pyamf; -static PyObject *__pyx_n_s__read; -static PyObject *__pyx_n_s__readAMF3; -static PyObject *__pyx_n_s__readBoolean; -static PyObject *__pyx_n_s__readBytes; -static PyObject *__pyx_n_s__readDate; -static PyObject *__pyx_n_s__readElement; -static PyObject *__pyx_n_s__readList; -static PyObject *__pyx_n_s__readLongString; -static PyObject *__pyx_n_s__readMixedArray; -static PyObject *__pyx_n_s__readNull; -static PyObject *__pyx_n_s__readNumber; -static PyObject *__pyx_n_s__readObject; -static PyObject *__pyx_n_s__readReference; -static PyObject *__pyx_n_s__readString; -static PyObject *__pyx_n_s__readTypedObject; -static PyObject *__pyx_n_s__readUndefined; -static PyObject *__pyx_n_s__readXML; -static PyObject *__pyx_n_s__read_double; -static PyObject *__pyx_n_s__read_short; -static PyObject *__pyx_n_s__read_uchar; -static PyObject *__pyx_n_s__read_ulong; -static PyObject *__pyx_n_s__read_ushort; -static PyObject *__pyx_n_s__seek; -static PyObject *__pyx_n_s__serialiseString; -static PyObject *__pyx_n_s__static_attrs; -static PyObject *__pyx_n_s__stream; -static PyObject *__pyx_n_s__strict; -static PyObject *__pyx_n_s__timezone_offset; -static PyObject *__pyx_n_s__tostring; -static PyObject *__pyx_n_s__use_amf3; -static PyObject *__pyx_n_s__util; -static PyObject *__pyx_n_s__write; -static PyObject *__pyx_n_s__writeAMF3; -static PyObject *__pyx_n_s__writeBytes; -static PyObject *__pyx_n_s__writeElement; -static PyObject *__pyx_n_s__writeList; -static PyObject *__pyx_n_s__writeObject; -static PyObject *__pyx_n_s__writeReference; -static PyObject *__pyx_n_s__writeType; -static PyObject *__pyx_n_s__write_double; -static PyObject *__pyx_n_s__write_ulong; -static PyObject *__pyx_n_s__write_ushort; -static PyObject *__pyx_n_s__xml; -static PyObject *__pyx_int_0; -static PyObject *__pyx_k_tuple_1; -static PyObject *__pyx_k_tuple_2; -static PyObject *__pyx_k_tuple_4; -static PyObject *__pyx_k_tuple_10; -static PyObject *__pyx_k_tuple_11; -static PyObject *__pyx_k_tuple_12; -static PyObject *__pyx_k_tuple_14; -static PyObject *__pyx_k_tuple_16; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":50 - * cdef amf3.Context amf3_context - * - * cpdef int clear(self) except -1: # <<<<<<<<<<<<<< - * codec.Context.clear(self) - * - */ - -static PyObject *__pyx_pf_6cpyamf_4amf0_7Context_clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static int __pyx_f_6cpyamf_4amf0_7Context_clear(struct __pyx_obj_6cpyamf_4amf0_Context *__pyx_v_self, int __pyx_skip_dispatch) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("clear"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__clear); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4amf0_7Context_clear)) { - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":51 - * - * cpdef int clear(self) except -1: - * codec.Context.clear(self) # <<<<<<<<<<<<<< - * - * if self.amf3_context: - */ - __pyx_t_3 = __pyx_vtabptr_6cpyamf_5codec_Context->clear(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self), 1); if (unlikely(__pyx_t_3 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":53 - * codec.Context.clear(self) - * - * if self.amf3_context: # <<<<<<<<<<<<<< - * self.amf3_context.clear() - * - */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->amf3_context)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_4) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":54 - * - * if self.amf3_context: - * self.amf3_context.clear() # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->amf3_context->__pyx_base.__pyx_vtab)->__pyx_base.clear(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->amf3_context), 0); if (unlikely(__pyx_t_3 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":56 - * self.amf3_context.clear() - * - * return 0 # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.amf0.Context.clear"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":50 - * cdef amf3.Context amf3_context - * - * cpdef int clear(self) except -1: # <<<<<<<<<<<<<< - * codec.Context.clear(self) - * - */ - -static PyObject *__pyx_pf_6cpyamf_4amf0_7Context_clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4amf0_7Context_clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("clear"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Context *)((struct __pyx_obj_6cpyamf_4amf0_Context *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.clear(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self), 1); if (unlikely(__pyx_t_1 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.amf0.Context.clear"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":67 - * cdef amf3.Decoder amf3_decoder - * - * def __cinit__(self): # <<<<<<<<<<<<<< - * self.use_amf3 = 0 - * - */ - -static int __pyx_pf_6cpyamf_4amf0_7Decoder___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6cpyamf_4amf0_7Decoder___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - int __pyx_r; - __Pyx_RefNannySetupContext("__cinit__"); - 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; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":68 - * - * def __cinit__(self): - * self.use_amf3 = 0 # <<<<<<<<<<<<<< - * - * def __init__(self, *args, **kwargs): - */ - ((struct __pyx_obj_6cpyamf_4amf0_Decoder *)__pyx_v_self)->use_amf3 = 0; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":70 - * self.use_amf3 = 0 - * - * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<< - * self.use_amf3 = kwargs.pop('use_amf3', 0) - * self.context = kwargs.pop('context', None) - */ - -static int __pyx_pf_6cpyamf_4amf0_7Decoder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6cpyamf_4amf0_7Decoder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_args = 0; - PyObject *__pyx_v_kwargs = 0; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("__init__"); - if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; - __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); - if (unlikely(!__pyx_v_kwargs)) return -1; - __Pyx_GOTREF(__pyx_v_kwargs); - __Pyx_INCREF(__pyx_args); - __pyx_v_args = __pyx_args; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":71 - * - * def __init__(self, *args, **kwargs): - * self.use_amf3 = kwargs.pop('use_amf3', 0) # <<<<<<<<<<<<<< - * self.context = kwargs.pop('context', None) - * - */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_kwargs), __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - ((struct __pyx_obj_6cpyamf_4amf0_Decoder *)__pyx_v_self)->use_amf3 = __pyx_t_3; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":72 - * def __init__(self, *args, **kwargs): - * self.use_amf3 = kwargs.pop('use_amf3', 0) - * self.context = kwargs.pop('context', None) # <<<<<<<<<<<<<< - * - * if self.context is None: - */ - __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_kwargs), __pyx_n_s__pop); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6cpyamf_4amf0_Context))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_4amf0_Decoder *)__pyx_v_self)->context); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6cpyamf_4amf0_Decoder *)__pyx_v_self)->context)); - ((struct __pyx_obj_6cpyamf_4amf0_Decoder *)__pyx_v_self)->context = ((struct __pyx_obj_6cpyamf_4amf0_Context *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":74 - * self.context = kwargs.pop('context', None) - * - * if self.context is None: # <<<<<<<<<<<<<< - * self.context = Context() - * - */ - __pyx_t_3 = (((PyObject *)((struct __pyx_obj_6cpyamf_4amf0_Decoder *)__pyx_v_self)->context) == Py_None); - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":75 - * - * if self.context is None: - * self.context = Context() # <<<<<<<<<<<<<< - * - * codec.Codec.__init__(self, *args, **kwargs) - */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6cpyamf_4amf0_Context)), ((PyObject *)__pyx_empty_tuple), NULL); 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_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_4amf0_Decoder *)__pyx_v_self)->context); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6cpyamf_4amf0_Decoder *)__pyx_v_self)->context)); - ((struct __pyx_obj_6cpyamf_4amf0_Decoder *)__pyx_v_self)->context = ((struct __pyx_obj_6cpyamf_4amf0_Context *)__pyx_t_1); - __pyx_t_1 = 0; - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":77 - * self.context = Context() - * - * codec.Codec.__init__(self, *args, **kwargs) # <<<<<<<<<<<<<< - * - * cdef object readNumber(self): - */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_6cpyamf_5codec_Codec)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __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 = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_self); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - __pyx_t_4 = PySequence_Tuple(((PyObject *)__pyx_v_args)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_v_kwargs)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("cpyamf.amf0.Decoder.__init__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_args); - __Pyx_DECREF(__pyx_v_kwargs); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":79 - * codec.Codec.__init__(self, *args, **kwargs) - * - * cdef object readNumber(self): # <<<<<<<<<<<<<< - * cdef double i - * - */ - -static PyObject *__pyx_f_6cpyamf_4amf0_7Decoder_readNumber(struct __pyx_obj_6cpyamf_4amf0_Decoder *__pyx_v_self) { - double __pyx_v_i; - PyObject *__pyx_r = NULL; - 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; - __Pyx_RefNannySetupContext("readNumber"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":82 - * cdef double i - * - * self.stream.read_double(&i) # <<<<<<<<<<<<<< - * - * if floor(i) == i: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->read_double(__pyx_v_self->__pyx_base.__pyx_base.stream, (&__pyx_v_i)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":84 - * self.stream.read_double(&i) - * - * if floor(i) == i: # <<<<<<<<<<<<<< - * try: - * return int(i) - */ - __pyx_t_2 = (floor(__pyx_v_i) == __pyx_v_i); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":85 - * - * if floor(i) == i: - * try: # <<<<<<<<<<<<<< - * return int(i) - * except OverflowError: - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - __Pyx_XGOTREF(__pyx_save_exc_type); - __Pyx_XGOTREF(__pyx_save_exc_value); - __Pyx_XGOTREF(__pyx_save_exc_tb); - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":86 - * if floor(i) == i: - * try: - * return int(i) # <<<<<<<<<<<<<< - * except OverflowError: - * return i - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L4_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L4_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L4_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L8_try_return; - } - __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L11_try_end; - __pyx_L8_try_return:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L0; - __pyx_L4_error:; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":87 - * try: - * return int(i) - * except OverflowError: # <<<<<<<<<<<<<< - * return i - * - */ - __pyx_t_1 = PyErr_ExceptionMatches(__pyx_builtin_OverflowError); - if (__pyx_t_1) { - __Pyx_AddTraceback("cpyamf.amf0.Decoder.readNumber"); - if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GOTREF(__pyx_t_5); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":88 - * return int(i) - * except OverflowError: - * return i # <<<<<<<<<<<<<< - * - * return i - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = PyFloat_FromDouble(__pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_r = __pyx_t_6; - __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L7_except_return; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L5_exception_handled; - } - __pyx_L6_except_error:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L7_except_return:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L0; - __pyx_L5_exception_handled:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L11_try_end:; - } - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":90 - * return i - * - * return i # <<<<<<<<<<<<<< - * - * cdef object readBoolean(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("cpyamf.amf0.Decoder.readNumber"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":92 - * return i - * - * cdef object readBoolean(self): # <<<<<<<<<<<<<< - * cdef unsigned char b = self.stream.read_uchar() - * - */ - -static PyObject *__pyx_f_6cpyamf_4amf0_7Decoder_readBoolean(struct __pyx_obj_6cpyamf_4amf0_Decoder *__pyx_v_self) { - unsigned char __pyx_v_b; - PyObject *__pyx_r = NULL; - unsigned char __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("readBoolean"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":93 - * - * cdef object readBoolean(self): - * cdef unsigned char b = self.stream.read_uchar() # <<<<<<<<<<<<<< - * - * if b == 1: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->read_uchar(__pyx_v_self->__pyx_base.__pyx_base.stream, 0); if (unlikely(__pyx_t_1 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_b = __pyx_t_1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":97 - * if b == 1: - * return True - * elif b == 0: # <<<<<<<<<<<<<< - * return False - * - */ - switch (__pyx_v_b) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":95 - * cdef unsigned char b = self.stream.read_uchar() - * - * if b == 1: # <<<<<<<<<<<<<< - * return True - * elif b == 0: - */ - case 1: - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":96 - * - * if b == 1: - * return True # <<<<<<<<<<<<<< - * elif b == 0: - * return False - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyBool_FromLong(1); 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_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - break; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":97 - * if b == 1: - * return True - * elif b == 0: # <<<<<<<<<<<<<< - * return False - * - */ - case 0: - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":98 - * return True - * elif b == 0: - * return False # <<<<<<<<<<<<<< - * - * raise pyamf.DecodeError('Bad boolean read from stream') - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - break; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":100 - * return False - * - * raise pyamf.DecodeError('Bad boolean read from stream') # <<<<<<<<<<<<<< - * - * cdef object readBytes(self): - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__DecodeError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __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); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __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("cpyamf.amf0.Decoder.readBoolean"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":102 - * raise pyamf.DecodeError('Bad boolean read from stream') - * - * cdef object readBytes(self): # <<<<<<<<<<<<<< - * cdef object u - * - */ - -static PyObject *__pyx_f_6cpyamf_4amf0_7Decoder_readBytes(struct __pyx_obj_6cpyamf_4amf0_Decoder *__pyx_v_self) { - PyObject *__pyx_v_u; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("readBytes"); - __pyx_v_u = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":105 - * cdef object u - * - * u = self.readString() # <<<<<<<<<<<<<< - * - * return self.context.getBytesForString(u) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readString(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_v_u); - __pyx_v_u = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":107 - * u = self.readString() - * - * return self.context.getBytesForString(u) # <<<<<<<<<<<<<< - * - * cpdef object readString(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6cpyamf_4amf0_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getBytesForString(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_u, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.amf0.Decoder.readBytes"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_u); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":109 - * return self.context.getBytesForString(u) - * - * cpdef object readString(self): # <<<<<<<<<<<<<< - * cdef unsigned short l - * cdef char *b = NULL - */ - -static PyObject *__pyx_pf_6cpyamf_4amf0_7Decoder_readString(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_f_6cpyamf_4amf0_7Decoder_readString(struct __pyx_obj_6cpyamf_4amf0_Decoder *__pyx_v_self, int __pyx_skip_dispatch) { - unsigned short __pyx_v_l; - char *__pyx_v_b; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - unsigned short __pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("readString"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__readString); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4amf0_7Decoder_readString)) { - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __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; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":111 - * cpdef object readString(self): - * cdef unsigned short l - * cdef char *b = NULL # <<<<<<<<<<<<<< - * - * l = self.stream.read_ushort() - */ - __pyx_v_b = NULL; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":113 - * cdef char *b = NULL - * - * l = self.stream.read_ushort() # <<<<<<<<<<<<<< - * - * self.stream.read(&b, l) - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->read_ushort(__pyx_v_self->__pyx_base.__pyx_base.stream, 0); if (unlikely(__pyx_t_3 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_l = __pyx_t_3; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":115 - * l = self.stream.read_ushort() - * - * self.stream.read(&b, l) # <<<<<<<<<<<<<< - * - * return PyUnicode_DecodeUTF8(b, l, 'strict') - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->read(__pyx_v_self->__pyx_base.__pyx_base.stream, (&__pyx_v_b), __pyx_v_l); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":117 - * self.stream.read(&b, l) - * - * return PyUnicode_DecodeUTF8(b, l, 'strict') # <<<<<<<<<<<<<< - * - * cdef dict readObjectAttributes(self, object obj_attrs): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyUnicode_DecodeUTF8(__pyx_v_b, ((Py_ssize_t)__pyx_v_l), __pyx_k__strict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __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("cpyamf.amf0.Decoder.readString"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":109 - * return self.context.getBytesForString(u) - * - * cpdef object readString(self): # <<<<<<<<<<<<<< - * cdef unsigned short l - * cdef char *b = NULL - */ - -static PyObject *__pyx_pf_6cpyamf_4amf0_7Decoder_readString(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4amf0_7Decoder_readString(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("readString"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)((struct __pyx_obj_6cpyamf_4amf0_Decoder *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.readString(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.amf0.Decoder.readString"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":119 - * return PyUnicode_DecodeUTF8(b, l, 'strict') - * - * cdef dict readObjectAttributes(self, object obj_attrs): # <<<<<<<<<<<<<< - * cdef object key - * cdef char *peek = NULL - */ - -static PyObject *__pyx_f_6cpyamf_4amf0_7Decoder_readObjectAttributes(struct __pyx_obj_6cpyamf_4amf0_Decoder *__pyx_v_self, PyObject *__pyx_v_obj_attrs) { - PyObject *__pyx_v_key; - char *__pyx_v_peek; - PyObject *__pyx_r = NULL; - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_seek __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("readObjectAttributes"); - __pyx_v_key = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":121 - * cdef dict readObjectAttributes(self, object obj_attrs): - * cdef object key - * cdef char *peek = NULL # <<<<<<<<<<<<<< - * - * while True: - */ - __pyx_v_peek = NULL; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":123 - * cdef char *peek = NULL - * - * while True: # <<<<<<<<<<<<<< - * self.stream.peek(&peek, 3) - * - */ - while (1) { - if (!1) break; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":124 - * - * while True: - * self.stream.peek(&peek, 3) # <<<<<<<<<<<<<< - * - * if memcmp(peek, b'\x00\x00\x09', 3) == 0: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->peek(__pyx_v_self->__pyx_base.__pyx_base.stream, (&__pyx_v_peek), 3); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":126 - * self.stream.peek(&peek, 3) - * - * if memcmp(peek, b'\x00\x00\x09', 3) == 0: # <<<<<<<<<<<<<< - * self.stream.seek(3, 1) - * - */ - __pyx_t_2 = (memcmp(__pyx_v_peek, __pyx_k_5, 3) == 0); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":127 - * - * if memcmp(peek, b'\x00\x00\x09', 3) == 0: - * self.stream.seek(3, 1) # <<<<<<<<<<<<<< - * - * break - */ - __pyx_t_4.__pyx_n = 1; - __pyx_t_4.mode = 1; - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->seek(__pyx_v_self->__pyx_base.__pyx_base.stream, 3, 0, &__pyx_t_4); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":129 - * self.stream.seek(3, 1) - * - * break # <<<<<<<<<<<<<< - * - * key = self.readBytes() - */ - goto __pyx_L4_break; - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":131 - * break - * - * key = self.readBytes() # <<<<<<<<<<<<<< - * - * PyDict_SetItem(obj_attrs, key, self.readElement()) - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->readBytes(__pyx_v_self); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_v_key); - __pyx_v_key = __pyx_t_5; - __pyx_t_5 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":133 - * key = self.readBytes() - * - * PyDict_SetItem(obj_attrs, key, self.readElement()) # <<<<<<<<<<<<<< - * - * # discard the end marker (TYPE_OBJECTTERM) - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readElement(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self), 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyDict_SetItem(__pyx_v_obj_attrs, __pyx_v_key, __pyx_t_5); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __pyx_L4_break:; - - __pyx_r = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("cpyamf.amf0.Decoder.readObjectAttributes"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_key); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":137 - * # discard the end marker (TYPE_OBJECTTERM) - * - * cdef object readObject(self): # <<<<<<<<<<<<<< - * cdef object obj = ASObject() - * - */ - -static PyObject *__pyx_f_6cpyamf_4amf0_7Decoder_readObject(struct __pyx_obj_6cpyamf_4amf0_Decoder *__pyx_v_self) { - PyObject *__pyx_v_obj = 0; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - __Pyx_RefNannySetupContext("readObject"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":138 - * - * cdef object readObject(self): - * cdef object obj = ASObject() # <<<<<<<<<<<<<< - * - * self.context.addObject(obj) - */ - __pyx_t_1 = PyObject_Call(__pyx_v_6cpyamf_4amf0_ASObject, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_obj = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":140 - * cdef object obj = ASObject() - * - * self.context.addObject(obj) # <<<<<<<<<<<<<< - * - * self.readObjectAttributes(obj) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_obj, 0); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":142 - * self.context.addObject(obj) - * - * self.readObjectAttributes(obj) # <<<<<<<<<<<<<< - * - * return obj - */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->readObjectAttributes(__pyx_v_self, __pyx_v_obj)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":144 - * self.readObjectAttributes(obj) - * - * return obj # <<<<<<<<<<<<<< - * - * cdef object readTypedObject(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_obj); - __pyx_r = __pyx_v_obj; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.amf0.Decoder.readObject"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_obj); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":146 - * return obj - * - * cdef object readTypedObject(self): # <<<<<<<<<<<<<< - * cdef object class_alias = self.readString() - * - */ - -static PyObject *__pyx_f_6cpyamf_4amf0_7Decoder_readTypedObject(struct __pyx_obj_6cpyamf_4amf0_Decoder *__pyx_v_self) { - PyObject *__pyx_v_class_alias = 0; - PyObject *__pyx_v_alias; - PyObject *__pyx_v_obj; - PyObject *__pyx_v_attrs = 0; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - 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; - Py_ssize_t __pyx_t_8; - __Pyx_RefNannySetupContext("readTypedObject"); - __pyx_v_alias = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_obj = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":147 - * - * cdef object readTypedObject(self): - * cdef object class_alias = self.readString() # <<<<<<<<<<<<<< - * - * try: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readString(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_class_alias = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":149 - * cdef object class_alias = self.readString() - * - * try: # <<<<<<<<<<<<<< - * alias = self.context.getClassAlias(class_alias) - * except UnknownClassAlias: - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - __Pyx_XGOTREF(__pyx_save_exc_type); - __Pyx_XGOTREF(__pyx_save_exc_value); - __Pyx_XGOTREF(__pyx_save_exc_tb); - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":150 - * - * try: - * alias = self.context.getClassAlias(class_alias) # <<<<<<<<<<<<<< - * except UnknownClassAlias: - * if self.strict: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getClassAlias(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_class_alias, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_v_alias); - __pyx_v_alias = __pyx_t_1; - __pyx_t_1 = 0; - } - __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":151 - * try: - * alias = self.context.getClassAlias(class_alias) - * except UnknownClassAlias: # <<<<<<<<<<<<<< - * if self.strict: - * raise - */ - __pyx_t_2 = PyErr_ExceptionMatches(__pyx_v_6cpyamf_4amf0_UnknownClassAlias); - if (__pyx_t_2) { - __Pyx_AddTraceback("cpyamf.amf0.Decoder.readTypedObject"); - if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GOTREF(__pyx_t_4); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":152 - * alias = self.context.getClassAlias(class_alias) - * except UnknownClassAlias: - * if self.strict: # <<<<<<<<<<<<<< - * raise - * - */ - if (__pyx_v_self->__pyx_base.__pyx_base.strict) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":153 - * except UnknownClassAlias: - * if self.strict: - * raise # <<<<<<<<<<<<<< - * - * alias = pyamf.TypedObjectClassAlias(class_alias) - */ - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - __Pyx_ErrRestore(__pyx_t_1, __pyx_t_3, __pyx_t_4); - __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - goto __pyx_L13; - } - __pyx_L13:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":155 - * raise - * - * alias = pyamf.TypedObjectClassAlias(class_alias) # <<<<<<<<<<<<<< - * - * obj = alias.createInstance(codec=self) - */ - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_v_class_alias); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_class_alias); - __Pyx_GIVEREF(__pyx_v_class_alias); - __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_v_alias); - __pyx_v_alias = __pyx_t_7; - __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L4_exception_handled; - } - __pyx_L5_except_error:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L4_exception_handled:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L10_try_end:; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":157 - * alias = pyamf.TypedObjectClassAlias(class_alias) - * - * obj = alias.createInstance(codec=self) # <<<<<<<<<<<<<< - * self.context.addObject(obj) - * - */ - __pyx_t_4 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s__createInstance); 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_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__codec), ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_v_obj); - __pyx_v_obj = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":158 - * - * obj = alias.createInstance(codec=self) - * self.context.addObject(obj) # <<<<<<<<<<<<<< - * - * cdef dict attrs = {} - */ - __pyx_t_8 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_obj, 0); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":160 - * self.context.addObject(obj) - * - * cdef dict attrs = {} # <<<<<<<<<<<<<< - * - * self.readObjectAttributes(attrs) - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_v_attrs = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":162 - * cdef dict attrs = {} - * - * self.readObjectAttributes(attrs) # <<<<<<<<<<<<<< - * - * alias.applyAttributes(obj, attrs, codec=self) - */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->readObjectAttributes(__pyx_v_self, ((PyObject *)__pyx_v_attrs))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":164 - * self.readObjectAttributes(attrs) - * - * alias.applyAttributes(obj, attrs, codec=self) # <<<<<<<<<<<<<< - * - * return obj - */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s__applyAttributes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_obj); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_obj); - __Pyx_GIVEREF(__pyx_v_obj); - __Pyx_INCREF(((PyObject *)__pyx_v_attrs)); - PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_attrs)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_attrs)); - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__codec), ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":166 - * alias.applyAttributes(obj, attrs, codec=self) - * - * return obj # <<<<<<<<<<<<<< - * - * cdef object readReference(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_obj); - __pyx_r = __pyx_v_obj; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __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("cpyamf.amf0.Decoder.readTypedObject"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_class_alias); - __Pyx_DECREF(__pyx_v_alias); - __Pyx_DECREF(__pyx_v_obj); - __Pyx_XDECREF(__pyx_v_attrs); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":168 - * return obj - * - * cdef object readReference(self): # <<<<<<<<<<<<<< - * cdef unsigned short idx - * - */ - -static PyObject *__pyx_f_6cpyamf_4amf0_7Decoder_readReference(struct __pyx_obj_6cpyamf_4amf0_Decoder *__pyx_v_self) { - unsigned short __pyx_v_idx; - PyObject *__pyx_v_o; - PyObject *__pyx_r = NULL; - unsigned short __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("readReference"); - __pyx_v_o = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":171 - * cdef unsigned short idx - * - * idx = self.stream.read_ushort() # <<<<<<<<<<<<<< - * o = self.context.getObject(idx) - * - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->read_ushort(__pyx_v_self->__pyx_base.__pyx_base.stream, 0); if (unlikely(__pyx_t_1 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_idx = __pyx_t_1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":172 - * - * idx = self.stream.read_ushort() - * o = self.context.getObject(idx) # <<<<<<<<<<<<<< - * - * if o is None: - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_idx, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_o); - __pyx_v_o = __pyx_t_2; - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":174 - * o = self.context.getObject(idx) - * - * if o is None: # <<<<<<<<<<<<<< - * raise pyamf.ReferenceError('Unknown reference %d' % (idx,)) - * - */ - __pyx_t_3 = (__pyx_v_o == Py_None); - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":175 - * - * if o is None: - * raise pyamf.ReferenceError('Unknown reference %d' % (idx,)) # <<<<<<<<<<<<<< - * - * return o - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ReferenceError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyInt_FromLong(__pyx_v_idx); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":177 - * raise pyamf.ReferenceError('Unknown reference %d' % (idx,)) - * - * return o # <<<<<<<<<<<<<< - * - * cdef object readMixedArray(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_o); - __pyx_r = __pyx_v_o; - goto __pyx_L0; - - __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_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("cpyamf.amf0.Decoder.readReference"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_o); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":179 - * return o - * - * cdef object readMixedArray(self): # <<<<<<<<<<<<<< - * cdef unsigned long l - * cdef dict attrs - */ - -static PyObject *__pyx_f_6cpyamf_4amf0_7Decoder_readMixedArray(struct __pyx_obj_6cpyamf_4amf0_Decoder *__pyx_v_self) { - unsigned long __pyx_v_l; - PyObject *__pyx_v_attrs; - PyObject *__pyx_v_obj; - PyObject *__pyx_v_key; - PyObject *__pyx_v_value; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - unsigned long __pyx_t_4; - void *__pyx_t_5; - void *__pyx_t_6; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - __Pyx_RefNannySetupContext("readMixedArray"); - __pyx_v_attrs = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_obj = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_key = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_value = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":183 - * cdef dict attrs - * - * obj = pyamf.MixedArray() # <<<<<<<<<<<<<< - * self.context.addObject(obj) - * - */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__MixedArray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_v_obj); - __pyx_v_obj = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":184 - * - * obj = pyamf.MixedArray() - * self.context.addObject(obj) # <<<<<<<<<<<<<< - * - * l = self.stream.read_ulong() - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_obj, 0); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":186 - * self.context.addObject(obj) - * - * l = self.stream.read_ulong() # <<<<<<<<<<<<<< - * - * attrs = self.readObjectAttributes(obj) - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->read_ulong(__pyx_v_self->__pyx_base.__pyx_base.stream, 0); if (unlikely(__pyx_t_4 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_l = __pyx_t_4; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":188 - * l = self.stream.read_ulong() - * - * attrs = self.readObjectAttributes(obj) # <<<<<<<<<<<<<< - * - * for key, value in attrs.iteritems(): - */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->readObjectAttributes(__pyx_v_self, __pyx_v_obj)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_v_attrs)); - __pyx_v_attrs = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":190 - * attrs = self.readObjectAttributes(obj) - * - * for key, value in attrs.iteritems(): # <<<<<<<<<<<<<< - * try: - * key = int(key) - */ - __Pyx_INCREF(((PyObject *)__pyx_v_attrs)); - __Pyx_XDECREF(__pyx_t_1); - __pyx_t_1 = ((PyObject *)__pyx_v_attrs); - __pyx_t_3 = 0; - while (1) { - if (!PyDict_Next(__pyx_t_1, (&__pyx_t_3), ((PyObject **)(&__pyx_t_5)), ((PyObject **)(&__pyx_t_6)))) break; - __Pyx_INCREF(((PyObject *)__pyx_t_5)); - __Pyx_DECREF(__pyx_v_key); - __pyx_v_key = ((PyObject *)__pyx_t_5); - __Pyx_INCREF(((PyObject *)__pyx_t_6)); - __Pyx_DECREF(__pyx_v_value); - __pyx_v_value = ((PyObject *)__pyx_t_6); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":191 - * - * for key, value in attrs.iteritems(): - * try: # <<<<<<<<<<<<<< - * key = int(key) - * except ValueError: - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - __Pyx_XGOTREF(__pyx_save_exc_type); - __Pyx_XGOTREF(__pyx_save_exc_value); - __Pyx_XGOTREF(__pyx_save_exc_tb); - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":192 - * for key, value in attrs.iteritems(): - * try: - * key = int(key) # <<<<<<<<<<<<<< - * except ValueError: - * pass - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L5_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L5_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_v_key); - __pyx_v_key = __pyx_t_7; - __pyx_t_7 = 0; - } - __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L12_try_end; - __pyx_L5_error:; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":193 - * try: - * key = int(key) - * except ValueError: # <<<<<<<<<<<<<< - * pass - * - */ - __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); - if (__pyx_t_8) { - PyErr_Restore(0,0,0); - goto __pyx_L6_exception_handled; - } - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L6_exception_handled:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L12_try_end:; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":196 - * pass - * - * obj[key] = value # <<<<<<<<<<<<<< - * - * return obj - */ - if (PyObject_SetItem(__pyx_v_obj, __pyx_v_key, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":198 - * obj[key] = value - * - * return obj # <<<<<<<<<<<<<< - * - * cdef object readList(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_obj); - __pyx_r = __pyx_v_obj; - goto __pyx_L0; - - __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_7); - __Pyx_AddTraceback("cpyamf.amf0.Decoder.readMixedArray"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_attrs); - __Pyx_DECREF(__pyx_v_obj); - __Pyx_DECREF(__pyx_v_key); - __Pyx_DECREF(__pyx_v_value); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":200 - * return obj - * - * cdef object readList(self): # <<<<<<<<<<<<<< - * cdef list obj = [] - * cdef unsigned long l - */ - -static PyObject *__pyx_f_6cpyamf_4amf0_7Decoder_readList(struct __pyx_obj_6cpyamf_4amf0_Decoder *__pyx_v_self) { - PyObject *__pyx_v_obj = 0; - unsigned long __pyx_v_l; - unsigned long __pyx_v_i; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - unsigned long __pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("readList"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":201 - * - * cdef object readList(self): - * cdef list obj = [] # <<<<<<<<<<<<<< - * cdef unsigned long l - * cdef unsigned long i - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_v_obj = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":205 - * cdef unsigned long i - * - * self.context.addObject(obj) # <<<<<<<<<<<<<< - * l = self.stream.read_ulong() - * - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), ((PyObject *)__pyx_v_obj), 0); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":206 - * - * self.context.addObject(obj) - * l = self.stream.read_ulong() # <<<<<<<<<<<<<< - * - * for i from 0 <= i < l: - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->read_ulong(__pyx_v_self->__pyx_base.__pyx_base.stream, 0); if (unlikely(__pyx_t_3 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_l = __pyx_t_3; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":208 - * l = self.stream.read_ulong() - * - * for i from 0 <= i < l: # <<<<<<<<<<<<<< - * PyList_Append(obj, self.readElement()) - * - */ - __pyx_t_3 = __pyx_v_l; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":209 - * - * for i from 0 <= i < l: - * PyList_Append(obj, self.readElement()) # <<<<<<<<<<<<<< - * - * return obj - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readElement(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyList_Append(((PyObject *)__pyx_v_obj), __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":211 - * PyList_Append(obj, self.readElement()) - * - * return obj # <<<<<<<<<<<<<< - * - * cdef object readDate(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_obj)); - __pyx_r = ((PyObject *)__pyx_v_obj); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.amf0.Decoder.readList"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_obj); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":213 - * return obj - * - * cdef object readDate(self): # <<<<<<<<<<<<<< - * cdef double ms - * cdef short tz - */ - -static PyObject *__pyx_f_6cpyamf_4amf0_7Decoder_readDate(struct __pyx_obj_6cpyamf_4amf0_Decoder *__pyx_v_self) { - double __pyx_v_ms; - short __pyx_v_tz; - PyObject *__pyx_v_d; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - short __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - Py_ssize_t __pyx_t_7; - __Pyx_RefNannySetupContext("readDate"); - __pyx_v_d = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":217 - * cdef short tz - * - * self.stream.read_double(&ms) # <<<<<<<<<<<<<< - * tz = self.stream.read_short() - * - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->read_double(__pyx_v_self->__pyx_base.__pyx_base.stream, (&__pyx_v_ms)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":218 - * - * self.stream.read_double(&ms) - * tz = self.stream.read_short() # <<<<<<<<<<<<<< - * - * # Timezones are ignored - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->read_short(__pyx_v_self->__pyx_base.__pyx_base.stream, 0); if (unlikely(__pyx_t_2 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_tz = __pyx_t_2; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":221 - * - * # Timezones are ignored - * d = util.get_datetime(ms / 1000.0) # <<<<<<<<<<<<<< - * - * if self.timezone_offset: - */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__util); 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_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__get_datetime); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyFloat_FromDouble((__pyx_v_ms / 1000.0)); 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_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), 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_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_v_d); - __pyx_v_d = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":223 - * d = util.get_datetime(ms / 1000.0) - * - * if self.timezone_offset: # <<<<<<<<<<<<<< - * d = d + self.timezone_offset - * - */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base.__pyx_base.timezone_offset); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_6) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":224 - * - * if self.timezone_offset: - * d = d + self.timezone_offset # <<<<<<<<<<<<<< - * - * self.context.addObject(d) - */ - __pyx_t_3 = PyNumber_Add(__pyx_v_d, __pyx_v_self->__pyx_base.__pyx_base.timezone_offset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_d); - __pyx_v_d = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":226 - * d = d + self.timezone_offset - * - * self.context.addObject(d) # <<<<<<<<<<<<<< - * - * return d - */ - __pyx_t_7 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_d, 0); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":228 - * self.context.addObject(d) - * - * return d # <<<<<<<<<<<<<< - * - * cdef object readLongString(self, bint bytes=0): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_d); - __pyx_r = __pyx_v_d; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("cpyamf.amf0.Decoder.readDate"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_d); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":230 - * return d - * - * cdef object readLongString(self, bint bytes=0): # <<<<<<<<<<<<<< - * cdef unsigned long l - * cdef char *b = NULL - */ - -static PyObject *__pyx_f_6cpyamf_4amf0_7Decoder_readLongString(struct __pyx_obj_6cpyamf_4amf0_Decoder *__pyx_v_self, struct __pyx_opt_args_6cpyamf_4amf0_7Decoder_readLongString *__pyx_optional_args) { - int __pyx_v_bytes = ((int)0); - unsigned long __pyx_v_l; - char *__pyx_v_b; - PyObject *__pyx_v_s; - PyObject *__pyx_r = NULL; - unsigned long __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("readLongString"); - if (__pyx_optional_args) { - if (__pyx_optional_args->__pyx_n > 0) { - __pyx_v_bytes = __pyx_optional_args->bytes; - } - } - __pyx_v_s = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":232 - * cdef object readLongString(self, bint bytes=0): - * cdef unsigned long l - * cdef char *b = NULL # <<<<<<<<<<<<<< - * cdef object s - * - */ - __pyx_v_b = NULL; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":235 - * cdef object s - * - * l = self.stream.read_ulong() # <<<<<<<<<<<<<< - * - * self.stream.read(&b, l) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->read_ulong(__pyx_v_self->__pyx_base.__pyx_base.stream, 0); if (unlikely(__pyx_t_1 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_l = __pyx_t_1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":237 - * l = self.stream.read_ulong() - * - * self.stream.read(&b, l) # <<<<<<<<<<<<<< - * s = PyString_FromStringAndSize(b, l) - * - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->read(__pyx_v_self->__pyx_base.__pyx_base.stream, (&__pyx_v_b), __pyx_v_l); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":238 - * - * self.stream.read(&b, l) - * s = PyString_FromStringAndSize(b, l) # <<<<<<<<<<<<<< - * - * if bytes: - */ - __pyx_t_3 = PyString_FromStringAndSize(__pyx_v_b, ((Py_ssize_t)__pyx_v_l)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_s); - __pyx_v_s = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":240 - * s = PyString_FromStringAndSize(b, l) - * - * if bytes: # <<<<<<<<<<<<<< - * return s - * - */ - if (__pyx_v_bytes) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":241 - * - * if bytes: - * return s # <<<<<<<<<<<<<< - * - * return self.context.getStringForBytes(s) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_s); - __pyx_r = __pyx_v_s; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":243 - * return s - * - * return self.context.getStringForBytes(s) # <<<<<<<<<<<<<< - * - * cdef object readXML(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_6cpyamf_4amf0_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getStringForBytes(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_s, 0)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.amf0.Decoder.readLongString"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_s); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":245 - * return self.context.getStringForBytes(s) - * - * cdef object readXML(self): # <<<<<<<<<<<<<< - * cdef object data = self.readLongString() - * cdef object root = xml.fromstring(data) - */ - -static PyObject *__pyx_f_6cpyamf_4amf0_7Decoder_readXML(struct __pyx_obj_6cpyamf_4amf0_Decoder *__pyx_v_self) { - PyObject *__pyx_v_data = 0; - PyObject *__pyx_v_root = 0; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - __Pyx_RefNannySetupContext("readXML"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":246 - * - * cdef object readXML(self): - * cdef object data = self.readLongString() # <<<<<<<<<<<<<< - * cdef object root = xml.fromstring(data) - * - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->readLongString(__pyx_v_self, NULL); 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_v_data = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":247 - * cdef object readXML(self): - * cdef object data = self.readLongString() - * cdef object root = xml.fromstring(data) # <<<<<<<<<<<<<< - * - * self.context.addObject(root) - */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__xml); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__fromstring); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__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_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_v_root = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":249 - * cdef object root = xml.fromstring(data) - * - * self.context.addObject(root) # <<<<<<<<<<<<<< - * - * return root - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_root, 0); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":251 - * self.context.addObject(root) - * - * return root # <<<<<<<<<<<<<< - * - * cdef object readAMF3(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_root); - __pyx_r = __pyx_v_root; - goto __pyx_L0; - - __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_3); - __Pyx_AddTraceback("cpyamf.amf0.Decoder.readXML"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_data); - __Pyx_XDECREF(__pyx_v_root); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":253 - * return root - * - * cdef object readAMF3(self): # <<<<<<<<<<<<<< - * if self.amf3_decoder is None: - * self.context.amf3_context = amf3.Context() - */ - -static PyObject *__pyx_f_6cpyamf_4amf0_7Decoder_readAMF3(struct __pyx_obj_6cpyamf_4amf0_Decoder *__pyx_v_self) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("readAMF3"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":254 - * - * cdef object readAMF3(self): - * if self.amf3_decoder is None: # <<<<<<<<<<<<<< - * self.context.amf3_context = amf3.Context() - * - */ - __pyx_t_1 = (((PyObject *)__pyx_v_self->amf3_decoder) == Py_None); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":255 - * cdef object readAMF3(self): - * if self.amf3_decoder is None: - * self.context.amf3_context = amf3.Context() # <<<<<<<<<<<<<< - * - * self.amf3_decoder = amf3.Decoder( - */ - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6cpyamf_4amf3_Context)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_v_self->context->amf3_context); - __Pyx_DECREF(((PyObject *)__pyx_v_self->context->amf3_context)); - __pyx_v_self->context->amf3_context = ((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":257 - * self.context.amf3_context = amf3.Context() - * - * self.amf3_decoder = amf3.Decoder( # <<<<<<<<<<<<<< - * stream=self.stream, - * context=self.context.amf3_context, - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":258 - * - * self.amf3_decoder = amf3.Decoder( - * stream=self.stream, # <<<<<<<<<<<<<< - * context=self.context.amf3_context, - * timezone_offset=self.timezone_offset) - */ - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__stream), ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.stream)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":259 - * self.amf3_decoder = amf3.Decoder( - * stream=self.stream, - * context=self.context.amf3_context, # <<<<<<<<<<<<<< - * timezone_offset=self.timezone_offset) - * - */ - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__context), ((PyObject *)__pyx_v_self->context->amf3_context)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":260 - * stream=self.stream, - * context=self.context.amf3_context, - * timezone_offset=self.timezone_offset) # <<<<<<<<<<<<<< - * - * return self.amf3_decoder.readElement() - */ - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__timezone_offset), __pyx_v_self->__pyx_base.__pyx_base.timezone_offset) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_6cpyamf_4amf3_Decoder)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":257 - * self.context.amf3_context = amf3.Context() - * - * self.amf3_decoder = amf3.Decoder( # <<<<<<<<<<<<<< - * stream=self.stream, - * context=self.context.amf3_context, - */ - __Pyx_GIVEREF(__pyx_t_3); - __Pyx_GOTREF(__pyx_v_self->amf3_decoder); - __Pyx_DECREF(((PyObject *)__pyx_v_self->amf3_decoder)); - __pyx_v_self->amf3_decoder = ((struct __pyx_obj_6cpyamf_4amf3_Decoder *)__pyx_t_3); - __pyx_t_3 = 0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":262 - * timezone_offset=self.timezone_offset) - * - * return self.amf3_decoder.readElement() # <<<<<<<<<<<<<< - * - * cdef object readConcreteElement(self, char type): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->amf3_decoder->__pyx_base.__pyx_vtab)->__pyx_base.readElement(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self->amf3_decoder), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - __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("cpyamf.amf0.Decoder.readAMF3"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":264 - * return self.amf3_decoder.readElement() - * - * cdef object readConcreteElement(self, char type): # <<<<<<<<<<<<<< - * if type == TYPE_NUMBER: - * return self.readNumber() - */ - -static PyObject *__pyx_f_6cpyamf_4amf0_7Decoder_readConcreteElement(struct __pyx_obj_6cpyamf_4amf0_Decoder *__pyx_v_self, char __pyx_v_type) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("readConcreteElement"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":265 - * - * cdef object readConcreteElement(self, char type): - * if type == TYPE_NUMBER: # <<<<<<<<<<<<<< - * return self.readNumber() - * elif type == TYPE_BOOL: - */ - __pyx_t_1 = (__pyx_v_type == __pyx_v_6cpyamf_4amf0_TYPE_NUMBER); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":266 - * cdef object readConcreteElement(self, char type): - * if type == TYPE_NUMBER: - * return self.readNumber() # <<<<<<<<<<<<<< - * elif type == TYPE_BOOL: - * return self.readBoolean() - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readNumber(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":267 - * if type == TYPE_NUMBER: - * return self.readNumber() - * elif type == TYPE_BOOL: # <<<<<<<<<<<<<< - * return self.readBoolean() - * elif type == TYPE_STRING: - */ - __pyx_t_1 = (__pyx_v_type == __pyx_v_6cpyamf_4amf0_TYPE_BOOL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":268 - * return self.readNumber() - * elif type == TYPE_BOOL: - * return self.readBoolean() # <<<<<<<<<<<<<< - * elif type == TYPE_STRING: - * return self.readString() - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->readBoolean(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":269 - * elif type == TYPE_BOOL: - * return self.readBoolean() - * elif type == TYPE_STRING: # <<<<<<<<<<<<<< - * return self.readString() - * elif type == TYPE_OBJECT: - */ - __pyx_t_1 = (__pyx_v_type == __pyx_v_6cpyamf_4amf0_TYPE_STRING); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":270 - * return self.readBoolean() - * elif type == TYPE_STRING: - * return self.readString() # <<<<<<<<<<<<<< - * elif type == TYPE_OBJECT: - * return self.readObject() - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readString(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":271 - * elif type == TYPE_STRING: - * return self.readString() - * elif type == TYPE_OBJECT: # <<<<<<<<<<<<<< - * return self.readObject() - * elif type == TYPE_NULL: - */ - __pyx_t_1 = (__pyx_v_type == __pyx_v_6cpyamf_4amf0_TYPE_OBJECT); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":272 - * return self.readString() - * elif type == TYPE_OBJECT: - * return self.readObject() # <<<<<<<<<<<<<< - * elif type == TYPE_NULL: - * return self.readNull() - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readObject(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":273 - * elif type == TYPE_OBJECT: - * return self.readObject() - * elif type == TYPE_NULL: # <<<<<<<<<<<<<< - * return self.readNull() - * elif type == TYPE_UNDEFINED: - */ - __pyx_t_1 = (__pyx_v_type == __pyx_v_6cpyamf_4amf0_TYPE_NULL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":274 - * return self.readObject() - * elif type == TYPE_NULL: - * return self.readNull() # <<<<<<<<<<<<<< - * elif type == TYPE_UNDEFINED: - * return self.readUndefined() - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readNull(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":275 - * elif type == TYPE_NULL: - * return self.readNull() - * elif type == TYPE_UNDEFINED: # <<<<<<<<<<<<<< - * return self.readUndefined() - * elif type == TYPE_REFERENCE: - */ - __pyx_t_1 = (__pyx_v_type == __pyx_v_6cpyamf_4amf0_TYPE_UNDEFINED); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":276 - * return self.readNull() - * elif type == TYPE_UNDEFINED: - * return self.readUndefined() # <<<<<<<<<<<<<< - * elif type == TYPE_REFERENCE: - * return self.readReference() - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readUndefined(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":277 - * elif type == TYPE_UNDEFINED: - * return self.readUndefined() - * elif type == TYPE_REFERENCE: # <<<<<<<<<<<<<< - * return self.readReference() - * elif type == TYPE_MIXEDARRAY: - */ - __pyx_t_1 = (__pyx_v_type == __pyx_v_6cpyamf_4amf0_TYPE_REFERENCE); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":278 - * return self.readUndefined() - * elif type == TYPE_REFERENCE: - * return self.readReference() # <<<<<<<<<<<<<< - * elif type == TYPE_MIXEDARRAY: - * return self.readMixedArray() - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->readReference(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":279 - * elif type == TYPE_REFERENCE: - * return self.readReference() - * elif type == TYPE_MIXEDARRAY: # <<<<<<<<<<<<<< - * return self.readMixedArray() - * elif type == TYPE_ARRAY: - */ - __pyx_t_1 = (__pyx_v_type == __pyx_v_6cpyamf_4amf0_TYPE_MIXEDARRAY); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":280 - * return self.readReference() - * elif type == TYPE_MIXEDARRAY: - * return self.readMixedArray() # <<<<<<<<<<<<<< - * elif type == TYPE_ARRAY: - * return self.readList() - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->readMixedArray(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":281 - * elif type == TYPE_MIXEDARRAY: - * return self.readMixedArray() - * elif type == TYPE_ARRAY: # <<<<<<<<<<<<<< - * return self.readList() - * elif type == TYPE_DATE: - */ - __pyx_t_1 = (__pyx_v_type == __pyx_v_6cpyamf_4amf0_TYPE_ARRAY); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":282 - * return self.readMixedArray() - * elif type == TYPE_ARRAY: - * return self.readList() # <<<<<<<<<<<<<< - * elif type == TYPE_DATE: - * return self.readDate() - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readList(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":283 - * elif type == TYPE_ARRAY: - * return self.readList() - * elif type == TYPE_DATE: # <<<<<<<<<<<<<< - * return self.readDate() - * elif type == TYPE_LONGSTRING: - */ - __pyx_t_1 = (__pyx_v_type == __pyx_v_6cpyamf_4amf0_TYPE_DATE); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":284 - * return self.readList() - * elif type == TYPE_DATE: - * return self.readDate() # <<<<<<<<<<<<<< - * elif type == TYPE_LONGSTRING: - * return self.readLongString() - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readDate(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":285 - * elif type == TYPE_DATE: - * return self.readDate() - * elif type == TYPE_LONGSTRING: # <<<<<<<<<<<<<< - * return self.readLongString() - * elif type == TYPE_UNSUPPORTED: - */ - __pyx_t_1 = (__pyx_v_type == __pyx_v_6cpyamf_4amf0_TYPE_LONGSTRING); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":286 - * return self.readDate() - * elif type == TYPE_LONGSTRING: - * return self.readLongString() # <<<<<<<<<<<<<< - * elif type == TYPE_UNSUPPORTED: - * return self.readNull() - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->readLongString(__pyx_v_self, NULL); 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_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":287 - * elif type == TYPE_LONGSTRING: - * return self.readLongString() - * elif type == TYPE_UNSUPPORTED: # <<<<<<<<<<<<<< - * return self.readNull() - * elif type == TYPE_XML: - */ - __pyx_t_1 = (__pyx_v_type == __pyx_v_6cpyamf_4amf0_TYPE_UNSUPPORTED); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":288 - * return self.readLongString() - * elif type == TYPE_UNSUPPORTED: - * return self.readNull() # <<<<<<<<<<<<<< - * elif type == TYPE_XML: - * return self.readXML() - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readNull(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":289 - * elif type == TYPE_UNSUPPORTED: - * return self.readNull() - * elif type == TYPE_XML: # <<<<<<<<<<<<<< - * return self.readXML() - * elif type == TYPE_TYPEDOBJECT: - */ - __pyx_t_1 = (__pyx_v_type == __pyx_v_6cpyamf_4amf0_TYPE_XML); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":290 - * return self.readNull() - * elif type == TYPE_XML: - * return self.readXML() # <<<<<<<<<<<<<< - * elif type == TYPE_TYPEDOBJECT: - * return self.readTypedObject() - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readXML(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self)); 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_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":291 - * elif type == TYPE_XML: - * return self.readXML() - * elif type == TYPE_TYPEDOBJECT: # <<<<<<<<<<<<<< - * return self.readTypedObject() - * elif type == TYPE_AMF3: - */ - __pyx_t_1 = (__pyx_v_type == __pyx_v_6cpyamf_4amf0_TYPE_TYPEDOBJECT); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":292 - * return self.readXML() - * elif type == TYPE_TYPEDOBJECT: - * return self.readTypedObject() # <<<<<<<<<<<<<< - * elif type == TYPE_AMF3: - * return self.readAMF3() - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->readTypedObject(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":293 - * elif type == TYPE_TYPEDOBJECT: - * return self.readTypedObject() - * elif type == TYPE_AMF3: # <<<<<<<<<<<<<< - * return self.readAMF3() - * - */ - __pyx_t_1 = (__pyx_v_type == __pyx_v_6cpyamf_4amf0_TYPE_AMF3); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":294 - * return self.readTypedObject() - * elif type == TYPE_AMF3: - * return self.readAMF3() # <<<<<<<<<<<<<< - * - * raise pyamf.DecodeError("Unsupported ActionScript type") - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->readAMF3(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":296 - * return self.readAMF3() - * - * raise pyamf.DecodeError("Unsupported ActionScript type") # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__DecodeError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __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); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __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("cpyamf.amf0.Decoder.readConcreteElement"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":63 - * """ - * - * cdef public bint use_amf3 # <<<<<<<<<<<<<< - * cdef readonly Context context - * cdef amf3.Decoder amf3_decoder - */ - -static PyObject *__pyx_pf_6cpyamf_4amf0_7Decoder_8use_amf3___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4amf0_7Decoder_8use_amf3___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(((struct __pyx_obj_6cpyamf_4amf0_Decoder *)__pyx_v_self)->use_amf3); 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); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.amf0.Decoder.use_amf3.__get__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6cpyamf_4amf0_7Decoder_8use_amf3___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pf_6cpyamf_4amf0_7Decoder_8use_amf3___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("__set__"); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_6cpyamf_4amf0_Decoder *)__pyx_v_self)->use_amf3 = __pyx_t_1; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf0.Decoder.use_amf3.__set__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":64 - * - * cdef public bint use_amf3 - * cdef readonly Context context # <<<<<<<<<<<<<< - * cdef amf3.Decoder amf3_decoder - * - */ - -static PyObject *__pyx_pf_6cpyamf_4amf0_7Decoder_7context___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4amf0_7Decoder_7context___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6cpyamf_4amf0_Decoder *)__pyx_v_self)->context)); - __pyx_r = ((PyObject *)((struct __pyx_obj_6cpyamf_4amf0_Decoder *)__pyx_v_self)->context); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":308 - * cdef amf3.Encoder amf3_encoder - * - * def __cinit__(self): # <<<<<<<<<<<<<< - * self.use_amf3 = 0 - * - */ - -static int __pyx_pf_6cpyamf_4amf0_7Encoder___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6cpyamf_4amf0_7Encoder___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - int __pyx_r; - __Pyx_RefNannySetupContext("__cinit__"); - 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; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":309 - * - * def __cinit__(self): - * self.use_amf3 = 0 # <<<<<<<<<<<<<< - * - * def __init__(self, *args, **kwargs): - */ - ((struct __pyx_obj_6cpyamf_4amf0_Encoder *)__pyx_v_self)->use_amf3 = 0; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":311 - * self.use_amf3 = 0 - * - * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<< - * self.use_amf3 = kwargs.pop('use_amf3', 0) - * - */ - -static int __pyx_pf_6cpyamf_4amf0_7Encoder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6cpyamf_4amf0_7Encoder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_args = 0; - PyObject *__pyx_v_kwargs = 0; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("__init__"); - if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; - __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); - if (unlikely(!__pyx_v_kwargs)) return -1; - __Pyx_GOTREF(__pyx_v_kwargs); - __Pyx_INCREF(__pyx_args); - __pyx_v_args = __pyx_args; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":312 - * - * def __init__(self, *args, **kwargs): - * self.use_amf3 = kwargs.pop('use_amf3', 0) # <<<<<<<<<<<<<< - * - * self.context = kwargs.pop('context', None) - */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_kwargs), __pyx_n_s__pop); 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_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - ((struct __pyx_obj_6cpyamf_4amf0_Encoder *)__pyx_v_self)->use_amf3 = __pyx_t_3; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":314 - * self.use_amf3 = kwargs.pop('use_amf3', 0) - * - * self.context = kwargs.pop('context', None) # <<<<<<<<<<<<<< - * - * if self.context is None: - */ - __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_kwargs), __pyx_n_s__pop); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_12), NULL); 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); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6cpyamf_4amf0_Context))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_4amf0_Encoder *)__pyx_v_self)->context); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6cpyamf_4amf0_Encoder *)__pyx_v_self)->context)); - ((struct __pyx_obj_6cpyamf_4amf0_Encoder *)__pyx_v_self)->context = ((struct __pyx_obj_6cpyamf_4amf0_Context *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":316 - * self.context = kwargs.pop('context', None) - * - * if self.context is None: # <<<<<<<<<<<<<< - * self.context = Context() - * - */ - __pyx_t_3 = (((PyObject *)((struct __pyx_obj_6cpyamf_4amf0_Encoder *)__pyx_v_self)->context) == Py_None); - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":317 - * - * if self.context is None: - * self.context = Context() # <<<<<<<<<<<<<< - * - * codec.Codec.__init__(self, *args, **kwargs) - */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6cpyamf_4amf0_Context)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_4amf0_Encoder *)__pyx_v_self)->context); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6cpyamf_4amf0_Encoder *)__pyx_v_self)->context)); - ((struct __pyx_obj_6cpyamf_4amf0_Encoder *)__pyx_v_self)->context = ((struct __pyx_obj_6cpyamf_4amf0_Context *)__pyx_t_1); - __pyx_t_1 = 0; - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":319 - * self.context = Context() - * - * codec.Codec.__init__(self, *args, **kwargs) # <<<<<<<<<<<<<< - * - * cdef inline int writeReference(self, o) except -2: - */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_6cpyamf_5codec_Codec)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __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 = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_self); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - __pyx_t_4 = PySequence_Tuple(((PyObject *)__pyx_v_args)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_v_kwargs)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("cpyamf.amf0.Encoder.__init__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_args); - __Pyx_DECREF(__pyx_v_kwargs); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":321 - * codec.Codec.__init__(self, *args, **kwargs) - * - * cdef inline int writeReference(self, o) except -2: # <<<<<<<<<<<<<< - * """ - * Write reference to the data stream. - */ - -static CYTHON_INLINE int __pyx_f_6cpyamf_4amf0_7Encoder_writeReference(struct __pyx_obj_6cpyamf_4amf0_Encoder *__pyx_v_self, PyObject *__pyx_v_o) { - Py_ssize_t __pyx_v_idx; - int __pyx_r; - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("writeReference"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":325 - * Write reference to the data stream. - * """ - * cdef Py_ssize_t idx = self.context.getObjectReference(o) # <<<<<<<<<<<<<< - * - * if idx == -1 or idx > 65535: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getObjectReference(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_o, 0); if (unlikely(__pyx_t_1 == -2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_idx = __pyx_t_1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":327 - * cdef Py_ssize_t idx = self.context.getObjectReference(o) - * - * if idx == -1 or idx > 65535: # <<<<<<<<<<<<<< - * return -1 - * - */ - __pyx_t_2 = (__pyx_v_idx == -1); - if (!__pyx_t_2) { - __pyx_t_3 = (__pyx_v_idx > 65535); - __pyx_t_4 = __pyx_t_3; - } else { - __pyx_t_4 = __pyx_t_2; - } - if (__pyx_t_4) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":328 - * - * if idx == -1 or idx > 65535: - * return -1 # <<<<<<<<<<<<<< - * - * self.writeType(TYPE_REFERENCE) - */ - __pyx_r = -1; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":330 - * return -1 - * - * self.writeType(TYPE_REFERENCE) # <<<<<<<<<<<<<< - * - * return self.stream.write_ushort(idx) - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf0_TYPE_REFERENCE); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":332 - * self.writeType(TYPE_REFERENCE) - * - * return self.stream.write_ushort(idx) # <<<<<<<<<<<<<< - * - * cdef int writeBoolean(self, b) except -1: - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write_ushort(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_v_idx, 0); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_5; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf0.Encoder.writeReference"); - __pyx_r = -2; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":334 - * return self.stream.write_ushort(idx) - * - * cdef int writeBoolean(self, b) except -1: # <<<<<<<<<<<<<< - * self.writeType(TYPE_BOOL) - * - */ - -static int __pyx_f_6cpyamf_4amf0_7Encoder_writeBoolean(struct __pyx_obj_6cpyamf_4amf0_Encoder *__pyx_v_self, PyObject *__pyx_v_b) { - int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - __Pyx_RefNannySetupContext("writeBoolean"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":335 - * - * cdef int writeBoolean(self, b) except -1: - * self.writeType(TYPE_BOOL) # <<<<<<<<<<<<<< - * - * if b is True: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf0_TYPE_BOOL); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":337 - * self.writeType(TYPE_BOOL) - * - * if b is True: # <<<<<<<<<<<<<< - * return self.writeType('\x01') - * else: - */ - __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = (__pyx_v_b == __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":338 - * - * if b is True: - * return self.writeType('\x01') # <<<<<<<<<<<<<< - * else: - * return self.writeType('\x00') - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), '\x01'); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_1; - goto __pyx_L0; - goto __pyx_L3; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":340 - * return self.writeType('\x01') - * else: - * return self.writeType('\x00') # <<<<<<<<<<<<<< - * - * cdef int writeUndefined(self, data) except -1: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), '\x00'); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_1; - goto __pyx_L0; - } - __pyx_L3:; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.amf0.Encoder.writeBoolean"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":342 - * return self.writeType('\x00') - * - * cdef int writeUndefined(self, data) except -1: # <<<<<<<<<<<<<< - * return self.writeType(TYPE_UNDEFINED) - * - */ - -static int __pyx_f_6cpyamf_4amf0_7Encoder_writeUndefined(struct __pyx_obj_6cpyamf_4amf0_Encoder *__pyx_v_self, PyObject *__pyx_v_data) { - int __pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("writeUndefined"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":343 - * - * cdef int writeUndefined(self, data) except -1: - * return self.writeType(TYPE_UNDEFINED) # <<<<<<<<<<<<<< - * - * cdef int writeNull(self, n) except -1: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf0_TYPE_UNDEFINED); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_1; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf0.Encoder.writeUndefined"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":345 - * return self.writeType(TYPE_UNDEFINED) - * - * cdef int writeNull(self, n) except -1: # <<<<<<<<<<<<<< - * """ - * Write null type to data stream. - */ - -static int __pyx_f_6cpyamf_4amf0_7Encoder_writeNull(struct __pyx_obj_6cpyamf_4amf0_Encoder *__pyx_v_self, PyObject *__pyx_v_n) { - int __pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("writeNull"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":349 - * Write null type to data stream. - * """ - * return self.writeType(TYPE_NULL) # <<<<<<<<<<<<<< - * - * cpdef int writeList(self, object a, bint is_proxy=0) except -1: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf0_TYPE_NULL); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_1; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf0.Encoder.writeNull"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":351 - * return self.writeType(TYPE_NULL) - * - * cpdef int writeList(self, object a, bint is_proxy=0) except -1: # <<<<<<<<<<<<<< - * """ - * Write array to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4amf0_7Encoder_writeList(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_f_6cpyamf_4amf0_7Encoder_writeList(struct __pyx_obj_6cpyamf_4amf0_Encoder *__pyx_v_self, PyObject *__pyx_v_a, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_4amf0_7Encoder_writeList *__pyx_optional_args) { - int __pyx_v_is_proxy = ((int)0); - Py_ssize_t __pyx_v_size; - Py_ssize_t __pyx_v_i; - PyObject *__pyx_v_x; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - Py_ssize_t __pyx_t_6; - __Pyx_RefNannySetupContext("writeList"); - if (__pyx_optional_args) { - if (__pyx_optional_args->__pyx_n > 0) { - __pyx_v_is_proxy = __pyx_optional_args->is_proxy; - } - } - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__writeList); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4amf0_7Encoder_writeList)) { - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_is_proxy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_a); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_a); - __Pyx_GIVEREF(__pyx_v_a); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":358 - * cdef PyObject *x - * - * if self.writeReference(a) != -1: # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->writeReference(__pyx_v_self, __pyx_v_a); if (unlikely(__pyx_t_4 == -2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = (__pyx_t_4 != -1); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":359 - * - * if self.writeReference(a) != -1: - * return 0 # <<<<<<<<<<<<<< - * - * self.context.addObject(a) - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":361 - * return 0 - * - * self.context.addObject(a) # <<<<<<<<<<<<<< - * - * self.writeType(TYPE_ARRAY) - */ - __pyx_t_6 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_a, 0); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":363 - * self.context.addObject(a) - * - * self.writeType(TYPE_ARRAY) # <<<<<<<<<<<<<< - * size = PyList_GET_SIZE(a) - * - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf0_TYPE_ARRAY); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":364 - * - * self.writeType(TYPE_ARRAY) - * size = PyList_GET_SIZE(a) # <<<<<<<<<<<<<< - * - * self.stream.write_ulong(size) - */ - __pyx_v_size = PyList_GET_SIZE(__pyx_v_a); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":366 - * size = PyList_GET_SIZE(a) - * - * self.stream.write_ulong(size) # <<<<<<<<<<<<<< - * - * for i from 0 <= i < size: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write_ulong(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_v_size, 0); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":368 - * self.stream.write_ulong(size) - * - * for i from 0 <= i < size: # <<<<<<<<<<<<<< - * x = PyList_GET_ITEM(a, i) - * - */ - __pyx_t_6 = __pyx_v_size; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":369 - * - * for i from 0 <= i < size: - * x = PyList_GET_ITEM(a, i) # <<<<<<<<<<<<<< - * - * self.writeElement(x) - */ - __pyx_v_x = PyList_GET_ITEM(__pyx_v_a, __pyx_v_i); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":371 - * x = PyList_GET_ITEM(a, i) - * - * self.writeElement(x) # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeElement(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), ((PyObject *)__pyx_v_x), 0); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":373 - * self.writeElement(x) - * - * return 0 # <<<<<<<<<<<<<< - * - * cdef int writeTuple(self, object a) except -1: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.amf0.Encoder.writeList"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":351 - * return self.writeType(TYPE_NULL) - * - * cpdef int writeList(self, object a, bint is_proxy=0) except -1: # <<<<<<<<<<<<<< - * """ - * Write array to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4amf0_7Encoder_writeList(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6cpyamf_4amf0_7Encoder_writeList[] = "\n Write array to the stream.\n "; -static PyObject *__pyx_pf_6cpyamf_4amf0_7Encoder_writeList(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_a = 0; - int __pyx_v_is_proxy; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeList __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__a,&__pyx_n_s__is_proxy,0}; - __Pyx_RefNannySetupContext("writeList"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - 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; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__is_proxy); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "writeList") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_a = values[0]; - if (values[1]) { - __pyx_v_is_proxy = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_is_proxy == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_is_proxy = ((int)0); - } - } else { - __pyx_v_is_proxy = ((int)0); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: __pyx_v_is_proxy = __Pyx_PyObject_IsTrue(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_is_proxy == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 1: __pyx_v_a = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("writeList", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.amf0.Encoder.writeList"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_2.__pyx_n = 1; - __pyx_t_2.is_proxy = __pyx_v_is_proxy; - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)((struct __pyx_obj_6cpyamf_4amf0_Encoder *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.writeList(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_a, 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.amf0.Encoder.writeList"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":375 - * return 0 - * - * cdef int writeTuple(self, object a) except -1: # <<<<<<<<<<<<<< - * cdef Py_ssize_t size, i - * cdef PyObject *x - */ - -static int __pyx_f_6cpyamf_4amf0_7Encoder_writeTuple(struct __pyx_obj_6cpyamf_4amf0_Encoder *__pyx_v_self, PyObject *__pyx_v_a) { - Py_ssize_t __pyx_v_size; - Py_ssize_t __pyx_v_i; - PyObject *__pyx_v_x; - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - Py_ssize_t __pyx_t_3; - __Pyx_RefNannySetupContext("writeTuple"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":379 - * cdef PyObject *x - * - * if self.writeReference(a) != -1: # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->writeReference(__pyx_v_self, __pyx_v_a); if (unlikely(__pyx_t_1 == -2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = (__pyx_t_1 != -1); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":380 - * - * if self.writeReference(a) != -1: - * return 0 # <<<<<<<<<<<<<< - * - * self.context.addObject(a) - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":382 - * return 0 - * - * self.context.addObject(a) # <<<<<<<<<<<<<< - * - * self.writeType(TYPE_ARRAY) - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_a, 0); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":384 - * self.context.addObject(a) - * - * self.writeType(TYPE_ARRAY) # <<<<<<<<<<<<<< - * size = PyTuple_GET_SIZE(a) - * - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf0_TYPE_ARRAY); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":385 - * - * self.writeType(TYPE_ARRAY) - * size = PyTuple_GET_SIZE(a) # <<<<<<<<<<<<<< - * - * self.stream.write_ulong(size) - */ - __pyx_v_size = PyTuple_GET_SIZE(__pyx_v_a); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":387 - * size = PyTuple_GET_SIZE(a) - * - * self.stream.write_ulong(size) # <<<<<<<<<<<<<< - * - * for i from 0 <= i < size: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write_ulong(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_v_size, 0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":389 - * self.stream.write_ulong(size) - * - * for i from 0 <= i < size: # <<<<<<<<<<<<<< - * x = PyTuple_GET_ITEM(a, i) - * - */ - __pyx_t_3 = __pyx_v_size; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":390 - * - * for i from 0 <= i < size: - * x = PyTuple_GET_ITEM(a, i) # <<<<<<<<<<<<<< - * - * self.writeElement(x) - */ - __pyx_v_x = PyTuple_GET_ITEM(__pyx_v_a, __pyx_v_i); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":392 - * x = PyTuple_GET_ITEM(a, i) - * - * self.writeElement(x) # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeElement(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), ((PyObject *)__pyx_v_x), 0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":394 - * self.writeElement(x) - * - * return 0 # <<<<<<<<<<<<<< - * - * cdef int writeInt(self, object a) except -1: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf0.Encoder.writeTuple"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":396 - * return 0 - * - * cdef int writeInt(self, object a) except -1: # <<<<<<<<<<<<<< - * self.writeType(TYPE_NUMBER) - * - */ - -static int __pyx_f_6cpyamf_4amf0_7Encoder_writeInt(struct __pyx_obj_6cpyamf_4amf0_Encoder *__pyx_v_self, PyObject *__pyx_v_a) { - int __pyx_r; - int __pyx_t_1; - double __pyx_t_2; - __Pyx_RefNannySetupContext("writeInt"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":397 - * - * cdef int writeInt(self, object a) except -1: - * self.writeType(TYPE_NUMBER) # <<<<<<<<<<<<<< - * - * return self.stream.write_double(a) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf0_TYPE_NUMBER); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":399 - * self.writeType(TYPE_NUMBER) - * - * return self.stream.write_double(a) # <<<<<<<<<<<<<< - * - * cdef int writeNumber(self, n) except -1: - */ - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_a); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write_double(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_t_2, 0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_1; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf0.Encoder.writeInt"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":401 - * return self.stream.write_double(a) - * - * cdef int writeNumber(self, n) except -1: # <<<<<<<<<<<<<< - * self.writeType(TYPE_NUMBER) - * - */ - -static int __pyx_f_6cpyamf_4amf0_7Encoder_writeNumber(struct __pyx_obj_6cpyamf_4amf0_Encoder *__pyx_v_self, PyObject *__pyx_v_n) { - int __pyx_r; - int __pyx_t_1; - double __pyx_t_2; - __Pyx_RefNannySetupContext("writeNumber"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":402 - * - * cdef int writeNumber(self, n) except -1: - * self.writeType(TYPE_NUMBER) # <<<<<<<<<<<<<< - * - * return self.stream.write_double(n) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf0_TYPE_NUMBER); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":404 - * self.writeType(TYPE_NUMBER) - * - * return self.stream.write_double(n) # <<<<<<<<<<<<<< - * - * cdef int writeLong(self, object a): - */ - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_n); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write_double(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_t_2, 0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_1; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf0.Encoder.writeNumber"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":406 - * return self.stream.write_double(n) - * - * cdef int writeLong(self, object a): # <<<<<<<<<<<<<< - * self.writeType(TYPE_NUMBER) - * - */ - -static int __pyx_f_6cpyamf_4amf0_7Encoder_writeLong(struct __pyx_obj_6cpyamf_4amf0_Encoder *__pyx_v_self, PyObject *__pyx_v_a) { - int __pyx_r; - int __pyx_t_1; - double __pyx_t_2; - __Pyx_RefNannySetupContext("writeLong"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":407 - * - * cdef int writeLong(self, object a): - * self.writeType(TYPE_NUMBER) # <<<<<<<<<<<<<< - * - * return self.stream.write_double(a) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf0_TYPE_NUMBER); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":409 - * self.writeType(TYPE_NUMBER) - * - * return self.stream.write_double(a) # <<<<<<<<<<<<<< - * - * cdef int writeBytes(self, s) except -1: - */ - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_a); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write_double(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_t_2, 0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_1; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf0.Encoder.writeLong"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":411 - * return self.stream.write_double(a) - * - * cdef int writeBytes(self, s) except -1: # <<<<<<<<<<<<<< - * """ - * Write a string of bytes to the data stream. - */ - -static int __pyx_f_6cpyamf_4amf0_7Encoder_writeBytes(struct __pyx_obj_6cpyamf_4amf0_Encoder *__pyx_v_self, PyObject *__pyx_v_s) { - Py_ssize_t __pyx_v_l; - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("writeBytes"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":415 - * Write a string of bytes to the data stream. - * """ - * cdef Py_ssize_t l = PyString_GET_SIZE(s) # <<<<<<<<<<<<<< - * - * if l > 0xffff: - */ - __pyx_v_l = PyString_GET_SIZE(__pyx_v_s); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":417 - * cdef Py_ssize_t l = PyString_GET_SIZE(s) - * - * if l > 0xffff: # <<<<<<<<<<<<<< - * self.writeType(TYPE_LONGSTRING) - * else: - */ - __pyx_t_1 = (__pyx_v_l > 0xffff); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":418 - * - * if l > 0xffff: - * self.writeType(TYPE_LONGSTRING) # <<<<<<<<<<<<<< - * else: - * self.writeType(TYPE_STRING) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf0_TYPE_LONGSTRING); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":420 - * self.writeType(TYPE_LONGSTRING) - * else: - * self.writeType(TYPE_STRING) # <<<<<<<<<<<<<< - * - * if l > 0xffff: - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf0_TYPE_STRING); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":422 - * self.writeType(TYPE_STRING) - * - * if l > 0xffff: # <<<<<<<<<<<<<< - * self.stream.write_ulong(l) - * else: - */ - __pyx_t_1 = (__pyx_v_l > 0xffff); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":423 - * - * if l > 0xffff: - * self.stream.write_ulong(l) # <<<<<<<<<<<<<< - * else: - * self.stream.write_ushort(l) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write_ulong(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_v_l, 0); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":425 - * self.stream.write_ulong(l) - * else: - * self.stream.write_ushort(l) # <<<<<<<<<<<<<< - * - * return self.stream.write(PyString_AS_STRING(s), l) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write_ushort(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_v_l, 0); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":427 - * self.stream.write_ushort(l) - * - * return self.stream.write(PyString_AS_STRING(s), l) # <<<<<<<<<<<<<< - * - * cdef int writeString(self, u) except -1: - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write(__pyx_v_self->__pyx_base.__pyx_base.stream, PyString_AS_STRING(__pyx_v_s), __pyx_v_l); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_2; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf0.Encoder.writeBytes"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":429 - * return self.stream.write(PyString_AS_STRING(s), l) - * - * cdef int writeString(self, u) except -1: # <<<<<<<<<<<<<< - * """ - * Write a unicode to the data stream. - */ - -static int __pyx_f_6cpyamf_4amf0_7Encoder_writeString(struct __pyx_obj_6cpyamf_4amf0_Encoder *__pyx_v_self, PyObject *__pyx_v_u) { - PyObject *__pyx_v_s = 0; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - __Pyx_RefNannySetupContext("writeString"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":433 - * Write a unicode to the data stream. - * """ - * cdef object s = self.context.getBytesForString(u) # <<<<<<<<<<<<<< - * - * return self.writeBytes(s) - */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6cpyamf_4amf0_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getBytesForString(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_u, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_s = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":435 - * cdef object s = self.context.getBytesForString(u) - * - * return self.writeBytes(s) # <<<<<<<<<<<<<< - * - * cpdef int serialiseString(self, u) except -1: - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeBytes(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_s); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_2; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.amf0.Encoder.writeString"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_s); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":437 - * return self.writeBytes(s) - * - * cpdef int serialiseString(self, u) except -1: # <<<<<<<<<<<<<< - * """ - * Similar to L{writeString} but does not encode a type byte. - */ - -static PyObject *__pyx_pf_6cpyamf_4amf0_7Encoder_serialiseString(PyObject *__pyx_v_self, PyObject *__pyx_v_u); /*proto*/ -static int __pyx_f_6cpyamf_4amf0_7Encoder_serialiseString(struct __pyx_obj_6cpyamf_4amf0_Encoder *__pyx_v_self, PyObject *__pyx_v_u, int __pyx_skip_dispatch) { - Py_ssize_t __pyx_v_l; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("serialiseString"); - __Pyx_INCREF(__pyx_v_u); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__serialiseString); 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); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4amf0_7Encoder_serialiseString)) { - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_u); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_u); - __Pyx_GIVEREF(__pyx_v_u); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":441 - * Similar to L{writeString} but does not encode a type byte. - * """ - * if PyUnicode_CheckExact(u): # <<<<<<<<<<<<<< - * u = self.context.getBytesForString(u) - * - */ - __pyx_t_5 = PyUnicode_CheckExact(__pyx_v_u); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":442 - * """ - * if PyUnicode_CheckExact(u): - * u = self.context.getBytesForString(u) # <<<<<<<<<<<<<< - * - * cdef Py_ssize_t l = PyString_GET_SIZE(u) - */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6cpyamf_4amf0_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getBytesForString(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_u, 0)); 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_v_u); - __pyx_v_u = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":444 - * u = self.context.getBytesForString(u) - * - * cdef Py_ssize_t l = PyString_GET_SIZE(u) # <<<<<<<<<<<<<< - * - * if l > 0xffff: - */ - __pyx_v_l = PyString_GET_SIZE(__pyx_v_u); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":446 - * cdef Py_ssize_t l = PyString_GET_SIZE(u) - * - * if l > 0xffff: # <<<<<<<<<<<<<< - * self.stream.write_ulong(l) - * else: - */ - __pyx_t_5 = (__pyx_v_l > 0xffff); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":447 - * - * if l > 0xffff: - * self.stream.write_ulong(l) # <<<<<<<<<<<<<< - * else: - * self.stream.write_ushort(l) - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write_ulong(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_v_l, 0); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":449 - * self.stream.write_ulong(l) - * else: - * self.stream.write_ushort(l) # <<<<<<<<<<<<<< - * - * return self.stream.write(PyString_AS_STRING(u), l) - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write_ushort(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_v_l, 0); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":451 - * self.stream.write_ushort(l) - * - * return self.stream.write(PyString_AS_STRING(u), l) # <<<<<<<<<<<<<< - * - * cdef int writeXML(self, e) except -1: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write(__pyx_v_self->__pyx_base.__pyx_base.stream, PyString_AS_STRING(__pyx_v_u), __pyx_v_l); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.amf0.Encoder.serialiseString"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_u); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":437 - * return self.writeBytes(s) - * - * cpdef int serialiseString(self, u) except -1: # <<<<<<<<<<<<<< - * """ - * Similar to L{writeString} but does not encode a type byte. - */ - -static PyObject *__pyx_pf_6cpyamf_4amf0_7Encoder_serialiseString(PyObject *__pyx_v_self, PyObject *__pyx_v_u); /*proto*/ -static char __pyx_doc_6cpyamf_4amf0_7Encoder_serialiseString[] = "\n Similar to L{writeString} but does not encode a type byte.\n "; -static PyObject *__pyx_pf_6cpyamf_4amf0_7Encoder_serialiseString(PyObject *__pyx_v_self, PyObject *__pyx_v_u) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("serialiseString"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)((struct __pyx_obj_6cpyamf_4amf0_Encoder *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.serialiseString(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_u, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.amf0.Encoder.serialiseString"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":453 - * return self.stream.write(PyString_AS_STRING(u), l) - * - * cdef int writeXML(self, e) except -1: # <<<<<<<<<<<<<< - * """ - * Writes an XML instance. - */ - -static int __pyx_f_6cpyamf_4amf0_7Encoder_writeXML(struct __pyx_obj_6cpyamf_4amf0_Encoder *__pyx_v_self, PyObject *__pyx_v_e) { - PyObject *__pyx_v_data; - Py_ssize_t __pyx_v_l; - int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - __Pyx_RefNannySetupContext("writeXML"); - __pyx_v_data = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":457 - * Writes an XML instance. - * """ - * self.writeType(TYPE_XML) # <<<<<<<<<<<<<< - * - * data = xml.tostring(e) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf0_TYPE_XML); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":459 - * self.writeType(TYPE_XML) - * - * data = xml.tostring(e) # <<<<<<<<<<<<<< - * - * if isinstance(data, unicode): - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__xml); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__tostring); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_e); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_e); - __Pyx_GIVEREF(__pyx_v_e); - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_v_data); - __pyx_v_data = __pyx_t_4; - __pyx_t_4 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":461 - * data = xml.tostring(e) - * - * if isinstance(data, unicode): # <<<<<<<<<<<<<< - * data = data.encode('utf-8') - * - */ - __pyx_t_5 = PyUnicode_Check(__pyx_v_data); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":462 - * - * if isinstance(data, unicode): - * data = data.encode('utf-8') # <<<<<<<<<<<<<< - * - * if not PyString_CheckExact(data): - */ - __pyx_t_4 = PyObject_GetAttr(__pyx_v_data, __pyx_n_s__encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_v_data); - __pyx_v_data = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":464 - * data = data.encode('utf-8') - * - * if not PyString_CheckExact(data): # <<<<<<<<<<<<<< - * raise TypeError('expected str from xml.tostring') - * - */ - __pyx_t_5 = (!PyString_CheckExact(__pyx_v_data)); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":465 - * - * if not PyString_CheckExact(data): - * raise TypeError('expected str from xml.tostring') # <<<<<<<<<<<<<< - * - * cdef Py_ssize_t l = PyString_GET_SIZE(data) - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_16), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":467 - * raise TypeError('expected str from xml.tostring') - * - * cdef Py_ssize_t l = PyString_GET_SIZE(data) # <<<<<<<<<<<<<< - * - * self.stream.write_ulong(l) - */ - __pyx_v_l = PyString_GET_SIZE(__pyx_v_data); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":469 - * cdef Py_ssize_t l = PyString_GET_SIZE(data) - * - * self.stream.write_ulong(l) # <<<<<<<<<<<<<< - * - * return self.stream.write(PyString_AS_STRING(data), l) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write_ulong(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_v_l, 0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":471 - * self.stream.write_ulong(l) - * - * return self.stream.write(PyString_AS_STRING(data), l) # <<<<<<<<<<<<<< - * - * cdef int writeDateTime(self, d) except -1: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write(__pyx_v_self->__pyx_base.__pyx_base.stream, PyString_AS_STRING(__pyx_v_data), __pyx_v_l); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_1; - goto __pyx_L0; - - __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("cpyamf.amf0.Encoder.writeXML"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_data); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":473 - * return self.stream.write(PyString_AS_STRING(data), l) - * - * cdef int writeDateTime(self, d) except -1: # <<<<<<<<<<<<<< - * if self.timezone_offset is not None: - * d -= self.timezone_offset - */ - -static int __pyx_f_6cpyamf_4amf0_7Encoder_writeDateTime(struct __pyx_obj_6cpyamf_4amf0_Encoder *__pyx_v_self, PyObject *__pyx_v_d) { - PyObject *__pyx_v_secs; - int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - double __pyx_t_6; - __Pyx_RefNannySetupContext("writeDateTime"); - __Pyx_INCREF(__pyx_v_d); - __pyx_v_secs = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":474 - * - * cdef int writeDateTime(self, d) except -1: - * if self.timezone_offset is not None: # <<<<<<<<<<<<<< - * d -= self.timezone_offset - * - */ - __pyx_t_1 = (__pyx_v_self->__pyx_base.__pyx_base.timezone_offset != Py_None); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":475 - * cdef int writeDateTime(self, d) except -1: - * if self.timezone_offset is not None: - * d -= self.timezone_offset # <<<<<<<<<<<<<< - * - * secs = util.get_timestamp(d) - */ - __pyx_t_2 = PyNumber_InPlaceSubtract(__pyx_v_d, __pyx_v_self->__pyx_base.__pyx_base.timezone_offset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_d); - __pyx_v_d = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":477 - * d -= self.timezone_offset - * - * secs = util.get_timestamp(d) # <<<<<<<<<<<<<< - * - * self.writeType(TYPE_DATE) - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__util); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__get_timestamp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_d); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_d); - __Pyx_GIVEREF(__pyx_v_d); - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_v_secs); - __pyx_v_secs = __pyx_t_4; - __pyx_t_4 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":479 - * secs = util.get_timestamp(d) - * - * self.writeType(TYPE_DATE) # <<<<<<<<<<<<<< - * self.stream.write_double(secs * 1000.0) - * - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf0_TYPE_DATE); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":480 - * - * self.writeType(TYPE_DATE) - * self.stream.write_double(secs * 1000.0) # <<<<<<<<<<<<<< - * - * return self.stream.write('\x00\x00', 2) - */ - __pyx_t_4 = PyFloat_FromDouble(1000.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyNumber_Multiply(__pyx_v_secs, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write_double(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_t_6, 0); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":482 - * self.stream.write_double(secs * 1000.0) - * - * return self.stream.write('\x00\x00', 2) # <<<<<<<<<<<<<< - * - * cdef int writeDict(self, dict o) except -1: - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_k_17, 2); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_5; - goto __pyx_L0; - - __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("cpyamf.amf0.Encoder.writeDateTime"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_secs); - __Pyx_DECREF(__pyx_v_d); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":484 - * return self.stream.write('\x00\x00', 2) - * - * cdef int writeDict(self, dict o) except -1: # <<<<<<<<<<<<<< - * if self.writeReference(o) != -1: - * return 0 - */ - -static int __pyx_f_6cpyamf_4amf0_7Encoder_writeDict(struct __pyx_obj_6cpyamf_4amf0_Encoder *__pyx_v_self, PyObject *__pyx_v_o) { - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - Py_ssize_t __pyx_t_3; - __Pyx_RefNannySetupContext("writeDict"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":485 - * - * cdef int writeDict(self, dict o) except -1: - * if self.writeReference(o) != -1: # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->writeReference(__pyx_v_self, ((PyObject *)__pyx_v_o)); if (unlikely(__pyx_t_1 == -2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = (__pyx_t_1 != -1); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":486 - * cdef int writeDict(self, dict o) except -1: - * if self.writeReference(o) != -1: - * return 0 # <<<<<<<<<<<<<< - * - * self.context.addObject(o) - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":488 - * return 0 - * - * self.context.addObject(o) # <<<<<<<<<<<<<< - * self.writeType(TYPE_OBJECT) - * self._writeDict(o) - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), ((PyObject *)__pyx_v_o), 0); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":489 - * - * self.context.addObject(o) - * self.writeType(TYPE_OBJECT) # <<<<<<<<<<<<<< - * self._writeDict(o) - * - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf0_TYPE_OBJECT); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":490 - * self.context.addObject(o) - * self.writeType(TYPE_OBJECT) - * self._writeDict(o) # <<<<<<<<<<<<<< - * - * return self._writeEndObject() - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->_writeDict(__pyx_v_self, __pyx_v_o); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":492 - * self._writeDict(o) - * - * return self._writeEndObject() # <<<<<<<<<<<<<< - * - * cdef int _writeDict(self, dict attrs) except -1: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->_writeEndObject(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_1; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf0.Encoder.writeDict"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":494 - * return self._writeEndObject() - * - * cdef int _writeDict(self, dict attrs) except -1: # <<<<<<<<<<<<<< - * """ - * Write C{dict} to the data stream. - */ - -static int __pyx_f_6cpyamf_4amf0_7Encoder__writeDict(struct __pyx_obj_6cpyamf_4amf0_Encoder *__pyx_v_self, PyObject *__pyx_v_attrs) { - PyObject *__pyx_v_key; - PyObject *__pyx_v_value; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - void *__pyx_t_3; - void *__pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - __Pyx_RefNannySetupContext("_writeDict"); - __pyx_v_key = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_value = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":500 - * @param o: The C{dict} data to be encoded to the AMF0 data stream. - * """ - * for key, value in attrs.iteritems(): # <<<<<<<<<<<<<< - * if PyInt_Check(key) or PyLong_Check(key): - * key = str(key) - */ - __Pyx_INCREF(((PyObject *)__pyx_v_attrs)); - __Pyx_XDECREF(__pyx_t_1); - __pyx_t_1 = ((PyObject *)__pyx_v_attrs); - __pyx_t_2 = 0; - while (1) { - if (!PyDict_Next(__pyx_t_1, (&__pyx_t_2), ((PyObject **)(&__pyx_t_3)), ((PyObject **)(&__pyx_t_4)))) break; - __Pyx_INCREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(__pyx_v_key); - __pyx_v_key = ((PyObject *)__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_t_4)); - __Pyx_DECREF(__pyx_v_value); - __pyx_v_value = ((PyObject *)__pyx_t_4); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":501 - * """ - * for key, value in attrs.iteritems(): - * if PyInt_Check(key) or PyLong_Check(key): # <<<<<<<<<<<<<< - * key = str(key) - * - */ - __pyx_t_5 = PyInt_Check(__pyx_v_key); - if (!__pyx_t_5) { - __pyx_t_6 = PyLong_Check(__pyx_v_key); - __pyx_t_7 = __pyx_t_6; - } else { - __pyx_t_7 = __pyx_t_5; - } - if (__pyx_t_7) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":502 - * for key, value in attrs.iteritems(): - * if PyInt_Check(key) or PyLong_Check(key): - * key = str(key) # <<<<<<<<<<<<<< - * - * self.serialiseString(key) - */ - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_8)); - __Pyx_INCREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_v_key); - __pyx_v_key = __pyx_t_9; - __pyx_t_9 = 0; - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":504 - * key = str(key) - * - * self.serialiseString(key) # <<<<<<<<<<<<<< - * self.writeElement(value) - * - */ - __pyx_t_10 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.serialiseString(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_key, 0); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":505 - * - * self.serialiseString(key) - * self.writeElement(value) # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_10 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeElement(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_value, 0); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":507 - * self.writeElement(value) - * - * return 0 # <<<<<<<<<<<<<< - * - * cdef inline int _writeEndObject(self) except -1: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("cpyamf.amf0.Encoder._writeDict"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_key); - __Pyx_DECREF(__pyx_v_value); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":509 - * return 0 - * - * cdef inline int _writeEndObject(self) except -1: # <<<<<<<<<<<<<< - * return self.stream.write('\x00\x00\x09', 3) - * - */ - -static CYTHON_INLINE int __pyx_f_6cpyamf_4amf0_7Encoder__writeEndObject(struct __pyx_obj_6cpyamf_4amf0_Encoder *__pyx_v_self) { - int __pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("_writeEndObject"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":510 - * - * cdef inline int _writeEndObject(self) except -1: - * return self.stream.write('\x00\x00\x09', 3) # <<<<<<<<<<<<<< - * - * cpdef int writeObject(self, o, bint is_proxy=0) except -1: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_k_5, 3); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_1; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf0.Encoder._writeEndObject"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":512 - * return self.stream.write('\x00\x00\x09', 3) - * - * cpdef int writeObject(self, o, bint is_proxy=0) except -1: # <<<<<<<<<<<<<< - * """ - * Write a Python object to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4amf0_7Encoder_writeObject(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_f_6cpyamf_4amf0_7Encoder_writeObject(struct __pyx_obj_6cpyamf_4amf0_Encoder *__pyx_v_self, PyObject *__pyx_v_o, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_4amf0_7Encoder_writeObject *__pyx_optional_args) { - int __pyx_v_is_proxy = ((int)0); - PyObject *__pyx_v_alias; - PyObject *__pyx_v_attrs = 0; - PyObject *__pyx_v_key; - PyObject *__pyx_v_value; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - Py_ssize_t __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - __Pyx_RefNannySetupContext("writeObject"); - if (__pyx_optional_args) { - if (__pyx_optional_args->__pyx_n > 0) { - __pyx_v_is_proxy = __pyx_optional_args->is_proxy; - } - } - __pyx_v_alias = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_key = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_value = Py_None; __Pyx_INCREF(Py_None); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__writeObject); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4amf0_7Encoder_writeObject)) { - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_is_proxy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_o); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o); - __Pyx_GIVEREF(__pyx_v_o); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":518 - * @param o: The object data to be encoded to the AMF0 data stream. - * """ - * if self.writeReference(o) != -1: # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->writeReference(__pyx_v_self, __pyx_v_o); if (unlikely(__pyx_t_4 == -2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = (__pyx_t_4 != -1); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":519 - * """ - * if self.writeReference(o) != -1: - * return 0 # <<<<<<<<<<<<<< - * - * self.context.addObject(o) - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":521 - * return 0 - * - * self.context.addObject(o) # <<<<<<<<<<<<<< - * alias = self.context.getClassAlias(o.__class__) - * - */ - __pyx_t_6 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_o, 0); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":522 - * - * self.context.addObject(o) - * alias = self.context.getClassAlias(o.__class__) # <<<<<<<<<<<<<< - * - * alias.compile() - */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s____class__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getClassAlias(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_v_alias); - __pyx_v_alias = __pyx_t_2; - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":524 - * alias = self.context.getClassAlias(o.__class__) - * - * alias.compile() # <<<<<<<<<<<<<< - * - * if alias.amf3: - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s__compile); 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_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":526 - * alias.compile() - * - * if alias.amf3: # <<<<<<<<<<<<<< - * return self.writeAMF3(o) - * - */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s__amf3); 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_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":527 - * - * if alias.amf3: - * return self.writeAMF3(o) # <<<<<<<<<<<<<< - * - * if alias.anonymous: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->writeAMF3(__pyx_v_self, __pyx_v_o); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":529 - * return self.writeAMF3(o) - * - * if alias.anonymous: # <<<<<<<<<<<<<< - * self.writeType(TYPE_OBJECT) - * else: - */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s__anonymous); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":530 - * - * if alias.anonymous: - * self.writeType(TYPE_OBJECT) # <<<<<<<<<<<<<< - * else: - * self.writeType(TYPE_TYPEDOBJECT) - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf0_TYPE_OBJECT); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":532 - * self.writeType(TYPE_OBJECT) - * else: - * self.writeType(TYPE_TYPEDOBJECT) # <<<<<<<<<<<<<< - * self.serialiseString(alias.alias) - * - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf0_TYPE_TYPEDOBJECT); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":533 - * else: - * self.writeType(TYPE_TYPEDOBJECT) - * self.serialiseString(alias.alias) # <<<<<<<<<<<<<< - * - * cdef dict attrs = alias.getEncodableAttributes(o, codec=self) - */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s__alias); 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_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.serialiseString(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_t_1, 0); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":535 - * self.serialiseString(alias.alias) - * - * cdef dict attrs = alias.getEncodableAttributes(o, codec=self) # <<<<<<<<<<<<<< - * - * if len(attrs) and alias.static_attrs: - */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s_18); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __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 = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_o); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_o); - __Pyx_GIVEREF(__pyx_v_o); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__codec), ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (!(likely(PyDict_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_t_7)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_attrs = ((PyObject *)__pyx_t_7); - __pyx_t_7 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":537 - * cdef dict attrs = alias.getEncodableAttributes(o, codec=self) - * - * if len(attrs) and alias.static_attrs: # <<<<<<<<<<<<<< - * for key in alias.static_attrs: - * value = attrs.pop(key) - */ - if (unlikely(__pyx_v_attrs == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_6 = PyDict_Size(((PyObject *)__pyx_v_attrs)); - if (__pyx_t_6) { - __pyx_t_7 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s__static_attrs); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_8 = __pyx_t_5; - } else { - __pyx_t_8 = __pyx_t_6; - } - if (__pyx_t_8) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":538 - * - * if len(attrs) and alias.static_attrs: - * for key in alias.static_attrs: # <<<<<<<<<<<<<< - * value = attrs.pop(key) - * - */ - __pyx_t_7 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s__static_attrs); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) { - __pyx_t_6 = 0; __pyx_t_3 = __pyx_t_7; __Pyx_INCREF(__pyx_t_3); - } else { - __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - for (;;) { - if (likely(PyList_CheckExact(__pyx_t_3))) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break; - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_7); __pyx_t_6++; - } else if (likely(PyTuple_CheckExact(__pyx_t_3))) { - if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_7); __pyx_t_6++; - } else { - __pyx_t_7 = PyIter_Next(__pyx_t_3); - if (!__pyx_t_7) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - __Pyx_GOTREF(__pyx_t_7); - } - __Pyx_DECREF(__pyx_v_key); - __pyx_v_key = __pyx_t_7; - __pyx_t_7 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":539 - * if len(attrs) and alias.static_attrs: - * for key in alias.static_attrs: - * value = attrs.pop(key) # <<<<<<<<<<<<<< - * - * self.serialiseString(key) - */ - __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_attrs), __pyx_n_s__pop); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_v_value); - __pyx_v_value = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":541 - * value = attrs.pop(key) - * - * self.serialiseString(key) # <<<<<<<<<<<<<< - * self.writeElement(value) - * - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.serialiseString(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_key, 0); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":542 - * - * self.serialiseString(key) - * self.writeElement(value) # <<<<<<<<<<<<<< - * - * if attrs: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeElement(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_value, 0); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L6; - } - __pyx_L6:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":544 - * self.writeElement(value) - * - * if attrs: # <<<<<<<<<<<<<< - * self._writeDict(attrs) - * - */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_attrs)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_8) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":545 - * - * if attrs: - * self._writeDict(attrs) # <<<<<<<<<<<<<< - * - * return self._writeEndObject() - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->_writeDict(__pyx_v_self, __pyx_v_attrs); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L9; - } - __pyx_L9:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":547 - * self._writeDict(attrs) - * - * return self._writeEndObject() # <<<<<<<<<<<<<< - * - * cdef int writeMixedArray(self, o) except -1: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->_writeEndObject(__pyx_v_self); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("cpyamf.amf0.Encoder.writeObject"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_alias); - __Pyx_XDECREF(__pyx_v_attrs); - __Pyx_DECREF(__pyx_v_key); - __Pyx_DECREF(__pyx_v_value); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":512 - * return self.stream.write('\x00\x00\x09', 3) - * - * cpdef int writeObject(self, o, bint is_proxy=0) except -1: # <<<<<<<<<<<<<< - * """ - * Write a Python object to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4amf0_7Encoder_writeObject(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6cpyamf_4amf0_7Encoder_writeObject[] = "\n Write a Python object to the stream.\n\n @param o: The object data to be encoded to the AMF0 data stream.\n "; -static PyObject *__pyx_pf_6cpyamf_4amf0_7Encoder_writeObject(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_o = 0; - int __pyx_v_is_proxy; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeObject __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__o,&__pyx_n_s__is_proxy,0}; - __Pyx_RefNannySetupContext("writeObject"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - 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; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__o); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__is_proxy); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "writeObject") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_o = values[0]; - if (values[1]) { - __pyx_v_is_proxy = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_is_proxy == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_is_proxy = ((int)0); - } - } else { - __pyx_v_is_proxy = ((int)0); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: __pyx_v_is_proxy = __Pyx_PyObject_IsTrue(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_is_proxy == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 1: __pyx_v_o = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("writeObject", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.amf0.Encoder.writeObject"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_2.__pyx_n = 1; - __pyx_t_2.is_proxy = __pyx_v_is_proxy; - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)((struct __pyx_obj_6cpyamf_4amf0_Encoder *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.writeObject(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_o, 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.amf0.Encoder.writeObject"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":549 - * return self._writeEndObject() - * - * cdef int writeMixedArray(self, o) except -1: # <<<<<<<<<<<<<< - * if self.writeReference(o) != -1: - * return 0 - */ - -static int __pyx_f_6cpyamf_4amf0_7Encoder_writeMixedArray(struct __pyx_obj_6cpyamf_4amf0_Encoder *__pyx_v_self, PyObject *__pyx_v_o) { - PyObject *__pyx_v_max_index; - PyObject *__pyx_v_y; - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - Py_ssize_t __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - int __pyx_t_8; - unsigned long __pyx_t_9; - __Pyx_RefNannySetupContext("writeMixedArray"); - __pyx_v_max_index = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_y = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":550 - * - * cdef int writeMixedArray(self, o) except -1: - * if self.writeReference(o) != -1: # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->writeReference(__pyx_v_self, __pyx_v_o); if (unlikely(__pyx_t_1 == -2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = (__pyx_t_1 != -1); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":551 - * cdef int writeMixedArray(self, o) except -1: - * if self.writeReference(o) != -1: - * return 0 # <<<<<<<<<<<<<< - * - * self.context.addObject(o) - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":553 - * return 0 - * - * self.context.addObject(o) # <<<<<<<<<<<<<< - * self.writeType(TYPE_MIXEDARRAY) - * - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_o, 0); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":554 - * - * self.context.addObject(o) - * self.writeType(TYPE_MIXEDARRAY) # <<<<<<<<<<<<<< - * - * # TODO: optimise this - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf0_TYPE_MIXEDARRAY); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":558 - * # TODO: optimise this - * # work out the highest integer index - * try: # <<<<<<<<<<<<<< - * # list comprehensions to save the day - * max_index = max([y[0] for y in o.items() - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - __Pyx_XGOTREF(__pyx_save_exc_type); - __Pyx_XGOTREF(__pyx_save_exc_value); - __Pyx_XGOTREF(__pyx_save_exc_tb); - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":560 - * try: - * # list comprehensions to save the day - * max_index = max([y[0] for y in o.items() # <<<<<<<<<<<<<< - * if isinstance(y[0], (int, long))]) - * - */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L4_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_t_5 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__items); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L4_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L4_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) { - __pyx_t_3 = 0; __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); - } else { - __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L4_error;} - __Pyx_GOTREF(__pyx_t_5); - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - for (;;) { - if (likely(PyList_CheckExact(__pyx_t_5))) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break; - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_6); __pyx_t_3++; - } else if (likely(PyTuple_CheckExact(__pyx_t_5))) { - if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_5)) break; - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_6); __pyx_t_3++; - } else { - __pyx_t_6 = PyIter_Next(__pyx_t_5); - if (!__pyx_t_6) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L4_error;} - break; - } - __Pyx_GOTREF(__pyx_t_6); - } - __Pyx_DECREF(__pyx_v_y); - __pyx_v_y = __pyx_t_6; - __pyx_t_6 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":561 - * # list comprehensions to save the day - * max_index = max([y[0] for y in o.items() - * if isinstance(y[0], (int, long))]) # <<<<<<<<<<<<<< - * - * if max_index < 0: - */ - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_y, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L4_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyInt_Check(__pyx_t_6); - if (!__pyx_t_2) { - __pyx_t_7 = PyLong_Check(__pyx_t_6); - __pyx_t_8 = __pyx_t_7; - } else { - __pyx_t_8 = __pyx_t_2; - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__pyx_t_8) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":560 - * try: - * # list comprehensions to save the day - * max_index = max([y[0] for y in o.items() # <<<<<<<<<<<<<< - * if isinstance(y[0], (int, long))]) - * - */ - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_y, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L4_error;} - __Pyx_GOTREF(__pyx_t_6); - if (unlikely(PyList_Append(__pyx_t_4, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L4_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - goto __pyx_L14; - } - __pyx_L14:; - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L4_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L4_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_v_max_index); - __pyx_v_max_index = __pyx_t_4; - __pyx_t_4 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":563 - * if isinstance(y[0], (int, long))]) - * - * if max_index < 0: # <<<<<<<<<<<<<< - * max_index = 0 - * except ValueError: - */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_max_index, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L4_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L4_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":564 - * - * if max_index < 0: - * max_index = 0 # <<<<<<<<<<<<<< - * except ValueError: - * max_index = 0 - */ - __Pyx_INCREF(__pyx_int_0); - __Pyx_DECREF(__pyx_v_max_index); - __pyx_v_max_index = __pyx_int_0; - goto __pyx_L15; - } - __pyx_L15:; - } - __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L11_try_end; - __pyx_L4_error:; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":565 - * if max_index < 0: - * max_index = 0 - * except ValueError: # <<<<<<<<<<<<<< - * max_index = 0 - * - */ - __pyx_t_1 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); - if (__pyx_t_1) { - __Pyx_AddTraceback("cpyamf.amf0.Encoder.writeMixedArray"); - if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":566 - * max_index = 0 - * except ValueError: - * max_index = 0 # <<<<<<<<<<<<<< - * - * self.stream.write_ulong(max_index) - */ - __Pyx_INCREF(__pyx_int_0); - __Pyx_DECREF(__pyx_v_max_index); - __pyx_v_max_index = __pyx_int_0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - goto __pyx_L5_exception_handled; - } - __pyx_L6_except_error:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L5_exception_handled:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L11_try_end:; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":568 - * max_index = 0 - * - * self.stream.write_ulong(max_index) # <<<<<<<<<<<<<< - * - * self._writeDict(dict(o)) - */ - __pyx_t_9 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_max_index); if (unlikely((__pyx_t_9 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write_ulong(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_t_9, 0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":570 - * self.stream.write_ulong(max_index) - * - * self._writeDict(dict(o)) # <<<<<<<<<<<<<< - * self._writeEndObject() - * - */ - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __Pyx_INCREF(__pyx_v_o); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_o); - __Pyx_GIVEREF(__pyx_v_o); - __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)&PyDict_Type)), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->_writeDict(__pyx_v_self, ((PyObject *)__pyx_t_5)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":571 - * - * self._writeDict(dict(o)) - * self._writeEndObject() # <<<<<<<<<<<<<< - * - * cdef int writeAMF3(self, o) except -1: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->_writeEndObject(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("cpyamf.amf0.Encoder.writeMixedArray"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_max_index); - __Pyx_DECREF(__pyx_v_y); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":573 - * self._writeEndObject() - * - * cdef int writeAMF3(self, o) except -1: # <<<<<<<<<<<<<< - * if self.amf3_encoder is None: - * self.context.amf3_context = amf3.Context() - */ - -static int __pyx_f_6cpyamf_4amf0_7Encoder_writeAMF3(struct __pyx_obj_6cpyamf_4amf0_Encoder *__pyx_v_self, PyObject *__pyx_v_o) { - int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("writeAMF3"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":574 - * - * cdef int writeAMF3(self, o) except -1: - * if self.amf3_encoder is None: # <<<<<<<<<<<<<< - * self.context.amf3_context = amf3.Context() - * - */ - __pyx_t_1 = (((PyObject *)__pyx_v_self->amf3_encoder) == Py_None); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":575 - * cdef int writeAMF3(self, o) except -1: - * if self.amf3_encoder is None: - * self.context.amf3_context = amf3.Context() # <<<<<<<<<<<<<< - * - * self.amf3_encoder = amf3.Encoder( - */ - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6cpyamf_4amf3_Context)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_v_self->context->amf3_context); - __Pyx_DECREF(((PyObject *)__pyx_v_self->context->amf3_context)); - __pyx_v_self->context->amf3_context = ((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":577 - * self.context.amf3_context = amf3.Context() - * - * self.amf3_encoder = amf3.Encoder( # <<<<<<<<<<<<<< - * stream=self.stream, - * context=self.context.amf3_context, - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":578 - * - * self.amf3_encoder = amf3.Encoder( - * stream=self.stream, # <<<<<<<<<<<<<< - * context=self.context.amf3_context, - * timezone_offset=self.timezone_offset) - */ - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__stream), ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.stream)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":579 - * self.amf3_encoder = amf3.Encoder( - * stream=self.stream, - * context=self.context.amf3_context, # <<<<<<<<<<<<<< - * timezone_offset=self.timezone_offset) - * - */ - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__context), ((PyObject *)__pyx_v_self->context->amf3_context)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":580 - * stream=self.stream, - * context=self.context.amf3_context, - * timezone_offset=self.timezone_offset) # <<<<<<<<<<<<<< - * - * self.writeType(TYPE_AMF3) - */ - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__timezone_offset), __pyx_v_self->__pyx_base.__pyx_base.timezone_offset) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_6cpyamf_4amf3_Encoder)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":577 - * self.context.amf3_context = amf3.Context() - * - * self.amf3_encoder = amf3.Encoder( # <<<<<<<<<<<<<< - * stream=self.stream, - * context=self.context.amf3_context, - */ - __Pyx_GIVEREF(__pyx_t_3); - __Pyx_GOTREF(__pyx_v_self->amf3_encoder); - __Pyx_DECREF(((PyObject *)__pyx_v_self->amf3_encoder)); - __pyx_v_self->amf3_encoder = ((struct __pyx_obj_6cpyamf_4amf3_Encoder *)__pyx_t_3); - __pyx_t_3 = 0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":582 - * timezone_offset=self.timezone_offset) - * - * self.writeType(TYPE_AMF3) # <<<<<<<<<<<<<< - * self.amf3_encoder.writeElement(o) - * - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf0_TYPE_AMF3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":583 - * - * self.writeType(TYPE_AMF3) - * self.amf3_encoder.writeElement(o) # <<<<<<<<<<<<<< - * - * cdef inline int handleBasicTypes(self, object element, object py_type) except -1: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->amf3_encoder->__pyx_base.__pyx_vtab)->__pyx_base.writeElement(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self->amf3_encoder), __pyx_v_o, 0); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.amf0.Encoder.writeAMF3"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":585 - * self.amf3_encoder.writeElement(o) - * - * cdef inline int handleBasicTypes(self, object element, object py_type) except -1: # <<<<<<<<<<<<<< - * if self.use_amf3: - * return self.writeAMF3(element) - */ - -static CYTHON_INLINE int __pyx_f_6cpyamf_4amf0_7Encoder_handleBasicTypes(struct __pyx_obj_6cpyamf_4amf0_Encoder *__pyx_v_self, PyObject *__pyx_v_element, PyObject *__pyx_v_py_type) { - int __pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("handleBasicTypes"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":586 - * - * cdef inline int handleBasicTypes(self, object element, object py_type) except -1: - * if self.use_amf3: # <<<<<<<<<<<<<< - * return self.writeAMF3(element) - * - */ - if (__pyx_v_self->use_amf3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":587 - * cdef inline int handleBasicTypes(self, object element, object py_type) except -1: - * if self.use_amf3: - * return self.writeAMF3(element) # <<<<<<<<<<<<<< - * - * return codec.Encoder.handleBasicTypes(self, element, py_type) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->writeAMF3(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_1; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":589 - * return self.writeAMF3(element) - * - * return codec.Encoder.handleBasicTypes(self, element, py_type) # <<<<<<<<<<<<<< - */ - __pyx_t_1 = __pyx_vtabptr_6cpyamf_5codec_Encoder->handleBasicTypes(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_element, __pyx_v_py_type); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_1; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf0.Encoder.handleBasicTypes"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":304 - * """ - * - * cdef public bint use_amf3 # <<<<<<<<<<<<<< - * cdef readonly Context context - * cdef amf3.Encoder amf3_encoder - */ - -static PyObject *__pyx_pf_6cpyamf_4amf0_7Encoder_8use_amf3___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4amf0_7Encoder_8use_amf3___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(((struct __pyx_obj_6cpyamf_4amf0_Encoder *)__pyx_v_self)->use_amf3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.amf0.Encoder.use_amf3.__get__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6cpyamf_4amf0_7Encoder_8use_amf3___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pf_6cpyamf_4amf0_7Encoder_8use_amf3___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("__set__"); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_6cpyamf_4amf0_Encoder *)__pyx_v_self)->use_amf3 = __pyx_t_1; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf0.Encoder.use_amf3.__set__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":305 - * - * cdef public bint use_amf3 - * cdef readonly Context context # <<<<<<<<<<<<<< - * cdef amf3.Encoder amf3_encoder - * - */ - -static PyObject *__pyx_pf_6cpyamf_4amf0_7Encoder_7context___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4amf0_7Encoder_7context___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6cpyamf_4amf0_Encoder *)__pyx_v_self)->context)); - __pyx_r = ((PyObject *)((struct __pyx_obj_6cpyamf_4amf0_Encoder *)__pyx_v_self)->context); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static struct __pyx_vtabstruct_6cpyamf_4amf0_Context __pyx_vtable_6cpyamf_4amf0_Context; - -static PyObject *__pyx_tp_new_6cpyamf_4amf0_Context(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6cpyamf_4amf0_Context *p; - PyObject *o = __pyx_ptype_6cpyamf_5codec_Context->tp_new(t, a, k); - if (!o) return 0; - p = ((struct __pyx_obj_6cpyamf_4amf0_Context *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6cpyamf_5codec_Context*)__pyx_vtabptr_6cpyamf_4amf0_Context; - p->amf3_context = ((struct __pyx_obj_6cpyamf_4amf3_Context *)Py_None); Py_INCREF(Py_None); - return o; -} - -static void __pyx_tp_dealloc_6cpyamf_4amf0_Context(PyObject *o) { - struct __pyx_obj_6cpyamf_4amf0_Context *p = (struct __pyx_obj_6cpyamf_4amf0_Context *)o; - Py_XDECREF(((PyObject *)p->amf3_context)); - __pyx_ptype_6cpyamf_5codec_Context->tp_dealloc(o); -} - -static int __pyx_tp_traverse_6cpyamf_4amf0_Context(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6cpyamf_4amf0_Context *p = (struct __pyx_obj_6cpyamf_4amf0_Context *)o; - if (__pyx_ptype_6cpyamf_5codec_Context->tp_traverse) { - e = __pyx_ptype_6cpyamf_5codec_Context->tp_traverse(o, v, a); if (e) return e; - } - if (p->amf3_context) { - e = (*v)(((PyObject*)p->amf3_context), a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6cpyamf_4amf0_Context(PyObject *o) { - struct __pyx_obj_6cpyamf_4amf0_Context *p = (struct __pyx_obj_6cpyamf_4amf0_Context *)o; - PyObject* tmp; - if (__pyx_ptype_6cpyamf_5codec_Context->tp_clear) { - __pyx_ptype_6cpyamf_5codec_Context->tp_clear(o); - } - tmp = ((PyObject*)p->amf3_context); - p->amf3_context = ((struct __pyx_obj_6cpyamf_4amf3_Context *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyMethodDef __pyx_methods_6cpyamf_4amf0_Context[] = { - {__Pyx_NAMESTR("clear"), (PyCFunction)__pyx_pf_6cpyamf_4amf0_7Context_clear, METH_NOARGS, __Pyx_DOCSTR(0)}, - {0, 0, 0, 0} -}; - -static PyNumberMethods __pyx_tp_as_number_Context = { - 0, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_divide*/ - #endif - 0, /*nb_remainder*/ - 0, /*nb_divmod*/ - 0, /*nb_power*/ - 0, /*nb_negative*/ - 0, /*nb_positive*/ - 0, /*nb_absolute*/ - 0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_coerce*/ - #endif - 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif - 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*nb_hex*/ - #endif - 0, /*nb_inplace_add*/ - 0, /*nb_inplace_subtract*/ - 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_inplace_divide*/ - #endif - 0, /*nb_inplace_remainder*/ - 0, /*nb_inplace_power*/ - 0, /*nb_inplace_lshift*/ - 0, /*nb_inplace_rshift*/ - 0, /*nb_inplace_and*/ - 0, /*nb_inplace_xor*/ - 0, /*nb_inplace_or*/ - 0, /*nb_floor_divide*/ - 0, /*nb_true_divide*/ - 0, /*nb_inplace_floor_divide*/ - 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 - 0, /*nb_index*/ - #endif -}; - -static PySequenceMethods __pyx_tp_as_sequence_Context = { - 0, /*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_Context = { - 0, /*mp_length*/ - 0, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; - -static PyBufferProcs __pyx_tp_as_buffer_Context = { - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif -}; - -PyTypeObject __pyx_type_6cpyamf_4amf0_Context = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cpyamf.amf0.Context"), /*tp_name*/ - sizeof(struct __pyx_obj_6cpyamf_4amf0_Context), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6cpyamf_4amf0_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*/ - &__pyx_tp_as_number_Context, /*tp_as_number*/ - &__pyx_tp_as_sequence_Context, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_Context, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_Context, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_6cpyamf_4amf0_Context, /*tp_traverse*/ - __pyx_tp_clear_6cpyamf_4amf0_Context, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6cpyamf_4amf0_Context, /*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_6cpyamf_4amf0_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*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif -}; -static struct __pyx_vtabstruct_6cpyamf_4amf0_Decoder __pyx_vtable_6cpyamf_4amf0_Decoder; - -static PyObject *__pyx_tp_new_6cpyamf_4amf0_Decoder(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6cpyamf_4amf0_Decoder *p; - PyObject *o = __pyx_ptype_6cpyamf_5codec_Decoder->tp_new(t, a, k); - if (!o) return 0; - p = ((struct __pyx_obj_6cpyamf_4amf0_Decoder *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6cpyamf_5codec_Decoder*)__pyx_vtabptr_6cpyamf_4amf0_Decoder; - p->context = ((struct __pyx_obj_6cpyamf_4amf0_Context *)Py_None); Py_INCREF(Py_None); - p->amf3_decoder = ((struct __pyx_obj_6cpyamf_4amf3_Decoder *)Py_None); Py_INCREF(Py_None); - if (__pyx_pf_6cpyamf_4amf0_7Decoder___cinit__(o, __pyx_empty_tuple, NULL) < 0) { - Py_DECREF(o); o = 0; - } - return o; -} - -static void __pyx_tp_dealloc_6cpyamf_4amf0_Decoder(PyObject *o) { - struct __pyx_obj_6cpyamf_4amf0_Decoder *p = (struct __pyx_obj_6cpyamf_4amf0_Decoder *)o; - Py_XDECREF(((PyObject *)p->context)); - Py_XDECREF(((PyObject *)p->amf3_decoder)); - __pyx_ptype_6cpyamf_5codec_Decoder->tp_dealloc(o); -} - -static int __pyx_tp_traverse_6cpyamf_4amf0_Decoder(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6cpyamf_4amf0_Decoder *p = (struct __pyx_obj_6cpyamf_4amf0_Decoder *)o; - if (__pyx_ptype_6cpyamf_5codec_Decoder->tp_traverse) { - e = __pyx_ptype_6cpyamf_5codec_Decoder->tp_traverse(o, v, a); if (e) return e; - } - if (p->context) { - e = (*v)(((PyObject*)p->context), a); if (e) return e; - } - if (p->amf3_decoder) { - e = (*v)(((PyObject*)p->amf3_decoder), a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6cpyamf_4amf0_Decoder(PyObject *o) { - struct __pyx_obj_6cpyamf_4amf0_Decoder *p = (struct __pyx_obj_6cpyamf_4amf0_Decoder *)o; - PyObject* tmp; - if (__pyx_ptype_6cpyamf_5codec_Decoder->tp_clear) { - __pyx_ptype_6cpyamf_5codec_Decoder->tp_clear(o); - } - tmp = ((PyObject*)p->context); - p->context = ((struct __pyx_obj_6cpyamf_4amf0_Context *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->amf3_decoder); - p->amf3_decoder = ((struct __pyx_obj_6cpyamf_4amf3_Decoder *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_6cpyamf_4amf0_7Decoder_use_amf3(PyObject *o, void *x) { - return __pyx_pf_6cpyamf_4amf0_7Decoder_8use_amf3___get__(o); -} - -static int __pyx_setprop_6cpyamf_4amf0_7Decoder_use_amf3(PyObject *o, PyObject *v, void *x) { - if (v) { - return __pyx_pf_6cpyamf_4amf0_7Decoder_8use_amf3___set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6cpyamf_4amf0_7Decoder_context(PyObject *o, void *x) { - return __pyx_pf_6cpyamf_4amf0_7Decoder_7context___get__(o); -} - -static PyMethodDef __pyx_methods_6cpyamf_4amf0_Decoder[] = { - {__Pyx_NAMESTR("readString"), (PyCFunction)__pyx_pf_6cpyamf_4amf0_7Decoder_readString, METH_NOARGS, __Pyx_DOCSTR(0)}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_6cpyamf_4amf0_Decoder[] = { - {(char *)"use_amf3", __pyx_getprop_6cpyamf_4amf0_7Decoder_use_amf3, __pyx_setprop_6cpyamf_4amf0_7Decoder_use_amf3, 0, 0}, - {(char *)"context", __pyx_getprop_6cpyamf_4amf0_7Decoder_context, 0, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyNumberMethods __pyx_tp_as_number_Decoder = { - 0, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_divide*/ - #endif - 0, /*nb_remainder*/ - 0, /*nb_divmod*/ - 0, /*nb_power*/ - 0, /*nb_negative*/ - 0, /*nb_positive*/ - 0, /*nb_absolute*/ - 0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_coerce*/ - #endif - 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif - 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*nb_hex*/ - #endif - 0, /*nb_inplace_add*/ - 0, /*nb_inplace_subtract*/ - 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_inplace_divide*/ - #endif - 0, /*nb_inplace_remainder*/ - 0, /*nb_inplace_power*/ - 0, /*nb_inplace_lshift*/ - 0, /*nb_inplace_rshift*/ - 0, /*nb_inplace_and*/ - 0, /*nb_inplace_xor*/ - 0, /*nb_inplace_or*/ - 0, /*nb_floor_divide*/ - 0, /*nb_true_divide*/ - 0, /*nb_inplace_floor_divide*/ - 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 - 0, /*nb_index*/ - #endif -}; - -static PySequenceMethods __pyx_tp_as_sequence_Decoder = { - 0, /*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_Decoder = { - 0, /*mp_length*/ - 0, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; - -static PyBufferProcs __pyx_tp_as_buffer_Decoder = { - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif -}; - -PyTypeObject __pyx_type_6cpyamf_4amf0_Decoder = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cpyamf.amf0.Decoder"), /*tp_name*/ - sizeof(struct __pyx_obj_6cpyamf_4amf0_Decoder), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6cpyamf_4amf0_Decoder, /*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*/ - &__pyx_tp_as_number_Decoder, /*tp_as_number*/ - &__pyx_tp_as_sequence_Decoder, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_Decoder, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_Decoder, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("\n "), /*tp_doc*/ - __pyx_tp_traverse_6cpyamf_4amf0_Decoder, /*tp_traverse*/ - __pyx_tp_clear_6cpyamf_4amf0_Decoder, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6cpyamf_4amf0_Decoder, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_6cpyamf_4amf0_Decoder, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pf_6cpyamf_4amf0_7Decoder___init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6cpyamf_4amf0_Decoder, /*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*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif -}; -static struct __pyx_vtabstruct_6cpyamf_4amf0_Encoder __pyx_vtable_6cpyamf_4amf0_Encoder; - -static PyObject *__pyx_tp_new_6cpyamf_4amf0_Encoder(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6cpyamf_4amf0_Encoder *p; - PyObject *o = __pyx_ptype_6cpyamf_5codec_Encoder->tp_new(t, a, k); - if (!o) return 0; - p = ((struct __pyx_obj_6cpyamf_4amf0_Encoder *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6cpyamf_5codec_Encoder*)__pyx_vtabptr_6cpyamf_4amf0_Encoder; - p->context = ((struct __pyx_obj_6cpyamf_4amf0_Context *)Py_None); Py_INCREF(Py_None); - p->amf3_encoder = ((struct __pyx_obj_6cpyamf_4amf3_Encoder *)Py_None); Py_INCREF(Py_None); - if (__pyx_pf_6cpyamf_4amf0_7Encoder___cinit__(o, __pyx_empty_tuple, NULL) < 0) { - Py_DECREF(o); o = 0; - } - return o; -} - -static void __pyx_tp_dealloc_6cpyamf_4amf0_Encoder(PyObject *o) { - struct __pyx_obj_6cpyamf_4amf0_Encoder *p = (struct __pyx_obj_6cpyamf_4amf0_Encoder *)o; - Py_XDECREF(((PyObject *)p->context)); - Py_XDECREF(((PyObject *)p->amf3_encoder)); - __pyx_ptype_6cpyamf_5codec_Encoder->tp_dealloc(o); -} - -static int __pyx_tp_traverse_6cpyamf_4amf0_Encoder(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6cpyamf_4amf0_Encoder *p = (struct __pyx_obj_6cpyamf_4amf0_Encoder *)o; - if (__pyx_ptype_6cpyamf_5codec_Encoder->tp_traverse) { - e = __pyx_ptype_6cpyamf_5codec_Encoder->tp_traverse(o, v, a); if (e) return e; - } - if (p->context) { - e = (*v)(((PyObject*)p->context), a); if (e) return e; - } - if (p->amf3_encoder) { - e = (*v)(((PyObject*)p->amf3_encoder), a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6cpyamf_4amf0_Encoder(PyObject *o) { - struct __pyx_obj_6cpyamf_4amf0_Encoder *p = (struct __pyx_obj_6cpyamf_4amf0_Encoder *)o; - PyObject* tmp; - if (__pyx_ptype_6cpyamf_5codec_Encoder->tp_clear) { - __pyx_ptype_6cpyamf_5codec_Encoder->tp_clear(o); - } - tmp = ((PyObject*)p->context); - p->context = ((struct __pyx_obj_6cpyamf_4amf0_Context *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->amf3_encoder); - p->amf3_encoder = ((struct __pyx_obj_6cpyamf_4amf3_Encoder *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_6cpyamf_4amf0_7Encoder_use_amf3(PyObject *o, void *x) { - return __pyx_pf_6cpyamf_4amf0_7Encoder_8use_amf3___get__(o); -} - -static int __pyx_setprop_6cpyamf_4amf0_7Encoder_use_amf3(PyObject *o, PyObject *v, void *x) { - if (v) { - return __pyx_pf_6cpyamf_4amf0_7Encoder_8use_amf3___set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6cpyamf_4amf0_7Encoder_context(PyObject *o, void *x) { - return __pyx_pf_6cpyamf_4amf0_7Encoder_7context___get__(o); -} - -static PyMethodDef __pyx_methods_6cpyamf_4amf0_Encoder[] = { - {__Pyx_NAMESTR("writeList"), (PyCFunction)__pyx_pf_6cpyamf_4amf0_7Encoder_writeList, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4amf0_7Encoder_writeList)}, - {__Pyx_NAMESTR("serialiseString"), (PyCFunction)__pyx_pf_6cpyamf_4amf0_7Encoder_serialiseString, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4amf0_7Encoder_serialiseString)}, - {__Pyx_NAMESTR("writeObject"), (PyCFunction)__pyx_pf_6cpyamf_4amf0_7Encoder_writeObject, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4amf0_7Encoder_writeObject)}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_6cpyamf_4amf0_Encoder[] = { - {(char *)"use_amf3", __pyx_getprop_6cpyamf_4amf0_7Encoder_use_amf3, __pyx_setprop_6cpyamf_4amf0_7Encoder_use_amf3, 0, 0}, - {(char *)"context", __pyx_getprop_6cpyamf_4amf0_7Encoder_context, 0, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyNumberMethods __pyx_tp_as_number_Encoder = { - 0, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_divide*/ - #endif - 0, /*nb_remainder*/ - 0, /*nb_divmod*/ - 0, /*nb_power*/ - 0, /*nb_negative*/ - 0, /*nb_positive*/ - 0, /*nb_absolute*/ - 0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_coerce*/ - #endif - 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif - 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*nb_hex*/ - #endif - 0, /*nb_inplace_add*/ - 0, /*nb_inplace_subtract*/ - 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_inplace_divide*/ - #endif - 0, /*nb_inplace_remainder*/ - 0, /*nb_inplace_power*/ - 0, /*nb_inplace_lshift*/ - 0, /*nb_inplace_rshift*/ - 0, /*nb_inplace_and*/ - 0, /*nb_inplace_xor*/ - 0, /*nb_inplace_or*/ - 0, /*nb_floor_divide*/ - 0, /*nb_true_divide*/ - 0, /*nb_inplace_floor_divide*/ - 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 - 0, /*nb_index*/ - #endif -}; - -static PySequenceMethods __pyx_tp_as_sequence_Encoder = { - 0, /*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_Encoder = { - 0, /*mp_length*/ - 0, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; - -static PyBufferProcs __pyx_tp_as_buffer_Encoder = { - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif -}; - -PyTypeObject __pyx_type_6cpyamf_4amf0_Encoder = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cpyamf.amf0.Encoder"), /*tp_name*/ - sizeof(struct __pyx_obj_6cpyamf_4amf0_Encoder), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6cpyamf_4amf0_Encoder, /*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*/ - &__pyx_tp_as_number_Encoder, /*tp_as_number*/ - &__pyx_tp_as_sequence_Encoder, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_Encoder, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_Encoder, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("\n The AMF0 Encoder.\n "), /*tp_doc*/ - __pyx_tp_traverse_6cpyamf_4amf0_Encoder, /*tp_traverse*/ - __pyx_tp_clear_6cpyamf_4amf0_Encoder, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6cpyamf_4amf0_Encoder, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_6cpyamf_4amf0_Encoder, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pf_6cpyamf_4amf0_7Encoder___init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6cpyamf_4amf0_Encoder, /*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*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif -}; - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - PyModuleDef_HEAD_INIT, - __Pyx_NAMESTR("amf0"), - __Pyx_DOCSTR(__pyx_k_19), /* 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_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0}, - {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0}, - {&__pyx_n_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 1}, - {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, - {&__pyx_n_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 1}, - {&__pyx_n_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 1}, - {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0}, - {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0}, - {&__pyx_n_s__ASObject, __pyx_k__ASObject, sizeof(__pyx_k__ASObject), 0, 0, 1, 1}, - {&__pyx_n_s__DecodeError, __pyx_k__DecodeError, sizeof(__pyx_k__DecodeError), 0, 0, 1, 1}, - {&__pyx_n_s__MixedArray, __pyx_k__MixedArray, sizeof(__pyx_k__MixedArray), 0, 0, 1, 1}, - {&__pyx_n_s__OverflowError, __pyx_k__OverflowError, sizeof(__pyx_k__OverflowError), 0, 0, 1, 1}, - {&__pyx_n_s__ReferenceError, __pyx_k__ReferenceError, sizeof(__pyx_k__ReferenceError), 0, 0, 1, 1}, - {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1}, - {&__pyx_n_s__UnknownClassAlias, __pyx_k__UnknownClassAlias, sizeof(__pyx_k__UnknownClassAlias), 0, 0, 1, 1}, - {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1}, - {&__pyx_n_s____class__, __pyx_k____class__, sizeof(__pyx_k____class__), 0, 0, 1, 1}, - {&__pyx_n_s____init__, __pyx_k____init__, sizeof(__pyx_k____init__), 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}, - {&__pyx_n_s___writeDict, __pyx_k___writeDict, sizeof(__pyx_k___writeDict), 0, 0, 1, 1}, - {&__pyx_n_s___writeEndObject, __pyx_k___writeEndObject, sizeof(__pyx_k___writeEndObject), 0, 0, 1, 1}, - {&__pyx_n_s__a, __pyx_k__a, sizeof(__pyx_k__a), 0, 0, 1, 1}, - {&__pyx_n_s__addObject, __pyx_k__addObject, sizeof(__pyx_k__addObject), 0, 0, 1, 1}, - {&__pyx_n_s__alias, __pyx_k__alias, sizeof(__pyx_k__alias), 0, 0, 1, 1}, - {&__pyx_n_s__amf3, __pyx_k__amf3, sizeof(__pyx_k__amf3), 0, 0, 1, 1}, - {&__pyx_n_s__amf3_context, __pyx_k__amf3_context, sizeof(__pyx_k__amf3_context), 0, 0, 1, 1}, - {&__pyx_n_s__amf3_decoder, __pyx_k__amf3_decoder, sizeof(__pyx_k__amf3_decoder), 0, 0, 1, 1}, - {&__pyx_n_s__amf3_encoder, __pyx_k__amf3_encoder, sizeof(__pyx_k__amf3_encoder), 0, 0, 1, 1}, - {&__pyx_n_s__anonymous, __pyx_k__anonymous, sizeof(__pyx_k__anonymous), 0, 0, 1, 1}, - {&__pyx_n_s__applyAttributes, __pyx_k__applyAttributes, sizeof(__pyx_k__applyAttributes), 0, 0, 1, 1}, - {&__pyx_n_s__clear, __pyx_k__clear, sizeof(__pyx_k__clear), 0, 0, 1, 1}, - {&__pyx_n_s__codec, __pyx_k__codec, sizeof(__pyx_k__codec), 0, 0, 1, 1}, - {&__pyx_n_s__compile, __pyx_k__compile, sizeof(__pyx_k__compile), 0, 0, 1, 1}, - {&__pyx_n_s__context, __pyx_k__context, sizeof(__pyx_k__context), 0, 0, 1, 1}, - {&__pyx_n_s__createInstance, __pyx_k__createInstance, sizeof(__pyx_k__createInstance), 0, 0, 1, 1}, - {&__pyx_n_s__encode, __pyx_k__encode, sizeof(__pyx_k__encode), 0, 0, 1, 1}, - {&__pyx_n_s__fromstring, __pyx_k__fromstring, sizeof(__pyx_k__fromstring), 0, 0, 1, 1}, - {&__pyx_n_s__getBytesForString, __pyx_k__getBytesForString, sizeof(__pyx_k__getBytesForString), 0, 0, 1, 1}, - {&__pyx_n_s__getClassAlias, __pyx_k__getClassAlias, sizeof(__pyx_k__getClassAlias), 0, 0, 1, 1}, - {&__pyx_n_s__getObject, __pyx_k__getObject, sizeof(__pyx_k__getObject), 0, 0, 1, 1}, - {&__pyx_n_s__getObjectReference, __pyx_k__getObjectReference, sizeof(__pyx_k__getObjectReference), 0, 0, 1, 1}, - {&__pyx_n_s__getStringForBytes, __pyx_k__getStringForBytes, sizeof(__pyx_k__getStringForBytes), 0, 0, 1, 1}, - {&__pyx_n_s__get_datetime, __pyx_k__get_datetime, sizeof(__pyx_k__get_datetime), 0, 0, 1, 1}, - {&__pyx_n_s__get_timestamp, __pyx_k__get_timestamp, sizeof(__pyx_k__get_timestamp), 0, 0, 1, 1}, - {&__pyx_n_s__is_proxy, __pyx_k__is_proxy, sizeof(__pyx_k__is_proxy), 0, 0, 1, 1}, - {&__pyx_n_s__items, __pyx_k__items, sizeof(__pyx_k__items), 0, 0, 1, 1}, - {&__pyx_n_s__max, __pyx_k__max, sizeof(__pyx_k__max), 0, 0, 1, 1}, - {&__pyx_n_s__o, __pyx_k__o, sizeof(__pyx_k__o), 0, 0, 1, 1}, - {&__pyx_n_s__peek, __pyx_k__peek, sizeof(__pyx_k__peek), 0, 0, 1, 1}, - {&__pyx_n_s__pop, __pyx_k__pop, sizeof(__pyx_k__pop), 0, 0, 1, 1}, - {&__pyx_n_s__pyamf, __pyx_k__pyamf, sizeof(__pyx_k__pyamf), 0, 0, 1, 1}, - {&__pyx_n_s__read, __pyx_k__read, sizeof(__pyx_k__read), 0, 0, 1, 1}, - {&__pyx_n_s__readAMF3, __pyx_k__readAMF3, sizeof(__pyx_k__readAMF3), 0, 0, 1, 1}, - {&__pyx_n_s__readBoolean, __pyx_k__readBoolean, sizeof(__pyx_k__readBoolean), 0, 0, 1, 1}, - {&__pyx_n_s__readBytes, __pyx_k__readBytes, sizeof(__pyx_k__readBytes), 0, 0, 1, 1}, - {&__pyx_n_s__readDate, __pyx_k__readDate, sizeof(__pyx_k__readDate), 0, 0, 1, 1}, - {&__pyx_n_s__readElement, __pyx_k__readElement, sizeof(__pyx_k__readElement), 0, 0, 1, 1}, - {&__pyx_n_s__readList, __pyx_k__readList, sizeof(__pyx_k__readList), 0, 0, 1, 1}, - {&__pyx_n_s__readLongString, __pyx_k__readLongString, sizeof(__pyx_k__readLongString), 0, 0, 1, 1}, - {&__pyx_n_s__readMixedArray, __pyx_k__readMixedArray, sizeof(__pyx_k__readMixedArray), 0, 0, 1, 1}, - {&__pyx_n_s__readNull, __pyx_k__readNull, sizeof(__pyx_k__readNull), 0, 0, 1, 1}, - {&__pyx_n_s__readNumber, __pyx_k__readNumber, sizeof(__pyx_k__readNumber), 0, 0, 1, 1}, - {&__pyx_n_s__readObject, __pyx_k__readObject, sizeof(__pyx_k__readObject), 0, 0, 1, 1}, - {&__pyx_n_s__readReference, __pyx_k__readReference, sizeof(__pyx_k__readReference), 0, 0, 1, 1}, - {&__pyx_n_s__readString, __pyx_k__readString, sizeof(__pyx_k__readString), 0, 0, 1, 1}, - {&__pyx_n_s__readTypedObject, __pyx_k__readTypedObject, sizeof(__pyx_k__readTypedObject), 0, 0, 1, 1}, - {&__pyx_n_s__readUndefined, __pyx_k__readUndefined, sizeof(__pyx_k__readUndefined), 0, 0, 1, 1}, - {&__pyx_n_s__readXML, __pyx_k__readXML, sizeof(__pyx_k__readXML), 0, 0, 1, 1}, - {&__pyx_n_s__read_double, __pyx_k__read_double, sizeof(__pyx_k__read_double), 0, 0, 1, 1}, - {&__pyx_n_s__read_short, __pyx_k__read_short, sizeof(__pyx_k__read_short), 0, 0, 1, 1}, - {&__pyx_n_s__read_uchar, __pyx_k__read_uchar, sizeof(__pyx_k__read_uchar), 0, 0, 1, 1}, - {&__pyx_n_s__read_ulong, __pyx_k__read_ulong, sizeof(__pyx_k__read_ulong), 0, 0, 1, 1}, - {&__pyx_n_s__read_ushort, __pyx_k__read_ushort, sizeof(__pyx_k__read_ushort), 0, 0, 1, 1}, - {&__pyx_n_s__seek, __pyx_k__seek, sizeof(__pyx_k__seek), 0, 0, 1, 1}, - {&__pyx_n_s__serialiseString, __pyx_k__serialiseString, sizeof(__pyx_k__serialiseString), 0, 0, 1, 1}, - {&__pyx_n_s__static_attrs, __pyx_k__static_attrs, sizeof(__pyx_k__static_attrs), 0, 0, 1, 1}, - {&__pyx_n_s__stream, __pyx_k__stream, sizeof(__pyx_k__stream), 0, 0, 1, 1}, - {&__pyx_n_s__strict, __pyx_k__strict, sizeof(__pyx_k__strict), 0, 0, 1, 1}, - {&__pyx_n_s__timezone_offset, __pyx_k__timezone_offset, sizeof(__pyx_k__timezone_offset), 0, 0, 1, 1}, - {&__pyx_n_s__tostring, __pyx_k__tostring, sizeof(__pyx_k__tostring), 0, 0, 1, 1}, - {&__pyx_n_s__use_amf3, __pyx_k__use_amf3, sizeof(__pyx_k__use_amf3), 0, 0, 1, 1}, - {&__pyx_n_s__util, __pyx_k__util, sizeof(__pyx_k__util), 0, 0, 1, 1}, - {&__pyx_n_s__write, __pyx_k__write, sizeof(__pyx_k__write), 0, 0, 1, 1}, - {&__pyx_n_s__writeAMF3, __pyx_k__writeAMF3, sizeof(__pyx_k__writeAMF3), 0, 0, 1, 1}, - {&__pyx_n_s__writeBytes, __pyx_k__writeBytes, sizeof(__pyx_k__writeBytes), 0, 0, 1, 1}, - {&__pyx_n_s__writeElement, __pyx_k__writeElement, sizeof(__pyx_k__writeElement), 0, 0, 1, 1}, - {&__pyx_n_s__writeList, __pyx_k__writeList, sizeof(__pyx_k__writeList), 0, 0, 1, 1}, - {&__pyx_n_s__writeObject, __pyx_k__writeObject, sizeof(__pyx_k__writeObject), 0, 0, 1, 1}, - {&__pyx_n_s__writeReference, __pyx_k__writeReference, sizeof(__pyx_k__writeReference), 0, 0, 1, 1}, - {&__pyx_n_s__writeType, __pyx_k__writeType, sizeof(__pyx_k__writeType), 0, 0, 1, 1}, - {&__pyx_n_s__write_double, __pyx_k__write_double, sizeof(__pyx_k__write_double), 0, 0, 1, 1}, - {&__pyx_n_s__write_ulong, __pyx_k__write_ulong, sizeof(__pyx_k__write_ulong), 0, 0, 1, 1}, - {&__pyx_n_s__write_ushort, __pyx_k__write_ushort, sizeof(__pyx_k__write_ushort), 0, 0, 1, 1}, - {&__pyx_n_s__xml, __pyx_k__xml, sizeof(__pyx_k__xml), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_OverflowError = __Pyx_GetName(__pyx_b, __pyx_n_s__OverflowError); if (!__pyx_builtin_OverflowError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_max = __Pyx_GetName(__pyx_b, __pyx_n_s__max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":71 - * - * def __init__(self, *args, **kwargs): - * self.use_amf3 = kwargs.pop('use_amf3', 0) # <<<<<<<<<<<<<< - * self.context = kwargs.pop('context', None) - * - */ - __pyx_k_tuple_1 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_1)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__use_amf3)); - PyTuple_SET_ITEM(__pyx_k_tuple_1, 0, ((PyObject *)__pyx_n_s__use_amf3)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__use_amf3)); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_k_tuple_1, 1, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_1)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":72 - * def __init__(self, *args, **kwargs): - * self.use_amf3 = kwargs.pop('use_amf3', 0) - * self.context = kwargs.pop('context', None) # <<<<<<<<<<<<<< - * - * if self.context is None: - */ - __pyx_k_tuple_2 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_2)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__context)); - PyTuple_SET_ITEM(__pyx_k_tuple_2, 0, ((PyObject *)__pyx_n_s__context)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__context)); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_k_tuple_2, 1, Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":100 - * return False - * - * raise pyamf.DecodeError('Bad boolean read from stream') # <<<<<<<<<<<<<< - * - * cdef object readBytes(self): - */ - __pyx_k_tuple_4 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_4)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_3)); - PyTuple_SET_ITEM(__pyx_k_tuple_4, 0, ((PyObject *)__pyx_kp_s_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":296 - * return self.readAMF3() - * - * raise pyamf.DecodeError("Unsupported ActionScript type") # <<<<<<<<<<<<<< - * - * - */ - __pyx_k_tuple_10 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_10)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_9)); - PyTuple_SET_ITEM(__pyx_k_tuple_10, 0, ((PyObject *)__pyx_kp_s_9)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":312 - * - * def __init__(self, *args, **kwargs): - * self.use_amf3 = kwargs.pop('use_amf3', 0) # <<<<<<<<<<<<<< - * - * self.context = kwargs.pop('context', None) - */ - __pyx_k_tuple_11 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_11)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__use_amf3)); - PyTuple_SET_ITEM(__pyx_k_tuple_11, 0, ((PyObject *)__pyx_n_s__use_amf3)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__use_amf3)); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_k_tuple_11, 1, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":314 - * self.use_amf3 = kwargs.pop('use_amf3', 0) - * - * self.context = kwargs.pop('context', None) # <<<<<<<<<<<<<< - * - * if self.context is None: - */ - __pyx_k_tuple_12 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_12)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__context)); - PyTuple_SET_ITEM(__pyx_k_tuple_12, 0, ((PyObject *)__pyx_n_s__context)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__context)); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_k_tuple_12, 1, Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":462 - * - * if isinstance(data, unicode): - * data = data.encode('utf-8') # <<<<<<<<<<<<<< - * - * if not PyString_CheckExact(data): - */ - __pyx_k_tuple_14 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_14)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_13)); - PyTuple_SET_ITEM(__pyx_k_tuple_14, 0, ((PyObject *)__pyx_kp_s_13)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":465 - * - * if not PyString_CheckExact(data): - * raise TypeError('expected str from xml.tostring') # <<<<<<<<<<<<<< - * - * cdef Py_ssize_t l = PyString_GET_SIZE(data) - */ - __pyx_k_tuple_16 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_16)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_15)); - PyTuple_SET_ITEM(__pyx_k_tuple_16, 0, ((PyObject *)__pyx_kp_s_15)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_15)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16)); - __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;}; - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initamf0(void); /*proto*/ -PyMODINIT_FUNC initamf0(void) -#else -PyMODINIT_FUNC PyInit_amf0(void); /*proto*/ -PyMODINIT_FUNC PyInit_amf0(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - #if CYTHON_REFNANNY - void* __pyx_refnanny = NULL; - __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"); - } - __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_amf0(void)", __LINE__, __FILE__); - #endif - __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_binding_PyCFunctionType_USED - if (__pyx_binding_PyCFunctionType_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(__Pyx_NAMESTR("amf0"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_19), 0, PYTHON_API_VERSION); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - #if PY_MAJOR_VERSION < 3 - Py_INCREF(__pyx_m); - #endif - __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); - if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__Pyx_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 (__pyx_module_is_main_cpyamf__amf0) { - if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - } - /*--- 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 ---*/ - __pyx_v_6cpyamf_4amf0_ASObject = Py_None; Py_INCREF(Py_None); - __pyx_v_6cpyamf_4amf0_UnknownClassAlias = Py_None; Py_INCREF(Py_None); - /*--- Function export code ---*/ - /*--- Type init code ---*/ - __pyx_ptype_6cpyamf_5codec_Context = __Pyx_ImportType("cpyamf.codec", "Context", sizeof(struct __pyx_obj_6cpyamf_5codec_Context), 1); if (unlikely(!__pyx_ptype_6cpyamf_5codec_Context)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_6cpyamf_5codec_Context->tp_dict, &__pyx_vtabptr_6cpyamf_5codec_Context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_6cpyamf_4amf0_Context = &__pyx_vtable_6cpyamf_4amf0_Context; - __pyx_vtable_6cpyamf_4amf0_Context.__pyx_base = *__pyx_vtabptr_6cpyamf_5codec_Context; - __pyx_vtable_6cpyamf_4amf0_Context.__pyx_base.clear = (int (*)(struct __pyx_obj_6cpyamf_5codec_Context *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4amf0_7Context_clear; - __pyx_type_6cpyamf_4amf0_Context.tp_base = __pyx_ptype_6cpyamf_5codec_Context; - if (PyType_Ready(&__pyx_type_6cpyamf_4amf0_Context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6cpyamf_4amf0_Context.tp_dict, __pyx_vtabptr_6cpyamf_4amf0_Context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Context", (PyObject *)&__pyx_type_6cpyamf_4amf0_Context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_4amf0_Context = &__pyx_type_6cpyamf_4amf0_Context; - __pyx_ptype_6cpyamf_5codec_Decoder = __Pyx_ImportType("cpyamf.codec", "Decoder", sizeof(struct __pyx_obj_6cpyamf_5codec_Decoder), 1); if (unlikely(!__pyx_ptype_6cpyamf_5codec_Decoder)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_6cpyamf_5codec_Decoder->tp_dict, &__pyx_vtabptr_6cpyamf_5codec_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_6cpyamf_4amf0_Decoder = &__pyx_vtable_6cpyamf_4amf0_Decoder; - __pyx_vtable_6cpyamf_4amf0_Decoder.__pyx_base = *__pyx_vtabptr_6cpyamf_5codec_Decoder; - __pyx_vtable_6cpyamf_4amf0_Decoder.__pyx_base.readDate = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *))__pyx_f_6cpyamf_4amf0_7Decoder_readDate; - __pyx_vtable_6cpyamf_4amf0_Decoder.__pyx_base.readString = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4amf0_7Decoder_readString; - __pyx_vtable_6cpyamf_4amf0_Decoder.__pyx_base.readObject = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *))__pyx_f_6cpyamf_4amf0_7Decoder_readObject; - __pyx_vtable_6cpyamf_4amf0_Decoder.__pyx_base.readNumber = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *))__pyx_f_6cpyamf_4amf0_7Decoder_readNumber; - __pyx_vtable_6cpyamf_4amf0_Decoder.__pyx_base.readList = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *))__pyx_f_6cpyamf_4amf0_7Decoder_readList; - __pyx_vtable_6cpyamf_4amf0_Decoder.__pyx_base.readXML = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *))__pyx_f_6cpyamf_4amf0_7Decoder_readXML; - __pyx_vtable_6cpyamf_4amf0_Decoder.__pyx_base.readConcreteElement = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *, char))__pyx_f_6cpyamf_4amf0_7Decoder_readConcreteElement; - __pyx_vtable_6cpyamf_4amf0_Decoder.readBoolean = (PyObject *(*)(struct __pyx_obj_6cpyamf_4amf0_Decoder *))__pyx_f_6cpyamf_4amf0_7Decoder_readBoolean; - __pyx_vtable_6cpyamf_4amf0_Decoder.readBytes = (PyObject *(*)(struct __pyx_obj_6cpyamf_4amf0_Decoder *))__pyx_f_6cpyamf_4amf0_7Decoder_readBytes; - __pyx_vtable_6cpyamf_4amf0_Decoder.readObjectAttributes = (PyObject *(*)(struct __pyx_obj_6cpyamf_4amf0_Decoder *, PyObject *))__pyx_f_6cpyamf_4amf0_7Decoder_readObjectAttributes; - __pyx_vtable_6cpyamf_4amf0_Decoder.readTypedObject = (PyObject *(*)(struct __pyx_obj_6cpyamf_4amf0_Decoder *))__pyx_f_6cpyamf_4amf0_7Decoder_readTypedObject; - __pyx_vtable_6cpyamf_4amf0_Decoder.readReference = (PyObject *(*)(struct __pyx_obj_6cpyamf_4amf0_Decoder *))__pyx_f_6cpyamf_4amf0_7Decoder_readReference; - __pyx_vtable_6cpyamf_4amf0_Decoder.readMixedArray = (PyObject *(*)(struct __pyx_obj_6cpyamf_4amf0_Decoder *))__pyx_f_6cpyamf_4amf0_7Decoder_readMixedArray; - __pyx_vtable_6cpyamf_4amf0_Decoder.readLongString = (PyObject *(*)(struct __pyx_obj_6cpyamf_4amf0_Decoder *, struct __pyx_opt_args_6cpyamf_4amf0_7Decoder_readLongString *__pyx_optional_args))__pyx_f_6cpyamf_4amf0_7Decoder_readLongString; - __pyx_vtable_6cpyamf_4amf0_Decoder.readAMF3 = (PyObject *(*)(struct __pyx_obj_6cpyamf_4amf0_Decoder *))__pyx_f_6cpyamf_4amf0_7Decoder_readAMF3; - __pyx_type_6cpyamf_4amf0_Decoder.tp_base = __pyx_ptype_6cpyamf_5codec_Decoder; - if (PyType_Ready(&__pyx_type_6cpyamf_4amf0_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6cpyamf_4amf0_Decoder.tp_dict, __pyx_vtabptr_6cpyamf_4amf0_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Decoder", (PyObject *)&__pyx_type_6cpyamf_4amf0_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_4amf0_Decoder = &__pyx_type_6cpyamf_4amf0_Decoder; - __pyx_ptype_6cpyamf_5codec_Encoder = __Pyx_ImportType("cpyamf.codec", "Encoder", sizeof(struct __pyx_obj_6cpyamf_5codec_Encoder), 1); if (unlikely(!__pyx_ptype_6cpyamf_5codec_Encoder)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_6cpyamf_5codec_Encoder->tp_dict, &__pyx_vtabptr_6cpyamf_5codec_Encoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_6cpyamf_4amf0_Encoder = &__pyx_vtable_6cpyamf_4amf0_Encoder; - __pyx_vtable_6cpyamf_4amf0_Encoder.__pyx_base = *__pyx_vtabptr_6cpyamf_5codec_Encoder; - __pyx_vtable_6cpyamf_4amf0_Encoder.__pyx_base.serialiseString = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4amf0_7Encoder_serialiseString; - __pyx_vtable_6cpyamf_4amf0_Encoder.__pyx_base.writeNull = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf0_7Encoder_writeNull; - __pyx_vtable_6cpyamf_4amf0_Encoder.__pyx_base.writeUndefined = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf0_7Encoder_writeUndefined; - __pyx_vtable_6cpyamf_4amf0_Encoder.__pyx_base.writeString = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf0_7Encoder_writeString; - __pyx_vtable_6cpyamf_4amf0_Encoder.__pyx_base.writeBytes = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf0_7Encoder_writeBytes; - __pyx_vtable_6cpyamf_4amf0_Encoder.__pyx_base.writeBoolean = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf0_7Encoder_writeBoolean; - __pyx_vtable_6cpyamf_4amf0_Encoder.__pyx_base.writeInt = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf0_7Encoder_writeInt; - __pyx_vtable_6cpyamf_4amf0_Encoder.__pyx_base.writeLong = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf0_7Encoder_writeLong; - __pyx_vtable_6cpyamf_4amf0_Encoder.__pyx_base.writeNumber = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf0_7Encoder_writeNumber; - __pyx_vtable_6cpyamf_4amf0_Encoder.__pyx_base.writeDateTime = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf0_7Encoder_writeDateTime; - __pyx_vtable_6cpyamf_4amf0_Encoder.__pyx_base.writeXML = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf0_7Encoder_writeXML; - __pyx_vtable_6cpyamf_4amf0_Encoder.__pyx_base.writeList = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeList *__pyx_optional_args))__pyx_f_6cpyamf_4amf0_7Encoder_writeList; - __pyx_vtable_6cpyamf_4amf0_Encoder.__pyx_base.writeTuple = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf0_7Encoder_writeTuple; - __pyx_vtable_6cpyamf_4amf0_Encoder.__pyx_base.writeObject = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeObject *__pyx_optional_args))__pyx_f_6cpyamf_4amf0_7Encoder_writeObject; - __pyx_vtable_6cpyamf_4amf0_Encoder.__pyx_base.writeDict = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf0_7Encoder_writeDict; - __pyx_vtable_6cpyamf_4amf0_Encoder.__pyx_base.writeMixedArray = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf0_7Encoder_writeMixedArray; - __pyx_vtable_6cpyamf_4amf0_Encoder.__pyx_base.handleBasicTypes = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, PyObject *))__pyx_f_6cpyamf_4amf0_7Encoder_handleBasicTypes; - __pyx_vtable_6cpyamf_4amf0_Encoder.writeReference = (int (*)(struct __pyx_obj_6cpyamf_4amf0_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf0_7Encoder_writeReference; - __pyx_vtable_6cpyamf_4amf0_Encoder._writeDict = (int (*)(struct __pyx_obj_6cpyamf_4amf0_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf0_7Encoder__writeDict; - __pyx_vtable_6cpyamf_4amf0_Encoder._writeEndObject = (int (*)(struct __pyx_obj_6cpyamf_4amf0_Encoder *))__pyx_f_6cpyamf_4amf0_7Encoder__writeEndObject; - __pyx_vtable_6cpyamf_4amf0_Encoder.writeAMF3 = (int (*)(struct __pyx_obj_6cpyamf_4amf0_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf0_7Encoder_writeAMF3; - __pyx_type_6cpyamf_4amf0_Encoder.tp_base = __pyx_ptype_6cpyamf_5codec_Encoder; - if (PyType_Ready(&__pyx_type_6cpyamf_4amf0_Encoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6cpyamf_4amf0_Encoder.tp_dict, __pyx_vtabptr_6cpyamf_4amf0_Encoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Encoder", (PyObject *)&__pyx_type_6cpyamf_4amf0_Encoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_4amf0_Encoder = &__pyx_type_6cpyamf_4amf0_Encoder; - /*--- Type import code ---*/ - __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[1]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_4util_cBufferedByteStream = __Pyx_ImportType("cpyamf.util", "cBufferedByteStream", sizeof(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream), 1); if (unlikely(!__pyx_ptype_6cpyamf_4util_cBufferedByteStream)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_6cpyamf_4util_cBufferedByteStream->tp_dict, &__pyx_vtabptr_6cpyamf_4util_cBufferedByteStream) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_4util_BufferedByteStream = __Pyx_ImportType("cpyamf.util", "BufferedByteStream", sizeof(struct __pyx_obj_6cpyamf_4util_BufferedByteStream), 1); if (unlikely(!__pyx_ptype_6cpyamf_4util_BufferedByteStream)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_6cpyamf_4util_BufferedByteStream->tp_dict, &__pyx_vtabptr_6cpyamf_4util_BufferedByteStream) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_5codec_IndexedCollection = __Pyx_ImportType("cpyamf.codec", "IndexedCollection", sizeof(struct __pyx_obj_6cpyamf_5codec_IndexedCollection), 1); if (unlikely(!__pyx_ptype_6cpyamf_5codec_IndexedCollection)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_6cpyamf_5codec_IndexedCollection->tp_dict, &__pyx_vtabptr_6cpyamf_5codec_IndexedCollection) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_5codec_Codec = __Pyx_ImportType("cpyamf.codec", "Codec", sizeof(struct __pyx_obj_6cpyamf_5codec_Codec), 1); if (unlikely(!__pyx_ptype_6cpyamf_5codec_Codec)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_4amf3_ClassDefinition = __Pyx_ImportType("cpyamf.amf3", "ClassDefinition", sizeof(struct __pyx_obj_6cpyamf_4amf3_ClassDefinition), 1); if (unlikely(!__pyx_ptype_6cpyamf_4amf3_ClassDefinition)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_6cpyamf_4amf3_ClassDefinition->tp_dict, &__pyx_vtabptr_6cpyamf_4amf3_ClassDefinition) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_4amf3_Context = __Pyx_ImportType("cpyamf.amf3", "Context", sizeof(struct __pyx_obj_6cpyamf_4amf3_Context), 1); if (unlikely(!__pyx_ptype_6cpyamf_4amf3_Context)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_6cpyamf_4amf3_Context->tp_dict, &__pyx_vtabptr_6cpyamf_4amf3_Context) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_4amf3_Decoder = __Pyx_ImportType("cpyamf.amf3", "Decoder", sizeof(struct __pyx_obj_6cpyamf_4amf3_Decoder), 1); if (unlikely(!__pyx_ptype_6cpyamf_4amf3_Decoder)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_6cpyamf_4amf3_Decoder->tp_dict, &__pyx_vtabptr_6cpyamf_4amf3_Decoder) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_4amf3_Encoder = __Pyx_ImportType("cpyamf.amf3", "Encoder", sizeof(struct __pyx_obj_6cpyamf_4amf3_Encoder), 1); if (unlikely(!__pyx_ptype_6cpyamf_4amf3_Encoder)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_6cpyamf_4amf3_Encoder->tp_dict, &__pyx_vtabptr_6cpyamf_4amf3_Encoder) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":19 - * from cpyamf cimport codec, amf3 - * - * import pyamf # <<<<<<<<<<<<<< - * from pyamf import xml, util - * - */ - __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__pyamf), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__pyamf, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":20 - * - * import pyamf - * from pyamf import xml, util # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__xml)); - PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__xml)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__xml)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__util)); - PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__util)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__util)); - __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__pyamf), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__xml); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__xml, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__util); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__util, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __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; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":23 - * - * - * cdef char TYPE_NUMBER = '\x00' # <<<<<<<<<<<<<< - * cdef char TYPE_BOOL = '\x01' - * cdef char TYPE_STRING = '\x02' - */ - __pyx_v_6cpyamf_4amf0_TYPE_NUMBER = '\x00'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":24 - * - * cdef char TYPE_NUMBER = '\x00' - * cdef char TYPE_BOOL = '\x01' # <<<<<<<<<<<<<< - * cdef char TYPE_STRING = '\x02' - * cdef char TYPE_OBJECT = '\x03' - */ - __pyx_v_6cpyamf_4amf0_TYPE_BOOL = '\x01'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":25 - * cdef char TYPE_NUMBER = '\x00' - * cdef char TYPE_BOOL = '\x01' - * cdef char TYPE_STRING = '\x02' # <<<<<<<<<<<<<< - * cdef char TYPE_OBJECT = '\x03' - * cdef char TYPE_MOVIECLIP = '\x04' - */ - __pyx_v_6cpyamf_4amf0_TYPE_STRING = '\x02'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":26 - * cdef char TYPE_BOOL = '\x01' - * cdef char TYPE_STRING = '\x02' - * cdef char TYPE_OBJECT = '\x03' # <<<<<<<<<<<<<< - * cdef char TYPE_MOVIECLIP = '\x04' - * cdef char TYPE_NULL = '\x05' - */ - __pyx_v_6cpyamf_4amf0_TYPE_OBJECT = '\x03'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":27 - * cdef char TYPE_STRING = '\x02' - * cdef char TYPE_OBJECT = '\x03' - * cdef char TYPE_MOVIECLIP = '\x04' # <<<<<<<<<<<<<< - * cdef char TYPE_NULL = '\x05' - * cdef char TYPE_UNDEFINED = '\x06' - */ - __pyx_v_6cpyamf_4amf0_TYPE_MOVIECLIP = '\x04'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":28 - * cdef char TYPE_OBJECT = '\x03' - * cdef char TYPE_MOVIECLIP = '\x04' - * cdef char TYPE_NULL = '\x05' # <<<<<<<<<<<<<< - * cdef char TYPE_UNDEFINED = '\x06' - * cdef char TYPE_REFERENCE = '\x07' - */ - __pyx_v_6cpyamf_4amf0_TYPE_NULL = '\x05'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":29 - * cdef char TYPE_MOVIECLIP = '\x04' - * cdef char TYPE_NULL = '\x05' - * cdef char TYPE_UNDEFINED = '\x06' # <<<<<<<<<<<<<< - * cdef char TYPE_REFERENCE = '\x07' - * cdef char TYPE_MIXEDARRAY = '\x08' - */ - __pyx_v_6cpyamf_4amf0_TYPE_UNDEFINED = '\x06'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":30 - * cdef char TYPE_NULL = '\x05' - * cdef char TYPE_UNDEFINED = '\x06' - * cdef char TYPE_REFERENCE = '\x07' # <<<<<<<<<<<<<< - * cdef char TYPE_MIXEDARRAY = '\x08' - * cdef char TYPE_OBJECTTERM = '\x09' - */ - __pyx_v_6cpyamf_4amf0_TYPE_REFERENCE = '\x07'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":31 - * cdef char TYPE_UNDEFINED = '\x06' - * cdef char TYPE_REFERENCE = '\x07' - * cdef char TYPE_MIXEDARRAY = '\x08' # <<<<<<<<<<<<<< - * cdef char TYPE_OBJECTTERM = '\x09' - * cdef char TYPE_ARRAY = '\x0A' - */ - __pyx_v_6cpyamf_4amf0_TYPE_MIXEDARRAY = '\x08'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":32 - * cdef char TYPE_REFERENCE = '\x07' - * cdef char TYPE_MIXEDARRAY = '\x08' - * cdef char TYPE_OBJECTTERM = '\x09' # <<<<<<<<<<<<<< - * cdef char TYPE_ARRAY = '\x0A' - * cdef char TYPE_DATE = '\x0B' - */ - __pyx_v_6cpyamf_4amf0_TYPE_OBJECTTERM = '\t'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":33 - * cdef char TYPE_MIXEDARRAY = '\x08' - * cdef char TYPE_OBJECTTERM = '\x09' - * cdef char TYPE_ARRAY = '\x0A' # <<<<<<<<<<<<<< - * cdef char TYPE_DATE = '\x0B' - * cdef char TYPE_LONGSTRING = '\x0C' - */ - __pyx_v_6cpyamf_4amf0_TYPE_ARRAY = '\n'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":34 - * cdef char TYPE_OBJECTTERM = '\x09' - * cdef char TYPE_ARRAY = '\x0A' - * cdef char TYPE_DATE = '\x0B' # <<<<<<<<<<<<<< - * cdef char TYPE_LONGSTRING = '\x0C' - * cdef char TYPE_UNSUPPORTED = '\x0D' - */ - __pyx_v_6cpyamf_4amf0_TYPE_DATE = '\x0B'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":35 - * cdef char TYPE_ARRAY = '\x0A' - * cdef char TYPE_DATE = '\x0B' - * cdef char TYPE_LONGSTRING = '\x0C' # <<<<<<<<<<<<<< - * cdef char TYPE_UNSUPPORTED = '\x0D' - * cdef char TYPE_RECORDSET = '\x0E' - */ - __pyx_v_6cpyamf_4amf0_TYPE_LONGSTRING = '\x0C'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":36 - * cdef char TYPE_DATE = '\x0B' - * cdef char TYPE_LONGSTRING = '\x0C' - * cdef char TYPE_UNSUPPORTED = '\x0D' # <<<<<<<<<<<<<< - * cdef char TYPE_RECORDSET = '\x0E' - * cdef char TYPE_XML = '\x0F' - */ - __pyx_v_6cpyamf_4amf0_TYPE_UNSUPPORTED = '\r'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":37 - * cdef char TYPE_LONGSTRING = '\x0C' - * cdef char TYPE_UNSUPPORTED = '\x0D' - * cdef char TYPE_RECORDSET = '\x0E' # <<<<<<<<<<<<<< - * cdef char TYPE_XML = '\x0F' - * cdef char TYPE_TYPEDOBJECT = '\x10' - */ - __pyx_v_6cpyamf_4amf0_TYPE_RECORDSET = '\x0E'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":38 - * cdef char TYPE_UNSUPPORTED = '\x0D' - * cdef char TYPE_RECORDSET = '\x0E' - * cdef char TYPE_XML = '\x0F' # <<<<<<<<<<<<<< - * cdef char TYPE_TYPEDOBJECT = '\x10' - * cdef char TYPE_AMF3 = '\x11' - */ - __pyx_v_6cpyamf_4amf0_TYPE_XML = '\x0F'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":39 - * cdef char TYPE_RECORDSET = '\x0E' - * cdef char TYPE_XML = '\x0F' - * cdef char TYPE_TYPEDOBJECT = '\x10' # <<<<<<<<<<<<<< - * cdef char TYPE_AMF3 = '\x11' - * - */ - __pyx_v_6cpyamf_4amf0_TYPE_TYPEDOBJECT = '\x10'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":40 - * cdef char TYPE_XML = '\x0F' - * cdef char TYPE_TYPEDOBJECT = '\x10' - * cdef char TYPE_AMF3 = '\x11' # <<<<<<<<<<<<<< - * - * - */ - __pyx_v_6cpyamf_4amf0_TYPE_AMF3 = '\x11'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":43 - * - * - * cdef object ASObject = pyamf.ASObject # <<<<<<<<<<<<<< - * cdef object UnknownClassAlias = pyamf.UnknownClassAlias - * - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ASObject); 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); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_v_6cpyamf_4amf0_ASObject); - __Pyx_DECREF(__pyx_v_6cpyamf_4amf0_ASObject); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_v_6cpyamf_4amf0_ASObject = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":44 - * - * cdef object ASObject = pyamf.ASObject - * cdef object UnknownClassAlias = pyamf.UnknownClassAlias # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); 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_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__UnknownClassAlias); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_v_6cpyamf_4amf0_UnknownClassAlias); - __Pyx_DECREF(__pyx_v_6cpyamf_4amf0_UnknownClassAlias); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_v_6cpyamf_4amf0_UnknownClassAlias = __pyx_t_2; - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf0.pyx":1 - * # Copyright (c) The PyAMF Project. # <<<<<<<<<<<<<< - * # See LICENSE.txt for details. - * - */ - __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(((PyObject *)__pyx_t_2)); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/Library/Python/2.6/site-packages/Cython/Includes/cpython/type.pxd":2 - * - * cdef extern from "Python.h": # <<<<<<<<<<<<<< - * # The C structure of the objects used to describe built-in types. - * - */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - if (__pyx_m) { - __Pyx_AddTraceback("init cpyamf.amf0"); - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init cpyamf.amf0"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -/* Runtime support code */ - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} - -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 *number, *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"; - } - number = (num_expected == 1) ? "" : "s"; - PyErr_Format(PyExc_TypeError, - #if PY_VERSION_HEX < 0x02050000 - "%s() takes %s %d positional argument%s (%d given)", - #else - "%s() takes %s %zd positional argument%s (%zd given)", - #endif - func_name, more_or_less, num_expected, number, 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; - while (PyDict_Next(kwdict, &pos, &key, 0)) { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) - #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) - #endif - goto invalid_keyword_type; - } - if ((!kw_allowed) && unlikely(key)) - goto invalid_keyword; - return 1; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - return 0; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif - return 0; -} - -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (unlikely(!type)) { - PyErr_Format(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 int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { - PyObject *local_type, *local_value, *local_tb; - 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; - PyErr_NormalizeException(&local_type, &local_value, &local_tb); - if (unlikely(tstate->curexc_type)) - goto bad; - #if PY_MAJOR_VERSION >= 3 - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) - goto bad; - #endif - *type = local_type; - *value = local_value; - *tb = local_tb; - Py_INCREF(local_type); - Py_INCREF(local_value); - Py_INCREF(local_tb); - 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; - /* Make sure tstate is in a consistent state when we XDECREF - these objects (XDECREF may run arbitrary code). */ - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); - 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_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_AS_STRING(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; - } else { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { - #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { - #endif - goto invalid_keyword_type; - } else { - for (name = first_kw_arg; *name; name++) { - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) break; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) break; - #endif - } - if (*name) { - values[name-argnames] = value; - } else { - /* unexpected keyword found */ - for (name=argnames; name != first_kw_arg; name++) { - if (**name == key) goto arg_passed_twice; - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) goto arg_passed_twice; - #endif - } - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - } - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, **name); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - - -static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { - 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); -} - -static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { - 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); -} - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *py_import = 0; - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - py_import = __Pyx_GetAttrString(__pyx_b, "__import__"); - if (!py_import) - goto bad; - 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; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, NULL); -bad: - Py_XDECREF(empty_list); - Py_XDECREF(py_import); - Py_XDECREF(empty_dict); - return module; -} - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - 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); -} - -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - 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; -} - - -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - Py_XINCREF(type); - Py_XINCREF(value); - Py_XINCREF(tb); - /* First, check the traceback argument, replacing None with NULL. */ - if (tb == Py_None) { - Py_DECREF(tb); - tb = 0; - } - else if (tb != NULL && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - /* Next, replace a missing value with None */ - if (value == NULL) { - value = Py_None; - Py_INCREF(value); - } - #if PY_VERSION_HEX < 0x02050000 - if (!PyClass_Check(type)) - #else - if (!PyType_Check(type)) - #endif - { - /* Raising an instance. The value should be a dummy. */ - if (value != Py_None) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - /* Normalize to raise , */ - Py_DECREF(value); - value = type; - #if PY_VERSION_HEX < 0x02050000 - if (PyInstance_Check(type)) { - type = (PyObject*) ((PyInstanceObject*)type)->in_class; - Py_INCREF(type); - } - else { - type = 0; - PyErr_SetString(PyExc_TypeError, - "raise: exception must be an old-style class or instance"); - goto raise_error; - } - #else - 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; - } - #endif - } - - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} - -#else /* Python 3+ */ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - 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)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } - - PyErr_SetObject(type, value); - - if (tb) { - 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); - } - } - -bad: - return; -} -#endif - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { - const unsigned char neg_one = (unsigned char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned char" : - "value too large to convert to unsigned char"); - } - return (unsigned char)-1; - } - return (unsigned char)val; - } - return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { - const unsigned short neg_one = (unsigned short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned short" : - "value too large to convert to unsigned short"); - } - return (unsigned short)-1; - } - return (unsigned short)val; - } - return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { - const unsigned int neg_one = (unsigned int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned int" : - "value too large to convert to unsigned int"); - } - return (unsigned int)-1; - } - return (unsigned int)val; - } - return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { - const char neg_one = (char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to char" : - "value too large to convert to char"); - } - return (char)-1; - } - return (char)val; - } - return (char)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { - const short neg_one = (short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to short" : - "value too large to convert to short"); - } - return (short)-1; - } - return (short)val; - } - return (short)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { - const signed char neg_one = (signed char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed char" : - "value too large to convert to signed char"); - } - return (signed char)-1; - } - return (signed char)val; - } - return (signed char)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { - const signed short neg_one = (signed short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed short" : - "value too large to convert to signed short"); - } - return (signed short)-1; - } - return (signed short)val; - } - return (signed short)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { - const signed int neg_one = (signed int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed int" : - "value too large to convert to signed int"); - } - return (signed int)-1; - } - return (signed int)val; - } - return (signed int)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { - const unsigned long neg_one = (unsigned long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - unsigned long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned long)-1; - val = __Pyx_PyInt_AsUnsignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { - const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - unsigned PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { - const long neg_one = (long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long)-1; - val = __Pyx_PyInt_AsLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { - const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { - const signed long neg_one = (signed long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - signed long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed long)-1; - val = __Pyx_PyInt_AsSignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { - const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - signed PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsSignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - long size, int strict) -{ - PyObject *py_module = 0; - PyObject *result = 0; - PyObject *py_name = 0; - char warning[200]; - - py_module = __Pyx_ImportModule(module_name); - if (!py_module) - goto bad; - #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(class_name); - #else - py_name = PyUnicode_FromString(class_name); - #endif - 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, - "%s.%s is not a type object", - module_name, class_name); - goto bad; - } - if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), - "%s.%s size changed, may indicate binary incompatibility", - module_name, class_name); - #if PY_VERSION_HEX < 0x02050000 - PyErr_Warn(NULL, warning); - #else - PyErr_WarnEx(NULL, warning, 0); - #endif - } - else if (((PyTypeObject *)result)->tp_basicsize != size) { - PyErr_Format(PyExc_ValueError, - "%s.%s has the wrong size, try recompiling", - module_name, class_name); - goto bad; - } - return (PyTypeObject *)result; -bad: - Py_XDECREF(py_module); - Py_XDECREF(result); - return 0; -} -#endif - -#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; - - #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(name); - #else - py_name = PyUnicode_FromString(name); - #endif - 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 - -static int __Pyx_GetVtable(PyObject *dict, void *vtabptr) { - PyObject *ob = PyMapping_GetItemString(dict, (char *)"__pyx_vtable__"); - if (!ob) - goto bad; -#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) - *(void **)vtabptr = PyCapsule_GetPointer(ob, 0); -#else - *(void **)vtabptr = PyCObject_AsVoidPtr(ob); -#endif - if (!*(void **)vtabptr) - goto bad; - Py_DECREF(ob); - return 0; -bad: - Py_XDECREF(ob); - return -1; -} - -static int __Pyx_SetVtable(PyObject *dict, void *vtable) { -#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) - PyObject *ob = PyCapsule_New(vtable, 0, 0); -#else - PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); -#endif - if (!ob) - goto bad; - if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0) - goto bad; - Py_DECREF(ob); - return 0; -bad: - Py_XDECREF(ob); - return -1; -} - -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" - -static void __Pyx_AddTraceback(const char *funcname) { - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - PyObject *py_globals = 0; - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(__pyx_filename); - #else - py_srcfile = PyUnicode_FromString(__pyx_filename); - #endif - if (!py_srcfile) goto bad; - if (__pyx_clineno) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #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_globals = PyModule_GetDict(__pyx_m); - if (!py_globals) goto bad; - py_code = PyCode_New( - 0, /*int argcount,*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*int kwonlyargcount,*/ - #endif - 0, /*int nlocals,*/ - 0, /*int stacksize,*/ - 0, /*int flags,*/ - __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,*/ - __pyx_lineno, /*int firstlineno,*/ - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - if (!py_code) goto bad; - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - py_globals, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = __pyx_lineno; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -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 /* Python 3+ has unicode identifiers */ - 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; -} - -/* Type Conversion Functions */ - -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_VERSION_HEX < 0x03000000 - 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_VERSION_HEX < 0x03000000 - 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_VERSION_HEX < 0x03000000 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%s__ returned non-%s (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 = 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) { -#if PY_VERSION_HEX < 0x02050000 - if (ival <= LONG_MAX) - return PyInt_FromLong((long)ival); - else { - unsigned char *bytes = (unsigned char *) &ival; - int one = 1; int little = (int)*(unsigned char*)&one; - return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); - } -#else - return PyInt_FromSize_t(ival); -#endif -} - -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { - unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); - if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { - return (size_t)-1; - } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t)-1; - } - return (size_t)val; -} - - -#endif /* Py_PYTHON_H */ diff --git a/cpyamf/amf3.c b/cpyamf/amf3.c deleted file mode 100644 index ecef4611..00000000 --- a/cpyamf/amf3.c +++ /dev/null @@ -1,14665 +0,0 @@ -/* Generated by Cython 0.13 on Thu Nov 25 19:27:11 2010 */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#else - -#include /* For offsetof */ -#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 - -#if PY_VERSION_HEX < 0x02040000 - #define METH_COEXIST 0 - #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) - #define PyDict_Contains(d,o) PySequence_Contains(d,o) -#endif - -#if PY_VERSION_HEX < 0x02050000 - typedef int Py_ssize_t; - #define PY_SSIZE_T_MAX INT_MAX - #define PY_SSIZE_T_MIN INT_MIN - #define PY_FORMAT_SIZE_T "" - #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) PyInt_AsLong(o) - #define PyNumber_Index(o) PyNumber_Int(o) - #define PyIndex_Check(o) PyNumber_Check(o) - #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - -#endif - -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" -#endif - -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif - -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#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_VERSION_HEX < 0x02060000 - #define PyBytesObject PyStringObject - #define PyBytes_Type PyString_Type - #define PyBytes_Check PyString_Check - #define PyBytes_CheckExact PyString_CheckExact - #define PyBytes_FromString PyString_FromString - #define PyBytes_FromStringAndSize PyString_FromStringAndSize - #define PyBytes_FromFormat PyString_FromFormat - #define PyBytes_DecodeEscape PyString_DecodeEscape - #define PyBytes_AsString PyString_AsString - #define PyBytes_AsStringAndSize PyString_AsStringAndSize - #define PyBytes_Size PyString_Size - #define PyBytes_AS_STRING PyString_AS_STRING - #define PyBytes_GET_SIZE PyString_GET_SIZE - #define PyBytes_Repr PyString_Repr - #define PyBytes_Concat PyString_Concat - #define PyBytes_ConcatAndDel PyString_ConcatAndDel - #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) - #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) -#endif - -#ifndef PySet_CheckExact -# define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif - -#if PY_MAJOR_VERSION >= 3 - #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 -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#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 - -#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) - #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) - #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) -#else - #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) - #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) -#else - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_NAMESTR(n) ((char *)(n)) - #define __Pyx_DOCSTR(n) ((char *)(n)) -#else - #define __Pyx_NAMESTR(n) (n) - #define __Pyx_DOCSTR(n) (n) -#endif - -#ifdef __cplusplus -#define __PYX_EXTERN_C extern "C" -#else -#define __PYX_EXTERN_C extern -#endif - -#if defined(WIN32) || defined(MS_WINDOWS) -#define _USE_MATH_DEFINES -#endif -#include -#define __PYX_HAVE_API__cpyamf__amf3 -#include "stdio.h" -#include "pythread.h" -#include "stdlib.h" - -/* inline attribute */ -#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 - -/* unused attribute */ -#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) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif - -typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ - - -/* Type Conversion Predeclarations */ - -#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) - -#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); -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); - -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) - - -#ifdef __GNUC__ -/* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else /* __GNUC__ > 2 ... */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -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[] = { - "amf3.pyx", - "amf3.pxd", - "util.pxd", - "codec.pxd", - "bool.pxd", -}; - -/* Type declarations */ - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pxd":28 - * cpdef bint at_eof(self) except -1 - * cpdef inline Py_ssize_t remaining(self) except -1 - * cpdef int seek(self, Py_ssize_t pos, int mode=*) except -1 # <<<<<<<<<<<<<< - * cpdef object getvalue(self) - * cdef Py_ssize_t peek(self, char **buf, Py_ssize_t size) except -1 - */ - -struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_seek { - int __pyx_n; - int mode; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pxd":31 - * cpdef object getvalue(self) - * cdef Py_ssize_t peek(self, char **buf, Py_ssize_t size) except -1 - * cpdef int truncate(self, Py_ssize_t size=?) except -1 # <<<<<<<<<<<<<< - * cpdef int consume(self) except -1 - * cdef int unpack_int(self, unsigned int num_bytes, void *ret) except -1 - */ - -struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_truncate { - int __pyx_n; - Py_ssize_t size; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":102 - * cdef int writeDate(self, object o) except -1 - * cdef int writeXML(self, object o) except -1 - * cpdef int writeList(self, object o, bint is_proxy=?) except -1 # <<<<<<<<<<<<<< - * cdef int writeTuple(self, object o) except -1 - * cdef int writeSequence(self, object iterable) except -1 - */ - -struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeList { - int __pyx_n; - int is_proxy; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":105 - * cdef int writeTuple(self, object o) except -1 - * cdef int writeSequence(self, object iterable) except -1 - * cpdef int writeObject(self, object o, bint is_proxy=?) except -1 # <<<<<<<<<<<<<< - * cdef int writeDict(self, dict o) except -1 - * cdef int writeMixedArray(self, object o) except -1 - */ - -struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeObject { - int __pyx_n; - int is_proxy; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pxd":51 - * - * cdef object readBytes(self) - * cdef object readInteger(self, int signed=?) # <<<<<<<<<<<<<< - * cdef object readByteArray(self) - * cdef object readProxy(self, obj) - */ - -struct __pyx_opt_args_6cpyamf_4amf3_7Decoder_readInteger { - int __pyx_n; - int __pyx_signed; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":700 - * return 0 - * - * cpdef int writeList(self, object n, bint is_proxy=0) except -1: # <<<<<<<<<<<<<< - * cdef Py_ssize_t ref = self.context.getObjectReference(n) - * cdef Py_ssize_t i - */ - -struct __pyx_opt_args_6cpyamf_4amf3_7Encoder_writeList { - int __pyx_n; - int is_proxy; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":852 - * self.writeElement(n[k]) - * - * cpdef int writeObject(self, object obj, bint is_proxy=0) except -1: # <<<<<<<<<<<<<< - * cdef Py_ssize_t ref - * cdef object kls - */ - -struct __pyx_opt_args_6cpyamf_4amf3_7Encoder_writeObject { - int __pyx_n; - int is_proxy; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1095 - * - * - * cdef int decode_int(cBufferedByteStream stream, int sign=0) except? -1: # <<<<<<<<<<<<<< - * cdef int n = 0 - * cdef int result = 0 - */ - -struct __pyx_opt_args_6cpyamf_4amf3_decode_int { - int __pyx_n; - int sign; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":54 - * - * - * cdef class Codec(object): # <<<<<<<<<<<<<< - * """ - * Base class for Encoder/Decoder classes. Provides base functionality for - */ - -struct __pyx_obj_6cpyamf_5codec_Codec { - PyObject_HEAD - struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *stream; - int strict; - PyObject *timezone_offset; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":65 - * - * - * cdef class Decoder(Codec): # <<<<<<<<<<<<<< - * cdef object readDate(self) - * cpdef object readString(self) - */ - -struct __pyx_obj_6cpyamf_5codec_Decoder { - struct __pyx_obj_6cpyamf_5codec_Codec __pyx_base; - struct __pyx_vtabstruct_6cpyamf_5codec_Decoder *__pyx_vtab; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pxd":5 - * - * - * cdef class cBufferedByteStream: # <<<<<<<<<<<<<< - * """ - * The c version of BufferedByteStream. - */ - -struct __pyx_obj_6cpyamf_4util_cBufferedByteStream { - PyObject_HEAD - struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *__pyx_vtab; - char endian; - char *buffer; - int closed; - Py_ssize_t pos; - Py_ssize_t size; - Py_ssize_t length; - Py_ssize_t min_buf_size; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pxd":61 - * - * - * cdef class BufferedByteStream(cBufferedByteStream): # <<<<<<<<<<<<<< - * """ - * A file like object that mimics StringIO with some extra helper methods. - */ - -struct __pyx_obj_6cpyamf_4util_BufferedByteStream { - struct __pyx_obj_6cpyamf_4util_cBufferedByteStream __pyx_base; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pxd":42 - * - * - * cdef class Decoder(codec.Decoder): # <<<<<<<<<<<<<< - * cdef public bint use_proxies - * cdef readonly Context context - */ - -struct __pyx_obj_6cpyamf_4amf3_Decoder { - struct __pyx_obj_6cpyamf_5codec_Decoder __pyx_base; - int use_proxies; - struct __pyx_obj_6cpyamf_4amf3_Context *context; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":11 - * from cpyamf cimport util - * - * cdef class IndexedCollection(object): # <<<<<<<<<<<<<< - * """ - * Provides reference functionality for amf contexts. - */ - -struct __pyx_obj_6cpyamf_5codec_IndexedCollection { - PyObject_HEAD - struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *__pyx_vtab; - int use_hash; - PyObject **data; - PyObject *refs; - Py_ssize_t size; - Py_ssize_t length; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":81 - * - * - * cdef class Encoder(Codec): # <<<<<<<<<<<<<< - * """ - * """ - */ - -struct __pyx_obj_6cpyamf_5codec_Encoder { - struct __pyx_obj_6cpyamf_5codec_Codec __pyx_base; - struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *__pyx_vtab; - PyObject *func_cache; - PyObject *use_write_object; - PyObject *bucket; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pxd":56 - * - * - * cdef class Encoder(codec.Encoder): # <<<<<<<<<<<<<< - * cdef public bint use_proxies - * cdef readonly Context context - */ - -struct __pyx_obj_6cpyamf_4amf3_Encoder { - struct __pyx_obj_6cpyamf_5codec_Encoder __pyx_base; - int use_proxies; - struct __pyx_obj_6cpyamf_4amf3_Context *context; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":32 - * - * - * cdef class Context(object): # <<<<<<<<<<<<<< - * """ - * C based version of ``pyamf.BaseContext`` - */ - -struct __pyx_obj_6cpyamf_5codec_Context { - PyObject_HEAD - struct __pyx_vtabstruct_6cpyamf_5codec_Context *__pyx_vtab; - PyObject *class_aliases; - struct __pyx_obj_6cpyamf_5codec_IndexedCollection *objects; - PyObject *unicodes; - PyObject *_strings; - PyObject *extra; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pxd":22 - * - * - * cdef class Context(codec.Context): # <<<<<<<<<<<<<< - * cdef codec.IndexedCollection strings - * cdef dict classes - */ - -struct __pyx_obj_6cpyamf_4amf3_Context { - struct __pyx_obj_6cpyamf_5codec_Context __pyx_base; - struct __pyx_obj_6cpyamf_5codec_IndexedCollection *strings; - PyObject *classes; - PyObject *class_ref; - PyObject *proxied_objects; - Py_ssize_t class_idx; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pxd":4 - * - * - * cdef class ClassDefinition(object): # <<<<<<<<<<<<<< - * """ - * Holds transient class trait info for an individual encode/decode. - */ - -struct __pyx_obj_6cpyamf_4amf3_ClassDefinition { - PyObject_HEAD - struct __pyx_vtabstruct_6cpyamf_4amf3_ClassDefinition *__pyx_vtab; - PyObject *alias; - Py_ssize_t ref; - Py_ssize_t attr_len; - int encoding; - char *encoded_ref; - Py_ssize_t encoded_ref_size; - PyObject *static_properties; -}; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":64 - * - * - * cdef class ClassDefinition(object): # <<<<<<<<<<<<<< - * """ - * Holds transient class trait info for an individual encode/decode. - */ - -struct __pyx_vtabstruct_6cpyamf_4amf3_ClassDefinition { - int (*writeReference)(struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *, struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *); -}; -static struct __pyx_vtabstruct_6cpyamf_4amf3_ClassDefinition *__pyx_vtabptr_6cpyamf_4amf3_ClassDefinition; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":32 - * - * - * cdef class Context(object): # <<<<<<<<<<<<<< - * """ - * C based version of ``pyamf.BaseContext`` - */ - -struct __pyx_vtabstruct_6cpyamf_5codec_Context { - int (*clear)(struct __pyx_obj_6cpyamf_5codec_Context *, int __pyx_skip_dispatch); - PyObject *(*getClassAlias)(struct __pyx_obj_6cpyamf_5codec_Context *, PyObject *, int __pyx_skip_dispatch); - PyObject *(*getObject)(struct __pyx_obj_6cpyamf_5codec_Context *, Py_ssize_t, int __pyx_skip_dispatch); - Py_ssize_t (*getObjectReference)(struct __pyx_obj_6cpyamf_5codec_Context *, PyObject *, int __pyx_skip_dispatch); - Py_ssize_t (*addObject)(struct __pyx_obj_6cpyamf_5codec_Context *, PyObject *, int __pyx_skip_dispatch); - PyObject *(*getStringForBytes)(struct __pyx_obj_6cpyamf_5codec_Context *, PyObject *, int __pyx_skip_dispatch); - PyObject *(*getBytesForString)(struct __pyx_obj_6cpyamf_5codec_Context *, PyObject *, int __pyx_skip_dispatch); -}; -static struct __pyx_vtabstruct_6cpyamf_5codec_Context *__pyx_vtabptr_6cpyamf_5codec_Context; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":65 - * - * - * cdef class Decoder(Codec): # <<<<<<<<<<<<<< - * cdef object readDate(self) - * cpdef object readString(self) - */ - -struct __pyx_vtabstruct_6cpyamf_5codec_Decoder { - PyObject *(*readDate)(struct __pyx_obj_6cpyamf_5codec_Decoder *); - PyObject *(*readString)(struct __pyx_obj_6cpyamf_5codec_Decoder *, int __pyx_skip_dispatch); - PyObject *(*readObject)(struct __pyx_obj_6cpyamf_5codec_Decoder *); - PyObject *(*readNumber)(struct __pyx_obj_6cpyamf_5codec_Decoder *); - PyObject *(*readNull)(struct __pyx_obj_6cpyamf_5codec_Decoder *); - PyObject *(*readUndefined)(struct __pyx_obj_6cpyamf_5codec_Decoder *); - PyObject *(*readList)(struct __pyx_obj_6cpyamf_5codec_Decoder *); - PyObject *(*readXML)(struct __pyx_obj_6cpyamf_5codec_Decoder *); - PyObject *(*readElement)(struct __pyx_obj_6cpyamf_5codec_Decoder *, int __pyx_skip_dispatch); - PyObject *(*readConcreteElement)(struct __pyx_obj_6cpyamf_5codec_Decoder *, char); - int (*send)(struct __pyx_obj_6cpyamf_5codec_Decoder *, PyObject *, int __pyx_skip_dispatch); -}; -static struct __pyx_vtabstruct_6cpyamf_5codec_Decoder *__pyx_vtabptr_6cpyamf_5codec_Decoder; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":138 - * - * - * cdef class Context(codec.Context): # <<<<<<<<<<<<<< - * """ - * I hold the AMF3 context for en/decoding streams. - */ - -struct __pyx_vtabstruct_6cpyamf_4amf3_Context { - struct __pyx_vtabstruct_6cpyamf_5codec_Context __pyx_base; - PyObject *(*getString)(struct __pyx_obj_6cpyamf_4amf3_Context *, Py_ssize_t, int __pyx_skip_dispatch); - Py_ssize_t (*getStringReference)(struct __pyx_obj_6cpyamf_4amf3_Context *, PyObject *, int __pyx_skip_dispatch); - Py_ssize_t (*addString)(struct __pyx_obj_6cpyamf_4amf3_Context *, PyObject *, int __pyx_skip_dispatch); - int (*addProxyObject)(struct __pyx_obj_6cpyamf_4amf3_Context *, PyObject *, PyObject *, int __pyx_skip_dispatch); - PyObject *(*getProxyForObject)(struct __pyx_obj_6cpyamf_4amf3_Context *, PyObject *, int __pyx_skip_dispatch); - PyObject *(*getObjectForProxy)(struct __pyx_obj_6cpyamf_4amf3_Context *, PyObject *, int __pyx_skip_dispatch); - PyObject *(*getClassByReference)(struct __pyx_obj_6cpyamf_4amf3_Context *, Py_ssize_t, int __pyx_skip_dispatch); - struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *(*getClass)(struct __pyx_obj_6cpyamf_4amf3_Context *, PyObject *, int __pyx_skip_dispatch); - Py_ssize_t (*addClass)(struct __pyx_obj_6cpyamf_4amf3_Context *, struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *, PyObject *, int __pyx_skip_dispatch); -}; -static struct __pyx_vtabstruct_6cpyamf_4amf3_Context *__pyx_vtabptr_6cpyamf_4amf3_Context; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":81 - * - * - * cdef class Encoder(Codec): # <<<<<<<<<<<<<< - * """ - * """ - */ - -struct __pyx_vtabstruct_6cpyamf_5codec_Encoder { - int (*serialiseString)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch); - int (*writeType)(struct __pyx_obj_6cpyamf_5codec_Encoder *, char); - int (*writeNull)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeUndefined)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeString)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeBytes)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeBoolean)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeInt)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeLong)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeNumber)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeDateTime)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeDate)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeXML)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeList)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeList *__pyx_optional_args); - int (*writeTuple)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeSequence)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeObject)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeObject *__pyx_optional_args); - int (*writeDict)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeMixedArray)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeGenerator)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*handleBasicTypes)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, PyObject *); - int (*checkBadTypes)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, PyObject *); - int (*writeElement)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch); - int (*send)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch); -}; -static struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *__pyx_vtabptr_6cpyamf_5codec_Encoder; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":595 - * - * - * cdef class Encoder(codec.Encoder): # <<<<<<<<<<<<<< - * """ - * The AMF3 Encoder. - */ - -struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder { - struct __pyx_vtabstruct_6cpyamf_5codec_Encoder __pyx_base; - int (*writeByteArray)(struct __pyx_obj_6cpyamf_4amf3_Encoder *, PyObject *); - int (*writeProxy)(struct __pyx_obj_6cpyamf_4amf3_Encoder *, PyObject *); -}; -static struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *__pyx_vtabptr_6cpyamf_4amf3_Encoder; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pxd":5 - * - * - * cdef class cBufferedByteStream: # <<<<<<<<<<<<<< - * """ - * The c version of BufferedByteStream. - */ - -struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream { - Py_ssize_t (*tell)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - int (*write)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, char *, Py_ssize_t); - int (*_init_buffer)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *); - int (*_actually_increase_buffer)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t); - int (*_increase_buffer)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t); - int (*has_available)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t); - int (*read)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, char **, Py_ssize_t); - int (*at_eof)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - Py_ssize_t (*remaining)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - int (*seek)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_seek *__pyx_optional_args); - PyObject *(*getvalue)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - Py_ssize_t (*peek)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, char **, Py_ssize_t); - int (*truncate)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_truncate *__pyx_optional_args); - int (*consume)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - int (*unpack_int)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned int, void *); - int (*pack_int)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int, long); - int (*pack_uint)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int, unsigned long); - unsigned char (*read_uchar)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - char (*read_char)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - unsigned short (*read_ushort)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - short (*read_short)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - unsigned long (*read_24bit_uint)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - long (*read_24bit_int)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - unsigned long (*read_ulong)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - long (*read_long)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - int (*write_uchar)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned char, int __pyx_skip_dispatch); - int (*write_char)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, char, int __pyx_skip_dispatch); - int (*write_ushort)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned short, int __pyx_skip_dispatch); - int (*write_short)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, short, int __pyx_skip_dispatch); - int (*write_24bit_uint)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned long, int __pyx_skip_dispatch); - int (*write_24bit_int)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, long, int __pyx_skip_dispatch); - int (*write_ulong)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned long, int __pyx_skip_dispatch); - int (*write_long)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, long, int __pyx_skip_dispatch); - PyObject *(*read_utf8_string)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t, int __pyx_skip_dispatch); - int (*write_utf8_string)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, PyObject *, int __pyx_skip_dispatch); - int (*read_double)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, double *); - int (*write_double)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, double, int __pyx_skip_dispatch); - int (*read_float)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, float *); - int (*write_float)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, float, int __pyx_skip_dispatch); - int (*append)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, PyObject *, int __pyx_skip_dispatch); -}; -static struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *__pyx_vtabptr_6cpyamf_4util_cBufferedByteStream; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":250 - * - * - * cdef class Decoder(codec.Decoder): # <<<<<<<<<<<<<< - * """ - * Decodes an AMF3 data stream. - */ - -struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder { - struct __pyx_vtabstruct_6cpyamf_5codec_Decoder __pyx_base; - struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *(*_getClassDefinition)(struct __pyx_obj_6cpyamf_4amf3_Decoder *, long); - int (*_readStatic)(struct __pyx_obj_6cpyamf_4amf3_Decoder *, struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *, PyObject *); - int (*_readDynamic)(struct __pyx_obj_6cpyamf_4amf3_Decoder *, struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *, PyObject *); - PyObject *(*readBytes)(struct __pyx_obj_6cpyamf_4amf3_Decoder *); - PyObject *(*readInteger)(struct __pyx_obj_6cpyamf_4amf3_Decoder *, struct __pyx_opt_args_6cpyamf_4amf3_7Decoder_readInteger *__pyx_optional_args); - PyObject *(*readByteArray)(struct __pyx_obj_6cpyamf_4amf3_Decoder *); - PyObject *(*readProxy)(struct __pyx_obj_6cpyamf_4amf3_Decoder *, PyObject *); -}; -static struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *__pyx_vtabptr_6cpyamf_4amf3_Decoder; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":11 - * from cpyamf cimport util - * - * cdef class IndexedCollection(object): # <<<<<<<<<<<<<< - * """ - * Provides reference functionality for amf contexts. - */ - -struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection { - int (*_actually_increase_size)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *); - int (*_increase_size)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *); - void (*_clear)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *); - int (*clear)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *, int __pyx_skip_dispatch); - PyObject *(*_ref)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *, PyObject *); - PyObject *(*getByReference)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *, Py_ssize_t, int __pyx_skip_dispatch); - Py_ssize_t (*getReferenceTo)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *, PyObject *, int __pyx_skip_dispatch); - Py_ssize_t (*append)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *, PyObject *, int __pyx_skip_dispatch); -}; -static struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *__pyx_vtabptr_6cpyamf_5codec_IndexedCollection; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pxd":61 - * - * - * cdef class BufferedByteStream(cBufferedByteStream): # <<<<<<<<<<<<<< - * """ - * A file like object that mimics StringIO with some extra helper methods. - */ - -struct __pyx_vtabstruct_6cpyamf_4util_BufferedByteStream { - struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream __pyx_base; -}; -static struct __pyx_vtabstruct_6cpyamf_4util_BufferedByteStream *__pyx_vtabptr_6cpyamf_4util_BufferedByteStream; - -#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) { - 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; - } - #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) - #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_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0) -#else - #define __Pyx_RefNannySetupContext(name) - #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_XDECREF(r) Py_XDECREF(r) -#endif /* CYTHON_REFNANNY */ -#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) -#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - -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); /*proto*/ - -static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, - const char* function_name, int kw_allowed); /*proto*/ - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, PyObject* kw_name); /*proto*/ - -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { - PyObject* value; -#if PY_MAJOR_VERSION >= 3 - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (unlikely(PyErr_Occurred())) - return NULL; - value = default_value; - } - Py_INCREF(value); -#else - if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { - /* these presumably have safe hash functions */ - value = PyDict_GetItem(d, key); - if (unlikely(!value)) { - value = default_value; - } - Py_INCREF(value); - } else { - PyObject *m; - m = __Pyx_GetAttrString(d, "get"); - if (!m) return NULL; - value = PyObject_CallFunctionObjArgs(m, key, - (default_value == Py_None) ? NULL : default_value, NULL); - Py_DECREF(m); - } -#endif - return value; -} - -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ - -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); /*proto*/ - -#define __Pyx_SetItemInt(o, i, v, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_SetItemInt_Fast(o, i, v) : \ - __Pyx_SetItemInt_Generic(o, to_py_func(i), v)) - -static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { - int r; - if (!j) return -1; - r = PyObject_SetItem(o, j, v); - Py_DECREF(j); - return r; -} - -static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v) { - if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { - Py_INCREF(v); - Py_DECREF(PyList_GET_ITEM(o, i)); - PyList_SET_ITEM(o, i, v); - return 1; - } - else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && (likely(i >= 0))) - return PySequence_SetItem(o, i, v); - else { - PyObject *j = PyInt_FromSsize_t(i); - return __Pyx_SetItemInt_Generic(o, j, v); - } -} - - -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; -} - - -#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_List_Fast(o, i) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) { - if (likely(o != Py_None)) { - if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) { - PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i); - Py_INCREF(r); - return r; - } - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - -#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Tuple_Fast(o, i) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) { - if (likely(o != Py_None)) { - if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) { - PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i); - Py_INCREF(r); - return r; - } - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - - -#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Fast(o, i) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) { - PyObject *r; - if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { - r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - } - else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - } - else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) { - r = PySequence_GetItem(o, i); - } - else { - r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); - } - return r; -} - -static double __Pyx__PyObject_AsDouble(PyObject* obj); /* proto */ - -#define __Pyx_PyObject_AsDouble(obj) \ - ((likely(PyFloat_CheckExact(obj))) ? \ - PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj)) - -static CYTHON_INLINE long __Pyx_NegateNonNeg(long b) { return unlikely(b < 0) ? b : !b; } -static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) { - return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b); -} - -static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ -static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); - -static void __Pyx_WriteUnraisable(const char *name); /*proto*/ - -static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ - -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict); /*proto*/ - -static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ - -static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/ - -static void __Pyx_AddTraceback(const char *funcname); /*proto*/ - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -/* Module declarations from cpyamf */ - -/* Module declarations from cpyamf.util */ - -static PyTypeObject *__pyx_ptype_6cpyamf_4util_cBufferedByteStream = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_4util_BufferedByteStream = 0; -/* Module declarations from cpyamf.codec */ - -static PyTypeObject *__pyx_ptype_6cpyamf_5codec_IndexedCollection = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_5codec_Context = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_5codec_Codec = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_5codec_Decoder = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_5codec_Encoder = 0; -/* 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 cpython.type */ - -/* 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 cpython.complex */ - -/* 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.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 libc.stdlib */ - -/* Module declarations from cython */ - -/* Module declarations from cpyamf.amf3 */ - -static PyTypeObject *__pyx_ptype_6cpyamf_4amf3_ClassDefinition = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_4amf3_Context = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_4amf3_Decoder = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_4amf3_Encoder = 0; -static char __pyx_v_6cpyamf_4amf3_TYPE_UNDEFINED; -static char __pyx_v_6cpyamf_4amf3_TYPE_NULL; -static char __pyx_v_6cpyamf_4amf3_TYPE_BOOL_FALSE; -static char __pyx_v_6cpyamf_4amf3_TYPE_BOOL_TRUE; -static char __pyx_v_6cpyamf_4amf3_TYPE_INTEGER; -static char __pyx_v_6cpyamf_4amf3_TYPE_NUMBER; -static char __pyx_v_6cpyamf_4amf3_TYPE_STRING; -static char __pyx_v_6cpyamf_4amf3_TYPE_XML; -static char __pyx_v_6cpyamf_4amf3_TYPE_DATE; -static char __pyx_v_6cpyamf_4amf3_TYPE_ARRAY; -static char __pyx_v_6cpyamf_4amf3_TYPE_OBJECT; -static char __pyx_v_6cpyamf_4amf3_TYPE_XMLSTRING; -static char __pyx_v_6cpyamf_4amf3_TYPE_BYTEARRAY; -static unsigned int __pyx_v_6cpyamf_4amf3_REFERENCE_BIT; -static char __pyx_v_6cpyamf_4amf3_REF_CHAR; -static long __pyx_v_6cpyamf_4amf3_MAX_29B_INT; -static long __pyx_v_6cpyamf_4amf3_MIN_29B_INT; -static int __pyx_v_6cpyamf_4amf3_OBJECT_ENCODING_STATIC; -static int __pyx_v_6cpyamf_4amf3_OBJECT_ENCODING_EXTERNAL; -static int __pyx_v_6cpyamf_4amf3_OBJECT_ENCODING_DYNAMIC; -static int __pyx_v_6cpyamf_4amf3_OBJECT_ENCODING_PROXY; -static PyObject *__pyx_v_6cpyamf_4amf3_ByteArrayType = 0; -static PyObject *__pyx_v_6cpyamf_4amf3_DataInput = 0; -static PyObject *__pyx_v_6cpyamf_4amf3_DataOutput = 0; -static PyObject *__pyx_v_6cpyamf_4amf3_empty_string = 0; -static PyObject *__pyx_v_6cpyamf_4amf3_empty_unicode = 0; -static PyObject *__pyx_v_6cpyamf_4amf3_undefined = 0; -static int __pyx_f_6cpyamf_4amf3_encode_int(long, char **); /*proto*/ -static int __pyx_f_6cpyamf_4amf3_decode_int(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, struct __pyx_opt_args_6cpyamf_4amf3_decode_int *__pyx_optional_args); /*proto*/ -static CYTHON_INLINE int __pyx_f_6cpyamf_4amf3__encode_integer(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int); /*proto*/ -static CYTHON_INLINE Py_ssize_t __pyx_f_6cpyamf_4amf3__read_ref(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *); /*proto*/ -#define __Pyx_MODULE_NAME "cpyamf.amf3" -int __pyx_module_is_main_cpyamf__amf3 = 0; - -/* Implementation of cpyamf.amf3 */ -static PyObject *__pyx_builtin_ImportError; -static PyObject *__pyx_builtin_TypeError; -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_KeyError; -static char __pyx_k_1[] = "encodable_properties"; -static char __pyx_k_3[] = "TypedObjectClassAlias"; -static char __pyx_k_4[] = "Unknown reference"; -static char __pyx_k_6[] = "Unknown object encoding"; -static char __pyx_k_8[] = "Unsupported ActionScript type"; -static char __pyx_k_11[] = "Expected str or unicode"; -static char __pyx_k_13[] = ""; -static char __pyx_k_14[] = "dicts cannot contain empty string keys"; -static char __pyx_k_16[] = "Non int/str key value found in dict"; -static char __pyx_k_18[] = "getEncodableAttributes"; -static char __pyx_k_19[] = "Expected dict for encodable attributes"; -static char __pyx_k_21[] = "utf-8"; -static char __pyx_k_23[] = "Expected string from xml serialization"; -static char __pyx_k_25[] = "\nC-extension for L{pyamf.amf3} Python module in L{PyAMF}.\n\n@since: 0.6\n"; -static char __pyx_k__n[] = "n"; -static char __pyx_k__obj[] = "obj"; -static char __pyx_k__pop[] = "pop"; -static char __pyx_k__ref[] = "ref"; -static char __pyx_k__xml[] = "xml"; -static char __pyx_k__amf3[] = "amf3"; -static char __pyx_k__flex[] = "flex"; -static char __pyx_k__keys[] = "keys"; -static char __pyx_k__peek[] = "peek"; -static char __pyx_k__read[] = "read"; -static char __pyx_k__seek[] = "seek"; -static char __pyx_k__util[] = "util"; -static char __pyx_k__zlib[] = "zlib"; -static char __pyx_k__alias[] = "alias"; -static char __pyx_k__clear[] = "clear"; -static char __pyx_k__codec[] = "codec"; -static char __pyx_k__error[] = "error"; -static char __pyx_k__index[] = "index"; -static char __pyx_k__klass[] = "klass"; -static char __pyx_k__pyamf[] = "pyamf"; -static char __pyx_k__types[] = "types"; -static char __pyx_k__write[] = "write"; -static char __pyx_k__append[] = "append"; -static char __pyx_k__decode[] = "decode"; -static char __pyx_k__encode[] = "encode"; -static char __pyx_k__stream[] = "stream"; -static char __pyx_k__strict[] = "strict"; -static char __pyx_k__classes[] = "classes"; -static char __pyx_k__compile[] = "compile"; -static char __pyx_k__context[] = "context"; -static char __pyx_k__dynamic[] = "dynamic"; -static char __pyx_k__proxied[] = "proxied"; -static char __pyx_k__readXML[] = "readXML"; -static char __pyx_k__strings[] = "strings"; -static char __pyx_k__ASObject[] = "ASObject"; -static char __pyx_k__KeyError[] = "KeyError"; -static char __pyx_k____init__[] = "__init__"; -static char __pyx_k____main__[] = "__main__"; -static char __pyx_k____test__[] = "__test__"; -static char __pyx_k__addClass[] = "addClass"; -static char __pyx_k__attr_len[] = "attr_len"; -static char __pyx_k__encoding[] = "encoding"; -static char __pyx_k__external[] = "external"; -static char __pyx_k__getClass[] = "getClass"; -static char __pyx_k__is_proxy[] = "is_proxy"; -static char __pyx_k__readDate[] = "readDate"; -static char __pyx_k__readList[] = "readList"; -static char __pyx_k__tostring[] = "tostring"; -static char __pyx_k__use_hash[] = "use_hash"; -static char __pyx_k__ByteArray[] = "ByteArray"; -static char __pyx_k__DataInput[] = "DataInput"; -static char __pyx_k__TypeError[] = "TypeError"; -static char __pyx_k__Undefined[] = "Undefined"; -static char __pyx_k____class__[] = "__class__"; -static char __pyx_k__addObject[] = "addObject"; -static char __pyx_k__addString[] = "addString"; -static char __pyx_k__anonymous[] = "anonymous"; -static char __pyx_k__class_idx[] = "class_idx"; -static char __pyx_k__class_ref[] = "class_ref"; -static char __pyx_k__getObject[] = "getObject"; -static char __pyx_k__getString[] = "getString"; -static char __pyx_k__readBytes[] = "readBytes"; -static char __pyx_k__readProxy[] = "readProxy"; -static char __pyx_k__writeList[] = "writeList"; -static char __pyx_k__writeType[] = "writeType"; -static char __pyx_k__DataOutput[] = "DataOutput"; -static char __pyx_k__MixedArray[] = "MixedArray"; -static char __pyx_k__ValueError[] = "ValueError"; -static char __pyx_k__compressed[] = "compressed"; -static char __pyx_k__decompress[] = "decompress"; -static char __pyx_k__fromstring[] = "fromstring"; -static char __pyx_k__readNumber[] = "readNumber"; -static char __pyx_k__readObject[] = "readObject"; -static char __pyx_k__readString[] = "readString"; -static char __pyx_k__read_uchar[] = "read_uchar"; -static char __pyx_k__writeProxy[] = "writeProxy"; -static char __pyx_k__DecodeError[] = "DecodeError"; -static char __pyx_k__EncodeError[] = "EncodeError"; -static char __pyx_k__ImportError[] = "ImportError"; -static char __pyx_k____readamf__[] = "__readamf__"; -static char __pyx_k___readStatic[] = "_readStatic"; -static char __pyx_k__encoded_ref[] = "encoded_ref"; -static char __pyx_k__readElement[] = "readElement"; -static char __pyx_k__readInteger[] = "readInteger"; -static char __pyx_k__read_double[] = "read_double"; -static char __pyx_k__use_proxies[] = "use_proxies"; -static char __pyx_k__writeNumber[] = "writeNumber"; -static char __pyx_k__writeObject[] = "writeObject"; -static char __pyx_k__write_uchar[] = "write_uchar"; -static char __pyx_k____writeamf__[] = "__writeamf__"; -static char __pyx_k___readDynamic[] = "_readDynamic"; -static char __pyx_k__get_datetime[] = "get_datetime"; -static char __pyx_k__proxy_object[] = "proxy_object"; -static char __pyx_k__static_attrs[] = "static_attrs"; -static char __pyx_k__writeElement[] = "writeElement"; -static char __pyx_k__write_double[] = "write_double"; -static char __pyx_k__getClassAlias[] = "getClassAlias"; -static char __pyx_k__get_timestamp[] = "get_timestamp"; -static char __pyx_k__readByteArray[] = "readByteArray"; -static char __pyx_k__ReferenceError[] = "ReferenceError"; -static char __pyx_k__addProxyObject[] = "addProxyObject"; -static char __pyx_k__createInstance[] = "createInstance"; -static char __pyx_k__getByReference[] = "getByReference"; -static char __pyx_k__getReferenceTo[] = "getReferenceTo"; -static char __pyx_k__unproxy_object[] = "unproxy_object"; -static char __pyx_k__writeByteArray[] = "writeByteArray"; -static char __pyx_k__writeReference[] = "writeReference"; -static char __pyx_k__applyAttributes[] = "applyAttributes"; -static char __pyx_k__proxied_objects[] = "proxied_objects"; -static char __pyx_k__serialiseString[] = "serialiseString"; -static char __pyx_k__timezone_offset[] = "timezone_offset"; -static char __pyx_k__encoded_ref_size[] = "encoded_ref_size"; -static char __pyx_k__UnknownClassAlias[] = "UnknownClassAlias"; -static char __pyx_k__getBytesForString[] = "getBytesForString"; -static char __pyx_k__getObjectForProxy[] = "getObjectForProxy"; -static char __pyx_k__getProxyForObject[] = "getProxyForObject"; -static char __pyx_k__static_properties[] = "static_properties"; -static char __pyx_k__getObjectReference[] = "getObjectReference"; -static char __pyx_k__getStringReference[] = "getStringReference"; -static char __pyx_k___getClassDefinition[] = "_getClassDefinition"; -static char __pyx_k__getClassByReference[] = "getClassByReference"; -static char __pyx_k__use_proxies_default[] = "use_proxies_default"; -static PyObject *__pyx_n_s_1; -static PyObject *__pyx_kp_s_11; -static PyObject *__pyx_kp_s_13; -static PyObject *__pyx_kp_s_14; -static PyObject *__pyx_kp_s_16; -static PyObject *__pyx_n_s_18; -static PyObject *__pyx_kp_s_19; -static PyObject *__pyx_kp_s_21; -static PyObject *__pyx_kp_s_23; -static PyObject *__pyx_n_s_3; -static PyObject *__pyx_kp_s_4; -static PyObject *__pyx_kp_s_6; -static PyObject *__pyx_kp_s_8; -static PyObject *__pyx_n_s__ASObject; -static PyObject *__pyx_n_s__ByteArray; -static PyObject *__pyx_n_s__DataInput; -static PyObject *__pyx_n_s__DataOutput; -static PyObject *__pyx_n_s__DecodeError; -static PyObject *__pyx_n_s__EncodeError; -static PyObject *__pyx_n_s__ImportError; -static PyObject *__pyx_n_s__KeyError; -static PyObject *__pyx_n_s__MixedArray; -static PyObject *__pyx_n_s__ReferenceError; -static PyObject *__pyx_n_s__TypeError; -static PyObject *__pyx_n_s__Undefined; -static PyObject *__pyx_n_s__UnknownClassAlias; -static PyObject *__pyx_n_s__ValueError; -static PyObject *__pyx_n_s____class__; -static PyObject *__pyx_n_s____init__; -static PyObject *__pyx_n_s____main__; -static PyObject *__pyx_n_s____readamf__; -static PyObject *__pyx_n_s____test__; -static PyObject *__pyx_n_s____writeamf__; -static PyObject *__pyx_n_s___getClassDefinition; -static PyObject *__pyx_n_s___readDynamic; -static PyObject *__pyx_n_s___readStatic; -static PyObject *__pyx_n_s__addClass; -static PyObject *__pyx_n_s__addObject; -static PyObject *__pyx_n_s__addProxyObject; -static PyObject *__pyx_n_s__addString; -static PyObject *__pyx_n_s__alias; -static PyObject *__pyx_n_s__amf3; -static PyObject *__pyx_n_s__anonymous; -static PyObject *__pyx_n_s__append; -static PyObject *__pyx_n_s__applyAttributes; -static PyObject *__pyx_n_s__attr_len; -static PyObject *__pyx_n_s__class_idx; -static PyObject *__pyx_n_s__class_ref; -static PyObject *__pyx_n_s__classes; -static PyObject *__pyx_n_s__clear; -static PyObject *__pyx_n_s__codec; -static PyObject *__pyx_n_s__compile; -static PyObject *__pyx_n_s__compressed; -static PyObject *__pyx_n_s__context; -static PyObject *__pyx_n_s__createInstance; -static PyObject *__pyx_n_s__decode; -static PyObject *__pyx_n_s__decompress; -static PyObject *__pyx_n_s__dynamic; -static PyObject *__pyx_n_s__encode; -static PyObject *__pyx_n_s__encoded_ref; -static PyObject *__pyx_n_s__encoded_ref_size; -static PyObject *__pyx_n_s__encoding; -static PyObject *__pyx_n_s__error; -static PyObject *__pyx_n_s__external; -static PyObject *__pyx_n_s__flex; -static PyObject *__pyx_n_s__fromstring; -static PyObject *__pyx_n_s__getByReference; -static PyObject *__pyx_n_s__getBytesForString; -static PyObject *__pyx_n_s__getClass; -static PyObject *__pyx_n_s__getClassAlias; -static PyObject *__pyx_n_s__getClassByReference; -static PyObject *__pyx_n_s__getObject; -static PyObject *__pyx_n_s__getObjectForProxy; -static PyObject *__pyx_n_s__getObjectReference; -static PyObject *__pyx_n_s__getProxyForObject; -static PyObject *__pyx_n_s__getReferenceTo; -static PyObject *__pyx_n_s__getString; -static PyObject *__pyx_n_s__getStringReference; -static PyObject *__pyx_n_s__get_datetime; -static PyObject *__pyx_n_s__get_timestamp; -static PyObject *__pyx_n_s__index; -static PyObject *__pyx_n_s__is_proxy; -static PyObject *__pyx_n_s__keys; -static PyObject *__pyx_n_s__klass; -static PyObject *__pyx_n_s__n; -static PyObject *__pyx_n_s__obj; -static PyObject *__pyx_n_s__peek; -static PyObject *__pyx_n_s__pop; -static PyObject *__pyx_n_s__proxied; -static PyObject *__pyx_n_s__proxied_objects; -static PyObject *__pyx_n_s__proxy_object; -static PyObject *__pyx_n_s__pyamf; -static PyObject *__pyx_n_s__read; -static PyObject *__pyx_n_s__readByteArray; -static PyObject *__pyx_n_s__readBytes; -static PyObject *__pyx_n_s__readDate; -static PyObject *__pyx_n_s__readElement; -static PyObject *__pyx_n_s__readInteger; -static PyObject *__pyx_n_s__readList; -static PyObject *__pyx_n_s__readNumber; -static PyObject *__pyx_n_s__readObject; -static PyObject *__pyx_n_s__readProxy; -static PyObject *__pyx_n_s__readString; -static PyObject *__pyx_n_s__readXML; -static PyObject *__pyx_n_s__read_double; -static PyObject *__pyx_n_s__read_uchar; -static PyObject *__pyx_n_s__ref; -static PyObject *__pyx_n_s__seek; -static PyObject *__pyx_n_s__serialiseString; -static PyObject *__pyx_n_s__static_attrs; -static PyObject *__pyx_n_s__static_properties; -static PyObject *__pyx_n_s__stream; -static PyObject *__pyx_n_s__strict; -static PyObject *__pyx_n_s__strings; -static PyObject *__pyx_n_s__timezone_offset; -static PyObject *__pyx_n_s__tostring; -static PyObject *__pyx_n_s__types; -static PyObject *__pyx_n_s__unproxy_object; -static PyObject *__pyx_n_s__use_hash; -static PyObject *__pyx_n_s__use_proxies; -static PyObject *__pyx_n_s__use_proxies_default; -static PyObject *__pyx_n_s__util; -static PyObject *__pyx_n_s__write; -static PyObject *__pyx_n_s__writeByteArray; -static PyObject *__pyx_n_s__writeElement; -static PyObject *__pyx_n_s__writeList; -static PyObject *__pyx_n_s__writeNumber; -static PyObject *__pyx_n_s__writeObject; -static PyObject *__pyx_n_s__writeProxy; -static PyObject *__pyx_n_s__writeReference; -static PyObject *__pyx_n_s__writeType; -static PyObject *__pyx_n_s__write_double; -static PyObject *__pyx_n_s__write_uchar; -static PyObject *__pyx_n_s__xml; -static PyObject *__pyx_n_s__zlib; -static PyObject *__pyx_int_0; -static PyObject *__pyx_int_1; -static PyObject *__pyx_int_neg_1; -static PyObject *__pyx_k_tuple_2; -static PyObject *__pyx_k_tuple_5; -static PyObject *__pyx_k_tuple_7; -static PyObject *__pyx_k_tuple_9; -static PyObject *__pyx_k_tuple_10; -static PyObject *__pyx_k_tuple_12; -static PyObject *__pyx_k_tuple_15; -static PyObject *__pyx_k_tuple_17; -static PyObject *__pyx_k_tuple_20; -static PyObject *__pyx_k_tuple_22; -static PyObject *__pyx_k_tuple_24; -static PyObject *__pyx_k_tuple_26; -static PyObject *__pyx_k_tuple_27; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":69 - * """ - * - * def __cinit__(self): # <<<<<<<<<<<<<< - * self.alias = None - * self.ref = -1 - */ - -static int __pyx_pf_6cpyamf_4amf3_15ClassDefinition___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6cpyamf_4amf3_15ClassDefinition___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - int __pyx_r; - __Pyx_RefNannySetupContext("__cinit__"); - 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; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":70 - * - * def __cinit__(self): - * self.alias = None # <<<<<<<<<<<<<< - * self.ref = -1 - * self.attr_len = -1 - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->alias); - __Pyx_DECREF(((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->alias); - ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->alias = Py_None; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":71 - * def __cinit__(self): - * self.alias = None - * self.ref = -1 # <<<<<<<<<<<<<< - * self.attr_len = -1 - * self.encoding = -1 - */ - ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->ref = -1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":72 - * self.alias = None - * self.ref = -1 - * self.attr_len = -1 # <<<<<<<<<<<<<< - * self.encoding = -1 - * self.encoded_ref = NULL - */ - ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->attr_len = -1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":73 - * self.ref = -1 - * self.attr_len = -1 - * self.encoding = -1 # <<<<<<<<<<<<<< - * self.encoded_ref = NULL - * self.encoded_ref_size = -1 - */ - ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->encoding = -1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":74 - * self.attr_len = -1 - * self.encoding = -1 - * self.encoded_ref = NULL # <<<<<<<<<<<<<< - * self.encoded_ref_size = -1 - * - */ - ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->encoded_ref = NULL; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":75 - * self.encoding = -1 - * self.encoded_ref = NULL - * self.encoded_ref_size = -1 # <<<<<<<<<<<<<< - * - * def __init__(self, alias): - */ - ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->encoded_ref_size = -1; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":77 - * self.encoded_ref_size = -1 - * - * def __init__(self, alias): # <<<<<<<<<<<<<< - * self.alias = alias - * - */ - -static int __pyx_pf_6cpyamf_4amf3_15ClassDefinition___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6cpyamf_4amf3_15ClassDefinition___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_alias = 0; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - Py_ssize_t __pyx_t_4; - int __pyx_t_5; - Py_ssize_t __pyx_t_6; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__alias,0}; - __Pyx_RefNannySetupContext("__init__"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[1] = {0}; - 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; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alias); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_alias = values[0]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_alias = PyTuple_GET_ITEM(__pyx_args, 0); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.amf3.ClassDefinition.__init__"); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":78 - * - * def __init__(self, alias): - * self.alias = alias # <<<<<<<<<<<<<< - * - * alias.compile() - */ - __Pyx_INCREF(__pyx_v_alias); - __Pyx_GIVEREF(__pyx_v_alias); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->alias); - __Pyx_DECREF(((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->alias); - ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->alias = __pyx_v_alias; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":80 - * self.alias = alias - * - * alias.compile() # <<<<<<<<<<<<<< - * - * self.attr_len = 0 - */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s__compile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __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; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":82 - * alias.compile() - * - * self.attr_len = 0 # <<<<<<<<<<<<<< - * self.static_properties = [] - * - */ - ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->attr_len = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":83 - * - * self.attr_len = 0 - * self.static_properties = [] # <<<<<<<<<<<<<< - * - * if alias.static_attrs: - */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->static_properties); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->static_properties)); - ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->static_properties = __pyx_t_2; - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":85 - * self.static_properties = [] - * - * if alias.static_attrs: # <<<<<<<<<<<<<< - * self.attr_len = len(alias.static_attrs) - * self.static_properties = alias.static_attrs - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s__static_attrs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":86 - * - * if alias.static_attrs: - * self.attr_len = len(alias.static_attrs) # <<<<<<<<<<<<<< - * self.static_properties = alias.static_attrs - * - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s__static_attrs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->attr_len = __pyx_t_4; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":87 - * if alias.static_attrs: - * self.attr_len = len(alias.static_attrs) - * self.static_properties = alias.static_attrs # <<<<<<<<<<<<<< - * - * self.encoding = OBJECT_ENCODING_DYNAMIC - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s__static_attrs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->static_properties); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->static_properties)); - ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->static_properties = ((PyObject *)__pyx_t_2); - __pyx_t_2 = 0; - goto __pyx_L6; - } - __pyx_L6:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":89 - * self.static_properties = alias.static_attrs - * - * self.encoding = OBJECT_ENCODING_DYNAMIC # <<<<<<<<<<<<<< - * - * if alias.external: - */ - ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->encoding = __pyx_v_6cpyamf_4amf3_OBJECT_ENCODING_DYNAMIC; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":91 - * self.encoding = OBJECT_ENCODING_DYNAMIC - * - * if alias.external: # <<<<<<<<<<<<<< - * self.encoding = OBJECT_ENCODING_EXTERNAL - * elif not alias.dynamic: - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s__external); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":92 - * - * if alias.external: - * self.encoding = OBJECT_ENCODING_EXTERNAL # <<<<<<<<<<<<<< - * elif not alias.dynamic: - * if alias.encodable_properties is not None: - */ - ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->encoding = __pyx_v_6cpyamf_4amf3_OBJECT_ENCODING_EXTERNAL; - goto __pyx_L7; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":93 - * if alias.external: - * self.encoding = OBJECT_ENCODING_EXTERNAL - * elif not alias.dynamic: # <<<<<<<<<<<<<< - * if alias.encodable_properties is not None: - * if len(alias.static_attrs) == len(alias.encodable_properties): - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s__dynamic); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = (!__pyx_t_3); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":94 - * self.encoding = OBJECT_ENCODING_EXTERNAL - * elif not alias.dynamic: - * if alias.encodable_properties is not None: # <<<<<<<<<<<<<< - * if len(alias.static_attrs) == len(alias.encodable_properties): - * self.encoding = OBJECT_ENCODING_STATIC - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = (__pyx_t_2 != Py_None); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":95 - * elif not alias.dynamic: - * if alias.encodable_properties is not None: - * if len(alias.static_attrs) == len(alias.encodable_properties): # <<<<<<<<<<<<<< - * self.encoding = OBJECT_ENCODING_STATIC - * else: - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s__static_attrs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = (__pyx_t_4 == __pyx_t_6); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":96 - * if alias.encodable_properties is not None: - * if len(alias.static_attrs) == len(alias.encodable_properties): - * self.encoding = OBJECT_ENCODING_STATIC # <<<<<<<<<<<<<< - * else: - * self.encoding = OBJECT_ENCODING_STATIC - */ - ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->encoding = __pyx_v_6cpyamf_4amf3_OBJECT_ENCODING_STATIC; - goto __pyx_L9; - } - __pyx_L9:; - goto __pyx_L8; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":98 - * self.encoding = OBJECT_ENCODING_STATIC - * else: - * self.encoding = OBJECT_ENCODING_STATIC # <<<<<<<<<<<<<< - * - * def __dealloc__(self): - */ - ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->encoding = __pyx_v_6cpyamf_4amf3_OBJECT_ENCODING_STATIC; - } - __pyx_L8:; - goto __pyx_L7; - } - __pyx_L7:; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.amf3.ClassDefinition.__init__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":100 - * self.encoding = OBJECT_ENCODING_STATIC - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * if self.encoded_ref != NULL: - * free(self.encoded_ref) - */ - -static void __pyx_pf_6cpyamf_4amf3_15ClassDefinition___dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pf_6cpyamf_4amf3_15ClassDefinition___dealloc__(PyObject *__pyx_v_self) { - int __pyx_t_1; - __Pyx_RefNannySetupContext("__dealloc__"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":101 - * - * def __dealloc__(self): - * if self.encoded_ref != NULL: # <<<<<<<<<<<<<< - * free(self.encoded_ref) - * self.encoded_ref = NULL - */ - __pyx_t_1 = (((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->encoded_ref != NULL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":102 - * def __dealloc__(self): - * if self.encoded_ref != NULL: - * free(self.encoded_ref) # <<<<<<<<<<<<<< - * self.encoded_ref = NULL - * - */ - free(((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->encoded_ref); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":103 - * if self.encoded_ref != NULL: - * free(self.encoded_ref) - * self.encoded_ref = NULL # <<<<<<<<<<<<<< - * - * cdef int writeReference(self, cBufferedByteStream stream): - */ - ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->encoded_ref = NULL; - goto __pyx_L5; - } - __pyx_L5:; - - __Pyx_RefNannyFinishContext(); -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":105 - * self.encoded_ref = NULL - * - * cdef int writeReference(self, cBufferedByteStream stream): # <<<<<<<<<<<<<< - * if self.encoded_ref != NULL: - * return stream.write(self.encoded_ref, self.encoded_ref_size) - */ - -static int __pyx_f_6cpyamf_4amf3_15ClassDefinition_writeReference(struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *__pyx_v_self, struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_stream) { - Py_ssize_t __pyx_v_ref; - char *__pyx_v_buf; - int __pyx_v_ret; - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("writeReference"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":106 - * - * cdef int writeReference(self, cBufferedByteStream stream): - * if self.encoded_ref != NULL: # <<<<<<<<<<<<<< - * return stream.write(self.encoded_ref, self.encoded_ref_size) - * - */ - __pyx_t_1 = (__pyx_v_self->encoded_ref != NULL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":107 - * cdef int writeReference(self, cBufferedByteStream stream): - * if self.encoded_ref != NULL: - * return stream.write(self.encoded_ref, self.encoded_ref_size) # <<<<<<<<<<<<<< - * - * cdef Py_ssize_t ref = 0 - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_stream->__pyx_vtab)->write(__pyx_v_stream, __pyx_v_self->encoded_ref, __pyx_v_self->encoded_ref_size); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_2; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":109 - * return stream.write(self.encoded_ref, self.encoded_ref_size) - * - * cdef Py_ssize_t ref = 0 # <<<<<<<<<<<<<< - * cdef char *buf - * cdef int ret = 0 - */ - __pyx_v_ref = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":111 - * cdef Py_ssize_t ref = 0 - * cdef char *buf - * cdef int ret = 0 # <<<<<<<<<<<<<< - * - * if self.encoding != OBJECT_ENCODING_EXTERNAL: - */ - __pyx_v_ret = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":113 - * cdef int ret = 0 - * - * if self.encoding != OBJECT_ENCODING_EXTERNAL: # <<<<<<<<<<<<<< - * ref += self.attr_len << 4 - * - */ - __pyx_t_1 = (__pyx_v_self->encoding != __pyx_v_6cpyamf_4amf3_OBJECT_ENCODING_EXTERNAL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":114 - * - * if self.encoding != OBJECT_ENCODING_EXTERNAL: - * ref += self.attr_len << 4 # <<<<<<<<<<<<<< - * - * ref |= self.encoding << 2 | REFERENCE_BIT << 1 | REFERENCE_BIT - */ - __pyx_v_ref = (__pyx_v_ref + (__pyx_v_self->attr_len << 4)); - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":116 - * ref += self.attr_len << 4 - * - * ref |= self.encoding << 2 | REFERENCE_BIT << 1 | REFERENCE_BIT # <<<<<<<<<<<<<< - * - * try: - */ - __pyx_v_ref = (__pyx_v_ref | (((__pyx_v_self->encoding << 2) | (__pyx_v_6cpyamf_4amf3_REFERENCE_BIT << 1)) | __pyx_v_6cpyamf_4amf3_REFERENCE_BIT)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":118 - * ref |= self.encoding << 2 | REFERENCE_BIT << 1 | REFERENCE_BIT - * - * try: # <<<<<<<<<<<<<< - * ret = encode_int(ref, &buf) - * - */ - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":119 - * - * try: - * ret = encode_int(ref, &buf) # <<<<<<<<<<<<<< - * - * stream.write(buf, ret) - */ - __pyx_t_2 = __pyx_f_6cpyamf_4amf3_encode_int(__pyx_v_ref, (&__pyx_v_buf)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L6;} - __pyx_v_ret = __pyx_t_2; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":121 - * ret = encode_int(ref, &buf) - * - * stream.write(buf, ret) # <<<<<<<<<<<<<< - * finally: - * if buf != NULL: - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_stream->__pyx_vtab)->write(__pyx_v_stream, __pyx_v_buf, __pyx_v_ret); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L6;} - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":123 - * stream.write(buf, ret) - * finally: - * if buf != NULL: # <<<<<<<<<<<<<< - * free(buf) - * - */ - /*finally:*/ { - int __pyx_why; - PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; - int __pyx_exc_lineno; - __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 0; goto __pyx_L7; - __pyx_L6: { - __pyx_why = 4; - __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); - __pyx_exc_lineno = __pyx_lineno; - goto __pyx_L7; - } - __pyx_L7:; - __pyx_t_1 = (__pyx_v_buf != NULL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":124 - * finally: - * if buf != NULL: - * free(buf) # <<<<<<<<<<<<<< - * - * try: - */ - free(__pyx_v_buf); - goto __pyx_L9; - } - __pyx_L9:; - switch (__pyx_why) { - case 4: { - __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); - __pyx_lineno = __pyx_exc_lineno; - __pyx_exc_type = 0; - __pyx_exc_value = 0; - __pyx_exc_tb = 0; - goto __pyx_L1_error; - } - } - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":126 - * free(buf) - * - * try: # <<<<<<<<<<<<<< - * self.encoded_ref_size = encode_int(self.ref << 2 | REFERENCE_BIT, &self.encoded_ref) - * except: - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - __Pyx_XGOTREF(__pyx_save_exc_type); - __Pyx_XGOTREF(__pyx_save_exc_value); - __Pyx_XGOTREF(__pyx_save_exc_tb); - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":127 - * - * try: - * self.encoded_ref_size = encode_int(self.ref << 2 | REFERENCE_BIT, &self.encoded_ref) # <<<<<<<<<<<<<< - * except: - * if self.encoded_ref != NULL: - */ - __pyx_t_2 = __pyx_f_6cpyamf_4amf3_encode_int(((__pyx_v_self->ref << 2) | __pyx_v_6cpyamf_4amf3_REFERENCE_BIT), (&__pyx_v_self->encoded_ref)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L10_error;} - __pyx_v_self->encoded_ref_size = __pyx_t_2; - } - __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L17_try_end; - __pyx_L10_error:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":128 - * try: - * self.encoded_ref_size = encode_int(self.ref << 2 | REFERENCE_BIT, &self.encoded_ref) - * except: # <<<<<<<<<<<<<< - * if self.encoded_ref != NULL: - * free(self.encoded_ref) - */ - /*except:*/ { - __Pyx_AddTraceback("cpyamf.amf3.ClassDefinition.writeReference"); - if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GOTREF(__pyx_t_5); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":129 - * self.encoded_ref_size = encode_int(self.ref << 2 | REFERENCE_BIT, &self.encoded_ref) - * except: - * if self.encoded_ref != NULL: # <<<<<<<<<<<<<< - * free(self.encoded_ref) - * self.encoded_ref = NULL - */ - __pyx_t_1 = (__pyx_v_self->encoded_ref != NULL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":130 - * except: - * if self.encoded_ref != NULL: - * free(self.encoded_ref) # <<<<<<<<<<<<<< - * self.encoded_ref = NULL - * - */ - free(__pyx_v_self->encoded_ref); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":131 - * if self.encoded_ref != NULL: - * free(self.encoded_ref) - * self.encoded_ref = NULL # <<<<<<<<<<<<<< - * - * raise - */ - __pyx_v_self->encoded_ref = NULL; - goto __pyx_L20; - } - __pyx_L20:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":133 - * self.encoded_ref = NULL - * - * raise # <<<<<<<<<<<<<< - * - * return 0 - */ - __Pyx_GIVEREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_5); - __Pyx_ErrRestore(__pyx_t_3, __pyx_t_4, __pyx_t_5); - __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L11_exception_handled; - } - __pyx_L12_except_error:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L11_exception_handled:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L17_try_end:; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":135 - * raise - * - * return 0 # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = 0; - goto __pyx_L0; - - __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_WriteUnraisable("cpyamf.amf3.ClassDefinition.writeReference"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pxd":9 - * """ - * - * cdef readonly object alias # <<<<<<<<<<<<<< - * cdef Py_ssize_t ref - * cdef readonly Py_ssize_t attr_len - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_15ClassDefinition_5alias___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4amf3_15ClassDefinition_5alias___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->alias); - __pyx_r = ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->alias; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pxd":11 - * cdef readonly object alias - * cdef Py_ssize_t ref - * cdef readonly Py_ssize_t attr_len # <<<<<<<<<<<<<< - * cdef readonly int encoding - * - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_15ClassDefinition_8attr_len___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4amf3_15ClassDefinition_8attr_len___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->attr_len); 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); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.amf3.ClassDefinition.attr_len.__get__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pxd":12 - * cdef Py_ssize_t ref - * cdef readonly Py_ssize_t attr_len - * cdef readonly int encoding # <<<<<<<<<<<<<< - * - * cdef char *encoded_ref - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_15ClassDefinition_8encoding___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4amf3_15ClassDefinition_8encoding___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->encoding); 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); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.amf3.ClassDefinition.encoding.__get__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pxd":17 - * cdef Py_ssize_t encoded_ref_size - * - * cdef readonly list static_properties # <<<<<<<<<<<<<< - * - * cdef int writeReference(self, util.cBufferedByteStream stream) - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_15ClassDefinition_17static_properties___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4amf3_15ClassDefinition_17static_properties___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->static_properties)); - __pyx_r = ((PyObject *)((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_v_self)->static_properties); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":143 - * """ - * - * def __cinit__(self): # <<<<<<<<<<<<<< - * self.strings = codec.IndexedCollection(use_hash=1) - * self.classes = {} - */ - -static int __pyx_pf_6cpyamf_4amf3_7Context___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6cpyamf_4amf3_7Context___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("__cinit__"); - 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; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":144 - * - * def __cinit__(self): - * self.strings = codec.IndexedCollection(use_hash=1) # <<<<<<<<<<<<<< - * self.classes = {} - * self.class_ref = {} - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__use_hash), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_6cpyamf_5codec_IndexedCollection)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self)->strings); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self)->strings)); - ((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self)->strings = ((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":145 - * def __cinit__(self): - * self.strings = codec.IndexedCollection(use_hash=1) - * self.classes = {} # <<<<<<<<<<<<<< - * self.class_ref = {} - * self.proxied_objects = {} - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self)->classes); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self)->classes)); - ((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self)->classes = __pyx_t_2; - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":146 - * self.strings = codec.IndexedCollection(use_hash=1) - * self.classes = {} - * self.class_ref = {} # <<<<<<<<<<<<<< - * self.proxied_objects = {} - * - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self)->class_ref); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self)->class_ref)); - ((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self)->class_ref = __pyx_t_2; - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":147 - * self.classes = {} - * self.class_ref = {} - * self.proxied_objects = {} # <<<<<<<<<<<<<< - * - * self.class_idx = 0 - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self)->proxied_objects); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self)->proxied_objects)); - ((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self)->proxied_objects = __pyx_t_2; - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":149 - * self.proxied_objects = {} - * - * self.class_idx = 0 # <<<<<<<<<<<<<< - * - * cpdef int clear(self) except -1: - */ - ((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self)->class_idx = 0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.amf3.Context.__cinit__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":151 - * self.class_idx = 0 - * - * cpdef int clear(self) except -1: # <<<<<<<<<<<<<< - * """ - * Clears the context. - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static int __pyx_f_6cpyamf_4amf3_7Context_clear(struct __pyx_obj_6cpyamf_4amf3_Context *__pyx_v_self, int __pyx_skip_dispatch) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - __Pyx_RefNannySetupContext("clear"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__clear); 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); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4amf3_7Context_clear)) { - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":155 - * Clears the context. - * """ - * codec.Context.clear(self) # <<<<<<<<<<<<<< - * - * self.strings.clear() - */ - __pyx_t_3 = __pyx_vtabptr_6cpyamf_5codec_Context->clear(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self), 1); if (unlikely(__pyx_t_3 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":157 - * codec.Context.clear(self) - * - * self.strings.clear() # <<<<<<<<<<<<<< - * self.proxied_objects = {} - * - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *)__pyx_v_self->strings->__pyx_vtab)->clear(__pyx_v_self->strings, 0); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":158 - * - * self.strings.clear() - * self.proxied_objects = {} # <<<<<<<<<<<<<< - * - * self.classes = {} - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __Pyx_GOTREF(__pyx_v_self->proxied_objects); - __Pyx_DECREF(((PyObject *)__pyx_v_self->proxied_objects)); - __pyx_v_self->proxied_objects = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":160 - * self.proxied_objects = {} - * - * self.classes = {} # <<<<<<<<<<<<<< - * self.class_ref = {} - * self.class_idx = 0 - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __Pyx_GOTREF(__pyx_v_self->classes); - __Pyx_DECREF(((PyObject *)__pyx_v_self->classes)); - __pyx_v_self->classes = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":161 - * - * self.classes = {} - * self.class_ref = {} # <<<<<<<<<<<<<< - * self.class_idx = 0 - * - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __Pyx_GOTREF(__pyx_v_self->class_ref); - __Pyx_DECREF(((PyObject *)__pyx_v_self->class_ref)); - __pyx_v_self->class_ref = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":162 - * self.classes = {} - * self.class_ref = {} - * self.class_idx = 0 # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_v_self->class_idx = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":164 - * self.class_idx = 0 - * - * return 0 # <<<<<<<<<<<<<< - * - * cpdef object getString(self, Py_ssize_t ref): - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.amf3.Context.clear"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":151 - * self.class_idx = 0 - * - * cpdef int clear(self) except -1: # <<<<<<<<<<<<<< - * """ - * Clears the context. - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6cpyamf_4amf3_7Context_clear[] = "\n Clears the context.\n "; -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("clear"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.clear(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self), 1); if (unlikely(__pyx_t_1 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.amf3.Context.clear"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":166 - * return 0 - * - * cpdef object getString(self, Py_ssize_t ref): # <<<<<<<<<<<<<< - * return self.strings.getByReference(ref) - * - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_getString(PyObject *__pyx_v_self, PyObject *__pyx_arg_ref); /*proto*/ -static PyObject *__pyx_f_6cpyamf_4amf3_7Context_getString(struct __pyx_obj_6cpyamf_4amf3_Context *__pyx_v_self, Py_ssize_t __pyx_v_ref, int __pyx_skip_dispatch) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("getString"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__getString); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4amf3_7Context_getString)) { - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_ref); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __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[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__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 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":167 - * - * cpdef object getString(self, Py_ssize_t ref): - * return self.strings.getByReference(ref) # <<<<<<<<<<<<<< - * - * cpdef Py_ssize_t getStringReference(self, object s) except -2: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *)__pyx_v_self->strings->__pyx_vtab)->getByReference(__pyx_v_self->strings, __pyx_v_ref, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __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_3); - __Pyx_AddTraceback("cpyamf.amf3.Context.getString"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":166 - * return 0 - * - * cpdef object getString(self, Py_ssize_t ref): # <<<<<<<<<<<<<< - * return self.strings.getByReference(ref) - * - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_getString(PyObject *__pyx_v_self, PyObject *__pyx_arg_ref); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_getString(PyObject *__pyx_v_self, PyObject *__pyx_arg_ref) { - Py_ssize_t __pyx_v_ref; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("getString"); - assert(__pyx_arg_ref); { - __pyx_v_ref = __Pyx_PyIndex_AsSsize_t(__pyx_arg_ref); if (unlikely((__pyx_v_ref == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.amf3.Context.getString"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self)->__pyx_base.__pyx_vtab)->getString(((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self), __pyx_v_ref, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.amf3.Context.getString"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":169 - * return self.strings.getByReference(ref) - * - * cpdef Py_ssize_t getStringReference(self, object s) except -2: # <<<<<<<<<<<<<< - * return self.strings.getReferenceTo(s) - * - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_getStringReference(PyObject *__pyx_v_self, PyObject *__pyx_v_s); /*proto*/ -static Py_ssize_t __pyx_f_6cpyamf_4amf3_7Context_getStringReference(struct __pyx_obj_6cpyamf_4amf3_Context *__pyx_v_self, PyObject *__pyx_v_s, int __pyx_skip_dispatch) { - Py_ssize_t __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - __Pyx_RefNannySetupContext("getStringReference"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__getStringReference); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4amf3_7Context_getStringReference)) { - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_s); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_s); - __Pyx_GIVEREF(__pyx_v_s); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":170 - * - * cpdef Py_ssize_t getStringReference(self, object s) except -2: - * return self.strings.getReferenceTo(s) # <<<<<<<<<<<<<< - * - * cpdef Py_ssize_t addString(self, object s) except -1: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *)__pyx_v_self->strings->__pyx_vtab)->getReferenceTo(__pyx_v_self->strings, __pyx_v_s, 0); if (unlikely(__pyx_t_4 == -2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.amf3.Context.getStringReference"); - __pyx_r = -2; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":169 - * return self.strings.getByReference(ref) - * - * cpdef Py_ssize_t getStringReference(self, object s) except -2: # <<<<<<<<<<<<<< - * return self.strings.getReferenceTo(s) - * - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_getStringReference(PyObject *__pyx_v_self, PyObject *__pyx_v_s); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_getStringReference(PyObject *__pyx_v_self, PyObject *__pyx_v_s) { - PyObject *__pyx_r = NULL; - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("getStringReference"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self)->__pyx_base.__pyx_vtab)->getStringReference(((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self), __pyx_v_s, 1); if (unlikely(__pyx_t_1 == -2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.amf3.Context.getStringReference"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":172 - * return self.strings.getReferenceTo(s) - * - * cpdef Py_ssize_t addString(self, object s) except -1: # <<<<<<<<<<<<<< - * """ - * Returns -2 which signifies that s was empty - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_addString(PyObject *__pyx_v_self, PyObject *__pyx_v_s); /*proto*/ -static Py_ssize_t __pyx_f_6cpyamf_4amf3_7Context_addString(struct __pyx_obj_6cpyamf_4amf3_Context *__pyx_v_self, PyObject *__pyx_v_s, int __pyx_skip_dispatch) { - Py_ssize_t __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - __Pyx_RefNannySetupContext("addString"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__addString); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4amf3_7Context_addString)) { - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_s); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_s); - __Pyx_GIVEREF(__pyx_v_s); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":176 - * Returns -2 which signifies that s was empty - * """ - * return self.strings.append(s) # <<<<<<<<<<<<<< - * - * cpdef object getClassByReference(self, Py_ssize_t ref): - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *)__pyx_v_self->strings->__pyx_vtab)->append(__pyx_v_self->strings, __pyx_v_s, 0); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.amf3.Context.addString"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":172 - * return self.strings.getReferenceTo(s) - * - * cpdef Py_ssize_t addString(self, object s) except -1: # <<<<<<<<<<<<<< - * """ - * Returns -2 which signifies that s was empty - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_addString(PyObject *__pyx_v_self, PyObject *__pyx_v_s); /*proto*/ -static char __pyx_doc_6cpyamf_4amf3_7Context_addString[] = "\n Returns -2 which signifies that s was empty\n "; -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_addString(PyObject *__pyx_v_self, PyObject *__pyx_v_s) { - PyObject *__pyx_r = NULL; - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("addString"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self)->__pyx_base.__pyx_vtab)->addString(((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self), __pyx_v_s, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.amf3.Context.addString"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":178 - * return self.strings.append(s) - * - * cpdef object getClassByReference(self, Py_ssize_t ref): # <<<<<<<<<<<<<< - * return self.class_ref.get(ref, None) - * - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_getClassByReference(PyObject *__pyx_v_self, PyObject *__pyx_arg_ref); /*proto*/ -static PyObject *__pyx_f_6cpyamf_4amf3_7Context_getClassByReference(struct __pyx_obj_6cpyamf_4amf3_Context *__pyx_v_self, Py_ssize_t __pyx_v_ref, int __pyx_skip_dispatch) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("getClassByReference"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__getClassByReference); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4amf3_7Context_getClassByReference)) { - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_ref); 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_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__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 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); 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_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":179 - * - * cpdef object getClassByReference(self, Py_ssize_t ref): - * return self.class_ref.get(ref, None) # <<<<<<<<<<<<<< - * - * cpdef ClassDefinition getClass(self, object klass): - */ - __Pyx_XDECREF(__pyx_r); - if (unlikely(__pyx_v_self->class_ref == Py_None)) { - PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'get'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_ref); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_self->class_ref), __pyx_t_1, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __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; - - __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_3); - __Pyx_AddTraceback("cpyamf.amf3.Context.getClassByReference"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":178 - * return self.strings.append(s) - * - * cpdef object getClassByReference(self, Py_ssize_t ref): # <<<<<<<<<<<<<< - * return self.class_ref.get(ref, None) - * - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_getClassByReference(PyObject *__pyx_v_self, PyObject *__pyx_arg_ref); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_getClassByReference(PyObject *__pyx_v_self, PyObject *__pyx_arg_ref) { - Py_ssize_t __pyx_v_ref; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("getClassByReference"); - assert(__pyx_arg_ref); { - __pyx_v_ref = __Pyx_PyIndex_AsSsize_t(__pyx_arg_ref); if (unlikely((__pyx_v_ref == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.amf3.Context.getClassByReference"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self)->__pyx_base.__pyx_vtab)->getClassByReference(((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self), __pyx_v_ref, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.amf3.Context.getClassByReference"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":181 - * return self.class_ref.get(ref, None) - * - * cpdef ClassDefinition getClass(self, object klass): # <<<<<<<<<<<<<< - * return self.classes.get(klass, None) - * - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_getClass(PyObject *__pyx_v_self, PyObject *__pyx_v_klass); /*proto*/ -static struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *__pyx_f_6cpyamf_4amf3_7Context_getClass(struct __pyx_obj_6cpyamf_4amf3_Context *__pyx_v_self, PyObject *__pyx_v_klass, int __pyx_skip_dispatch) { - struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("getClass"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__getClass); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4amf3_7Context_getClass)) { - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_klass); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_klass); - __Pyx_GIVEREF(__pyx_v_klass); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); 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); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6cpyamf_4amf3_ClassDefinition))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_t_3); - __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":182 - * - * cpdef ClassDefinition getClass(self, object klass): - * return self.classes.get(klass, None) # <<<<<<<<<<<<<< - * - * cpdef Py_ssize_t addClass(self, ClassDefinition alias, klass) except? -1: - */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - if (unlikely(__pyx_v_self->classes == Py_None)) { - PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'get'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_self->classes), __pyx_v_klass, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6cpyamf_4amf3_ClassDefinition))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_t_1); - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)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_3); - __Pyx_AddTraceback("cpyamf.amf3.Context.getClass"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF((PyObject *)__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":181 - * return self.class_ref.get(ref, None) - * - * cpdef ClassDefinition getClass(self, object klass): # <<<<<<<<<<<<<< - * return self.classes.get(klass, None) - * - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_getClass(PyObject *__pyx_v_self, PyObject *__pyx_v_klass); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_getClass(PyObject *__pyx_v_self, PyObject *__pyx_v_klass) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("getClass"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self)->__pyx_base.__pyx_vtab)->getClass(((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self), __pyx_v_klass, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.amf3.Context.getClass"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":184 - * return self.classes.get(klass, None) - * - * cpdef Py_ssize_t addClass(self, ClassDefinition alias, klass) except? -1: # <<<<<<<<<<<<<< - * cdef object ref = self.class_idx - * - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_addClass(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static Py_ssize_t __pyx_f_6cpyamf_4amf3_7Context_addClass(struct __pyx_obj_6cpyamf_4amf3_Context *__pyx_v_self, struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *__pyx_v_alias, PyObject *__pyx_v_klass, int __pyx_skip_dispatch) { - PyObject *__pyx_v_ref = 0; - Py_ssize_t __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - __Pyx_RefNannySetupContext("addClass"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__addClass); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4amf3_7Context_addClass)) { - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(((PyObject *)__pyx_v_alias)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_alias)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_alias)); - __Pyx_INCREF(__pyx_v_klass); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_klass); - __Pyx_GIVEREF(__pyx_v_klass); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":185 - * - * cpdef Py_ssize_t addClass(self, ClassDefinition alias, klass) except? -1: - * cdef object ref = self.class_idx # <<<<<<<<<<<<<< - * - * self.class_ref[ref] = alias - */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->class_idx); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_ref = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":187 - * cdef object ref = self.class_idx - * - * self.class_ref[ref] = alias # <<<<<<<<<<<<<< - * self.classes[klass] = alias - * - */ - if (PyDict_SetItem(((PyObject *)__pyx_v_self->class_ref), __pyx_v_ref, ((PyObject *)__pyx_v_alias)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":188 - * - * self.class_ref[ref] = alias - * self.classes[klass] = alias # <<<<<<<<<<<<<< - * - * alias.ref = ref - */ - if (PyDict_SetItem(((PyObject *)__pyx_v_self->classes), __pyx_v_klass, ((PyObject *)__pyx_v_alias)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":190 - * self.classes[klass] = alias - * - * alias.ref = ref # <<<<<<<<<<<<<< - * self.class_idx += 1 - * - */ - __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ref); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_alias->ref = __pyx_t_4; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":191 - * - * alias.ref = ref - * self.class_idx += 1 # <<<<<<<<<<<<<< - * - * return ref - */ - __pyx_v_self->class_idx = (__pyx_v_self->class_idx + 1); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":193 - * self.class_idx += 1 - * - * return ref # <<<<<<<<<<<<<< - * - * cpdef object getProxyForObject(self, object obj): - */ - __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ref); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.amf3.Context.addClass"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_ref); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":184 - * return self.classes.get(klass, None) - * - * cpdef Py_ssize_t addClass(self, ClassDefinition alias, klass) except? -1: # <<<<<<<<<<<<<< - * cdef object ref = self.class_idx - * - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_addClass(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_addClass(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *__pyx_v_alias = 0; - PyObject *__pyx_v_klass = 0; - PyObject *__pyx_r = NULL; - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__alias,&__pyx_n_s__klass,0}; - __Pyx_RefNannySetupContext("addClass"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - 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; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alias); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__klass); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("addClass", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "addClass") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_alias = ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)values[0]); - __pyx_v_klass = values[1]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_alias = ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)PyTuple_GET_ITEM(__pyx_args, 0)); - __pyx_v_klass = PyTuple_GET_ITEM(__pyx_args, 1); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("addClass", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.amf3.Context.addClass"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alias), __pyx_ptype_6cpyamf_4amf3_ClassDefinition, 1, "alias", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self)->__pyx_base.__pyx_vtab)->addClass(((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self), __pyx_v_alias, __pyx_v_klass, 1); if (unlikely(__pyx_t_1 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.amf3.Context.addClass"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":195 - * return ref - * - * cpdef object getProxyForObject(self, object obj): # <<<<<<<<<<<<<< - * """ - * Returns the proxied version of C{obj} as stored in the context, or - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_getProxyForObject(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/ -static PyObject *__pyx_f_6cpyamf_4amf3_7Context_getProxyForObject(struct __pyx_obj_6cpyamf_4amf3_Context *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) { - PyObject *__pyx_v_ret; - PyObject *__pyx_v_flex; - PyObject *__pyx_v_proxied; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("getProxyForObject"); - __pyx_v_flex = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_proxied = Py_None; __Pyx_INCREF(Py_None); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__getProxyForObject); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4amf3_7Context_getProxyForObject)) { - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_obj); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj); - __Pyx_GIVEREF(__pyx_v_obj); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":203 - * @since: 0.6 - * """ - * cdef PyObject *ret = PyDict_GetItem(self.proxied_objects, PyLong_FromVoidPtr(obj)) # <<<<<<<<<<<<<< - * - * if ret != NULL: - */ - __pyx_t_1 = PyLong_FromVoidPtr(((void *)__pyx_v_obj)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_ret = PyDict_GetItem(((PyObject *)__pyx_v_self->proxied_objects), __pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":205 - * cdef PyObject *ret = PyDict_GetItem(self.proxied_objects, PyLong_FromVoidPtr(obj)) - * - * if ret != NULL: # <<<<<<<<<<<<<< - * return ret - * - */ - __pyx_t_4 = (__pyx_v_ret != NULL); - if (__pyx_t_4) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":206 - * - * if ret != NULL: - * return ret # <<<<<<<<<<<<<< - * - * from pyamf import flex - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_ret)); - __pyx_r = ((PyObject *)__pyx_v_ret); - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":208 - * return ret - * - * from pyamf import flex # <<<<<<<<<<<<<< - * - * proxied = flex.proxy_object(obj) - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__flex)); - PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__flex)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__flex)); - __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s__pyamf), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__flex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_1); - __Pyx_DECREF(__pyx_v_flex); - __pyx_v_flex = __pyx_t_1; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":210 - * from pyamf import flex - * - * proxied = flex.proxy_object(obj) # <<<<<<<<<<<<<< - * - * self.addProxyObject(obj, proxied) - */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_flex, __pyx_n_s__proxy_object); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_obj); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_obj); - __Pyx_GIVEREF(__pyx_v_obj); - __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_v_proxied); - __pyx_v_proxied = __pyx_t_2; - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":212 - * proxied = flex.proxy_object(obj) - * - * self.addProxyObject(obj, proxied) # <<<<<<<<<<<<<< - * - * return proxied - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->__pyx_base.__pyx_vtab)->addProxyObject(__pyx_v_self, __pyx_v_obj, __pyx_v_proxied, 0); if (unlikely(__pyx_t_5 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":214 - * self.addProxyObject(obj, proxied) - * - * return proxied # <<<<<<<<<<<<<< - * - * cpdef object getObjectForProxy(self, object proxy): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_proxied); - __pyx_r = __pyx_v_proxied; - goto __pyx_L0; - - __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_3); - __Pyx_AddTraceback("cpyamf.amf3.Context.getProxyForObject"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_flex); - __Pyx_DECREF(__pyx_v_proxied); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":195 - * return ref - * - * cpdef object getProxyForObject(self, object obj): # <<<<<<<<<<<<<< - * """ - * Returns the proxied version of C{obj} as stored in the context, or - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_getProxyForObject(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/ -static char __pyx_doc_6cpyamf_4amf3_7Context_getProxyForObject[] = "\n Returns the proxied version of C{obj} as stored in the context, or\n creates a new proxied object and returns that.\n\n @see: L{pyamf.flex.proxy_object}\n @since: 0.6\n "; -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_getProxyForObject(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("getProxyForObject"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self)->__pyx_base.__pyx_vtab)->getProxyForObject(((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self), __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.amf3.Context.getProxyForObject"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":216 - * return proxied - * - * cpdef object getObjectForProxy(self, object proxy): # <<<<<<<<<<<<<< - * """ - * Returns the unproxied version of C{proxy} as stored in the context, or - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_getObjectForProxy(PyObject *__pyx_v_self, PyObject *__pyx_v_proxy); /*proto*/ -static PyObject *__pyx_f_6cpyamf_4amf3_7Context_getObjectForProxy(struct __pyx_obj_6cpyamf_4amf3_Context *__pyx_v_self, PyObject *__pyx_v_proxy, int __pyx_skip_dispatch) { - PyObject *__pyx_v_ret; - PyObject *__pyx_v_flex; - PyObject *__pyx_v_obj; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("getObjectForProxy"); - __pyx_v_flex = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_obj = Py_None; __Pyx_INCREF(Py_None); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__getObjectForProxy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4amf3_7Context_getObjectForProxy)) { - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_proxy); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_proxy); - __Pyx_GIVEREF(__pyx_v_proxy); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":224 - * @since: 0.6 - * """ - * cdef PyObject *ret = PyDict_GetItem(self.proxied_objects, PyLong_FromVoidPtr(proxy)) # <<<<<<<<<<<<<< - * - * if ret != NULL: - */ - __pyx_t_1 = PyLong_FromVoidPtr(((void *)__pyx_v_proxy)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_ret = PyDict_GetItem(((PyObject *)__pyx_v_self->proxied_objects), __pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":226 - * cdef PyObject *ret = PyDict_GetItem(self.proxied_objects, PyLong_FromVoidPtr(proxy)) - * - * if ret != NULL: # <<<<<<<<<<<<<< - * return ret - * - */ - __pyx_t_4 = (__pyx_v_ret != NULL); - if (__pyx_t_4) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":227 - * - * if ret != NULL: - * return ret # <<<<<<<<<<<<<< - * - * from pyamf import flex - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_ret)); - __pyx_r = ((PyObject *)__pyx_v_ret); - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":229 - * return ret - * - * from pyamf import flex # <<<<<<<<<<<<<< - * - * obj = flex.unproxy_object(proxy) - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__flex)); - PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__flex)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__flex)); - __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s__pyamf), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__flex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_1); - __Pyx_DECREF(__pyx_v_flex); - __pyx_v_flex = __pyx_t_1; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":231 - * from pyamf import flex - * - * obj = flex.unproxy_object(proxy) # <<<<<<<<<<<<<< - * - * self.addProxyObject(obj, proxy) - */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_flex, __pyx_n_s__unproxy_object); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_proxy); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_proxy); - __Pyx_GIVEREF(__pyx_v_proxy); - __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_v_obj); - __pyx_v_obj = __pyx_t_2; - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":233 - * obj = flex.unproxy_object(proxy) - * - * self.addProxyObject(obj, proxy) # <<<<<<<<<<<<<< - * - * return obj - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->__pyx_base.__pyx_vtab)->addProxyObject(__pyx_v_self, __pyx_v_obj, __pyx_v_proxy, 0); if (unlikely(__pyx_t_5 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":235 - * self.addProxyObject(obj, proxy) - * - * return obj # <<<<<<<<<<<<<< - * - * cpdef int addProxyObject(self, object obj, object proxied) except? -1: - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_obj); - __pyx_r = __pyx_v_obj; - goto __pyx_L0; - - __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_3); - __Pyx_AddTraceback("cpyamf.amf3.Context.getObjectForProxy"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_flex); - __Pyx_DECREF(__pyx_v_obj); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":216 - * return proxied - * - * cpdef object getObjectForProxy(self, object proxy): # <<<<<<<<<<<<<< - * """ - * Returns the unproxied version of C{proxy} as stored in the context, or - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_getObjectForProxy(PyObject *__pyx_v_self, PyObject *__pyx_v_proxy); /*proto*/ -static char __pyx_doc_6cpyamf_4amf3_7Context_getObjectForProxy[] = "\n Returns the unproxied version of C{proxy} as stored in the context, or\n unproxies the proxy and returns that 'raw' object.\n\n @see: L{pyamf.flex.unproxy_object}\n @since: 0.6\n "; -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_getObjectForProxy(PyObject *__pyx_v_self, PyObject *__pyx_v_proxy) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("getObjectForProxy"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self)->__pyx_base.__pyx_vtab)->getObjectForProxy(((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self), __pyx_v_proxy, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.amf3.Context.getObjectForProxy"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":237 - * return obj - * - * cpdef int addProxyObject(self, object obj, object proxied) except? -1: # <<<<<<<<<<<<<< - * """ - * Stores a reference to the unproxied and proxied versions of C{obj} for - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_addProxyObject(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_f_6cpyamf_4amf3_7Context_addProxyObject(struct __pyx_obj_6cpyamf_4amf3_Context *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_proxied, int __pyx_skip_dispatch) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("addProxyObject"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__addProxyObject); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4amf3_7Context_addProxyObject)) { - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_obj); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj); - __Pyx_GIVEREF(__pyx_v_obj); - __Pyx_INCREF(__pyx_v_proxied); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_proxied); - __Pyx_GIVEREF(__pyx_v_proxied); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":244 - * @since: 0.6 - * """ - * self.proxied_objects[PyLong_FromVoidPtr(obj)] = proxied # <<<<<<<<<<<<<< - * self.proxied_objects[PyLong_FromVoidPtr(proxied)] = obj - * - */ - __pyx_t_1 = PyLong_FromVoidPtr(((void *)__pyx_v_obj)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(((PyObject *)__pyx_v_self->proxied_objects), __pyx_t_1, __pyx_v_proxied) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":245 - * """ - * self.proxied_objects[PyLong_FromVoidPtr(obj)] = proxied - * self.proxied_objects[PyLong_FromVoidPtr(proxied)] = obj # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_1 = PyLong_FromVoidPtr(((void *)__pyx_v_proxied)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(((PyObject *)__pyx_v_self->proxied_objects), __pyx_t_1, __pyx_v_obj) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":247 - * self.proxied_objects[PyLong_FromVoidPtr(proxied)] = obj - * - * return 0 # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.amf3.Context.addProxyObject"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":237 - * return obj - * - * cpdef int addProxyObject(self, object obj, object proxied) except? -1: # <<<<<<<<<<<<<< - * """ - * Stores a reference to the unproxied and proxied versions of C{obj} for - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_addProxyObject(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6cpyamf_4amf3_7Context_addProxyObject[] = "\n Stores a reference to the unproxied and proxied versions of C{obj} for\n later retrieval.\n\n @since: 0.6\n "; -static PyObject *__pyx_pf_6cpyamf_4amf3_7Context_addProxyObject(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_obj = 0; - PyObject *__pyx_v_proxied = 0; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__obj,&__pyx_n_s__proxied,0}; - __Pyx_RefNannySetupContext("addProxyObject"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - 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; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__obj); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__proxied); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("addProxyObject", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "addProxyObject") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_obj = values[0]; - __pyx_v_proxied = values[1]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_obj = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_proxied = PyTuple_GET_ITEM(__pyx_args, 1); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("addProxyObject", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.amf3.Context.addProxyObject"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self)->__pyx_base.__pyx_vtab)->addProxyObject(((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_self), __pyx_v_obj, __pyx_v_proxied, 1); if (unlikely(__pyx_t_1 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __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; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.amf3.Context.addProxyObject"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":255 - * """ - * - * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<< - * context = kwargs.pop('context', None) - * - */ - -static int __pyx_pf_6cpyamf_4amf3_7Decoder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6cpyamf_4amf3_7Decoder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_args = 0; - PyObject *__pyx_v_kwargs = 0; - PyObject *__pyx_v_context; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("__init__"); - if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; - __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); - if (unlikely(!__pyx_v_kwargs)) return -1; - __Pyx_GOTREF(__pyx_v_kwargs); - __Pyx_INCREF(__pyx_args); - __pyx_v_args = __pyx_args; - __pyx_v_context = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":256 - * - * def __init__(self, *args, **kwargs): - * context = kwargs.pop('context', None) # <<<<<<<<<<<<<< - * - * if context is None: - */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_kwargs), __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_v_context); - __pyx_v_context = __pyx_t_2; - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":258 - * context = kwargs.pop('context', None) - * - * if context is None: # <<<<<<<<<<<<<< - * context = Context() - * - */ - __pyx_t_3 = (__pyx_v_context == Py_None); - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":259 - * - * if context is None: - * context = Context() # <<<<<<<<<<<<<< - * - * self.context = context - */ - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6cpyamf_4amf3_Context)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_context); - __pyx_v_context = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":261 - * context = Context() - * - * self.context = context # <<<<<<<<<<<<<< - * - * codec.Decoder.__init__(self, *args, **kwargs) - */ - if (!(likely(((__pyx_v_context) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_context, __pyx_ptype_6cpyamf_4amf3_Context))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_INCREF(__pyx_v_context); - __Pyx_GIVEREF(__pyx_v_context); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_4amf3_Decoder *)__pyx_v_self)->context); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6cpyamf_4amf3_Decoder *)__pyx_v_self)->context)); - ((struct __pyx_obj_6cpyamf_4amf3_Decoder *)__pyx_v_self)->context = ((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_context); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":263 - * self.context = context - * - * codec.Decoder.__init__(self, *args, **kwargs) # <<<<<<<<<<<<<< - * - * cdef object readInteger(self, int signed=1): - */ - __pyx_t_2 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_6cpyamf_5codec_Decoder)), __pyx_n_s____init__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_self); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - __pyx_t_4 = PySequence_Tuple(((PyObject *)__pyx_v_args)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_v_kwargs)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("cpyamf.amf3.Decoder.__init__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_args); - __Pyx_DECREF(__pyx_v_kwargs); - __Pyx_DECREF(__pyx_v_context); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":265 - * codec.Decoder.__init__(self, *args, **kwargs) - * - * cdef object readInteger(self, int signed=1): # <<<<<<<<<<<<<< - * """ - * Reads and returns an integer from the stream. - */ - -static PyObject *__pyx_f_6cpyamf_4amf3_7Decoder_readInteger(struct __pyx_obj_6cpyamf_4amf3_Decoder *__pyx_v_self, struct __pyx_opt_args_6cpyamf_4amf3_7Decoder_readInteger *__pyx_optional_args) { - int __pyx_v_signed = ((int)1); - int __pyx_v_r; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - struct __pyx_opt_args_6cpyamf_4amf3_decode_int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("readInteger"); - if (__pyx_optional_args) { - if (__pyx_optional_args->__pyx_n > 0) { - __pyx_v_signed = __pyx_optional_args->__pyx_signed; - } - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":274 - * format. - * """ - * cdef int r = decode_int(self.stream, signed) # <<<<<<<<<<<<<< - * - * return r - */ - __pyx_t_2.__pyx_n = 1; - __pyx_t_2.sign = __pyx_v_signed; - __pyx_t_1 = __pyx_f_6cpyamf_4amf3_decode_int(__pyx_v_self->__pyx_base.__pyx_base.stream, &__pyx_t_2); if (unlikely(__pyx_t_1 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_r = __pyx_t_1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":276 - * cdef int r = decode_int(self.stream, signed) - * - * return r # <<<<<<<<<<<<<< - * - * cdef object readNumber(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyInt_FromLong(__pyx_v_r); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.amf3.Decoder.readInteger"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":278 - * return r - * - * cdef object readNumber(self): # <<<<<<<<<<<<<< - * cdef double d - * - */ - -static PyObject *__pyx_f_6cpyamf_4amf3_7Decoder_readNumber(struct __pyx_obj_6cpyamf_4amf3_Decoder *__pyx_v_self) { - double __pyx_v_d; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("readNumber"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":281 - * cdef double d - * - * self.stream.read_double(&d) # <<<<<<<<<<<<<< - * - * return d - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->read_double(__pyx_v_self->__pyx_base.__pyx_base.stream, (&__pyx_v_d)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":283 - * self.stream.read_double(&d) - * - * return d # <<<<<<<<<<<<<< - * - * cdef object readBytes(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_d); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.amf3.Decoder.readNumber"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":285 - * return d - * - * cdef object readBytes(self): # <<<<<<<<<<<<<< - * cdef object s = self.readString() - * - */ - -static PyObject *__pyx_f_6cpyamf_4amf3_7Decoder_readBytes(struct __pyx_obj_6cpyamf_4amf3_Decoder *__pyx_v_self) { - PyObject *__pyx_v_s = 0; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("readBytes"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":286 - * - * cdef object readBytes(self): - * cdef object s = self.readString() # <<<<<<<<<<<<<< - * - * return self.context.getBytesForString(s) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readString(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_s = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":288 - * cdef object s = self.readString() - * - * return self.context.getBytesForString(s) # <<<<<<<<<<<<<< - * - * cpdef object readString(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getBytesForString(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_s, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.amf3.Decoder.readBytes"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_s); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":290 - * return self.context.getBytesForString(s) - * - * cpdef object readString(self): # <<<<<<<<<<<<<< - * """ - * Reads and returns a string from the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Decoder_readString(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_f_6cpyamf_4amf3_7Decoder_readString(struct __pyx_obj_6cpyamf_4amf3_Decoder *__pyx_v_self, int __pyx_skip_dispatch) { - Py_ssize_t __pyx_v_r; - PyObject *__pyx_v_s; - char *__pyx_v_buf; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("readString"); - __pyx_v_s = Py_None; __Pyx_INCREF(Py_None); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__readString); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4amf3_7Decoder_readString)) { - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __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; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":294 - * Reads and returns a string from the stream. - * """ - * cdef Py_ssize_t r = _read_ref(self.stream) # <<<<<<<<<<<<<< - * cdef object s - * - */ - __pyx_t_3 = __pyx_f_6cpyamf_4amf3__read_ref(__pyx_v_self->__pyx_base.__pyx_base.stream); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_r = __pyx_t_3; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":297 - * cdef object s - * - * if r & REFERENCE_BIT == 0: # <<<<<<<<<<<<<< - * # read a string reference - * return self.context.getString(r >> 1) - */ - __pyx_t_4 = ((__pyx_v_r & __pyx_v_6cpyamf_4amf3_REFERENCE_BIT) == 0); - if (__pyx_t_4) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":299 - * if r & REFERENCE_BIT == 0: - * # read a string reference - * return self.context.getString(r >> 1) # <<<<<<<<<<<<<< - * - * r >>= 1 - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->getString(__pyx_v_self->context, (__pyx_v_r >> 1), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":301 - * return self.context.getString(r >> 1) - * - * r >>= 1 # <<<<<<<<<<<<<< - * - * if r == 0: - */ - __pyx_v_r = (__pyx_v_r >> 1); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":303 - * r >>= 1 - * - * if r == 0: # <<<<<<<<<<<<<< - * return empty_unicode - * - */ - __pyx_t_4 = (__pyx_v_r == 0); - if (__pyx_t_4) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":304 - * - * if r == 0: - * return empty_unicode # <<<<<<<<<<<<<< - * - * cdef char *buf = NULL - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_6cpyamf_4amf3_empty_unicode)); - __pyx_r = ((PyObject *)__pyx_v_6cpyamf_4amf3_empty_unicode); - goto __pyx_L0; - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":306 - * return empty_unicode - * - * cdef char *buf = NULL # <<<<<<<<<<<<<< - * - * self.stream.read(&buf, r) - */ - __pyx_v_buf = NULL; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":308 - * cdef char *buf = NULL - * - * self.stream.read(&buf, r) # <<<<<<<<<<<<<< - * s = PyUnicode_DecodeUTF8(buf, r, 'strict') - * - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->read(__pyx_v_self->__pyx_base.__pyx_base.stream, (&__pyx_v_buf), __pyx_v_r); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":309 - * - * self.stream.read(&buf, r) - * s = PyUnicode_DecodeUTF8(buf, r, 'strict') # <<<<<<<<<<<<<< - * - * self.context.addString(s) - */ - __pyx_t_1 = PyUnicode_DecodeUTF8(__pyx_v_buf, __pyx_v_r, __pyx_k__strict); 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_DECREF(__pyx_v_s); - __pyx_v_s = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":311 - * s = PyUnicode_DecodeUTF8(buf, r, 'strict') - * - * self.context.addString(s) # <<<<<<<<<<<<<< - * - * return s - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->addString(__pyx_v_self->context, __pyx_v_s, 0); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":313 - * self.context.addString(s) - * - * return s # <<<<<<<<<<<<<< - * - * cdef object readDate(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_s); - __pyx_r = __pyx_v_s; - goto __pyx_L0; - - __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("cpyamf.amf3.Decoder.readString"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_s); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":290 - * return self.context.getBytesForString(s) - * - * cpdef object readString(self): # <<<<<<<<<<<<<< - * """ - * Reads and returns a string from the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Decoder_readString(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6cpyamf_4amf3_7Decoder_readString[] = "\n Reads and returns a string from the stream.\n "; -static PyObject *__pyx_pf_6cpyamf_4amf3_7Decoder_readString(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("readString"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)((struct __pyx_obj_6cpyamf_4amf3_Decoder *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.readString(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.amf3.Decoder.readString"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":315 - * return s - * - * cdef object readDate(self): # <<<<<<<<<<<<<< - * """ - * Read date from the stream. - */ - -static PyObject *__pyx_f_6cpyamf_4amf3_7Decoder_readDate(struct __pyx_obj_6cpyamf_4amf3_Decoder *__pyx_v_self) { - Py_ssize_t __pyx_v_ref; - double __pyx_v_ms; - PyObject *__pyx_v_result = 0; - PyObject *__pyx_r = NULL; - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - __Pyx_RefNannySetupContext("readDate"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":321 - * The timezone is ignored as the date is always in UTC. - * """ - * cdef Py_ssize_t ref = _read_ref(self.stream) # <<<<<<<<<<<<<< - * - * if ref & REFERENCE_BIT == 0: - */ - __pyx_t_1 = __pyx_f_6cpyamf_4amf3__read_ref(__pyx_v_self->__pyx_base.__pyx_base.stream); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ref = __pyx_t_1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":323 - * cdef Py_ssize_t ref = _read_ref(self.stream) - * - * if ref & REFERENCE_BIT == 0: # <<<<<<<<<<<<<< - * return self.context.getObject(ref >> 1) - * - */ - __pyx_t_2 = ((__pyx_v_ref & __pyx_v_6cpyamf_4amf3_REFERENCE_BIT) == 0); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":324 - * - * if ref & REFERENCE_BIT == 0: - * return self.context.getObject(ref >> 1) # <<<<<<<<<<<<<< - * - * cdef double ms - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), (__pyx_v_ref >> 1), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":328 - * cdef double ms - * - * self.stream.read_double(&ms) # <<<<<<<<<<<<<< - * - * cdef object result = util.get_datetime(ms / 1000.0) - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->read_double(__pyx_v_self->__pyx_base.__pyx_base.stream, (&__pyx_v_ms)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":330 - * self.stream.read_double(&ms) - * - * cdef object result = util.get_datetime(ms / 1000.0) # <<<<<<<<<<<<<< - * - * if self.timezone_offset is not None: - */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__util); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__get_datetime); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyFloat_FromDouble((__pyx_v_ms / 1000.0)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __pyx_v_result = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":332 - * cdef object result = util.get_datetime(ms / 1000.0) - * - * if self.timezone_offset is not None: # <<<<<<<<<<<<<< - * result += self.timezone_offset - * - */ - __pyx_t_2 = (__pyx_v_self->__pyx_base.__pyx_base.timezone_offset != Py_None); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":333 - * - * if self.timezone_offset is not None: - * result += self.timezone_offset # <<<<<<<<<<<<<< - * - * self.context.addObject(result) - */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_v_self->__pyx_base.__pyx_base.timezone_offset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_result); - __pyx_v_result = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":335 - * result += self.timezone_offset - * - * self.context.addObject(result) # <<<<<<<<<<<<<< - * - * return result - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_result, 0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":337 - * self.context.addObject(result) - * - * return result # <<<<<<<<<<<<<< - * - * cdef object readList(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_result); - __pyx_r = __pyx_v_result; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("cpyamf.amf3.Decoder.readDate"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_result); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":339 - * return result - * - * cdef object readList(self): # <<<<<<<<<<<<<< - * """ - * Reads an array from the stream. - */ - -static PyObject *__pyx_f_6cpyamf_4amf3_7Decoder_readList(struct __pyx_obj_6cpyamf_4amf3_Decoder *__pyx_v_self) { - int __pyx_v_size; - int __pyx_v_i; - PyObject *__pyx_v_result; - PyObject *__pyx_v_tmp; - PyObject *__pyx_v_key; - PyObject *__pyx_v_el; - PyObject *__pyx_r = NULL; - 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; - __Pyx_RefNannySetupContext("readList"); - __pyx_v_result = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_tmp = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_key = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_el = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":343 - * Reads an array from the stream. - * """ - * cdef int size = _read_ref(self.stream) # <<<<<<<<<<<<<< - * cdef int i - * cdef list result - */ - __pyx_t_1 = __pyx_f_6cpyamf_4amf3__read_ref(__pyx_v_self->__pyx_base.__pyx_base.stream); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_size = __pyx_t_1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":349 - * cdef unicode key - * - * if size & REFERENCE_BIT == 0: # <<<<<<<<<<<<<< - * return self.context.getObject(size >> 1) - * - */ - __pyx_t_2 = ((__pyx_v_size & __pyx_v_6cpyamf_4amf3_REFERENCE_BIT) == 0); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":350 - * - * if size & REFERENCE_BIT == 0: - * return self.context.getObject(size >> 1) # <<<<<<<<<<<<<< - * - * size >>= 1 - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), (__pyx_v_size >> 1), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":352 - * return self.context.getObject(size >> 1) - * - * size >>= 1 # <<<<<<<<<<<<<< - * key = self.readString() - * - */ - __pyx_v_size = (__pyx_v_size >> 1); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":353 - * - * size >>= 1 - * key = self.readString() # <<<<<<<<<<<<<< - * - * if PyUnicode_GetSize(key) == 0: - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readString(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected unicode, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_v_key)); - __pyx_v_key = ((PyObject *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":355 - * key = self.readString() - * - * if PyUnicode_GetSize(key) == 0: # <<<<<<<<<<<<<< - * # integer indexes only -> python list - * result = [] - */ - __pyx_t_1 = PyUnicode_GetSize(((PyObject *)__pyx_v_key)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = (__pyx_t_1 == 0); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":357 - * if PyUnicode_GetSize(key) == 0: - * # integer indexes only -> python list - * result = [] # <<<<<<<<<<<<<< - * self.context.addObject(result) - * - */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_v_result)); - __pyx_v_result = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":358 - * # integer indexes only -> python list - * result = [] - * self.context.addObject(result) # <<<<<<<<<<<<<< - * - * for i from 0 <= i < size: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), ((PyObject *)__pyx_v_result), 0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":360 - * self.context.addObject(result) - * - * for i from 0 <= i < size: # <<<<<<<<<<<<<< - * result.append(self.readElement()) - * - */ - __pyx_t_4 = __pyx_v_size; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":361 - * - * for i from 0 <= i < size: - * result.append(self.readElement()) # <<<<<<<<<<<<<< - * - * return result - */ - if (unlikely(__pyx_v_result == Py_None)) { - PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readElement(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":363 - * result.append(self.readElement()) - * - * return result # <<<<<<<<<<<<<< - * - * tmp = pyamf.MixedArray() - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_result)); - __pyx_r = ((PyObject *)__pyx_v_result); - goto __pyx_L0; - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":365 - * return result - * - * tmp = pyamf.MixedArray() # <<<<<<<<<<<<<< - * self.context.addObject(result) - * - */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__MixedArray); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_v_tmp); - __pyx_v_tmp = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":366 - * - * tmp = pyamf.MixedArray() - * self.context.addObject(result) # <<<<<<<<<<<<<< - * - * while PyUnicode_GetSize(key): - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), ((PyObject *)__pyx_v_result), 0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":368 - * self.context.addObject(result) - * - * while PyUnicode_GetSize(key): # <<<<<<<<<<<<<< - * tmp[key] = self.readElement() - * key = self.readString() - */ - while (1) { - __pyx_t_1 = PyUnicode_GetSize(((PyObject *)__pyx_v_key)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!__pyx_t_1) break; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":369 - * - * while PyUnicode_GetSize(key): - * tmp[key] = self.readElement() # <<<<<<<<<<<<<< - * key = self.readString() - * - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readElement(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyObject_SetItem(__pyx_v_tmp, ((PyObject *)__pyx_v_key), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":370 - * while PyUnicode_GetSize(key): - * tmp[key] = self.readElement() - * key = self.readString() # <<<<<<<<<<<<<< - * - * for i from 0 <= i < size: - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readString(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected unicode, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_v_key)); - __pyx_v_key = ((PyObject *)__pyx_t_3); - __pyx_t_3 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":372 - * key = self.readString() - * - * for i from 0 <= i < size: # <<<<<<<<<<<<<< - * el = self.readElement() - * tmp[i] = el - */ - __pyx_t_4 = __pyx_v_size; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":373 - * - * for i from 0 <= i < size: - * el = self.readElement() # <<<<<<<<<<<<<< - * tmp[i] = el - * - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readElement(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_el); - __pyx_v_el = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":374 - * for i from 0 <= i < size: - * el = self.readElement() - * tmp[i] = el # <<<<<<<<<<<<<< - * - * return tmp - */ - if (__Pyx_SetItemInt(__pyx_v_tmp, __pyx_v_i, __pyx_v_el, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":376 - * tmp[i] = el - * - * return tmp # <<<<<<<<<<<<<< - * - * cdef ClassDefinition _getClassDefinition(self, long ref): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_tmp); - __pyx_r = __pyx_v_tmp; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("cpyamf.amf3.Decoder.readList"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_result); - __Pyx_DECREF(__pyx_v_tmp); - __Pyx_DECREF(__pyx_v_key); - __Pyx_DECREF(__pyx_v_el); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":378 - * return tmp - * - * cdef ClassDefinition _getClassDefinition(self, long ref): # <<<<<<<<<<<<<< - * """ - * Reads class definition from the stream. - */ - -static struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *__pyx_f_6cpyamf_4amf3_7Decoder__getClassDefinition(struct __pyx_obj_6cpyamf_4amf3_Decoder *__pyx_v_self, long __pyx_v_ref) { - PyObject *__pyx_v_name = 0; - PyObject *__pyx_v_alias = 0; - Py_ssize_t __pyx_v_i; - struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *__pyx_v_class_def = 0; - struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - Py_ssize_t __pyx_t_9; - __Pyx_RefNannySetupContext("_getClassDefinition"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":382 - * Reads class definition from the stream. - * """ - * if ref & REFERENCE_BIT == 0: # <<<<<<<<<<<<<< - * return self.context.getClassByReference(ref >> 1) - * - */ - __pyx_t_1 = ((__pyx_v_ref & __pyx_v_6cpyamf_4amf3_REFERENCE_BIT) == 0); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":383 - * """ - * if ref & REFERENCE_BIT == 0: - * return self.context.getClassByReference(ref >> 1) # <<<<<<<<<<<<<< - * - * ref >>= 1 - */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->getClassByReference(__pyx_v_self->context, (__pyx_v_ref >> 1), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6cpyamf_4amf3_ClassDefinition))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_t_2); - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":385 - * return self.context.getClassByReference(ref >> 1) - * - * ref >>= 1 # <<<<<<<<<<<<<< - * - * cdef object name = self.readString() - */ - __pyx_v_ref = (__pyx_v_ref >> 1); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":387 - * ref >>= 1 - * - * cdef object name = self.readString() # <<<<<<<<<<<<<< - * cdef object alias = None - * cdef Py_ssize_t i - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readString(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self), 0); 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_v_name = __pyx_t_2; - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":388 - * - * cdef object name = self.readString() - * cdef object alias = None # <<<<<<<<<<<<<< - * cdef Py_ssize_t i - * - */ - __Pyx_INCREF(Py_None); - __pyx_v_alias = Py_None; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":391 - * cdef Py_ssize_t i - * - * if PyUnicode_GET_SIZE(name) == 0: # <<<<<<<<<<<<<< - * name = pyamf.ASObject - * - */ - __pyx_t_1 = (PyUnicode_GET_SIZE(__pyx_v_name) == 0); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":392 - * - * if PyUnicode_GET_SIZE(name) == 0: - * name = pyamf.ASObject # <<<<<<<<<<<<<< - * - * try: - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ASObject); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_v_name); - __pyx_v_name = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":394 - * name = pyamf.ASObject - * - * try: # <<<<<<<<<<<<<< - * alias = self.context.getClassAlias(name) - * except pyamf.UnknownClassAlias: - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - __Pyx_XGOTREF(__pyx_save_exc_type); - __Pyx_XGOTREF(__pyx_save_exc_value); - __Pyx_XGOTREF(__pyx_save_exc_tb); - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":395 - * - * try: - * alias = self.context.getClassAlias(name) # <<<<<<<<<<<<<< - * except pyamf.UnknownClassAlias: - * if self.strict: - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getClassAlias(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_name, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L5_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_alias); - __pyx_v_alias = __pyx_t_3; - __pyx_t_3 = 0; - } - __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L12_try_end; - __pyx_L5_error:; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":396 - * try: - * alias = self.context.getClassAlias(name) - * except pyamf.UnknownClassAlias: # <<<<<<<<<<<<<< - * if self.strict: - * raise - */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__UnknownClassAlias); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = PyErr_ExceptionMatches(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_4) { - __Pyx_AddTraceback("cpyamf.amf3.Decoder._getClassDefinition"); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GOTREF(__pyx_t_5); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":397 - * alias = self.context.getClassAlias(name) - * except pyamf.UnknownClassAlias: - * if self.strict: # <<<<<<<<<<<<<< - * raise - * - */ - if (__pyx_v_self->__pyx_base.__pyx_base.strict) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":398 - * except pyamf.UnknownClassAlias: - * if self.strict: - * raise # <<<<<<<<<<<<<< - * - * alias = pyamf.TypedObjectClassAlias(name) - */ - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_5); - __Pyx_ErrRestore(__pyx_t_2, __pyx_t_3, __pyx_t_5); - __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - goto __pyx_L15; - } - __pyx_L15:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":400 - * raise - * - * alias = pyamf.TypedObjectClassAlias(name) # <<<<<<<<<<<<<< - * - * cdef ClassDefinition class_def = ClassDefinition(alias) - */ - __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __Pyx_INCREF(__pyx_v_name); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_name); - __Pyx_GIVEREF(__pyx_v_name); - __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_v_alias); - __pyx_v_alias = __pyx_t_8; - __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L6_exception_handled; - } - __pyx_L7_except_error:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L6_exception_handled:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L12_try_end:; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":402 - * alias = pyamf.TypedObjectClassAlias(name) - * - * cdef ClassDefinition class_def = ClassDefinition(alias) # <<<<<<<<<<<<<< - * - * class_def.encoding = ref & 0x03 - */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_v_alias); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_alias); - __Pyx_GIVEREF(__pyx_v_alias); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6cpyamf_4amf3_ClassDefinition)), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_v_class_def = ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":404 - * cdef ClassDefinition class_def = ClassDefinition(alias) - * - * class_def.encoding = ref & 0x03 # <<<<<<<<<<<<<< - * class_def.attr_len = ref >> 2 - * class_def.static_properties = [] - */ - __pyx_v_class_def->encoding = (__pyx_v_ref & 0x03); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":405 - * - * class_def.encoding = ref & 0x03 - * class_def.attr_len = ref >> 2 # <<<<<<<<<<<<<< - * class_def.static_properties = [] - * - */ - __pyx_v_class_def->attr_len = (__pyx_v_ref >> 2); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":406 - * class_def.encoding = ref & 0x03 - * class_def.attr_len = ref >> 2 - * class_def.static_properties = [] # <<<<<<<<<<<<<< - * - * if class_def.attr_len > 0: - */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __Pyx_GOTREF(__pyx_v_class_def->static_properties); - __Pyx_DECREF(((PyObject *)__pyx_v_class_def->static_properties)); - __pyx_v_class_def->static_properties = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":408 - * class_def.static_properties = [] - * - * if class_def.attr_len > 0: # <<<<<<<<<<<<<< - * for i from 0 <= i < class_def.attr_len: - * class_def.static_properties.append(self.readString()) - */ - __pyx_t_1 = (__pyx_v_class_def->attr_len > 0); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":409 - * - * if class_def.attr_len > 0: - * for i from 0 <= i < class_def.attr_len: # <<<<<<<<<<<<<< - * class_def.static_properties.append(self.readString()) - * - */ - __pyx_t_9 = __pyx_v_class_def->attr_len; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":410 - * if class_def.attr_len > 0: - * for i from 0 <= i < class_def.attr_len: - * class_def.static_properties.append(self.readString()) # <<<<<<<<<<<<<< - * - * self.context.addClass(class_def, alias.klass) - */ - if (unlikely(__pyx_v_class_def->static_properties == Py_None)) { - PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readString(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyList_Append(__pyx_v_class_def->static_properties, __pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - goto __pyx_L16; - } - __pyx_L16:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":412 - * class_def.static_properties.append(self.readString()) - * - * self.context.addClass(class_def, alias.klass) # <<<<<<<<<<<<<< - * - * return class_def - */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s__klass); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->addClass(__pyx_v_self->context, __pyx_v_class_def, __pyx_t_3, 0); if (unlikely(__pyx_t_9 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":414 - * self.context.addClass(class_def, alias.klass) - * - * return class_def # <<<<<<<<<<<<<< - * - * @cython.boundscheck(False) - */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __Pyx_INCREF(((PyObject *)__pyx_v_class_def)); - __pyx_r = __pyx_v_class_def; - goto __pyx_L0; - - __pyx_r = ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)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_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("cpyamf.amf3.Decoder._getClassDefinition"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_name); - __Pyx_XDECREF(__pyx_v_alias); - __Pyx_XDECREF((PyObject *)__pyx_v_class_def); - __Pyx_XGIVEREF((PyObject *)__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":417 - * - * @cython.boundscheck(False) - * cdef int _readStatic(self, ClassDefinition class_def, dict obj) except -1: # <<<<<<<<<<<<<< - * cdef Py_ssize_t i - * - */ - -static int __pyx_f_6cpyamf_4amf3_7Decoder__readStatic(struct __pyx_obj_6cpyamf_4amf3_Decoder *__pyx_v_self, struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *__pyx_v_class_def, PyObject *__pyx_v_obj) { - Py_ssize_t __pyx_v_i; - int __pyx_r; - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("_readStatic"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":420 - * cdef Py_ssize_t i - * - * for 0 <= i < class_def.attr_len: # <<<<<<<<<<<<<< - * obj[class_def.static_properties[i]] = self.readElement() - * - */ - __pyx_t_1 = __pyx_v_class_def->attr_len; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":421 - * - * for 0 <= i < class_def.attr_len: - * obj[class_def.static_properties[i]] = self.readElement() # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readElement(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_class_def->static_properties), __pyx_v_i, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(((PyObject *)__pyx_v_obj), __pyx_t_3, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":423 - * obj[class_def.static_properties[i]] = self.readElement() - * - * return 0 # <<<<<<<<<<<<<< - * - * cdef int _readDynamic(self, ClassDefinition class_def, dict obj) except -1: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.amf3.Decoder._readStatic"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":425 - * return 0 - * - * cdef int _readDynamic(self, ClassDefinition class_def, dict obj) except -1: # <<<<<<<<<<<<<< - * cdef object attr - * cdef char *peek - */ - -static int __pyx_f_6cpyamf_4amf3_7Decoder__readDynamic(struct __pyx_obj_6cpyamf_4amf3_Decoder *__pyx_v_self, struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *__pyx_v_class_def, PyObject *__pyx_v_obj) { - PyObject *__pyx_v_attr; - char *__pyx_v_peek; - int __pyx_r; - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_seek __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("_readDynamic"); - __pyx_v_attr = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":430 - * - * - * while True: # <<<<<<<<<<<<<< - * self.stream.peek(&peek, 1) - * - */ - while (1) { - if (!1) break; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":431 - * - * while True: - * self.stream.peek(&peek, 1) # <<<<<<<<<<<<<< - * - * if peek[0] == REF_CHAR: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->peek(__pyx_v_self->__pyx_base.__pyx_base.stream, (&__pyx_v_peek), 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":433 - * self.stream.peek(&peek, 1) - * - * if peek[0] == REF_CHAR: # <<<<<<<<<<<<<< - * self.stream.seek(1, 1) - * - */ - __pyx_t_2 = ((__pyx_v_peek[0]) == __pyx_v_6cpyamf_4amf3_REF_CHAR); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":434 - * - * if peek[0] == REF_CHAR: - * self.stream.seek(1, 1) # <<<<<<<<<<<<<< - * - * break - */ - __pyx_t_4.__pyx_n = 1; - __pyx_t_4.mode = 1; - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->seek(__pyx_v_self->__pyx_base.__pyx_base.stream, 1, 0, &__pyx_t_4); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":436 - * self.stream.seek(1, 1) - * - * break # <<<<<<<<<<<<<< - * - * attr = self.readBytes() - */ - goto __pyx_L4_break; - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":438 - * break - * - * attr = self.readBytes() # <<<<<<<<<<<<<< - * - * PyDict_SetItem(obj, attr, self.readElement()) - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->readBytes(__pyx_v_self); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_v_attr); - __pyx_v_attr = __pyx_t_5; - __pyx_t_5 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":440 - * attr = self.readBytes() - * - * PyDict_SetItem(obj, attr, self.readElement()) # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readElement(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self), 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyDict_SetItem(((PyObject *)__pyx_v_obj), __pyx_v_attr, __pyx_t_5); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __pyx_L4_break:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":442 - * PyDict_SetItem(obj, attr, self.readElement()) - * - * return 0 # <<<<<<<<<<<<<< - * - * cdef object readObject(self): - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("cpyamf.amf3.Decoder._readDynamic"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_attr); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":444 - * return 0 - * - * cdef object readObject(self): # <<<<<<<<<<<<<< - * """ - * Reads an object from the stream. - */ - -static PyObject *__pyx_f_6cpyamf_4amf3_7Decoder_readObject(struct __pyx_obj_6cpyamf_4amf3_Decoder *__pyx_v_self) { - int __pyx_v_ref; - PyObject *__pyx_v_obj; - struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *__pyx_v_class_def = 0; - PyObject *__pyx_v_alias = 0; - PyObject *__pyx_v_obj_attrs = 0; - PyObject *__pyx_r = NULL; - Py_ssize_t __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_t_8; - PyObject *__pyx_t_9 = NULL; - __Pyx_RefNannySetupContext("readObject"); - __pyx_v_obj = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":452 - * @raise pyamf.DecodeError: Unknown object encoding. - * """ - * cdef int ref = _read_ref(self.stream) # <<<<<<<<<<<<<< - * cdef object obj - * - */ - __pyx_t_1 = __pyx_f_6cpyamf_4amf3__read_ref(__pyx_v_self->__pyx_base.__pyx_base.stream); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ref = __pyx_t_1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":455 - * cdef object obj - * - * if ref & REFERENCE_BIT == 0: # <<<<<<<<<<<<<< - * obj = self.context.getObject(ref >> 1) - * - */ - __pyx_t_2 = ((__pyx_v_ref & __pyx_v_6cpyamf_4amf3_REFERENCE_BIT) == 0); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":456 - * - * if ref & REFERENCE_BIT == 0: - * obj = self.context.getObject(ref >> 1) # <<<<<<<<<<<<<< - * - * if obj is None: - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), (__pyx_v_ref >> 1), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_obj); - __pyx_v_obj = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":458 - * obj = self.context.getObject(ref >> 1) - * - * if obj is None: # <<<<<<<<<<<<<< - * raise pyamf.ReferenceError('Unknown reference') - * - */ - __pyx_t_2 = (__pyx_v_obj == Py_None); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":459 - * - * if obj is None: - * raise pyamf.ReferenceError('Unknown reference') # <<<<<<<<<<<<<< - * - * if self.use_proxies == 1: - */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ReferenceError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __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); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":461 - * raise pyamf.ReferenceError('Unknown reference') - * - * if self.use_proxies == 1: # <<<<<<<<<<<<<< - * return self.readProxy(obj) - * - */ - __pyx_t_2 = (__pyx_v_self->use_proxies == 1); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":462 - * - * if self.use_proxies == 1: - * return self.readProxy(obj) # <<<<<<<<<<<<<< - * - * return obj - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->readProxy(__pyx_v_self, __pyx_v_obj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":464 - * return self.readProxy(obj) - * - * return obj # <<<<<<<<<<<<<< - * - * cdef ClassDefinition class_def = self._getClassDefinition(ref >> 1) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_obj); - __pyx_r = __pyx_v_obj; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":466 - * return obj - * - * cdef ClassDefinition class_def = self._getClassDefinition(ref >> 1) # <<<<<<<<<<<<<< - * cdef object alias = class_def.alias - * - */ - __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->_getClassDefinition(__pyx_v_self, (__pyx_v_ref >> 1))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_class_def = ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":467 - * - * cdef ClassDefinition class_def = self._getClassDefinition(ref >> 1) - * cdef object alias = class_def.alias # <<<<<<<<<<<<<< - * - * obj = alias.createInstance(codec=self) - */ - __Pyx_INCREF(__pyx_v_class_def->alias); - __pyx_v_alias = __pyx_v_class_def->alias; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":469 - * cdef object alias = class_def.alias - * - * obj = alias.createInstance(codec=self) # <<<<<<<<<<<<<< - * cdef dict obj_attrs = {} - * - */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s__createInstance); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__codec), ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_v_obj); - __pyx_v_obj = __pyx_t_5; - __pyx_t_5 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":470 - * - * obj = alias.createInstance(codec=self) - * cdef dict obj_attrs = {} # <<<<<<<<<<<<<< - * - * self.context.addObject(obj) - */ - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __pyx_v_obj_attrs = __pyx_t_5; - __pyx_t_5 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":472 - * cdef dict obj_attrs = {} - * - * self.context.addObject(obj) # <<<<<<<<<<<<<< - * - * if class_def.encoding == OBJECT_ENCODING_DYNAMIC: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_obj, 0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":474 - * self.context.addObject(obj) - * - * if class_def.encoding == OBJECT_ENCODING_DYNAMIC: # <<<<<<<<<<<<<< - * self._readStatic(class_def, obj_attrs) - * self._readDynamic(class_def, obj_attrs) - */ - __pyx_t_2 = (__pyx_v_class_def->encoding == __pyx_v_6cpyamf_4amf3_OBJECT_ENCODING_DYNAMIC); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":475 - * - * if class_def.encoding == OBJECT_ENCODING_DYNAMIC: - * self._readStatic(class_def, obj_attrs) # <<<<<<<<<<<<<< - * self._readDynamic(class_def, obj_attrs) - * elif class_def.encoding == OBJECT_ENCODING_STATIC: - */ - __pyx_t_6 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->_readStatic(__pyx_v_self, __pyx_v_class_def, __pyx_v_obj_attrs); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":476 - * if class_def.encoding == OBJECT_ENCODING_DYNAMIC: - * self._readStatic(class_def, obj_attrs) - * self._readDynamic(class_def, obj_attrs) # <<<<<<<<<<<<<< - * elif class_def.encoding == OBJECT_ENCODING_STATIC: - * self._readStatic(class_def, obj_attrs) - */ - __pyx_t_6 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->_readDynamic(__pyx_v_self, __pyx_v_class_def, __pyx_v_obj_attrs); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":477 - * self._readStatic(class_def, obj_attrs) - * self._readDynamic(class_def, obj_attrs) - * elif class_def.encoding == OBJECT_ENCODING_STATIC: # <<<<<<<<<<<<<< - * self._readStatic(class_def, obj_attrs) - * elif class_def.encoding == OBJECT_ENCODING_EXTERNAL or class_def.encoding == OBJECT_ENCODING_PROXY: - */ - __pyx_t_2 = (__pyx_v_class_def->encoding == __pyx_v_6cpyamf_4amf3_OBJECT_ENCODING_STATIC); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":478 - * self._readDynamic(class_def, obj_attrs) - * elif class_def.encoding == OBJECT_ENCODING_STATIC: - * self._readStatic(class_def, obj_attrs) # <<<<<<<<<<<<<< - * elif class_def.encoding == OBJECT_ENCODING_EXTERNAL or class_def.encoding == OBJECT_ENCODING_PROXY: - * obj.__readamf__(DataInput(self)) - */ - __pyx_t_6 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->_readStatic(__pyx_v_self, __pyx_v_class_def, __pyx_v_obj_attrs); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":479 - * elif class_def.encoding == OBJECT_ENCODING_STATIC: - * self._readStatic(class_def, obj_attrs) - * elif class_def.encoding == OBJECT_ENCODING_EXTERNAL or class_def.encoding == OBJECT_ENCODING_PROXY: # <<<<<<<<<<<<<< - * obj.__readamf__(DataInput(self)) - * - */ - __pyx_t_2 = (__pyx_v_class_def->encoding == __pyx_v_6cpyamf_4amf3_OBJECT_ENCODING_EXTERNAL); - if (!__pyx_t_2) { - __pyx_t_7 = (__pyx_v_class_def->encoding == __pyx_v_6cpyamf_4amf3_OBJECT_ENCODING_PROXY); - __pyx_t_8 = __pyx_t_7; - } else { - __pyx_t_8 = __pyx_t_2; - } - if (__pyx_t_8) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":480 - * self._readStatic(class_def, obj_attrs) - * elif class_def.encoding == OBJECT_ENCODING_EXTERNAL or class_def.encoding == OBJECT_ENCODING_PROXY: - * obj.__readamf__(DataInput(self)) # <<<<<<<<<<<<<< - * - * if self.use_proxies == 1: - */ - __pyx_t_5 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s____readamf__); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __pyx_t_3 = PyObject_Call(__pyx_v_6cpyamf_4amf3_DataInput, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":482 - * obj.__readamf__(DataInput(self)) - * - * if self.use_proxies == 1: # <<<<<<<<<<<<<< - * return self.readProxy(obj) - * - */ - __pyx_t_8 = (__pyx_v_self->use_proxies == 1); - if (__pyx_t_8) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":483 - * - * if self.use_proxies == 1: - * return self.readProxy(obj) # <<<<<<<<<<<<<< - * - * return obj - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->readProxy(__pyx_v_self, __pyx_v_obj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - goto __pyx_L7; - } - __pyx_L7:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":485 - * return self.readProxy(obj) - * - * return obj # <<<<<<<<<<<<<< - * else: - * raise pyamf.DecodeError("Unknown object encoding") - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_obj); - __pyx_r = __pyx_v_obj; - goto __pyx_L0; - goto __pyx_L6; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":487 - * return obj - * else: - * raise pyamf.DecodeError("Unknown object encoding") # <<<<<<<<<<<<<< - * - * alias.applyAttributes(obj, obj_attrs, codec=self) - */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__DecodeError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __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); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L6:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":489 - * raise pyamf.DecodeError("Unknown object encoding") - * - * alias.applyAttributes(obj, obj_attrs, codec=self) # <<<<<<<<<<<<<< - * - * if self.use_proxies: - */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s__applyAttributes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_v_obj); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_obj); - __Pyx_GIVEREF(__pyx_v_obj); - __Pyx_INCREF(((PyObject *)__pyx_v_obj_attrs)); - PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_obj_attrs)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_obj_attrs)); - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__codec), ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":491 - * alias.applyAttributes(obj, obj_attrs, codec=self) - * - * if self.use_proxies: # <<<<<<<<<<<<<< - * return self.readProxy(obj) - * - */ - if (__pyx_v_self->use_proxies) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":492 - * - * if self.use_proxies: - * return self.readProxy(obj) # <<<<<<<<<<<<<< - * - * return obj - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_9 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->readProxy(__pyx_v_self, __pyx_v_obj); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_r = __pyx_t_9; - __pyx_t_9 = 0; - goto __pyx_L0; - goto __pyx_L8; - } - __pyx_L8:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":494 - * return self.readProxy(obj) - * - * return obj # <<<<<<<<<<<<<< - * - * cdef object readXML(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_obj); - __pyx_r = __pyx_v_obj; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("cpyamf.amf3.Decoder.readObject"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_obj); - __Pyx_XDECREF((PyObject *)__pyx_v_class_def); - __Pyx_XDECREF(__pyx_v_alias); - __Pyx_XDECREF(__pyx_v_obj_attrs); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":496 - * return obj - * - * cdef object readXML(self): # <<<<<<<<<<<<<< - * """ - * Reads an XML object from the stream. - */ - -static PyObject *__pyx_f_6cpyamf_4amf3_7Decoder_readXML(struct __pyx_obj_6cpyamf_4amf3_Decoder *__pyx_v_self) { - int __pyx_v_ref; - char *__pyx_v_buf; - PyObject *__pyx_v_s; - PyObject *__pyx_v_x; - PyObject *__pyx_r = NULL; - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - __Pyx_RefNannySetupContext("readXML"); - __pyx_v_s = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_x = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":500 - * Reads an XML object from the stream. - * """ - * cdef int ref = _read_ref(self.stream) # <<<<<<<<<<<<<< - * - * if ref & REFERENCE_BIT == 0: - */ - __pyx_t_1 = __pyx_f_6cpyamf_4amf3__read_ref(__pyx_v_self->__pyx_base.__pyx_base.stream); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ref = __pyx_t_1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":502 - * cdef int ref = _read_ref(self.stream) - * - * if ref & REFERENCE_BIT == 0: # <<<<<<<<<<<<<< - * return self.context.getObject(ref >> 1) - * - */ - __pyx_t_2 = ((__pyx_v_ref & __pyx_v_6cpyamf_4amf3_REFERENCE_BIT) == 0); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":503 - * - * if ref & REFERENCE_BIT == 0: - * return self.context.getObject(ref >> 1) # <<<<<<<<<<<<<< - * - * ref >>= 1 - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), (__pyx_v_ref >> 1), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":505 - * return self.context.getObject(ref >> 1) - * - * ref >>= 1 # <<<<<<<<<<<<<< - * - * cdef char *buf = NULL - */ - __pyx_v_ref = (__pyx_v_ref >> 1); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":507 - * ref >>= 1 - * - * cdef char *buf = NULL # <<<<<<<<<<<<<< - * cdef object s - * - */ - __pyx_v_buf = NULL; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":510 - * cdef object s - * - * self.stream.read(&buf, ref) # <<<<<<<<<<<<<< - * s = PyString_FromStringAndSize(buf, ref) - * - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->read(__pyx_v_self->__pyx_base.__pyx_base.stream, (&__pyx_v_buf), __pyx_v_ref); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":511 - * - * self.stream.read(&buf, ref) - * s = PyString_FromStringAndSize(buf, ref) # <<<<<<<<<<<<<< - * - * x = xml.fromstring(s) - */ - __pyx_t_3 = PyString_FromStringAndSize(__pyx_v_buf, __pyx_v_ref); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_s); - __pyx_v_s = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":513 - * s = PyString_FromStringAndSize(buf, ref) - * - * x = xml.fromstring(s) # <<<<<<<<<<<<<< - * self.context.addObject(x) - * - */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__xml); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__fromstring); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_s); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_s); - __Pyx_GIVEREF(__pyx_v_s); - __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_v_x); - __pyx_v_x = __pyx_t_6; - __pyx_t_6 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":514 - * - * x = xml.fromstring(s) - * self.context.addObject(x) # <<<<<<<<<<<<<< - * - * return x - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_x, 0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":516 - * self.context.addObject(x) - * - * return x # <<<<<<<<<<<<<< - * - * cdef object readByteArray(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_x); - __pyx_r = __pyx_v_x; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("cpyamf.amf3.Decoder.readXML"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_s); - __Pyx_DECREF(__pyx_v_x); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":518 - * return x - * - * cdef object readByteArray(self): # <<<<<<<<<<<<<< - * """ - * Reads a string of data from the stream. - */ - -static PyObject *__pyx_f_6cpyamf_4amf3_7Decoder_readByteArray(struct __pyx_obj_6cpyamf_4amf3_Decoder *__pyx_v_self) { - int __pyx_v_ref; - char *__pyx_v_buf; - PyObject *__pyx_v_s; - PyObject *__pyx_v_compressed = 0; - PyObject *__pyx_r = NULL; - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - __Pyx_RefNannySetupContext("readByteArray"); - __pyx_v_s = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":527 - * @note: This is not supported in ActionScript 1.0 and 2.0. - * """ - * cdef int ref = _read_ref(self.stream) # <<<<<<<<<<<<<< - * - * if ref & REFERENCE_BIT == 0: - */ - __pyx_t_1 = __pyx_f_6cpyamf_4amf3__read_ref(__pyx_v_self->__pyx_base.__pyx_base.stream); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ref = __pyx_t_1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":529 - * cdef int ref = _read_ref(self.stream) - * - * if ref & REFERENCE_BIT == 0: # <<<<<<<<<<<<<< - * return self.context.getObject(ref >> 1) - * - */ - __pyx_t_2 = ((__pyx_v_ref & __pyx_v_6cpyamf_4amf3_REFERENCE_BIT) == 0); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":530 - * - * if ref & REFERENCE_BIT == 0: - * return self.context.getObject(ref >> 1) # <<<<<<<<<<<<<< - * - * cdef char *buf = NULL - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), (__pyx_v_ref >> 1), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":532 - * return self.context.getObject(ref >> 1) - * - * cdef char *buf = NULL # <<<<<<<<<<<<<< - * cdef object s - * cdef object compressed = None - */ - __pyx_v_buf = NULL; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":534 - * cdef char *buf = NULL - * cdef object s - * cdef object compressed = None # <<<<<<<<<<<<<< - * - * ref >>= 1 - */ - __Pyx_INCREF(Py_None); - __pyx_v_compressed = Py_None; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":536 - * cdef object compressed = None - * - * ref >>= 1 # <<<<<<<<<<<<<< - * - * self.stream.read(&buf, ref) - */ - __pyx_v_ref = (__pyx_v_ref >> 1); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":538 - * ref >>= 1 - * - * self.stream.read(&buf, ref) # <<<<<<<<<<<<<< - * s = PyString_FromStringAndSize(buf, ref) - * - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->read(__pyx_v_self->__pyx_base.__pyx_base.stream, (&__pyx_v_buf), __pyx_v_ref); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":539 - * - * self.stream.read(&buf, ref) - * s = PyString_FromStringAndSize(buf, ref) # <<<<<<<<<<<<<< - * - * if zlib: - */ - __pyx_t_3 = PyString_FromStringAndSize(__pyx_v_buf, __pyx_v_ref); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_s); - __pyx_v_s = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":541 - * s = PyString_FromStringAndSize(buf, ref) - * - * if zlib: # <<<<<<<<<<<<<< - * try: - * s = zlib.decompress(s) - */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__zlib); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":542 - * - * if zlib: - * try: # <<<<<<<<<<<<<< - * s = zlib.decompress(s) - * compressed = True - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - __Pyx_XGOTREF(__pyx_save_exc_type); - __Pyx_XGOTREF(__pyx_save_exc_value); - __Pyx_XGOTREF(__pyx_save_exc_tb); - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":543 - * if zlib: - * try: - * s = zlib.decompress(s) # <<<<<<<<<<<<<< - * compressed = True - * except zlib.error: - */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__zlib); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L5_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__decompress); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L5_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L5_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_s); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_s); - __Pyx_GIVEREF(__pyx_v_s); - __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L5_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_v_s); - __pyx_v_s = __pyx_t_6; - __pyx_t_6 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":544 - * try: - * s = zlib.decompress(s) - * compressed = True # <<<<<<<<<<<<<< - * except zlib.error: - * compressed = False - */ - __pyx_t_6 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L5_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_v_compressed); - __pyx_v_compressed = __pyx_t_6; - __pyx_t_6 = 0; - } - __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L12_try_end; - __pyx_L5_error:; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":545 - * s = zlib.decompress(s) - * compressed = True - * except zlib.error: # <<<<<<<<<<<<<< - * compressed = False - * - */ - __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__zlib); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_4 = PyErr_ExceptionMatches(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_4) { - __Pyx_AddTraceback("cpyamf.amf3.Decoder.readByteArray"); - if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_6, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_5); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":546 - * compressed = True - * except zlib.error: - * compressed = False # <<<<<<<<<<<<<< - * - * s = (ByteArrayType)(s) - */ - __pyx_t_7 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_v_compressed); - __pyx_v_compressed = __pyx_t_7; - __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L6_exception_handled; - } - __pyx_L7_except_error:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L6_exception_handled:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L12_try_end:; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":548 - * compressed = False - * - * s = (ByteArrayType)(s) # <<<<<<<<<<<<<< - * - * s.compressed = compressed - */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_v_s); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_s); - __Pyx_GIVEREF(__pyx_v_s); - __pyx_t_6 = PyObject_Call(__pyx_v_6cpyamf_4amf3_ByteArrayType, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_v_s); - __pyx_v_s = __pyx_t_6; - __pyx_t_6 = 0; - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":550 - * s = (ByteArrayType)(s) - * - * s.compressed = compressed # <<<<<<<<<<<<<< - * - * self.context.addObject(s) - */ - if (PyObject_SetAttr(__pyx_v_s, __pyx_n_s__compressed, __pyx_v_compressed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":552 - * s.compressed = compressed - * - * self.context.addObject(s) # <<<<<<<<<<<<<< - * - * return s - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_s, 0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":554 - * self.context.addObject(s) - * - * return s # <<<<<<<<<<<<<< - * - * cdef object readProxy(self, obj): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_s); - __pyx_r = __pyx_v_s; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("cpyamf.amf3.Decoder.readByteArray"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_s); - __Pyx_XDECREF(__pyx_v_compressed); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":556 - * return s - * - * cdef object readProxy(self, obj): # <<<<<<<<<<<<<< - * """ - * Decodes a proxied object from the stream. - */ - -static PyObject *__pyx_f_6cpyamf_4amf3_7Decoder_readProxy(struct __pyx_obj_6cpyamf_4amf3_Decoder *__pyx_v_self, PyObject *__pyx_v_obj) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("readProxy"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":562 - * @since: 0.6 - * """ - * return self.context.getObjectForProxy(obj) # <<<<<<<<<<<<<< - * - * cdef object readConcreteElement(self, char t): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->getObjectForProxy(__pyx_v_self->context, __pyx_v_obj, 0); 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_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.amf3.Decoder.readProxy"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":564 - * return self.context.getObjectForProxy(obj) - * - * cdef object readConcreteElement(self, char t): # <<<<<<<<<<<<<< - * if t == TYPE_STRING: - * return self.readString() - */ - -static PyObject *__pyx_f_6cpyamf_4amf3_7Decoder_readConcreteElement(struct __pyx_obj_6cpyamf_4amf3_Decoder *__pyx_v_self, char __pyx_v_t) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - struct __pyx_opt_args_6cpyamf_4amf3_7Decoder_readInteger __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("readConcreteElement"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":565 - * - * cdef object readConcreteElement(self, char t): - * if t == TYPE_STRING: # <<<<<<<<<<<<<< - * return self.readString() - * elif t == TYPE_OBJECT: - */ - __pyx_t_1 = (__pyx_v_t == __pyx_v_6cpyamf_4amf3_TYPE_STRING); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":566 - * cdef object readConcreteElement(self, char t): - * if t == TYPE_STRING: - * return self.readString() # <<<<<<<<<<<<<< - * elif t == TYPE_OBJECT: - * return self.readObject() - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readString(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":567 - * if t == TYPE_STRING: - * return self.readString() - * elif t == TYPE_OBJECT: # <<<<<<<<<<<<<< - * return self.readObject() - * elif t == TYPE_UNDEFINED: - */ - __pyx_t_1 = (__pyx_v_t == __pyx_v_6cpyamf_4amf3_TYPE_OBJECT); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":568 - * return self.readString() - * elif t == TYPE_OBJECT: - * return self.readObject() # <<<<<<<<<<<<<< - * elif t == TYPE_UNDEFINED: - * return undefined - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readObject(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":569 - * elif t == TYPE_OBJECT: - * return self.readObject() - * elif t == TYPE_UNDEFINED: # <<<<<<<<<<<<<< - * return undefined - * elif t == TYPE_NULL: - */ - __pyx_t_1 = (__pyx_v_t == __pyx_v_6cpyamf_4amf3_TYPE_UNDEFINED); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":570 - * return self.readObject() - * elif t == TYPE_UNDEFINED: - * return undefined # <<<<<<<<<<<<<< - * elif t == TYPE_NULL: - * return None - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_6cpyamf_4amf3_undefined); - __pyx_r = __pyx_v_6cpyamf_4amf3_undefined; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":571 - * elif t == TYPE_UNDEFINED: - * return undefined - * elif t == TYPE_NULL: # <<<<<<<<<<<<<< - * return None - * elif t == TYPE_BOOL_FALSE: - */ - __pyx_t_1 = (__pyx_v_t == __pyx_v_6cpyamf_4amf3_TYPE_NULL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":572 - * return undefined - * elif t == TYPE_NULL: - * return None # <<<<<<<<<<<<<< - * elif t == TYPE_BOOL_FALSE: - * return False - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":573 - * elif t == TYPE_NULL: - * return None - * elif t == TYPE_BOOL_FALSE: # <<<<<<<<<<<<<< - * return False - * elif t == TYPE_BOOL_TRUE: - */ - __pyx_t_1 = (__pyx_v_t == __pyx_v_6cpyamf_4amf3_TYPE_BOOL_FALSE); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":574 - * return None - * elif t == TYPE_BOOL_FALSE: - * return False # <<<<<<<<<<<<<< - * elif t == TYPE_BOOL_TRUE: - * return True - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyBool_FromLong(0); 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_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":575 - * elif t == TYPE_BOOL_FALSE: - * return False - * elif t == TYPE_BOOL_TRUE: # <<<<<<<<<<<<<< - * return True - * elif t == TYPE_INTEGER: - */ - __pyx_t_1 = (__pyx_v_t == __pyx_v_6cpyamf_4amf3_TYPE_BOOL_TRUE); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":576 - * return False - * elif t == TYPE_BOOL_TRUE: - * return True # <<<<<<<<<<<<<< - * elif t == TYPE_INTEGER: - * return self.readInteger(1) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":577 - * elif t == TYPE_BOOL_TRUE: - * return True - * elif t == TYPE_INTEGER: # <<<<<<<<<<<<<< - * return self.readInteger(1) - * elif t == TYPE_NUMBER: - */ - __pyx_t_1 = (__pyx_v_t == __pyx_v_6cpyamf_4amf3_TYPE_INTEGER); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":578 - * return True - * elif t == TYPE_INTEGER: - * return self.readInteger(1) # <<<<<<<<<<<<<< - * elif t == TYPE_NUMBER: - * return self.readNumber() - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3.__pyx_n = 1; - __pyx_t_3.__pyx_signed = 1; - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->readInteger(__pyx_v_self, &__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":579 - * elif t == TYPE_INTEGER: - * return self.readInteger(1) - * elif t == TYPE_NUMBER: # <<<<<<<<<<<<<< - * return self.readNumber() - * elif t == TYPE_ARRAY: - */ - __pyx_t_1 = (__pyx_v_t == __pyx_v_6cpyamf_4amf3_TYPE_NUMBER); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":580 - * return self.readInteger(1) - * elif t == TYPE_NUMBER: - * return self.readNumber() # <<<<<<<<<<<<<< - * elif t == TYPE_ARRAY: - * return self.readList() - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readNumber(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":581 - * elif t == TYPE_NUMBER: - * return self.readNumber() - * elif t == TYPE_ARRAY: # <<<<<<<<<<<<<< - * return self.readList() - * elif t == TYPE_DATE: - */ - __pyx_t_1 = (__pyx_v_t == __pyx_v_6cpyamf_4amf3_TYPE_ARRAY); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":582 - * return self.readNumber() - * elif t == TYPE_ARRAY: - * return self.readList() # <<<<<<<<<<<<<< - * elif t == TYPE_DATE: - * return self.readDate() - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readList(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":583 - * elif t == TYPE_ARRAY: - * return self.readList() - * elif t == TYPE_DATE: # <<<<<<<<<<<<<< - * return self.readDate() - * elif t == TYPE_BYTEARRAY: - */ - __pyx_t_1 = (__pyx_v_t == __pyx_v_6cpyamf_4amf3_TYPE_DATE); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":584 - * return self.readList() - * elif t == TYPE_DATE: - * return self.readDate() # <<<<<<<<<<<<<< - * elif t == TYPE_BYTEARRAY: - * return self.readByteArray() - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readDate(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":585 - * elif t == TYPE_DATE: - * return self.readDate() - * elif t == TYPE_BYTEARRAY: # <<<<<<<<<<<<<< - * return self.readByteArray() - * elif t == TYPE_XML: - */ - __pyx_t_1 = (__pyx_v_t == __pyx_v_6cpyamf_4amf3_TYPE_BYTEARRAY); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":586 - * return self.readDate() - * elif t == TYPE_BYTEARRAY: - * return self.readByteArray() # <<<<<<<<<<<<<< - * elif t == TYPE_XML: - * return self.readXML() - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->readByteArray(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":587 - * elif t == TYPE_BYTEARRAY: - * return self.readByteArray() - * elif t == TYPE_XML: # <<<<<<<<<<<<<< - * return self.readXML() - * elif t == TYPE_XMLSTRING: - */ - __pyx_t_1 = (__pyx_v_t == __pyx_v_6cpyamf_4amf3_TYPE_XML); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":588 - * return self.readByteArray() - * elif t == TYPE_XML: - * return self.readXML() # <<<<<<<<<<<<<< - * elif t == TYPE_XMLSTRING: - * return self.readXML() - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readXML(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":589 - * elif t == TYPE_XML: - * return self.readXML() - * elif t == TYPE_XMLSTRING: # <<<<<<<<<<<<<< - * return self.readXML() - * - */ - __pyx_t_1 = (__pyx_v_t == __pyx_v_6cpyamf_4amf3_TYPE_XMLSTRING); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":590 - * return self.readXML() - * elif t == TYPE_XMLSTRING: - * return self.readXML() # <<<<<<<<<<<<<< - * - * raise pyamf.DecodeError("Unsupported ActionScript type") - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.readXML(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":592 - * return self.readXML() - * - * raise pyamf.DecodeError("Unsupported ActionScript type") # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__DecodeError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __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); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __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("cpyamf.amf3.Decoder.readConcreteElement"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pxd":43 - * - * cdef class Decoder(codec.Decoder): - * cdef public bint use_proxies # <<<<<<<<<<<<<< - * cdef readonly Context context - * - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Decoder_11use_proxies___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4amf3_7Decoder_11use_proxies___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(((struct __pyx_obj_6cpyamf_4amf3_Decoder *)__pyx_v_self)->use_proxies); 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); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.amf3.Decoder.use_proxies.__get__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6cpyamf_4amf3_7Decoder_11use_proxies___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pf_6cpyamf_4amf3_7Decoder_11use_proxies___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("__set__"); - __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 = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_6cpyamf_4amf3_Decoder *)__pyx_v_self)->use_proxies = __pyx_t_1; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf3.Decoder.use_proxies.__set__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pxd":44 - * cdef class Decoder(codec.Decoder): - * cdef public bint use_proxies - * cdef readonly Context context # <<<<<<<<<<<<<< - * - * cdef ClassDefinition _getClassDefinition(self, long ref) - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Decoder_7context___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4amf3_7Decoder_7context___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6cpyamf_4amf3_Decoder *)__pyx_v_self)->context)); - __pyx_r = ((PyObject *)((struct __pyx_obj_6cpyamf_4amf3_Decoder *)__pyx_v_self)->context); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":600 - * """ - * - * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<< - * self.use_proxies = kwargs.pop('use_proxies', amf3.use_proxies_default) - * context = kwargs.pop('context', None) - */ - -static int __pyx_pf_6cpyamf_4amf3_7Encoder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6cpyamf_4amf3_7Encoder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_args = 0; - PyObject *__pyx_v_kwargs = 0; - PyObject *__pyx_v_context; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("__init__"); - if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; - __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); - if (unlikely(!__pyx_v_kwargs)) return -1; - __Pyx_GOTREF(__pyx_v_kwargs); - __Pyx_INCREF(__pyx_args); - __pyx_v_args = __pyx_args; - __pyx_v_context = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":601 - * - * def __init__(self, *args, **kwargs): - * self.use_proxies = kwargs.pop('use_proxies', amf3.use_proxies_default) # <<<<<<<<<<<<<< - * context = kwargs.pop('context', None) - * - */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_kwargs), __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__amf3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__use_proxies_default); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__use_proxies)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__use_proxies)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__use_proxies)); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - ((struct __pyx_obj_6cpyamf_4amf3_Encoder *)__pyx_v_self)->use_proxies = __pyx_t_4; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":602 - * def __init__(self, *args, **kwargs): - * self.use_proxies = kwargs.pop('use_proxies', amf3.use_proxies_default) - * context = kwargs.pop('context', None) # <<<<<<<<<<<<<< - * - * if context is None: - */ - __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_kwargs), __pyx_n_s__pop); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_v_context); - __pyx_v_context = __pyx_t_2; - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":604 - * context = kwargs.pop('context', None) - * - * if context is None: # <<<<<<<<<<<<<< - * context = Context() - * - */ - __pyx_t_4 = (__pyx_v_context == Py_None); - if (__pyx_t_4) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":605 - * - * if context is None: - * context = Context() # <<<<<<<<<<<<<< - * - * self.context = context - */ - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6cpyamf_4amf3_Context)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_context); - __pyx_v_context = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":607 - * context = Context() - * - * self.context = context # <<<<<<<<<<<<<< - * - * codec.Encoder.__init__(self, *args, **kwargs) - */ - if (!(likely(((__pyx_v_context) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_context, __pyx_ptype_6cpyamf_4amf3_Context))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_INCREF(__pyx_v_context); - __Pyx_GIVEREF(__pyx_v_context); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_4amf3_Encoder *)__pyx_v_self)->context); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6cpyamf_4amf3_Encoder *)__pyx_v_self)->context)); - ((struct __pyx_obj_6cpyamf_4amf3_Encoder *)__pyx_v_self)->context = ((struct __pyx_obj_6cpyamf_4amf3_Context *)__pyx_v_context); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":609 - * self.context = context - * - * codec.Encoder.__init__(self, *args, **kwargs) # <<<<<<<<<<<<<< - * - * cdef inline int writeNull(self, n) except -1: - */ - __pyx_t_2 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_6cpyamf_5codec_Encoder)), __pyx_n_s____init__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __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[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_self); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - __pyx_t_1 = PySequence_Tuple(((PyObject *)__pyx_v_args)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_v_kwargs)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("cpyamf.amf3.Encoder.__init__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_args); - __Pyx_DECREF(__pyx_v_kwargs); - __Pyx_DECREF(__pyx_v_context); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":611 - * codec.Encoder.__init__(self, *args, **kwargs) - * - * cdef inline int writeNull(self, n) except -1: # <<<<<<<<<<<<<< - * """ - * Writes a C{null} value to the stream. - */ - -static CYTHON_INLINE int __pyx_f_6cpyamf_4amf3_7Encoder_writeNull(struct __pyx_obj_6cpyamf_4amf3_Encoder *__pyx_v_self, PyObject *__pyx_v_n) { - int __pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("writeNull"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":615 - * Writes a C{null} value to the stream. - * """ - * return self.writeType(TYPE_NULL) # <<<<<<<<<<<<<< - * - * cdef inline int writeUndefined(self, n) except -1: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf3_TYPE_NULL); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_1; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf3.Encoder.writeNull"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":617 - * return self.writeType(TYPE_NULL) - * - * cdef inline int writeUndefined(self, n) except -1: # <<<<<<<<<<<<<< - * return self.writeType(TYPE_UNDEFINED) - * - */ - -static CYTHON_INLINE int __pyx_f_6cpyamf_4amf3_7Encoder_writeUndefined(struct __pyx_obj_6cpyamf_4amf3_Encoder *__pyx_v_self, PyObject *__pyx_v_n) { - int __pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("writeUndefined"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":618 - * - * cdef inline int writeUndefined(self, n) except -1: - * return self.writeType(TYPE_UNDEFINED) # <<<<<<<<<<<<<< - * - * cdef inline int writeBoolean(self, n) except -1: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf3_TYPE_UNDEFINED); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_1; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf3.Encoder.writeUndefined"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":620 - * return self.writeType(TYPE_UNDEFINED) - * - * cdef inline int writeBoolean(self, n) except -1: # <<<<<<<<<<<<<< - * if n is True: - * return self.writeType(TYPE_BOOL_TRUE) - */ - -static CYTHON_INLINE int __pyx_f_6cpyamf_4amf3_7Encoder_writeBoolean(struct __pyx_obj_6cpyamf_4amf3_Encoder *__pyx_v_self, PyObject *__pyx_v_n) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - __Pyx_RefNannySetupContext("writeBoolean"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":621 - * - * cdef inline int writeBoolean(self, n) except -1: - * if n is True: # <<<<<<<<<<<<<< - * return self.writeType(TYPE_BOOL_TRUE) - * - */ - __pyx_t_1 = __Pyx_PyBool_FromLong(1); 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_t_2 = (__pyx_v_n == __pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":622 - * cdef inline int writeBoolean(self, n) except -1: - * if n is True: - * return self.writeType(TYPE_BOOL_TRUE) # <<<<<<<<<<<<<< - * - * return self.writeType(TYPE_BOOL_FALSE) - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf3_TYPE_BOOL_TRUE); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_3; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":624 - * return self.writeType(TYPE_BOOL_TRUE) - * - * return self.writeType(TYPE_BOOL_FALSE) # <<<<<<<<<<<<<< - * - * cpdef int serialiseString(self, u) except -1: - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf3_TYPE_BOOL_FALSE); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_3; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.amf3.Encoder.writeBoolean"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":626 - * return self.writeType(TYPE_BOOL_FALSE) - * - * cpdef int serialiseString(self, u) except -1: # <<<<<<<<<<<<<< - * """ - * Serialises a unicode object. - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Encoder_serialiseString(PyObject *__pyx_v_self, PyObject *__pyx_v_u); /*proto*/ -static int __pyx_f_6cpyamf_4amf3_7Encoder_serialiseString(struct __pyx_obj_6cpyamf_4amf3_Encoder *__pyx_v_self, PyObject *__pyx_v_u, int __pyx_skip_dispatch) { - Py_ssize_t __pyx_v_l; - int __pyx_v_is_unicode; - PyObject *__pyx_v_r; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - Py_ssize_t __pyx_t_6; - int __pyx_t_7; - __Pyx_RefNannySetupContext("serialiseString"); - __Pyx_INCREF(__pyx_v_u); - __pyx_v_r = Py_None; __Pyx_INCREF(Py_None); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__serialiseString); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4amf3_7Encoder_serialiseString)) { - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_u); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_u); - __Pyx_GIVEREF(__pyx_v_u); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":631 - * """ - * cdef Py_ssize_t l - * cdef bint is_unicode = 0 # <<<<<<<<<<<<<< - * - * if PyUnicode_Check(u): - */ - __pyx_v_is_unicode = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":633 - * cdef bint is_unicode = 0 - * - * if PyUnicode_Check(u): # <<<<<<<<<<<<<< - * l = PyUnicode_GET_SIZE(u) - * is_unicode = 1 - */ - __pyx_t_5 = PyUnicode_Check(__pyx_v_u); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":634 - * - * if PyUnicode_Check(u): - * l = PyUnicode_GET_SIZE(u) # <<<<<<<<<<<<<< - * is_unicode = 1 - * elif PyString_Check(u): - */ - __pyx_v_l = PyUnicode_GET_SIZE(__pyx_v_u); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":635 - * if PyUnicode_Check(u): - * l = PyUnicode_GET_SIZE(u) - * is_unicode = 1 # <<<<<<<<<<<<<< - * elif PyString_Check(u): - * l = PyString_GET_SIZE(u) - */ - __pyx_v_is_unicode = 1; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":636 - * l = PyUnicode_GET_SIZE(u) - * is_unicode = 1 - * elif PyString_Check(u): # <<<<<<<<<<<<<< - * l = PyString_GET_SIZE(u) - * else: - */ - __pyx_t_5 = PyString_Check(__pyx_v_u); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":637 - * is_unicode = 1 - * elif PyString_Check(u): - * l = PyString_GET_SIZE(u) # <<<<<<<<<<<<<< - * else: - * raise TypeError('Expected str or unicode') - */ - __pyx_v_l = PyString_GET_SIZE(__pyx_v_u); - goto __pyx_L3; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":639 - * l = PyString_GET_SIZE(u) - * else: - * raise TypeError('Expected str or unicode') # <<<<<<<<<<<<<< - * - * if l == 0: - */ - __pyx_t_1 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":641 - * raise TypeError('Expected str or unicode') - * - * if l == 0: # <<<<<<<<<<<<<< - * # '' is a special case - * return self.stream.write(&REF_CHAR, 1) - */ - __pyx_t_5 = (__pyx_v_l == 0); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":643 - * if l == 0: - * # '' is a special case - * return self.stream.write(&REF_CHAR, 1) # <<<<<<<<<<<<<< - * - * r = self.context.getStringReference(u) - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write(__pyx_v_self->__pyx_base.__pyx_base.stream, (&__pyx_v_6cpyamf_4amf3_REF_CHAR), 1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":645 - * return self.stream.write(&REF_CHAR, 1) - * - * r = self.context.getStringReference(u) # <<<<<<<<<<<<<< - * - * if r != -1: - */ - __pyx_t_6 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->getStringReference(__pyx_v_self->context, __pyx_v_u, 0); if (unlikely(__pyx_t_6 == -2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_v_r); - __pyx_v_r = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":647 - * r = self.context.getStringReference(u) - * - * if r != -1: # <<<<<<<<<<<<<< - * # we have a reference - * return _encode_integer(self.stream, r << 1) - */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_r, __pyx_int_neg_1, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":649 - * if r != -1: - * # we have a reference - * return _encode_integer(self.stream, r << 1) # <<<<<<<<<<<<<< - * - * self.context.addString(u) - */ - __pyx_t_1 = PyNumber_Lshift(__pyx_v_r, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __pyx_f_6cpyamf_4amf3__encode_integer(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_t_4); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_7; - goto __pyx_L0; - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":651 - * return _encode_integer(self.stream, r << 1) - * - * self.context.addString(u) # <<<<<<<<<<<<<< - * - * if is_unicode: - */ - __pyx_t_6 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->addString(__pyx_v_self->context, __pyx_v_u, 0); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":653 - * self.context.addString(u) - * - * if is_unicode: # <<<<<<<<<<<<<< - * u = self.context.getBytesForString(u) - * l = PyString_GET_SIZE(u) - */ - if (__pyx_v_is_unicode) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":654 - * - * if is_unicode: - * u = self.context.getBytesForString(u) # <<<<<<<<<<<<<< - * l = PyString_GET_SIZE(u) - * - */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getBytesForString(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_u, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_v_u); - __pyx_v_u = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":655 - * if is_unicode: - * u = self.context.getBytesForString(u) - * l = PyString_GET_SIZE(u) # <<<<<<<<<<<<<< - * - * _encode_integer(self.stream, (l << 1) | REFERENCE_BIT) - */ - __pyx_v_l = PyString_GET_SIZE(__pyx_v_u); - goto __pyx_L6; - } - __pyx_L6:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":657 - * l = PyString_GET_SIZE(u) - * - * _encode_integer(self.stream, (l << 1) | REFERENCE_BIT) # <<<<<<<<<<<<<< - * - * return self.stream.write(PyString_AS_STRING(u), l) - */ - __pyx_t_7 = __pyx_f_6cpyamf_4amf3__encode_integer(__pyx_v_self->__pyx_base.__pyx_base.stream, ((__pyx_v_l << 1) | __pyx_v_6cpyamf_4amf3_REFERENCE_BIT)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":659 - * _encode_integer(self.stream, (l << 1) | REFERENCE_BIT) - * - * return self.stream.write(PyString_AS_STRING(u), l) # <<<<<<<<<<<<<< - * - * cdef int writeString(self, object s) except -1: - */ - __pyx_t_7 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write(__pyx_v_self->__pyx_base.__pyx_base.stream, PyString_AS_STRING(__pyx_v_u), __pyx_v_l); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_7; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.amf3.Encoder.serialiseString"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_r); - __Pyx_DECREF(__pyx_v_u); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":626 - * return self.writeType(TYPE_BOOL_FALSE) - * - * cpdef int serialiseString(self, u) except -1: # <<<<<<<<<<<<<< - * """ - * Serialises a unicode object. - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Encoder_serialiseString(PyObject *__pyx_v_self, PyObject *__pyx_v_u); /*proto*/ -static char __pyx_doc_6cpyamf_4amf3_7Encoder_serialiseString[] = "\n Serialises a unicode object.\n "; -static PyObject *__pyx_pf_6cpyamf_4amf3_7Encoder_serialiseString(PyObject *__pyx_v_self, PyObject *__pyx_v_u) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("serialiseString"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)((struct __pyx_obj_6cpyamf_4amf3_Encoder *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.serialiseString(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_u, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.amf3.Encoder.serialiseString"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":661 - * return self.stream.write(PyString_AS_STRING(u), l) - * - * cdef int writeString(self, object s) except -1: # <<<<<<<<<<<<<< - * self.writeType(TYPE_STRING) - * self.serialiseString(s) - */ - -static int __pyx_f_6cpyamf_4amf3_7Encoder_writeString(struct __pyx_obj_6cpyamf_4amf3_Encoder *__pyx_v_self, PyObject *__pyx_v_s) { - int __pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("writeString"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":662 - * - * cdef int writeString(self, object s) except -1: - * self.writeType(TYPE_STRING) # <<<<<<<<<<<<<< - * self.serialiseString(s) - * - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf3_TYPE_STRING); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":663 - * cdef int writeString(self, object s) except -1: - * self.writeType(TYPE_STRING) - * self.serialiseString(s) # <<<<<<<<<<<<<< - * - * cdef int writeBytes(self, object s) except -1: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.serialiseString(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_s, 0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf3.Encoder.writeString"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":665 - * self.serialiseString(s) - * - * cdef int writeBytes(self, object s) except -1: # <<<<<<<<<<<<<< - * self.writeType(TYPE_STRING) - * self.serialiseString(s) - */ - -static int __pyx_f_6cpyamf_4amf3_7Encoder_writeBytes(struct __pyx_obj_6cpyamf_4amf3_Encoder *__pyx_v_self, PyObject *__pyx_v_s) { - int __pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("writeBytes"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":666 - * - * cdef int writeBytes(self, object s) except -1: - * self.writeType(TYPE_STRING) # <<<<<<<<<<<<<< - * self.serialiseString(s) - * - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf3_TYPE_STRING); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":667 - * cdef int writeBytes(self, object s) except -1: - * self.writeType(TYPE_STRING) - * self.serialiseString(s) # <<<<<<<<<<<<<< - * - * cdef int writeInt(self, object n) except -1: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.serialiseString(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_s, 0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf3.Encoder.writeBytes"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":669 - * self.serialiseString(s) - * - * cdef int writeInt(self, object n) except -1: # <<<<<<<<<<<<<< - * cdef long x = PyInt_AS_LONG(n) - * - */ - -static int __pyx_f_6cpyamf_4amf3_7Encoder_writeInt(struct __pyx_obj_6cpyamf_4amf3_Encoder *__pyx_v_self, PyObject *__pyx_v_n) { - long __pyx_v_x; - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - double __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - __Pyx_RefNannySetupContext("writeInt"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":670 - * - * cdef int writeInt(self, object n) except -1: - * cdef long x = PyInt_AS_LONG(n) # <<<<<<<<<<<<<< - * - * if x < MIN_29B_INT or x > MAX_29B_INT: - */ - __pyx_v_x = PyInt_AS_LONG(__pyx_v_n); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":672 - * cdef long x = PyInt_AS_LONG(n) - * - * if x < MIN_29B_INT or x > MAX_29B_INT: # <<<<<<<<<<<<<< - * return self.writeNumber(float(n)) - * - */ - __pyx_t_1 = (__pyx_v_x < __pyx_v_6cpyamf_4amf3_MIN_29B_INT); - if (!__pyx_t_1) { - __pyx_t_2 = (__pyx_v_x > __pyx_v_6cpyamf_4amf3_MAX_29B_INT); - __pyx_t_3 = __pyx_t_2; - } else { - __pyx_t_3 = __pyx_t_1; - } - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":673 - * - * if x < MIN_29B_INT or x > MAX_29B_INT: - * return self.writeNumber(float(n)) # <<<<<<<<<<<<<< - * - * self.writeType(TYPE_INTEGER) - */ - __pyx_t_4 = __Pyx_PyObject_AsDouble(__pyx_v_n); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = PyFloat_FromDouble(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeNumber(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_r = __pyx_t_6; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":675 - * return self.writeNumber(float(n)) - * - * self.writeType(TYPE_INTEGER) # <<<<<<<<<<<<<< - * _encode_integer(self.stream, x) - * - */ - __pyx_t_6 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf3_TYPE_INTEGER); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":676 - * - * self.writeType(TYPE_INTEGER) - * _encode_integer(self.stream, x) # <<<<<<<<<<<<<< - * - * cdef int writeLong(self, object n) except -1: - */ - __pyx_t_6 = __pyx_f_6cpyamf_4amf3__encode_integer(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_v_x); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("cpyamf.amf3.Encoder.writeInt"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":678 - * _encode_integer(self.stream, x) - * - * cdef int writeLong(self, object n) except -1: # <<<<<<<<<<<<<< - * cdef long x - * - */ - -static int __pyx_f_6cpyamf_4amf3_7Encoder_writeLong(struct __pyx_obj_6cpyamf_4amf3_Encoder *__pyx_v_self, PyObject *__pyx_v_n) { - long __pyx_v_x; - int __pyx_r; - long __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - double __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - int __pyx_t_8; - int __pyx_t_9; - int __pyx_t_10; - __Pyx_RefNannySetupContext("writeLong"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":681 - * cdef long x - * - * try: # <<<<<<<<<<<<<< - * x = PyLong_AsLong(n) - * except: - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - __Pyx_XGOTREF(__pyx_save_exc_type); - __Pyx_XGOTREF(__pyx_save_exc_value); - __Pyx_XGOTREF(__pyx_save_exc_tb); - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":682 - * - * try: - * x = PyLong_AsLong(n) # <<<<<<<<<<<<<< - * except: - * return self.writeNumber(float(n)) - */ - __pyx_t_1 = PyLong_AsLong(__pyx_v_n); if (unlikely(__pyx_t_1 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_x = __pyx_t_1; - } - __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":683 - * try: - * x = PyLong_AsLong(n) - * except: # <<<<<<<<<<<<<< - * return self.writeNumber(float(n)) - * - */ - /*except:*/ { - __Pyx_AddTraceback("cpyamf.amf3.Encoder.writeLong"); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GOTREF(__pyx_t_4); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":684 - * x = PyLong_AsLong(n) - * except: - * return self.writeNumber(float(n)) # <<<<<<<<<<<<<< - * - * if x < MIN_29B_INT or x > MAX_29B_INT: - */ - __pyx_t_5 = __Pyx_PyObject_AsDouble(__pyx_v_n); if (unlikely(__pyx_t_5 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __pyx_t_6 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeNumber(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_r = __pyx_t_7; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L6_except_return; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L4_exception_handled; - } - __pyx_L5_except_error:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L6_except_return:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L0; - __pyx_L4_exception_handled:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L10_try_end:; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":686 - * return self.writeNumber(float(n)) - * - * if x < MIN_29B_INT or x > MAX_29B_INT: # <<<<<<<<<<<<<< - * return self.writeNumber(float(n)) - * - */ - __pyx_t_8 = (__pyx_v_x < __pyx_v_6cpyamf_4amf3_MIN_29B_INT); - if (!__pyx_t_8) { - __pyx_t_9 = (__pyx_v_x > __pyx_v_6cpyamf_4amf3_MAX_29B_INT); - __pyx_t_10 = __pyx_t_9; - } else { - __pyx_t_10 = __pyx_t_8; - } - if (__pyx_t_10) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":687 - * - * if x < MIN_29B_INT or x > MAX_29B_INT: - * return self.writeNumber(float(n)) # <<<<<<<<<<<<<< - * - * self.writeType(TYPE_INTEGER) - */ - __pyx_t_5 = __Pyx_PyObject_AsDouble(__pyx_v_n); if (unlikely(__pyx_t_5 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeNumber(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_t_4); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_r = __pyx_t_7; - goto __pyx_L0; - goto __pyx_L13; - } - __pyx_L13:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":689 - * return self.writeNumber(float(n)) - * - * self.writeType(TYPE_INTEGER) # <<<<<<<<<<<<<< - * _encode_integer(self.stream, x) - * - */ - __pyx_t_7 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf3_TYPE_INTEGER); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":690 - * - * self.writeType(TYPE_INTEGER) - * _encode_integer(self.stream, x) # <<<<<<<<<<<<<< - * - * cdef int writeNumber(self, object n) except -1: - */ - __pyx_t_7 = __pyx_f_6cpyamf_4amf3__encode_integer(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_v_x); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __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_6); - __Pyx_AddTraceback("cpyamf.amf3.Encoder.writeLong"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":692 - * _encode_integer(self.stream, x) - * - * cdef int writeNumber(self, object n) except -1: # <<<<<<<<<<<<<< - * cdef double x = PyFloat_AS_DOUBLE(n) - * - */ - -static int __pyx_f_6cpyamf_4amf3_7Encoder_writeNumber(struct __pyx_obj_6cpyamf_4amf3_Encoder *__pyx_v_self, PyObject *__pyx_v_n) { - double __pyx_v_x; - int __pyx_r; - double __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("writeNumber"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":693 - * - * cdef int writeNumber(self, object n) except -1: - * cdef double x = PyFloat_AS_DOUBLE(n) # <<<<<<<<<<<<<< - * - * self.writeType(TYPE_NUMBER) - */ - __pyx_t_1 = PyFloat_AS_DOUBLE(__pyx_v_n); if (unlikely(__pyx_t_1 == -1.0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_x = __pyx_t_1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":695 - * cdef double x = PyFloat_AS_DOUBLE(n) - * - * self.writeType(TYPE_NUMBER) # <<<<<<<<<<<<<< - * self.stream.write_double(x) - * - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf3_TYPE_NUMBER); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":696 - * - * self.writeType(TYPE_NUMBER) - * self.stream.write_double(x) # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write_double(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_v_x, 0); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":698 - * self.stream.write_double(x) - * - * return 0 # <<<<<<<<<<<<<< - * - * cpdef int writeList(self, object n, bint is_proxy=0) except -1: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf3.Encoder.writeNumber"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":700 - * return 0 - * - * cpdef int writeList(self, object n, bint is_proxy=0) except -1: # <<<<<<<<<<<<<< - * cdef Py_ssize_t ref = self.context.getObjectReference(n) - * cdef Py_ssize_t i - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Encoder_writeList(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_f_6cpyamf_4amf3_7Encoder_writeList(struct __pyx_obj_6cpyamf_4amf3_Encoder *__pyx_v_self, PyObject *__pyx_v_n, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_4amf3_7Encoder_writeList *__pyx_optional_args) { - int __pyx_v_is_proxy = ((int)0); - Py_ssize_t __pyx_v_ref; - Py_ssize_t __pyx_v_i; - PyObject *__pyx_v_x; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - Py_ssize_t __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; - __Pyx_RefNannySetupContext("writeList"); - if (__pyx_optional_args) { - if (__pyx_optional_args->__pyx_n > 0) { - __pyx_v_is_proxy = __pyx_optional_args->is_proxy; - } - } - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__writeList); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4amf3_7Encoder_writeList)) { - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_is_proxy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_n); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_n); - __Pyx_GIVEREF(__pyx_v_n); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":701 - * - * cpdef int writeList(self, object n, bint is_proxy=0) except -1: - * cdef Py_ssize_t ref = self.context.getObjectReference(n) # <<<<<<<<<<<<<< - * cdef Py_ssize_t i - * cdef PyObject *x - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getObjectReference(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_n, 0); if (unlikely(__pyx_t_5 == -2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ref = __pyx_t_5; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":705 - * cdef PyObject *x - * - * if self.use_proxies == 1 and not is_proxy: # <<<<<<<<<<<<<< - * # Encode lists as ArrayCollections - * return self.writeProxy(n) - */ - __pyx_t_6 = (__pyx_v_self->use_proxies == 1); - if (__pyx_t_6) { - __pyx_t_7 = (!__pyx_v_is_proxy); - __pyx_t_8 = __pyx_t_7; - } else { - __pyx_t_8 = __pyx_t_6; - } - if (__pyx_t_8) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":707 - * if self.use_proxies == 1 and not is_proxy: - * # Encode lists as ArrayCollections - * return self.writeProxy(n) # <<<<<<<<<<<<<< - * - * self.writeType(TYPE_ARRAY) - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->writeProxy(__pyx_v_self, __pyx_v_n); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":709 - * return self.writeProxy(n) - * - * self.writeType(TYPE_ARRAY) # <<<<<<<<<<<<<< - * - * if ref != -1: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf3_TYPE_ARRAY); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":711 - * self.writeType(TYPE_ARRAY) - * - * if ref != -1: # <<<<<<<<<<<<<< - * return _encode_integer(self.stream, ref << 1) - * - */ - __pyx_t_8 = (__pyx_v_ref != -1); - if (__pyx_t_8) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":712 - * - * if ref != -1: - * return _encode_integer(self.stream, ref << 1) # <<<<<<<<<<<<<< - * - * self.context.addObject(n) - */ - __pyx_t_4 = __pyx_f_6cpyamf_4amf3__encode_integer(__pyx_v_self->__pyx_base.__pyx_base.stream, (__pyx_v_ref << 1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":714 - * return _encode_integer(self.stream, ref << 1) - * - * self.context.addObject(n) # <<<<<<<<<<<<<< - * ref = PyList_GET_SIZE(n) - * - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_n, 0); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":715 - * - * self.context.addObject(n) - * ref = PyList_GET_SIZE(n) # <<<<<<<<<<<<<< - * - * _encode_integer(self.stream, (ref << 1) | REFERENCE_BIT) - */ - __pyx_v_ref = PyList_GET_SIZE(__pyx_v_n); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":717 - * ref = PyList_GET_SIZE(n) - * - * _encode_integer(self.stream, (ref << 1) | REFERENCE_BIT) # <<<<<<<<<<<<<< - * - * self.writeType('\x01') - */ - __pyx_t_4 = __pyx_f_6cpyamf_4amf3__encode_integer(__pyx_v_self->__pyx_base.__pyx_base.stream, ((__pyx_v_ref << 1) | __pyx_v_6cpyamf_4amf3_REFERENCE_BIT)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":719 - * _encode_integer(self.stream, (ref << 1) | REFERENCE_BIT) - * - * self.writeType('\x01') # <<<<<<<<<<<<<< - * - * for i from 0 <= i < ref: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), '\x01'); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":721 - * self.writeType('\x01') - * - * for i from 0 <= i < ref: # <<<<<<<<<<<<<< - * x = PyList_GET_ITEM(n, i) - * - */ - __pyx_t_5 = __pyx_v_ref; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":722 - * - * for i from 0 <= i < ref: - * x = PyList_GET_ITEM(n, i) # <<<<<<<<<<<<<< - * - * self.writeElement(x) - */ - __pyx_v_x = PyList_GET_ITEM(__pyx_v_n, __pyx_v_i); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":724 - * x = PyList_GET_ITEM(n, i) - * - * self.writeElement(x) # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeElement(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), ((PyObject *)__pyx_v_x), 0); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":726 - * self.writeElement(x) - * - * return 0 # <<<<<<<<<<<<<< - * - * cdef int writeTuple(self, object n) except -1: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.amf3.Encoder.writeList"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":700 - * return 0 - * - * cpdef int writeList(self, object n, bint is_proxy=0) except -1: # <<<<<<<<<<<<<< - * cdef Py_ssize_t ref = self.context.getObjectReference(n) - * cdef Py_ssize_t i - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Encoder_writeList(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4amf3_7Encoder_writeList(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_n = 0; - int __pyx_v_is_proxy; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeList __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__n,&__pyx_n_s__is_proxy,0}; - __Pyx_RefNannySetupContext("writeList"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - 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; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__n); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__is_proxy); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "writeList") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_n = values[0]; - if (values[1]) { - __pyx_v_is_proxy = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_is_proxy == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_is_proxy = ((int)0); - } - } else { - __pyx_v_is_proxy = ((int)0); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: __pyx_v_is_proxy = __Pyx_PyObject_IsTrue(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_is_proxy == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 1: __pyx_v_n = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("writeList", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.amf3.Encoder.writeList"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_2.__pyx_n = 1; - __pyx_t_2.is_proxy = __pyx_v_is_proxy; - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)((struct __pyx_obj_6cpyamf_4amf3_Encoder *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.writeList(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_n, 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.amf3.Encoder.writeList"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":728 - * return 0 - * - * cdef int writeTuple(self, object n) except -1: # <<<<<<<<<<<<<< - * cdef Py_ssize_t ref = self.context.getObjectReference(n) - * cdef Py_ssize_t i - */ - -static int __pyx_f_6cpyamf_4amf3_7Encoder_writeTuple(struct __pyx_obj_6cpyamf_4amf3_Encoder *__pyx_v_self, PyObject *__pyx_v_n) { - Py_ssize_t __pyx_v_ref; - Py_ssize_t __pyx_v_i; - PyObject *__pyx_v_x; - int __pyx_r; - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - __Pyx_RefNannySetupContext("writeTuple"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":729 - * - * cdef int writeTuple(self, object n) except -1: - * cdef Py_ssize_t ref = self.context.getObjectReference(n) # <<<<<<<<<<<<<< - * cdef Py_ssize_t i - * cdef PyObject *x - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getObjectReference(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_n, 0); if (unlikely(__pyx_t_1 == -2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ref = __pyx_t_1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":733 - * cdef PyObject *x - * - * self.writeType(TYPE_ARRAY) # <<<<<<<<<<<<<< - * - * if ref != -1: - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf3_TYPE_ARRAY); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":735 - * self.writeType(TYPE_ARRAY) - * - * if ref != -1: # <<<<<<<<<<<<<< - * return _encode_integer(self.stream, ref << 1) - * - */ - __pyx_t_3 = (__pyx_v_ref != -1); - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":736 - * - * if ref != -1: - * return _encode_integer(self.stream, ref << 1) # <<<<<<<<<<<<<< - * - * self.context.addObject(n) - */ - __pyx_t_2 = __pyx_f_6cpyamf_4amf3__encode_integer(__pyx_v_self->__pyx_base.__pyx_base.stream, (__pyx_v_ref << 1)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_2; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":738 - * return _encode_integer(self.stream, ref << 1) - * - * self.context.addObject(n) # <<<<<<<<<<<<<< - * - * ref = PyTuple_GET_SIZE(n) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_n, 0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":740 - * self.context.addObject(n) - * - * ref = PyTuple_GET_SIZE(n) # <<<<<<<<<<<<<< - * - * _encode_integer(self.stream, (ref << 1) | REFERENCE_BIT) - */ - __pyx_v_ref = PyTuple_GET_SIZE(__pyx_v_n); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":742 - * ref = PyTuple_GET_SIZE(n) - * - * _encode_integer(self.stream, (ref << 1) | REFERENCE_BIT) # <<<<<<<<<<<<<< - * self.writeType('\x01') - * - */ - __pyx_t_2 = __pyx_f_6cpyamf_4amf3__encode_integer(__pyx_v_self->__pyx_base.__pyx_base.stream, ((__pyx_v_ref << 1) | __pyx_v_6cpyamf_4amf3_REFERENCE_BIT)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":743 - * - * _encode_integer(self.stream, (ref << 1) | REFERENCE_BIT) - * self.writeType('\x01') # <<<<<<<<<<<<<< - * - * for i from 0 <= i < ref: - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), '\x01'); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":745 - * self.writeType('\x01') - * - * for i from 0 <= i < ref: # <<<<<<<<<<<<<< - * x = PyTuple_GET_ITEM(n, i) - * - */ - __pyx_t_1 = __pyx_v_ref; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":746 - * - * for i from 0 <= i < ref: - * x = PyTuple_GET_ITEM(n, i) # <<<<<<<<<<<<<< - * - * self.writeElement(x) - */ - __pyx_v_x = PyTuple_GET_ITEM(__pyx_v_n, __pyx_v_i); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":748 - * x = PyTuple_GET_ITEM(n, i) - * - * self.writeElement(x) # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeElement(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), ((PyObject *)__pyx_v_x), 0); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":750 - * self.writeElement(x) - * - * return 0 # <<<<<<<<<<<<<< - * - * cdef int writeDict(self, dict obj) except -1: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf3.Encoder.writeTuple"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":752 - * return 0 - * - * cdef int writeDict(self, dict obj) except -1: # <<<<<<<<<<<<<< - * cdef Py_ssize_t idx = 0 - * - */ - -static int __pyx_f_6cpyamf_4amf3_7Encoder_writeDict(struct __pyx_obj_6cpyamf_4amf3_Encoder *__pyx_v_self, PyObject *__pyx_v_obj) { - Py_ssize_t __pyx_v_idx; - PyObject *__pyx_v_ref; - int __pyx_v_class_ref; - struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *__pyx_v_definition = 0; - PyObject *__pyx_v_key; - PyObject *__pyx_v_value; - int __pyx_r; - int __pyx_t_1; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - void *__pyx_t_8; - void *__pyx_t_9; - int __pyx_t_10; - PyObject *__pyx_t_11 = NULL; - __Pyx_RefNannySetupContext("writeDict"); - __pyx_v_ref = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_key = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_value = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":753 - * - * cdef int writeDict(self, dict obj) except -1: - * cdef Py_ssize_t idx = 0 # <<<<<<<<<<<<<< - * - * if self.use_proxies: - */ - __pyx_v_idx = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":755 - * cdef Py_ssize_t idx = 0 - * - * if self.use_proxies: # <<<<<<<<<<<<<< - * return self.writeProxy(obj) - * - */ - if (__pyx_v_self->use_proxies) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":756 - * - * if self.use_proxies: - * return self.writeProxy(obj) # <<<<<<<<<<<<<< - * - * self.writeType(TYPE_OBJECT) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->writeProxy(__pyx_v_self, ((PyObject *)__pyx_v_obj)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_1; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":758 - * return self.writeProxy(obj) - * - * self.writeType(TYPE_OBJECT) # <<<<<<<<<<<<<< - * - * ref = self.context.getObjectReference(obj) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf3_TYPE_OBJECT); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":760 - * self.writeType(TYPE_OBJECT) - * - * ref = self.context.getObjectReference(obj) # <<<<<<<<<<<<<< - * - * if ref != -1: - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getObjectReference(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), ((PyObject *)__pyx_v_obj), 0); if (unlikely(__pyx_t_2 == -2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_ref); - __pyx_v_ref = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":762 - * ref = self.context.getObjectReference(obj) - * - * if ref != -1: # <<<<<<<<<<<<<< - * _encode_integer(self.stream, ref << 1) - * - */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_ref, __pyx_int_neg_1, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_4) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":763 - * - * if ref != -1: - * _encode_integer(self.stream, ref << 1) # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_3 = PyNumber_Lshift(__pyx_v_ref, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __pyx_f_6cpyamf_4amf3__encode_integer(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":765 - * _encode_integer(self.stream, ref << 1) - * - * return 0 # <<<<<<<<<<<<<< - * - * self.context.addObject(obj) - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":767 - * return 0 - * - * self.context.addObject(obj) # <<<<<<<<<<<<<< - * - * cdef bint class_ref = 0 - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), ((PyObject *)__pyx_v_obj), 0); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":769 - * self.context.addObject(obj) - * - * cdef bint class_ref = 0 # <<<<<<<<<<<<<< - * cdef ClassDefinition definition = self.context.getClass(dict) - * - */ - __pyx_v_class_ref = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":770 - * - * cdef bint class_ref = 0 - * cdef ClassDefinition definition = self.context.getClass(dict) # <<<<<<<<<<<<<< - * - * if not definition: - */ - __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->getClass(__pyx_v_self->context, ((PyObject *)((PyObject*)&PyDict_Type)), 0)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_definition = ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":772 - * cdef ClassDefinition definition = self.context.getClass(dict) - * - * if not definition: # <<<<<<<<<<<<<< - * definition = ClassDefinition(self.context.getClassAlias(dict)) - * self.context.addClass(definition, dict) - */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_definition)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = (!__pyx_t_4); - if (__pyx_t_6) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":773 - * - * if not definition: - * definition = ClassDefinition(self.context.getClassAlias(dict)) # <<<<<<<<<<<<<< - * self.context.addClass(definition, dict) - * else: - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getClassAlias(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), ((PyObject *)((PyObject*)&PyDict_Type)), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6cpyamf_4amf3_ClassDefinition)), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_definition)); - __pyx_v_definition = ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":774 - * if not definition: - * definition = ClassDefinition(self.context.getClassAlias(dict)) - * self.context.addClass(definition, dict) # <<<<<<<<<<<<<< - * else: - * class_ref = 1 - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->addClass(__pyx_v_self->context, __pyx_v_definition, ((PyObject *)((PyObject*)&PyDict_Type)), 0); if (unlikely(__pyx_t_2 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":776 - * self.context.addClass(definition, dict) - * else: - * class_ref = 1 # <<<<<<<<<<<<<< - * - * definition.writeReference(self.stream) - */ - __pyx_v_class_ref = 1; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":778 - * class_ref = 1 - * - * definition.writeReference(self.stream) # <<<<<<<<<<<<<< - * - * if class_ref == 0: - */ - ((struct __pyx_vtabstruct_6cpyamf_4amf3_ClassDefinition *)__pyx_v_definition->__pyx_vtab)->writeReference(__pyx_v_definition, __pyx_v_self->__pyx_base.__pyx_base.stream); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":780 - * definition.writeReference(self.stream) - * - * if class_ref == 0: # <<<<<<<<<<<<<< - * self.stream.write(&REF_CHAR, 1) - * - */ - __pyx_t_6 = (__pyx_v_class_ref == 0); - if (__pyx_t_6) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":781 - * - * if class_ref == 0: - * self.stream.write(&REF_CHAR, 1) # <<<<<<<<<<<<<< - * - * for key, value in obj.iteritems(): - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write(__pyx_v_self->__pyx_base.__pyx_base.stream, (&__pyx_v_6cpyamf_4amf3_REF_CHAR), 1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":783 - * self.stream.write(&REF_CHAR, 1) - * - * for key, value in obj.iteritems(): # <<<<<<<<<<<<<< - * if PyInt_Check(key) or PyLong_Check(key): - * key = str(key) - */ - __Pyx_INCREF(((PyObject *)__pyx_v_obj)); - __Pyx_XDECREF(__pyx_t_3); - __pyx_t_3 = ((PyObject *)__pyx_v_obj); - __pyx_t_2 = 0; - while (1) { - if (!PyDict_Next(__pyx_t_3, (&__pyx_t_2), ((PyObject **)(&__pyx_t_8)), ((PyObject **)(&__pyx_t_9)))) break; - __Pyx_INCREF(((PyObject *)__pyx_t_8)); - __Pyx_DECREF(__pyx_v_key); - __pyx_v_key = ((PyObject *)__pyx_t_8); - __Pyx_INCREF(((PyObject *)__pyx_t_9)); - __Pyx_DECREF(__pyx_v_value); - __pyx_v_value = ((PyObject *)__pyx_t_9); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":784 - * - * for key, value in obj.iteritems(): - * if PyInt_Check(key) or PyLong_Check(key): # <<<<<<<<<<<<<< - * key = str(key) - * - */ - __pyx_t_6 = PyInt_Check(__pyx_v_key); - if (!__pyx_t_6) { - __pyx_t_4 = PyLong_Check(__pyx_v_key); - __pyx_t_10 = __pyx_t_4; - } else { - __pyx_t_10 = __pyx_t_6; - } - if (__pyx_t_10) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":785 - * for key, value in obj.iteritems(): - * if PyInt_Check(key) or PyLong_Check(key): - * key = str(key) # <<<<<<<<<<<<<< - * - * self.serialiseString(key) - */ - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - __Pyx_INCREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_v_key); - __pyx_v_key = __pyx_t_11; - __pyx_t_11 = 0; - goto __pyx_L9; - } - __pyx_L9:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":787 - * key = str(key) - * - * self.serialiseString(key) # <<<<<<<<<<<<<< - * self.writeElement(value) - * - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.serialiseString(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_key, 0); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":788 - * - * self.serialiseString(key) - * self.writeElement(value) # <<<<<<<<<<<<<< - * - * return self.stream.write(&REF_CHAR, 1) - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeElement(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_value, 0); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":790 - * self.writeElement(value) - * - * return self.stream.write(&REF_CHAR, 1) # <<<<<<<<<<<<<< - * - * cdef int writeMixedArray(self, object n) except -1: - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write(__pyx_v_self->__pyx_base.__pyx_base.stream, (&__pyx_v_6cpyamf_4amf3_REF_CHAR), 1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_5; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_AddTraceback("cpyamf.amf3.Encoder.writeDict"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_ref); - __Pyx_XDECREF((PyObject *)__pyx_v_definition); - __Pyx_DECREF(__pyx_v_key); - __Pyx_DECREF(__pyx_v_value); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":792 - * return self.stream.write(&REF_CHAR, 1) - * - * cdef int writeMixedArray(self, object n) except -1: # <<<<<<<<<<<<<< - * # Design bug in AMF3 that cannot read/write empty key strings - * # http://www.docuverse.com/blog/donpark/2007/05/14/flash-9-amf3-bug - */ - -static int __pyx_f_6cpyamf_4amf3_7Encoder_writeMixedArray(struct __pyx_obj_6cpyamf_4amf3_Encoder *__pyx_v_self, PyObject *__pyx_v_n) { - PyObject *__pyx_v_ref; - PyObject *__pyx_v_keys; - PyObject *__pyx_v_int_keys; - PyObject *__pyx_v_str_keys; - PyObject *__pyx_v_x; - Py_ssize_t __pyx_v_l; - PyObject *__pyx_v_k; - int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - Py_ssize_t __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - __Pyx_RefNannySetupContext("writeMixedArray"); - __pyx_v_ref = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_keys = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_int_keys = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_str_keys = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_x = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_k = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":796 - * # http://www.docuverse.com/blog/donpark/2007/05/14/flash-9-amf3-bug - * # for more info - * if '' in n: # <<<<<<<<<<<<<< - * raise pyamf.EncodeError("dicts cannot contain empty string keys") - * - */ - __pyx_t_1 = ((PySequence_Contains(__pyx_v_n, ((PyObject *)__pyx_kp_s_13)))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":797 - * # for more info - * if '' in n: - * raise pyamf.EncodeError("dicts cannot contain empty string keys") # <<<<<<<<<<<<<< - * - * if self.use_proxies: - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__EncodeError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __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); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":799 - * raise pyamf.EncodeError("dicts cannot contain empty string keys") - * - * if self.use_proxies: # <<<<<<<<<<<<<< - * return self.writeProxy(n) - * - */ - if (__pyx_v_self->use_proxies) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":800 - * - * if self.use_proxies: - * return self.writeProxy(n) # <<<<<<<<<<<<<< - * - * self.writeType(TYPE_ARRAY) - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->writeProxy(__pyx_v_self, __pyx_v_n); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":802 - * return self.writeProxy(n) - * - * self.writeType(TYPE_ARRAY) # <<<<<<<<<<<<<< - * - * ref = self.context.getObjectReference(n) - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf3_TYPE_ARRAY); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":804 - * self.writeType(TYPE_ARRAY) - * - * ref = self.context.getObjectReference(n) # <<<<<<<<<<<<<< - * - * if ref != -1: - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getObjectReference(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_n, 0); if (unlikely(__pyx_t_5 == -2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_ref); - __pyx_v_ref = __pyx_t_2; - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":806 - * ref = self.context.getObjectReference(n) - * - * if ref != -1: # <<<<<<<<<<<<<< - * return _encode_integer(self.stream, ref << 1) - * - */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_ref, __pyx_int_neg_1, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":807 - * - * if ref != -1: - * return _encode_integer(self.stream, ref << 1) # <<<<<<<<<<<<<< - * - * self.context.addObject(n) - */ - __pyx_t_2 = PyNumber_Lshift(__pyx_v_ref, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __pyx_f_6cpyamf_4amf3__encode_integer(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_t_4); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_6; - goto __pyx_L0; - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":809 - * return _encode_integer(self.stream, ref << 1) - * - * self.context.addObject(n) # <<<<<<<<<<<<<< - * - * # The AMF3 spec demands that all str based indicies be listed first - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_n, 0); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":812 - * - * # The AMF3 spec demands that all str based indicies be listed first - * keys = n.keys() # <<<<<<<<<<<<<< - * int_keys = [] - * str_keys = [] - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_n, __pyx_n_s__keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_v_keys); - __pyx_v_keys = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":813 - * # The AMF3 spec demands that all str based indicies be listed first - * keys = n.keys() - * int_keys = [] # <<<<<<<<<<<<<< - * str_keys = [] - * - */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_v_int_keys)); - __pyx_v_int_keys = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":814 - * keys = n.keys() - * int_keys = [] - * str_keys = [] # <<<<<<<<<<<<<< - * - * for x in keys: - */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_v_str_keys)); - __pyx_v_str_keys = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":816 - * str_keys = [] - * - * for x in keys: # <<<<<<<<<<<<<< - * if isinstance(x, (int, long)): - * int_keys.append(x) - */ - if (PyList_CheckExact(__pyx_v_keys) || PyTuple_CheckExact(__pyx_v_keys)) { - __pyx_t_5 = 0; __pyx_t_3 = __pyx_v_keys; __Pyx_INCREF(__pyx_t_3); - } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_keys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - } - for (;;) { - if (likely(PyList_CheckExact(__pyx_t_3))) { - if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; - } else if (likely(PyTuple_CheckExact(__pyx_t_3))) { - if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; - } else { - __pyx_t_2 = PyIter_Next(__pyx_t_3); - if (!__pyx_t_2) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - __Pyx_GOTREF(__pyx_t_2); - } - __Pyx_DECREF(__pyx_v_x); - __pyx_v_x = __pyx_t_2; - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":817 - * - * for x in keys: - * if isinstance(x, (int, long)): # <<<<<<<<<<<<<< - * int_keys.append(x) - * elif isinstance(x, (str, unicode)): - */ - __Pyx_INCREF(__pyx_v_x); - __pyx_t_2 = __pyx_v_x; - __pyx_t_1 = PyInt_Check(__pyx_t_2); - if (!__pyx_t_1) { - __pyx_t_7 = PyLong_Check(__pyx_t_2); - __pyx_t_8 = __pyx_t_7; - } else { - __pyx_t_8 = __pyx_t_1; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_8) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":818 - * for x in keys: - * if isinstance(x, (int, long)): - * int_keys.append(x) # <<<<<<<<<<<<<< - * elif isinstance(x, (str, unicode)): - * str_keys.append(x) - */ - if (unlikely(__pyx_v_int_keys == Py_None)) { - PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_6 = PyList_Append(__pyx_v_int_keys, __pyx_v_x); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":819 - * if isinstance(x, (int, long)): - * int_keys.append(x) - * elif isinstance(x, (str, unicode)): # <<<<<<<<<<<<<< - * str_keys.append(x) - * else: - */ - __Pyx_INCREF(__pyx_v_x); - __pyx_t_2 = __pyx_v_x; - __pyx_t_8 = PyString_Check(__pyx_t_2); - if (!__pyx_t_8) { - __pyx_t_1 = PyUnicode_Check(__pyx_t_2); - __pyx_t_7 = __pyx_t_1; - } else { - __pyx_t_7 = __pyx_t_8; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_7) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":820 - * int_keys.append(x) - * elif isinstance(x, (str, unicode)): - * str_keys.append(x) # <<<<<<<<<<<<<< - * else: - * raise ValueError("Non int/str key value found in dict") - */ - if (unlikely(__pyx_v_str_keys == Py_None)) { - PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_6 = PyList_Append(__pyx_v_str_keys, __pyx_v_x); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":822 - * str_keys.append(x) - * else: - * raise ValueError("Non int/str key value found in dict") # <<<<<<<<<<<<<< - * - * # Make sure the integer keys are within range - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_17), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L8:; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":825 - * - * # Make sure the integer keys are within range - * l = len(int_keys) # <<<<<<<<<<<<<< - * - * for x in int_keys: - */ - if (unlikely(__pyx_v_int_keys == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_v_int_keys)); - __pyx_v_l = __pyx_t_5; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":827 - * l = len(int_keys) - * - * for x in int_keys: # <<<<<<<<<<<<<< - * if l < x <= 0: - * # treat as a string key - */ - if (likely(((PyObject *)__pyx_v_int_keys) != Py_None)) { - __pyx_t_5 = 0; __pyx_t_3 = ((PyObject *)__pyx_v_int_keys); __Pyx_INCREF(__pyx_t_3); - } else { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - for (;;) { - if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; - __Pyx_DECREF(__pyx_v_x); - __pyx_v_x = __pyx_t_2; - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":828 - * - * for x in int_keys: - * if l < x <= 0: # <<<<<<<<<<<<<< - * # treat as a string key - * str_keys.append(x) - */ - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_l); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = PyObject_RichCompare(__pyx_t_2, __pyx_v_x, Py_LT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_PyObject_IsTrue(__pyx_t_9)) { - __Pyx_DECREF(__pyx_t_9); - __pyx_t_9 = PyObject_RichCompare(__pyx_v_x, __pyx_int_0, Py_LE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (__pyx_t_7) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":830 - * if l < x <= 0: - * # treat as a string key - * str_keys.append(x) # <<<<<<<<<<<<<< - * del int_keys[int_keys.index(x)] - * - */ - if (unlikely(__pyx_v_str_keys == Py_None)) { - PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_6 = PyList_Append(__pyx_v_str_keys, __pyx_v_x); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":831 - * # treat as a string key - * str_keys.append(x) - * del int_keys[int_keys.index(x)] # <<<<<<<<<<<<<< - * - * int_keys.sort() - */ - __pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_v_int_keys), __pyx_n_s__index); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_x); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_x); - __Pyx_GIVEREF(__pyx_v_x); - __pyx_t_10 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - if (PyObject_DelItem(((PyObject *)__pyx_v_int_keys), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - goto __pyx_L11; - } - __pyx_L11:; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":833 - * del int_keys[int_keys.index(x)] - * - * int_keys.sort() # <<<<<<<<<<<<<< - * - * # If integer keys don't start at 0, they will be treated as strings - */ - if (unlikely(__pyx_v_int_keys == Py_None)) { - PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'sort'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_6 = PyList_Sort(((PyObject *)__pyx_v_int_keys)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":836 - * - * # If integer keys don't start at 0, they will be treated as strings - * if len(int_keys) > 0 and int_keys[0] != 0: # <<<<<<<<<<<<<< - * for x in int_keys: - * str_keys.append(str(x)) - */ - if (unlikely(__pyx_v_int_keys == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_v_int_keys)); - __pyx_t_7 = (__pyx_t_5 > 0); - if (__pyx_t_7) { - __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_int_keys), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_NE); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_1 = __pyx_t_8; - } else { - __pyx_t_1 = __pyx_t_7; - } - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":837 - * # If integer keys don't start at 0, they will be treated as strings - * if len(int_keys) > 0 and int_keys[0] != 0: - * for x in int_keys: # <<<<<<<<<<<<<< - * str_keys.append(str(x)) - * del int_keys[int_keys.index(x)] - */ - if (likely(((PyObject *)__pyx_v_int_keys) != Py_None)) { - __pyx_t_5 = 0; __pyx_t_10 = ((PyObject *)__pyx_v_int_keys); __Pyx_INCREF(__pyx_t_10); - } else { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - for (;;) { - if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_10)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; - __Pyx_DECREF(__pyx_v_x); - __pyx_v_x = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":838 - * if len(int_keys) > 0 and int_keys[0] != 0: - * for x in int_keys: - * str_keys.append(str(x)) # <<<<<<<<<<<<<< - * del int_keys[int_keys.index(x)] - * - */ - if (unlikely(__pyx_v_str_keys == Py_None)) { - PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_x); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x); - __Pyx_GIVEREF(__pyx_v_x); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_6 = PyList_Append(__pyx_v_str_keys, __pyx_t_2); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":839 - * for x in int_keys: - * str_keys.append(str(x)) - * del int_keys[int_keys.index(x)] # <<<<<<<<<<<<<< - * - * _encode_integer(self.stream, len(int_keys) << 1 | REFERENCE_BIT) - */ - __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_int_keys), __pyx_n_s__index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __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[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_x); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x); - __Pyx_GIVEREF(__pyx_v_x); - __pyx_t_9 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_DelItem(((PyObject *)__pyx_v_int_keys), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - goto __pyx_L12; - } - __pyx_L12:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":841 - * del int_keys[int_keys.index(x)] - * - * _encode_integer(self.stream, len(int_keys) << 1 | REFERENCE_BIT) # <<<<<<<<<<<<<< - * - * for x in str_keys: - */ - if (unlikely(__pyx_v_int_keys == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_v_int_keys)); - __pyx_t_6 = __pyx_f_6cpyamf_4amf3__encode_integer(__pyx_v_self->__pyx_base.__pyx_base.stream, ((__pyx_t_5 << 1) | __pyx_v_6cpyamf_4amf3_REFERENCE_BIT)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":843 - * _encode_integer(self.stream, len(int_keys) << 1 | REFERENCE_BIT) - * - * for x in str_keys: # <<<<<<<<<<<<<< - * self.serialiseString(x) - * self.writeElement(n[x]) - */ - if (likely(((PyObject *)__pyx_v_str_keys) != Py_None)) { - __pyx_t_5 = 0; __pyx_t_10 = ((PyObject *)__pyx_v_str_keys); __Pyx_INCREF(__pyx_t_10); - } else { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - for (;;) { - if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_10)) break; - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; - __Pyx_DECREF(__pyx_v_x); - __pyx_v_x = __pyx_t_9; - __pyx_t_9 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":844 - * - * for x in str_keys: - * self.serialiseString(x) # <<<<<<<<<<<<<< - * self.writeElement(n[x]) - * - */ - __pyx_t_6 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.serialiseString(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_x, 0); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":845 - * for x in str_keys: - * self.serialiseString(x) - * self.writeElement(n[x]) # <<<<<<<<<<<<<< - * - * self.stream.write_uchar(0x01) - */ - __pyx_t_9 = PyObject_GetItem(__pyx_v_n, __pyx_v_x); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeElement(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_t_9, 0); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":847 - * self.writeElement(n[x]) - * - * self.stream.write_uchar(0x01) # <<<<<<<<<<<<<< - * - * for k in int_keys: - */ - __pyx_t_6 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write_uchar(__pyx_v_self->__pyx_base.__pyx_base.stream, 0x01, 0); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":849 - * self.stream.write_uchar(0x01) - * - * for k in int_keys: # <<<<<<<<<<<<<< - * self.writeElement(n[k]) - * - */ - if (likely(((PyObject *)__pyx_v_int_keys) != Py_None)) { - __pyx_t_5 = 0; __pyx_t_10 = ((PyObject *)__pyx_v_int_keys); __Pyx_INCREF(__pyx_t_10); - } else { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - for (;;) { - if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_10)) break; - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; - __Pyx_DECREF(__pyx_v_k); - __pyx_v_k = __pyx_t_9; - __pyx_t_9 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":850 - * - * for k in int_keys: - * self.writeElement(n[k]) # <<<<<<<<<<<<<< - * - * cpdef int writeObject(self, object obj, bint is_proxy=0) except -1: - */ - __pyx_t_9 = PyObject_GetItem(__pyx_v_n, __pyx_v_k); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeElement(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_t_9, 0); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("cpyamf.amf3.Encoder.writeMixedArray"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_ref); - __Pyx_DECREF(__pyx_v_keys); - __Pyx_DECREF(__pyx_v_int_keys); - __Pyx_DECREF(__pyx_v_str_keys); - __Pyx_DECREF(__pyx_v_x); - __Pyx_DECREF(__pyx_v_k); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":852 - * self.writeElement(n[k]) - * - * cpdef int writeObject(self, object obj, bint is_proxy=0) except -1: # <<<<<<<<<<<<<< - * cdef Py_ssize_t ref - * cdef object kls - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Encoder_writeObject(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_f_6cpyamf_4amf3_7Encoder_writeObject(struct __pyx_obj_6cpyamf_4amf3_Encoder *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_4amf3_7Encoder_writeObject *__pyx_optional_args) { - int __pyx_v_is_proxy = ((int)0); - Py_ssize_t __pyx_v_ref; - PyObject *__pyx_v_kls; - struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *__pyx_v_definition; - PyObject *__pyx_v_alias = 0; - int __pyx_v_class_ref; - int __pyx_v_ret; - char *__pyx_v_buf; - PyObject *__pyx_v_key; - PyObject *__pyx_v_value; - PyObject *__pyx_v_attrs; - PyObject *__pyx_v_attr; - int __pyx_r; - 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; - Py_ssize_t __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("writeObject"); - if (__pyx_optional_args) { - if (__pyx_optional_args->__pyx_n > 0) { - __pyx_v_is_proxy = __pyx_optional_args->is_proxy; - } - } - __pyx_v_kls = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_definition = ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_attrs = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_attr = Py_None; __Pyx_INCREF(Py_None); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__writeObject); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4amf3_7Encoder_writeObject)) { - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_is_proxy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_obj); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_obj); - __Pyx_GIVEREF(__pyx_v_obj); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":856 - * cdef object kls - * cdef ClassDefinition definition - * cdef object alias = None # <<<<<<<<<<<<<< - * cdef int class_ref = 0 - * cdef int ret = 0 - */ - __Pyx_INCREF(Py_None); - __pyx_v_alias = Py_None; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":857 - * cdef ClassDefinition definition - * cdef object alias = None - * cdef int class_ref = 0 # <<<<<<<<<<<<<< - * cdef int ret = 0 - * cdef char *buf = NULL - */ - __pyx_v_class_ref = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":858 - * cdef object alias = None - * cdef int class_ref = 0 - * cdef int ret = 0 # <<<<<<<<<<<<<< - * cdef char *buf = NULL - * cdef PyObject *key - */ - __pyx_v_ret = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":859 - * cdef int class_ref = 0 - * cdef int ret = 0 - * cdef char *buf = NULL # <<<<<<<<<<<<<< - * cdef PyObject *key - * cdef PyObject *value - */ - __pyx_v_buf = NULL; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":864 - * cdef object attrs - * - * if self.use_proxies and not is_proxy: # <<<<<<<<<<<<<< - * return self.writeProxy(obj) - * - */ - if (__pyx_v_self->use_proxies) { - __pyx_t_5 = (!__pyx_v_is_proxy); - __pyx_t_6 = __pyx_t_5; - } else { - __pyx_t_6 = __pyx_v_self->use_proxies; - } - if (__pyx_t_6) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":865 - * - * if self.use_proxies and not is_proxy: - * return self.writeProxy(obj) # <<<<<<<<<<<<<< - * - * self.writeType(TYPE_OBJECT) - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->writeProxy(__pyx_v_self, __pyx_v_obj); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":867 - * return self.writeProxy(obj) - * - * self.writeType(TYPE_OBJECT) # <<<<<<<<<<<<<< - * - * ref = self.context.getObjectReference(obj) - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf3_TYPE_OBJECT); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":869 - * self.writeType(TYPE_OBJECT) - * - * ref = self.context.getObjectReference(obj) # <<<<<<<<<<<<<< - * - * if ref != -1: - */ - __pyx_t_7 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getObjectReference(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_obj, 0); if (unlikely(__pyx_t_7 == -2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ref = __pyx_t_7; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":871 - * ref = self.context.getObjectReference(obj) - * - * if ref != -1: # <<<<<<<<<<<<<< - * _encode_integer(self.stream, ref << 1) - * - */ - __pyx_t_6 = (__pyx_v_ref != -1); - if (__pyx_t_6) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":872 - * - * if ref != -1: - * _encode_integer(self.stream, ref << 1) # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_4 = __pyx_f_6cpyamf_4amf3__encode_integer(__pyx_v_self->__pyx_base.__pyx_base.stream, (__pyx_v_ref << 1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":874 - * _encode_integer(self.stream, ref << 1) - * - * return 0 # <<<<<<<<<<<<<< - * - * self.context.addObject(obj) - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":876 - * return 0 - * - * self.context.addObject(obj) # <<<<<<<<<<<<<< - * - * # object is not referenced, serialise it - */ - __pyx_t_7 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_obj, 0); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":879 - * - * # object is not referenced, serialise it - * kls = obj.__class__ # <<<<<<<<<<<<<< - * definition = self.context.getClass(kls) - * - */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s____class__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_v_kls); - __pyx_v_kls = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":880 - * # object is not referenced, serialise it - * kls = obj.__class__ - * definition = self.context.getClass(kls) # <<<<<<<<<<<<<< - * - * if definition: - */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->getClass(__pyx_v_self->context, __pyx_v_kls, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_v_definition)); - __pyx_v_definition = ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":882 - * definition = self.context.getClass(kls) - * - * if definition: # <<<<<<<<<<<<<< - * class_ref = 1 - * alias = definition.alias - */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_definition)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_6) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":883 - * - * if definition: - * class_ref = 1 # <<<<<<<<<<<<<< - * alias = definition.alias - * else: - */ - __pyx_v_class_ref = 1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":884 - * if definition: - * class_ref = 1 - * alias = definition.alias # <<<<<<<<<<<<<< - * else: - * alias = self.context.getClassAlias(kls) - */ - __Pyx_INCREF(__pyx_v_definition->alias); - __Pyx_DECREF(__pyx_v_alias); - __pyx_v_alias = __pyx_v_definition->alias; - goto __pyx_L5; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":886 - * alias = definition.alias - * else: - * alias = self.context.getClassAlias(kls) # <<<<<<<<<<<<<< - * definition = ClassDefinition(alias) - * - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getClassAlias(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_kls, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_v_alias); - __pyx_v_alias = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":887 - * else: - * alias = self.context.getClassAlias(kls) - * definition = ClassDefinition(alias) # <<<<<<<<<<<<<< - * - * self.context.addClass(definition, alias.klass) - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_alias); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_alias); - __Pyx_GIVEREF(__pyx_v_alias); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6cpyamf_4amf3_ClassDefinition)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_definition)); - __pyx_v_definition = ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":889 - * definition = ClassDefinition(alias) - * - * self.context.addClass(definition, alias.klass) # <<<<<<<<<<<<<< - * - * definition.writeReference(self.stream) - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s__klass); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->addClass(__pyx_v_self->context, __pyx_v_definition, __pyx_t_2, 0); if (unlikely(__pyx_t_7 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":891 - * self.context.addClass(definition, alias.klass) - * - * definition.writeReference(self.stream) # <<<<<<<<<<<<<< - * - * if class_ref == 0: - */ - ((struct __pyx_vtabstruct_6cpyamf_4amf3_ClassDefinition *)__pyx_v_definition->__pyx_vtab)->writeReference(__pyx_v_definition, __pyx_v_self->__pyx_base.__pyx_base.stream); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":893 - * definition.writeReference(self.stream) - * - * if class_ref == 0: # <<<<<<<<<<<<<< - * if alias.anonymous: - * self.stream.write(&REF_CHAR, 1) - */ - __pyx_t_6 = (__pyx_v_class_ref == 0); - if (__pyx_t_6) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":894 - * - * if class_ref == 0: - * if alias.anonymous: # <<<<<<<<<<<<<< - * self.stream.write(&REF_CHAR, 1) - * else: - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s__anonymous); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_6) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":895 - * if class_ref == 0: - * if alias.anonymous: - * self.stream.write(&REF_CHAR, 1) # <<<<<<<<<<<<<< - * else: - * self.serialiseString(alias.alias) - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write(__pyx_v_self->__pyx_base.__pyx_base.stream, (&__pyx_v_6cpyamf_4amf3_REF_CHAR), 1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":897 - * self.stream.write(&REF_CHAR, 1) - * else: - * self.serialiseString(alias.alias) # <<<<<<<<<<<<<< - * - * # work out what the final reference for the class will be. - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s__alias); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.serialiseString(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_t_2, 0); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_L7:; - goto __pyx_L6; - } - __pyx_L6:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":904 - * # again. - * - * if alias.external: # <<<<<<<<<<<<<< - * obj.__writeamf__(DataOutput(self)) - * - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s__external); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_6) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":905 - * - * if alias.external: - * obj.__writeamf__(DataOutput(self)) # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s____writeamf__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __pyx_t_3 = PyObject_Call(__pyx_v_6cpyamf_4amf3_DataOutput, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":907 - * obj.__writeamf__(DataOutput(self)) - * - * return 0 # <<<<<<<<<<<<<< - * - * attrs = alias.getEncodableAttributes(obj, codec=self) - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L8; - } - __pyx_L8:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":909 - * return 0 - * - * attrs = alias.getEncodableAttributes(obj, codec=self) # <<<<<<<<<<<<<< - * - * if PyDict_CheckExact(attrs) != 1: - */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s_18); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_obj); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_obj); - __Pyx_GIVEREF(__pyx_v_obj); - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__codec), ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_v_attrs); - __pyx_v_attrs = __pyx_t_8; - __pyx_t_8 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":911 - * attrs = alias.getEncodableAttributes(obj, codec=self) - * - * if PyDict_CheckExact(attrs) != 1: # <<<<<<<<<<<<<< - * raise TypeError('Expected dict for encodable attributes') - * - */ - __pyx_t_6 = (PyDict_CheckExact(__pyx_v_attrs) != 1); - if (__pyx_t_6) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":912 - * - * if PyDict_CheckExact(attrs) != 1: - * raise TypeError('Expected dict for encodable attributes') # <<<<<<<<<<<<<< - * - * if definition.attr_len > 0: - */ - __pyx_t_8 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_20), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L9; - } - __pyx_L9:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":914 - * raise TypeError('Expected dict for encodable attributes') - * - * if definition.attr_len > 0: # <<<<<<<<<<<<<< - * if class_ref == 0: - * for attr in definition.static_properties: - */ - __pyx_t_6 = (__pyx_v_definition->attr_len > 0); - if (__pyx_t_6) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":915 - * - * if definition.attr_len > 0: - * if class_ref == 0: # <<<<<<<<<<<<<< - * for attr in definition.static_properties: - * self.serialiseString(attr) - */ - __pyx_t_6 = (__pyx_v_class_ref == 0); - if (__pyx_t_6) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":916 - * if definition.attr_len > 0: - * if class_ref == 0: - * for attr in definition.static_properties: # <<<<<<<<<<<<<< - * self.serialiseString(attr) - * - */ - if (likely(((PyObject *)__pyx_v_definition->static_properties) != Py_None)) { - __pyx_t_7 = 0; __pyx_t_8 = ((PyObject *)__pyx_v_definition->static_properties); __Pyx_INCREF(__pyx_t_8); - } else { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - for (;;) { - if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_8)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; - __Pyx_DECREF(__pyx_v_attr); - __pyx_v_attr = __pyx_t_2; - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":917 - * if class_ref == 0: - * for attr in definition.static_properties: - * self.serialiseString(attr) # <<<<<<<<<<<<<< - * - * for attr in definition.static_properties: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.serialiseString(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_attr, 0); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L11; - } - __pyx_L11:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":919 - * self.serialiseString(attr) - * - * for attr in definition.static_properties: # <<<<<<<<<<<<<< - * value = PyDict_GetItem(attrs, attr) - * - */ - if (likely(((PyObject *)__pyx_v_definition->static_properties) != Py_None)) { - __pyx_t_7 = 0; __pyx_t_8 = ((PyObject *)__pyx_v_definition->static_properties); __Pyx_INCREF(__pyx_t_8); - } else { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - for (;;) { - if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_8)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; - __Pyx_DECREF(__pyx_v_attr); - __pyx_v_attr = __pyx_t_2; - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":920 - * - * for attr in definition.static_properties: - * value = PyDict_GetItem(attrs, attr) # <<<<<<<<<<<<<< - * - * if value == NULL: - */ - __pyx_v_value = PyDict_GetItem(__pyx_v_attrs, __pyx_v_attr); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":922 - * value = PyDict_GetItem(attrs, attr) - * - * if value == NULL: # <<<<<<<<<<<<<< - * raise KeyError - * - */ - __pyx_t_6 = (__pyx_v_value == NULL); - if (__pyx_t_6) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":923 - * - * if value == NULL: - * raise KeyError # <<<<<<<<<<<<<< - * - * if PyDict_DelItem(attrs, attr) == -1: - */ - __Pyx_Raise(__pyx_builtin_KeyError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L16; - } - __pyx_L16:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":925 - * raise KeyError - * - * if PyDict_DelItem(attrs, attr) == -1: # <<<<<<<<<<<<<< - * return -1 - * - */ - __pyx_t_4 = PyDict_DelItem(__pyx_v_attrs, __pyx_v_attr); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = (__pyx_t_4 == -1); - if (__pyx_t_6) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":926 - * - * if PyDict_DelItem(attrs, attr) == -1: - * return -1 # <<<<<<<<<<<<<< - * - * self.writeElement(value) - */ - __pyx_r = -1; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L0; - goto __pyx_L17; - } - __pyx_L17:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":928 - * return -1 - * - * self.writeElement(value) # <<<<<<<<<<<<<< - * - * if definition.encoding == OBJECT_ENCODING_STATIC: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeElement(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), ((PyObject *)__pyx_v_value), 0); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":930 - * self.writeElement(value) - * - * if definition.encoding == OBJECT_ENCODING_STATIC: # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_t_6 = (__pyx_v_definition->encoding == __pyx_v_6cpyamf_4amf3_OBJECT_ENCODING_STATIC); - if (__pyx_t_6) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":931 - * - * if definition.encoding == OBJECT_ENCODING_STATIC: - * return 0 # <<<<<<<<<<<<<< - * - * if definition.encoding == OBJECT_ENCODING_DYNAMIC: - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L18; - } - __pyx_L18:; - goto __pyx_L10; - } - __pyx_L10:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":933 - * return 0 - * - * if definition.encoding == OBJECT_ENCODING_DYNAMIC: # <<<<<<<<<<<<<< - * ref = 0 - * key = NULL - */ - __pyx_t_6 = (__pyx_v_definition->encoding == __pyx_v_6cpyamf_4amf3_OBJECT_ENCODING_DYNAMIC); - if (__pyx_t_6) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":934 - * - * if definition.encoding == OBJECT_ENCODING_DYNAMIC: - * ref = 0 # <<<<<<<<<<<<<< - * key = NULL - * value = NULL - */ - __pyx_v_ref = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":935 - * if definition.encoding == OBJECT_ENCODING_DYNAMIC: - * ref = 0 - * key = NULL # <<<<<<<<<<<<<< - * value = NULL - * - */ - __pyx_v_key = NULL; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":936 - * ref = 0 - * key = NULL - * value = NULL # <<<<<<<<<<<<<< - * - * while PyDict_Next(attrs, &ref, &key, &value): - */ - __pyx_v_value = NULL; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":938 - * value = NULL - * - * while PyDict_Next(attrs, &ref, &key, &value): # <<<<<<<<<<<<<< - * self.serialiseString(key) - * self.writeElement(value) - */ - while (1) { - __pyx_t_4 = PyDict_Next(__pyx_v_attrs, (&__pyx_v_ref), (&__pyx_v_key), (&__pyx_v_value)); - if (!__pyx_t_4) break; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":939 - * - * while PyDict_Next(attrs, &ref, &key, &value): - * self.serialiseString(key) # <<<<<<<<<<<<<< - * self.writeElement(value) - * - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.serialiseString(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), ((PyObject *)__pyx_v_key), 0); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":940 - * while PyDict_Next(attrs, &ref, &key, &value): - * self.serialiseString(key) - * self.writeElement(value) # <<<<<<<<<<<<<< - * - * self.stream.write(&REF_CHAR, 1) - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeElement(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), ((PyObject *)__pyx_v_value), 0); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":942 - * self.writeElement(value) - * - * self.stream.write(&REF_CHAR, 1) # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write(__pyx_v_self->__pyx_base.__pyx_base.stream, (&__pyx_v_6cpyamf_4amf3_REF_CHAR), 1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L19; - } - __pyx_L19:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":944 - * self.stream.write(&REF_CHAR, 1) - * - * return 0 # <<<<<<<<<<<<<< - * - * cdef int writeByteArray(self, object obj) except -1: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("cpyamf.amf3.Encoder.writeObject"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_kls); - __Pyx_DECREF((PyObject *)__pyx_v_definition); - __Pyx_XDECREF(__pyx_v_alias); - __Pyx_DECREF(__pyx_v_attrs); - __Pyx_DECREF(__pyx_v_attr); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":852 - * self.writeElement(n[k]) - * - * cpdef int writeObject(self, object obj, bint is_proxy=0) except -1: # <<<<<<<<<<<<<< - * cdef Py_ssize_t ref - * cdef object kls - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Encoder_writeObject(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4amf3_7Encoder_writeObject(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_obj = 0; - int __pyx_v_is_proxy; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeObject __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__obj,&__pyx_n_s__is_proxy,0}; - __Pyx_RefNannySetupContext("writeObject"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - 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; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__obj); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__is_proxy); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "writeObject") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_obj = values[0]; - if (values[1]) { - __pyx_v_is_proxy = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_is_proxy == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_is_proxy = ((int)0); - } - } else { - __pyx_v_is_proxy = ((int)0); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: __pyx_v_is_proxy = __Pyx_PyObject_IsTrue(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_is_proxy == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 1: __pyx_v_obj = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("writeObject", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.amf3.Encoder.writeObject"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_2.__pyx_n = 1; - __pyx_t_2.is_proxy = __pyx_v_is_proxy; - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)((struct __pyx_obj_6cpyamf_4amf3_Encoder *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.writeObject(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_obj, 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.amf3.Encoder.writeObject"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":946 - * return 0 - * - * cdef int writeByteArray(self, object obj) except -1: # <<<<<<<<<<<<<< - * """ - * Writes a L{ByteArray} to the data stream. - */ - -static int __pyx_f_6cpyamf_4amf3_7Encoder_writeByteArray(struct __pyx_obj_6cpyamf_4amf3_Encoder *__pyx_v_self, PyObject *__pyx_v_obj) { - Py_ssize_t __pyx_v_ref; - PyObject *__pyx_v_buf; - PyObject *__pyx_v_l; - int __pyx_r; - int __pyx_t_1; - Py_ssize_t __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - __Pyx_RefNannySetupContext("writeByteArray"); - __pyx_v_buf = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_l = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":956 - * cdef object buf - * - * self.writeType(TYPE_BYTEARRAY) # <<<<<<<<<<<<<< - * - * ref = self.context.getObjectReference(obj) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf3_TYPE_BYTEARRAY); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":958 - * self.writeType(TYPE_BYTEARRAY) - * - * ref = self.context.getObjectReference(obj) # <<<<<<<<<<<<<< - * - * if ref != -1: - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getObjectReference(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_obj, 0); if (unlikely(__pyx_t_2 == -2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ref = __pyx_t_2; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":960 - * ref = self.context.getObjectReference(obj) - * - * if ref != -1: # <<<<<<<<<<<<<< - * _encode_integer(self.stream, ref << 1) - * - */ - __pyx_t_3 = (__pyx_v_ref != -1); - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":961 - * - * if ref != -1: - * _encode_integer(self.stream, ref << 1) # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_1 = __pyx_f_6cpyamf_4amf3__encode_integer(__pyx_v_self->__pyx_base.__pyx_base.stream, (__pyx_v_ref << 1)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":963 - * _encode_integer(self.stream, ref << 1) - * - * return 0 # <<<<<<<<<<<<<< - * - * self.context.addObject(obj) - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":965 - * return 0 - * - * self.context.addObject(obj) # <<<<<<<<<<<<<< - * - * buf = str(obj) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_obj, 0); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":967 - * self.context.addObject(obj) - * - * buf = str(obj) # <<<<<<<<<<<<<< - * l = PyString_GET_SIZE(buf) - * - */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_v_obj); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_obj); - __Pyx_GIVEREF(__pyx_v_obj); - __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_v_buf); - __pyx_v_buf = __pyx_t_5; - __pyx_t_5 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":968 - * - * buf = str(obj) - * l = PyString_GET_SIZE(buf) # <<<<<<<<<<<<<< - * - * _encode_integer(self.stream, (l << 1) | REFERENCE_BIT) - */ - __pyx_t_5 = PyInt_FromSsize_t(PyString_GET_SIZE(__pyx_v_buf)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_v_l); - __pyx_v_l = __pyx_t_5; - __pyx_t_5 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":970 - * l = PyString_GET_SIZE(buf) - * - * _encode_integer(self.stream, (l << 1) | REFERENCE_BIT) # <<<<<<<<<<<<<< - * self.stream.write(PyString_AS_STRING(buf), l) - * - */ - __pyx_t_5 = PyNumber_Lshift(__pyx_v_l, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyLong_FromUnsignedLong(__pyx_v_6cpyamf_4amf3_REFERENCE_BIT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Or(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = __pyx_f_6cpyamf_4amf3__encode_integer(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_t_1); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":971 - * - * _encode_integer(self.stream, (l << 1) | REFERENCE_BIT) - * self.stream.write(PyString_AS_STRING(buf), l) # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write(__pyx_v_self->__pyx_base.__pyx_base.stream, PyString_AS_STRING(__pyx_v_buf), __pyx_t_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":973 - * self.stream.write(PyString_AS_STRING(buf), l) - * - * return 0 # <<<<<<<<<<<<<< - * - * cdef int writeXML(self, obj) except -1: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("cpyamf.amf3.Encoder.writeByteArray"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_buf); - __Pyx_DECREF(__pyx_v_l); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":975 - * return 0 - * - * cdef int writeXML(self, obj) except -1: # <<<<<<<<<<<<<< - * self.writeType(TYPE_XMLSTRING) - * - */ - -static int __pyx_f_6cpyamf_4amf3_7Encoder_writeXML(struct __pyx_obj_6cpyamf_4amf3_Encoder *__pyx_v_self, PyObject *__pyx_v_obj) { - PyObject *__pyx_v_i; - PyObject *__pyx_v_s; - int __pyx_r; - int __pyx_t_1; - Py_ssize_t __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; - __Pyx_RefNannySetupContext("writeXML"); - __pyx_v_i = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_s = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":976 - * - * cdef int writeXML(self, obj) except -1: - * self.writeType(TYPE_XMLSTRING) # <<<<<<<<<<<<<< - * - * i = self.context.getObjectReference(obj) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf3_TYPE_XMLSTRING); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":978 - * self.writeType(TYPE_XMLSTRING) - * - * i = self.context.getObjectReference(obj) # <<<<<<<<<<<<<< - * - * if i != -1: - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getObjectReference(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_obj, 0); if (unlikely(__pyx_t_2 == -2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_i); - __pyx_v_i = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":980 - * i = self.context.getObjectReference(obj) - * - * if i != -1: # <<<<<<<<<<<<<< - * _encode_integer(self.stream, i << 1) - * - */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_i, __pyx_int_neg_1, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_4) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":981 - * - * if i != -1: - * _encode_integer(self.stream, i << 1) # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_3 = PyNumber_Lshift(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __pyx_f_6cpyamf_4amf3__encode_integer(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":983 - * _encode_integer(self.stream, i << 1) - * - * return 0 # <<<<<<<<<<<<<< - * - * self.context.addObject(obj) - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":985 - * return 0 - * - * self.context.addObject(obj) # <<<<<<<<<<<<<< - * - * s = xml.tostring(obj).encode('utf-8') - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_obj, 0); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":987 - * self.context.addObject(obj) - * - * s = xml.tostring(obj).encode('utf-8') # <<<<<<<<<<<<<< - * - * if not PyString_CheckExact(s): - */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__xml); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__tostring); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_obj); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_obj); - __Pyx_GIVEREF(__pyx_v_obj); - __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_22), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_v_s); - __pyx_v_s = __pyx_t_7; - __pyx_t_7 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":989 - * s = xml.tostring(obj).encode('utf-8') - * - * if not PyString_CheckExact(s): # <<<<<<<<<<<<<< - * raise TypeError('Expected string from xml serialization') - * - */ - __pyx_t_4 = (!PyString_CheckExact(__pyx_v_s)); - if (__pyx_t_4) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":990 - * - * if not PyString_CheckExact(s): - * raise TypeError('Expected string from xml serialization') # <<<<<<<<<<<<<< - * - * i = PyString_GET_SIZE(s) - */ - __pyx_t_7 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_24), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_Raise(__pyx_t_7, 0, 0); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":992 - * raise TypeError('Expected string from xml serialization') - * - * i = PyString_GET_SIZE(s) # <<<<<<<<<<<<<< - * - * _encode_integer(self.stream, (i << 1) | REFERENCE_BIT) - */ - __pyx_t_7 = PyInt_FromSsize_t(PyString_GET_SIZE(__pyx_v_s)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_v_i); - __pyx_v_i = __pyx_t_7; - __pyx_t_7 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":994 - * i = PyString_GET_SIZE(s) - * - * _encode_integer(self.stream, (i << 1) | REFERENCE_BIT) # <<<<<<<<<<<<<< - * self.stream.write(PyString_AS_STRING(s), i) - * - */ - __pyx_t_7 = PyNumber_Lshift(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyLong_FromUnsignedLong(__pyx_v_6cpyamf_4amf3_REFERENCE_BIT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyNumber_Or(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_1 = __pyx_f_6cpyamf_4amf3__encode_integer(__pyx_v_self->__pyx_base.__pyx_base.stream, __pyx_t_5); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":995 - * - * _encode_integer(self.stream, (i << 1) | REFERENCE_BIT) - * self.stream.write(PyString_AS_STRING(s), i) # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write(__pyx_v_self->__pyx_base.__pyx_base.stream, PyString_AS_STRING(__pyx_v_s), __pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":997 - * self.stream.write(PyString_AS_STRING(s), i) - * - * return 0 # <<<<<<<<<<<<<< - * - * cdef int writeDateTime(self, obj) except -1: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("cpyamf.amf3.Encoder.writeXML"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_i); - __Pyx_DECREF(__pyx_v_s); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":999 - * return 0 - * - * cdef int writeDateTime(self, obj) except -1: # <<<<<<<<<<<<<< - * """ - * Writes an L{datetime.datetime} object to the stream - */ - -static int __pyx_f_6cpyamf_4amf3_7Encoder_writeDateTime(struct __pyx_obj_6cpyamf_4amf3_Encoder *__pyx_v_self, PyObject *__pyx_v_obj) { - Py_ssize_t __pyx_v_ref; - double __pyx_v_ms; - int __pyx_r; - Py_ssize_t __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; - double __pyx_t_7; - __Pyx_RefNannySetupContext("writeDateTime"); - __Pyx_INCREF(__pyx_v_obj); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1003 - * Writes an L{datetime.datetime} object to the stream - * """ - * cdef Py_ssize_t ref = self.context.getObjectReference(obj) # <<<<<<<<<<<<<< - * - * self.writeType(TYPE_DATE) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.getObjectReference(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_obj, 0); if (unlikely(__pyx_t_1 == -2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ref = __pyx_t_1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1005 - * cdef Py_ssize_t ref = self.context.getObjectReference(obj) - * - * self.writeType(TYPE_DATE) # <<<<<<<<<<<<<< - * - * if ref != -1: - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeType(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_6cpyamf_4amf3_TYPE_DATE); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1007 - * self.writeType(TYPE_DATE) - * - * if ref != -1: # <<<<<<<<<<<<<< - * _encode_integer(self.stream, ref << 1) - * - */ - __pyx_t_3 = (__pyx_v_ref != -1); - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1008 - * - * if ref != -1: - * _encode_integer(self.stream, ref << 1) # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_2 = __pyx_f_6cpyamf_4amf3__encode_integer(__pyx_v_self->__pyx_base.__pyx_base.stream, (__pyx_v_ref << 1)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1010 - * _encode_integer(self.stream, ref << 1) - * - * return 0 # <<<<<<<<<<<<<< - * - * self.context.addObject(obj) - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1012 - * return 0 - * - * self.context.addObject(obj) # <<<<<<<<<<<<<< - * self.stream.write(&REF_CHAR, 1) - * - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->__pyx_base.addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self->context), __pyx_v_obj, 0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1013 - * - * self.context.addObject(obj) - * self.stream.write(&REF_CHAR, 1) # <<<<<<<<<<<<<< - * - * if self.timezone_offset is not None: - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write(__pyx_v_self->__pyx_base.__pyx_base.stream, (&__pyx_v_6cpyamf_4amf3_REF_CHAR), 1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1015 - * self.stream.write(&REF_CHAR, 1) - * - * if self.timezone_offset is not None: # <<<<<<<<<<<<<< - * obj -= self.timezone_offset - * - */ - __pyx_t_3 = (__pyx_v_self->__pyx_base.__pyx_base.timezone_offset != Py_None); - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1016 - * - * if self.timezone_offset is not None: - * obj -= self.timezone_offset # <<<<<<<<<<<<<< - * - * ms = util.get_timestamp(obj) - */ - __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_v_obj, __pyx_v_self->__pyx_base.__pyx_base.timezone_offset); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_v_obj); - __pyx_v_obj = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1018 - * obj -= self.timezone_offset - * - * ms = util.get_timestamp(obj) # <<<<<<<<<<<<<< - * self.stream.write_double(ms * 1000.0) - * - */ - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__util); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_timestamp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_v_obj); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_obj); - __Pyx_GIVEREF(__pyx_v_obj); - __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_v_ms = __pyx_t_7; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1019 - * - * ms = util.get_timestamp(obj) - * self.stream.write_double(ms * 1000.0) # <<<<<<<<<<<<<< - * - * cdef int writeProxy(self, obj) except -1: - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.__pyx_base.stream->__pyx_vtab)->write_double(__pyx_v_self->__pyx_base.__pyx_base.stream, (__pyx_v_ms * 1000.0), 0); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("cpyamf.amf3.Encoder.writeDateTime"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_obj); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1021 - * self.stream.write_double(ms * 1000.0) - * - * cdef int writeProxy(self, obj) except -1: # <<<<<<<<<<<<<< - * """ - * Encodes a proxied object to the stream. - */ - -static int __pyx_f_6cpyamf_4amf3_7Encoder_writeProxy(struct __pyx_obj_6cpyamf_4amf3_Encoder *__pyx_v_self, PyObject *__pyx_v_obj) { - PyObject *__pyx_v_proxy = 0; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeObject __pyx_t_3; - __Pyx_RefNannySetupContext("writeProxy"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1027 - * @since: 0.6 - * """ - * cdef object proxy = self.context.getProxyForObject(obj) # <<<<<<<<<<<<<< - * - * return self.writeObject(proxy, 1) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Context *)__pyx_v_self->context->__pyx_base.__pyx_vtab)->getProxyForObject(__pyx_v_self->context, __pyx_v_obj, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_proxy = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1029 - * cdef object proxy = self.context.getProxyForObject(obj) - * - * return self.writeObject(proxy, 1) # <<<<<<<<<<<<<< - * - * cdef inline int handleBasicTypes(self, object element, object py_type) except -1: - */ - __pyx_t_3.__pyx_n = 1; - __pyx_t_3.is_proxy = 1; - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.writeObject(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_proxy, 0, &__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_2; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.amf3.Encoder.writeProxy"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_proxy); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1031 - * return self.writeObject(proxy, 1) - * - * cdef inline int handleBasicTypes(self, object element, object py_type) except -1: # <<<<<<<<<<<<<< - * cdef int ret = codec.Encoder.handleBasicTypes(self, element, py_type) - * - */ - -static CYTHON_INLINE int __pyx_f_6cpyamf_4amf3_7Encoder_handleBasicTypes(struct __pyx_obj_6cpyamf_4amf3_Encoder *__pyx_v_self, PyObject *__pyx_v_element, PyObject *__pyx_v_py_type) { - int __pyx_v_ret; - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("handleBasicTypes"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1032 - * - * cdef inline int handleBasicTypes(self, object element, object py_type) except -1: - * cdef int ret = codec.Encoder.handleBasicTypes(self, element, py_type) # <<<<<<<<<<<<<< - * - * if ret == 1: # not handled - */ - __pyx_t_1 = __pyx_vtabptr_6cpyamf_5codec_Encoder->handleBasicTypes(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_element, __pyx_v_py_type); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ret = __pyx_t_1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1034 - * cdef int ret = codec.Encoder.handleBasicTypes(self, element, py_type) - * - * if ret == 1: # not handled # <<<<<<<<<<<<<< - * if py_type is ByteArrayType: - * return self.writeByteArray(element) - */ - __pyx_t_2 = (__pyx_v_ret == 1); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1035 - * - * if ret == 1: # not handled - * if py_type is ByteArrayType: # <<<<<<<<<<<<<< - * return self.writeByteArray(element) - * - */ - __pyx_t_2 = (__pyx_v_py_type == __pyx_v_6cpyamf_4amf3_ByteArrayType); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1036 - * if ret == 1: # not handled - * if py_type is ByteArrayType: - * return self.writeByteArray(element) # <<<<<<<<<<<<<< - * - * return ret - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder *)__pyx_v_self->__pyx_base.__pyx_vtab)->writeByteArray(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_1; - goto __pyx_L0; - goto __pyx_L4; - } - __pyx_L4:; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1038 - * return self.writeByteArray(element) - * - * return ret # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = __pyx_v_ret; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf3.Encoder.handleBasicTypes"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pxd":57 - * - * cdef class Encoder(codec.Encoder): - * cdef public bint use_proxies # <<<<<<<<<<<<<< - * cdef readonly Context context - * - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Encoder_11use_proxies___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4amf3_7Encoder_11use_proxies___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(((struct __pyx_obj_6cpyamf_4amf3_Encoder *)__pyx_v_self)->use_proxies); 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); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.amf3.Encoder.use_proxies.__get__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6cpyamf_4amf3_7Encoder_11use_proxies___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pf_6cpyamf_4amf3_7Encoder_11use_proxies___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("__set__"); - __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 = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_6cpyamf_4amf3_Encoder *)__pyx_v_self)->use_proxies = __pyx_t_1; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf3.Encoder.use_proxies.__set__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pxd":58 - * cdef class Encoder(codec.Encoder): - * cdef public bint use_proxies - * cdef readonly Context context # <<<<<<<<<<<<<< - * - * cdef int writeByteArray(self, object obj) except -1 - */ - -static PyObject *__pyx_pf_6cpyamf_4amf3_7Encoder_7context___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4amf3_7Encoder_7context___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6cpyamf_4amf3_Encoder *)__pyx_v_self)->context)); - __pyx_r = ((PyObject *)((struct __pyx_obj_6cpyamf_4amf3_Encoder *)__pyx_v_self)->context); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1041 - * - * - * cdef int encode_int(long i, char **buf) except -1: # <<<<<<<<<<<<<< - * # Use typecasting to get the twos complement representation of i - * cdef unsigned long n = (((&i)))[0] - */ - -static int __pyx_f_6cpyamf_4amf3_encode_int(long __pyx_v_i, char **__pyx_v_buf) { - unsigned long __pyx_v_n; - unsigned long __pyx_v_real_value; - unsigned char __pyx_v_count; - char *__pyx_v_bytes; - int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2; - __Pyx_RefNannySetupContext("encode_int"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1043 - * cdef int encode_int(long i, char **buf) except -1: - * # Use typecasting to get the twos complement representation of i - * cdef unsigned long n = (((&i)))[0] # <<<<<<<<<<<<<< - * - * cdef unsigned long real_value = n - */ - __pyx_v_n = (((unsigned long *)((void *)(&__pyx_v_i)))[0]); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1045 - * cdef unsigned long n = (((&i)))[0] - * - * cdef unsigned long real_value = n # <<<<<<<<<<<<<< - * cdef unsigned char count = 0 - * cdef char *bytes = NULL - */ - __pyx_v_real_value = __pyx_v_n; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1046 - * - * cdef unsigned long real_value = n - * cdef unsigned char count = 0 # <<<<<<<<<<<<<< - * cdef char *bytes = NULL - * - */ - __pyx_v_count = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1047 - * cdef unsigned long real_value = n - * cdef unsigned char count = 0 - * cdef char *bytes = NULL # <<<<<<<<<<<<<< - * - * if n > 0x1fffff: - */ - __pyx_v_bytes = NULL; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1049 - * cdef char *bytes = NULL - * - * if n > 0x1fffff: # <<<<<<<<<<<<<< - * bytes = malloc(4) - * - */ - __pyx_t_1 = (__pyx_v_n > 0x1fffff); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1050 - * - * if n > 0x1fffff: - * bytes = malloc(4) # <<<<<<<<<<<<<< - * - * if bytes == NULL: - */ - __pyx_v_bytes = ((char *)malloc(4)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1052 - * bytes = malloc(4) - * - * if bytes == NULL: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * - */ - __pyx_t_1 = (__pyx_v_bytes == NULL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1053 - * - * if bytes == NULL: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * - * n = n >> 1 - */ - __pyx_t_2 = PyErr_NoMemory(); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1055 - * PyErr_NoMemory() - * - * n = n >> 1 # <<<<<<<<<<<<<< - * bytes[count] = 0x80 | ((n >> 21) & 0xff) - * count += 1 - */ - __pyx_v_n = (__pyx_v_n >> 1); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1056 - * - * n = n >> 1 - * bytes[count] = 0x80 | ((n >> 21) & 0xff) # <<<<<<<<<<<<<< - * count += 1 - * - */ - (__pyx_v_bytes[__pyx_v_count]) = (0x80 | ((__pyx_v_n >> 21) & 0xff)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1057 - * n = n >> 1 - * bytes[count] = 0x80 | ((n >> 21) & 0xff) - * count += 1 # <<<<<<<<<<<<<< - * - * if n > 0x3fff: - */ - __pyx_v_count = (__pyx_v_count + 1); - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1059 - * count += 1 - * - * if n > 0x3fff: # <<<<<<<<<<<<<< - * if bytes == NULL: - * bytes = malloc(3) - */ - __pyx_t_1 = (__pyx_v_n > 0x3fff); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1060 - * - * if n > 0x3fff: - * if bytes == NULL: # <<<<<<<<<<<<<< - * bytes = malloc(3) - * - */ - __pyx_t_1 = (__pyx_v_bytes == NULL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1061 - * if n > 0x3fff: - * if bytes == NULL: - * bytes = malloc(3) # <<<<<<<<<<<<<< - * - * if bytes == NULL: - */ - __pyx_v_bytes = ((char *)malloc(3)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1063 - * bytes = malloc(3) - * - * if bytes == NULL: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * - */ - __pyx_t_1 = (__pyx_v_bytes == NULL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1064 - * - * if bytes == NULL: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * - * bytes[count] = 0x80 | ((n >> 14) & 0xff) - */ - __pyx_t_2 = PyErr_NoMemory(); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; - goto __pyx_L6; - } - __pyx_L6:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1066 - * PyErr_NoMemory() - * - * bytes[count] = 0x80 | ((n >> 14) & 0xff) # <<<<<<<<<<<<<< - * count += 1 - * - */ - (__pyx_v_bytes[__pyx_v_count]) = (0x80 | ((__pyx_v_n >> 14) & 0xff)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1067 - * - * bytes[count] = 0x80 | ((n >> 14) & 0xff) - * count += 1 # <<<<<<<<<<<<<< - * - * if n > 0x7f: - */ - __pyx_v_count = (__pyx_v_count + 1); - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1069 - * count += 1 - * - * if n > 0x7f: # <<<<<<<<<<<<<< - * if bytes == NULL: - * bytes = malloc(2) - */ - __pyx_t_1 = (__pyx_v_n > 0x7f); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1070 - * - * if n > 0x7f: - * if bytes == NULL: # <<<<<<<<<<<<<< - * bytes = malloc(2) - * - */ - __pyx_t_1 = (__pyx_v_bytes == NULL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1071 - * if n > 0x7f: - * if bytes == NULL: - * bytes = malloc(2) # <<<<<<<<<<<<<< - * - * if bytes == NULL: - */ - __pyx_v_bytes = ((char *)malloc(2)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1073 - * bytes = malloc(2) - * - * if bytes == NULL: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * - */ - __pyx_t_1 = (__pyx_v_bytes == NULL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1074 - * - * if bytes == NULL: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * - * bytes[count] = 0x80 | ((n >> 7) & 0xff) - */ - __pyx_t_2 = PyErr_NoMemory(); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L10; - } - __pyx_L10:; - goto __pyx_L9; - } - __pyx_L9:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1076 - * PyErr_NoMemory() - * - * bytes[count] = 0x80 | ((n >> 7) & 0xff) # <<<<<<<<<<<<<< - * count += 1 - * - */ - (__pyx_v_bytes[__pyx_v_count]) = (0x80 | ((__pyx_v_n >> 7) & 0xff)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1077 - * - * bytes[count] = 0x80 | ((n >> 7) & 0xff) - * count += 1 # <<<<<<<<<<<<<< - * - * if bytes == NULL: - */ - __pyx_v_count = (__pyx_v_count + 1); - goto __pyx_L8; - } - __pyx_L8:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1079 - * count += 1 - * - * if bytes == NULL: # <<<<<<<<<<<<<< - * bytes = malloc(1) - * - */ - __pyx_t_1 = (__pyx_v_bytes == NULL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1080 - * - * if bytes == NULL: - * bytes = malloc(1) # <<<<<<<<<<<<<< - * - * if bytes == NULL: - */ - __pyx_v_bytes = ((char *)malloc(1)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1082 - * bytes = malloc(1) - * - * if bytes == NULL: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * - */ - __pyx_t_1 = (__pyx_v_bytes == NULL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1083 - * - * if bytes == NULL: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * - * if real_value > 0x1fffff: - */ - __pyx_t_2 = PyErr_NoMemory(); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L12; - } - __pyx_L12:; - goto __pyx_L11; - } - __pyx_L11:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1085 - * PyErr_NoMemory() - * - * if real_value > 0x1fffff: # <<<<<<<<<<<<<< - * bytes[count] = real_value & 0xff - * else: - */ - __pyx_t_1 = (__pyx_v_real_value > 0x1fffff); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1086 - * - * if real_value > 0x1fffff: - * bytes[count] = real_value & 0xff # <<<<<<<<<<<<<< - * else: - * bytes[count] = real_value & 0x7f - */ - (__pyx_v_bytes[__pyx_v_count]) = (__pyx_v_real_value & 0xff); - goto __pyx_L13; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1088 - * bytes[count] = real_value & 0xff - * else: - * bytes[count] = real_value & 0x7f # <<<<<<<<<<<<<< - * - * buf[0] = bytes - */ - (__pyx_v_bytes[__pyx_v_count]) = (__pyx_v_real_value & 0x7f); - } - __pyx_L13:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1090 - * bytes[count] = real_value & 0x7f - * - * buf[0] = bytes # <<<<<<<<<<<<<< - * - * return count + 1 - */ - (__pyx_v_buf[0]) = __pyx_v_bytes; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1092 - * buf[0] = bytes - * - * return count + 1 # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = (__pyx_v_count + 1); - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf3.encode_int"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1095 - * - * - * cdef int decode_int(cBufferedByteStream stream, int sign=0) except? -1: # <<<<<<<<<<<<<< - * cdef int n = 0 - * cdef int result = 0 - */ - -static int __pyx_f_6cpyamf_4amf3_decode_int(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_stream, struct __pyx_opt_args_6cpyamf_4amf3_decode_int *__pyx_optional_args) { - int __pyx_v_sign = ((int)0); - int __pyx_v_n; - int __pyx_v_result; - unsigned char __pyx_v_b; - int __pyx_r; - unsigned char __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("decode_int"); - if (__pyx_optional_args) { - if (__pyx_optional_args->__pyx_n > 0) { - __pyx_v_sign = __pyx_optional_args->sign; - } - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1096 - * - * cdef int decode_int(cBufferedByteStream stream, int sign=0) except? -1: - * cdef int n = 0 # <<<<<<<<<<<<<< - * cdef int result = 0 - * cdef unsigned char b = stream.read_uchar() - */ - __pyx_v_n = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1097 - * cdef int decode_int(cBufferedByteStream stream, int sign=0) except? -1: - * cdef int n = 0 - * cdef int result = 0 # <<<<<<<<<<<<<< - * cdef unsigned char b = stream.read_uchar() - * - */ - __pyx_v_result = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1098 - * cdef int n = 0 - * cdef int result = 0 - * cdef unsigned char b = stream.read_uchar() # <<<<<<<<<<<<<< - * - * while b & 0x80 != 0 and n < 3: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_stream->__pyx_vtab)->read_uchar(__pyx_v_stream, 0); if (unlikely(__pyx_t_1 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_b = __pyx_t_1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1100 - * cdef unsigned char b = stream.read_uchar() - * - * while b & 0x80 != 0 and n < 3: # <<<<<<<<<<<<<< - * result <<= 7 - * result |= b & 0x7f - */ - while (1) { - __pyx_t_2 = ((__pyx_v_b & 0x80) != 0); - if (__pyx_t_2) { - __pyx_t_3 = (__pyx_v_n < 3); - __pyx_t_4 = __pyx_t_3; - } else { - __pyx_t_4 = __pyx_t_2; - } - if (!__pyx_t_4) break; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1101 - * - * while b & 0x80 != 0 and n < 3: - * result <<= 7 # <<<<<<<<<<<<<< - * result |= b & 0x7f - * - */ - __pyx_v_result = (__pyx_v_result << 7); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1102 - * while b & 0x80 != 0 and n < 3: - * result <<= 7 - * result |= b & 0x7f # <<<<<<<<<<<<<< - * - * b = stream.read_uchar() - */ - __pyx_v_result = (__pyx_v_result | (__pyx_v_b & 0x7f)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1104 - * result |= b & 0x7f - * - * b = stream.read_uchar() # <<<<<<<<<<<<<< - * - * n += 1 - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_stream->__pyx_vtab)->read_uchar(__pyx_v_stream, 0); if (unlikely(__pyx_t_1 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_b = __pyx_t_1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1106 - * b = stream.read_uchar() - * - * n += 1 # <<<<<<<<<<<<<< - * - * if n < 3: - */ - __pyx_v_n = (__pyx_v_n + 1); - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1108 - * n += 1 - * - * if n < 3: # <<<<<<<<<<<<<< - * result <<= 7 - * result |= b - */ - __pyx_t_4 = (__pyx_v_n < 3); - if (__pyx_t_4) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1109 - * - * if n < 3: - * result <<= 7 # <<<<<<<<<<<<<< - * result |= b - * else: - */ - __pyx_v_result = (__pyx_v_result << 7); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1110 - * if n < 3: - * result <<= 7 - * result |= b # <<<<<<<<<<<<<< - * else: - * result <<= 8 - */ - __pyx_v_result = (__pyx_v_result | __pyx_v_b); - goto __pyx_L5; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1112 - * result |= b - * else: - * result <<= 8 # <<<<<<<<<<<<<< - * result |= b - * - */ - __pyx_v_result = (__pyx_v_result << 8); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1113 - * else: - * result <<= 8 - * result |= b # <<<<<<<<<<<<<< - * - * if result & 0x10000000 != 0: - */ - __pyx_v_result = (__pyx_v_result | __pyx_v_b); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1115 - * result |= b - * - * if result & 0x10000000 != 0: # <<<<<<<<<<<<<< - * if sign == 1: - * result -= 0x20000000 - */ - __pyx_t_4 = ((__pyx_v_result & 0x10000000) != 0); - if (__pyx_t_4) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1116 - * - * if result & 0x10000000 != 0: - * if sign == 1: # <<<<<<<<<<<<<< - * result -= 0x20000000 - * else: - */ - __pyx_t_4 = (__pyx_v_sign == 1); - if (__pyx_t_4) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1117 - * if result & 0x10000000 != 0: - * if sign == 1: - * result -= 0x20000000 # <<<<<<<<<<<<<< - * else: - * result <<= 1 - */ - __pyx_v_result = (__pyx_v_result - 0x20000000); - goto __pyx_L7; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1119 - * result -= 0x20000000 - * else: - * result <<= 1 # <<<<<<<<<<<<<< - * result += 1 - * - */ - __pyx_v_result = (__pyx_v_result << 1); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1120 - * else: - * result <<= 1 - * result += 1 # <<<<<<<<<<<<<< - * - * return result - */ - __pyx_v_result = (__pyx_v_result + 1); - } - __pyx_L7:; - goto __pyx_L6; - } - __pyx_L6:; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1122 - * result += 1 - * - * return result # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = __pyx_v_result; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf3.decode_int"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1125 - * - * - * cdef inline int _encode_integer(cBufferedByteStream stream, int i) except -1: # <<<<<<<<<<<<<< - * cdef char *buf = NULL - * cdef int size = 0 - */ - -static CYTHON_INLINE int __pyx_f_6cpyamf_4amf3__encode_integer(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_stream, int __pyx_v_i) { - char *__pyx_v_buf; - int __pyx_v_size; - int __pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("_encode_integer"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1126 - * - * cdef inline int _encode_integer(cBufferedByteStream stream, int i) except -1: - * cdef char *buf = NULL # <<<<<<<<<<<<<< - * cdef int size = 0 - * - */ - __pyx_v_buf = NULL; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1127 - * cdef inline int _encode_integer(cBufferedByteStream stream, int i) except -1: - * cdef char *buf = NULL - * cdef int size = 0 # <<<<<<<<<<<<<< - * - * try: - */ - __pyx_v_size = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1129 - * cdef int size = 0 - * - * try: # <<<<<<<<<<<<<< - * size = encode_int(i, &buf) - * - */ - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1130 - * - * try: - * size = encode_int(i, &buf) # <<<<<<<<<<<<<< - * - * return stream.write(buf, size) - */ - __pyx_t_1 = __pyx_f_6cpyamf_4amf3_encode_int(__pyx_v_i, (&__pyx_v_buf)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L4;} - __pyx_v_size = __pyx_t_1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1132 - * size = encode_int(i, &buf) - * - * return stream.write(buf, size) # <<<<<<<<<<<<<< - * finally: - * free(buf) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_stream->__pyx_vtab)->write(__pyx_v_stream, __pyx_v_buf, __pyx_v_size); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L4;} - __pyx_r = __pyx_t_1; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1134 - * return stream.write(buf, size) - * finally: - * free(buf) # <<<<<<<<<<<<<< - * - * - */ - /*finally:*/ { - int __pyx_why; - PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; - int __pyx_exc_lineno; - __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 0; goto __pyx_L5; - __pyx_L3: __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 3; goto __pyx_L5; - __pyx_L4: { - __pyx_why = 4; - __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); - __pyx_exc_lineno = __pyx_lineno; - goto __pyx_L5; - } - __pyx_L5:; - free(__pyx_v_buf); - switch (__pyx_why) { - case 3: goto __pyx_L0; - case 4: { - __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); - __pyx_lineno = __pyx_exc_lineno; - __pyx_exc_type = 0; - __pyx_exc_value = 0; - __pyx_exc_tb = 0; - goto __pyx_L1_error; - } - } - } - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf3._encode_integer"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1137 - * - * - * cdef inline Py_ssize_t _read_ref(cBufferedByteStream stream) except -1: # <<<<<<<<<<<<<< - * return decode_int(stream, 0) - */ - -static CYTHON_INLINE Py_ssize_t __pyx_f_6cpyamf_4amf3__read_ref(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_stream) { - Py_ssize_t __pyx_r; - int __pyx_t_1; - struct __pyx_opt_args_6cpyamf_4amf3_decode_int __pyx_t_2; - __Pyx_RefNannySetupContext("_read_ref"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1138 - * - * cdef inline Py_ssize_t _read_ref(cBufferedByteStream stream) except -1: - * return decode_int(stream, 0) # <<<<<<<<<<<<<< - */ - __pyx_t_2.__pyx_n = 1; - __pyx_t_2.sign = 0; - __pyx_t_1 = __pyx_f_6cpyamf_4amf3_decode_int(__pyx_v_stream, &__pyx_t_2); if (unlikely(__pyx_t_1 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = ((Py_ssize_t)__pyx_t_1); - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.amf3._read_ref"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static struct __pyx_vtabstruct_6cpyamf_4amf3_ClassDefinition __pyx_vtable_6cpyamf_4amf3_ClassDefinition; - -static PyObject *__pyx_tp_new_6cpyamf_4amf3_ClassDefinition(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *p; - PyObject *o = (*t->tp_alloc)(t, 0); - if (!o) return 0; - p = ((struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)o); - p->__pyx_vtab = __pyx_vtabptr_6cpyamf_4amf3_ClassDefinition; - p->alias = Py_None; Py_INCREF(Py_None); - p->static_properties = ((PyObject *)Py_None); Py_INCREF(Py_None); - if (__pyx_pf_6cpyamf_4amf3_15ClassDefinition___cinit__(o, __pyx_empty_tuple, NULL) < 0) { - Py_DECREF(o); o = 0; - } - return o; -} - -static void __pyx_tp_dealloc_6cpyamf_4amf3_ClassDefinition(PyObject *o) { - struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *p = (struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)o; - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pf_6cpyamf_4amf3_15ClassDefinition___dealloc__(o); - if (PyErr_Occurred()) PyErr_WriteUnraisable(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); - } - Py_XDECREF(p->alias); - Py_XDECREF(((PyObject *)p->static_properties)); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_6cpyamf_4amf3_ClassDefinition(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *p = (struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)o; - if (p->alias) { - e = (*v)(p->alias, a); if (e) return e; - } - if (p->static_properties) { - e = (*v)(p->static_properties, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6cpyamf_4amf3_ClassDefinition(PyObject *o) { - struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *p = (struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *)o; - PyObject* tmp; - tmp = ((PyObject*)p->alias); - p->alias = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->static_properties); - p->static_properties = ((PyObject *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_6cpyamf_4amf3_15ClassDefinition_alias(PyObject *o, void *x) { - return __pyx_pf_6cpyamf_4amf3_15ClassDefinition_5alias___get__(o); -} - -static PyObject *__pyx_getprop_6cpyamf_4amf3_15ClassDefinition_attr_len(PyObject *o, void *x) { - return __pyx_pf_6cpyamf_4amf3_15ClassDefinition_8attr_len___get__(o); -} - -static PyObject *__pyx_getprop_6cpyamf_4amf3_15ClassDefinition_encoding(PyObject *o, void *x) { - return __pyx_pf_6cpyamf_4amf3_15ClassDefinition_8encoding___get__(o); -} - -static PyObject *__pyx_getprop_6cpyamf_4amf3_15ClassDefinition_static_properties(PyObject *o, void *x) { - return __pyx_pf_6cpyamf_4amf3_15ClassDefinition_17static_properties___get__(o); -} - -static PyMethodDef __pyx_methods_6cpyamf_4amf3_ClassDefinition[] = { - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_6cpyamf_4amf3_ClassDefinition[] = { - {(char *)"alias", __pyx_getprop_6cpyamf_4amf3_15ClassDefinition_alias, 0, 0, 0}, - {(char *)"attr_len", __pyx_getprop_6cpyamf_4amf3_15ClassDefinition_attr_len, 0, 0, 0}, - {(char *)"encoding", __pyx_getprop_6cpyamf_4amf3_15ClassDefinition_encoding, 0, 0, 0}, - {(char *)"static_properties", __pyx_getprop_6cpyamf_4amf3_15ClassDefinition_static_properties, 0, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyNumberMethods __pyx_tp_as_number_ClassDefinition = { - 0, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_divide*/ - #endif - 0, /*nb_remainder*/ - 0, /*nb_divmod*/ - 0, /*nb_power*/ - 0, /*nb_negative*/ - 0, /*nb_positive*/ - 0, /*nb_absolute*/ - 0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_coerce*/ - #endif - 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif - 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*nb_hex*/ - #endif - 0, /*nb_inplace_add*/ - 0, /*nb_inplace_subtract*/ - 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_inplace_divide*/ - #endif - 0, /*nb_inplace_remainder*/ - 0, /*nb_inplace_power*/ - 0, /*nb_inplace_lshift*/ - 0, /*nb_inplace_rshift*/ - 0, /*nb_inplace_and*/ - 0, /*nb_inplace_xor*/ - 0, /*nb_inplace_or*/ - 0, /*nb_floor_divide*/ - 0, /*nb_true_divide*/ - 0, /*nb_inplace_floor_divide*/ - 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 - 0, /*nb_index*/ - #endif -}; - -static PySequenceMethods __pyx_tp_as_sequence_ClassDefinition = { - 0, /*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_ClassDefinition = { - 0, /*mp_length*/ - 0, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; - -static PyBufferProcs __pyx_tp_as_buffer_ClassDefinition = { - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif -}; - -PyTypeObject __pyx_type_6cpyamf_4amf3_ClassDefinition = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cpyamf.amf3.ClassDefinition"), /*tp_name*/ - sizeof(struct __pyx_obj_6cpyamf_4amf3_ClassDefinition), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6cpyamf_4amf3_ClassDefinition, /*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*/ - &__pyx_tp_as_number_ClassDefinition, /*tp_as_number*/ - &__pyx_tp_as_sequence_ClassDefinition, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_ClassDefinition, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_ClassDefinition, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("\n Holds transient class trait info for an individual encode/decode.\n "), /*tp_doc*/ - __pyx_tp_traverse_6cpyamf_4amf3_ClassDefinition, /*tp_traverse*/ - __pyx_tp_clear_6cpyamf_4amf3_ClassDefinition, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6cpyamf_4amf3_ClassDefinition, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_6cpyamf_4amf3_ClassDefinition, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pf_6cpyamf_4amf3_15ClassDefinition___init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6cpyamf_4amf3_ClassDefinition, /*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*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif -}; -static struct __pyx_vtabstruct_6cpyamf_4amf3_Context __pyx_vtable_6cpyamf_4amf3_Context; - -static PyObject *__pyx_tp_new_6cpyamf_4amf3_Context(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6cpyamf_4amf3_Context *p; - PyObject *o = __pyx_ptype_6cpyamf_5codec_Context->tp_new(t, a, k); - if (!o) return 0; - p = ((struct __pyx_obj_6cpyamf_4amf3_Context *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6cpyamf_5codec_Context*)__pyx_vtabptr_6cpyamf_4amf3_Context; - p->strings = ((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)Py_None); Py_INCREF(Py_None); - p->classes = ((PyObject *)Py_None); Py_INCREF(Py_None); - p->class_ref = ((PyObject *)Py_None); Py_INCREF(Py_None); - p->proxied_objects = ((PyObject *)Py_None); Py_INCREF(Py_None); - if (__pyx_pf_6cpyamf_4amf3_7Context___cinit__(o, __pyx_empty_tuple, NULL) < 0) { - Py_DECREF(o); o = 0; - } - return o; -} - -static void __pyx_tp_dealloc_6cpyamf_4amf3_Context(PyObject *o) { - struct __pyx_obj_6cpyamf_4amf3_Context *p = (struct __pyx_obj_6cpyamf_4amf3_Context *)o; - Py_XDECREF(((PyObject *)p->strings)); - Py_XDECREF(((PyObject *)p->classes)); - Py_XDECREF(((PyObject *)p->class_ref)); - Py_XDECREF(((PyObject *)p->proxied_objects)); - __pyx_ptype_6cpyamf_5codec_Context->tp_dealloc(o); -} - -static int __pyx_tp_traverse_6cpyamf_4amf3_Context(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6cpyamf_4amf3_Context *p = (struct __pyx_obj_6cpyamf_4amf3_Context *)o; - if (__pyx_ptype_6cpyamf_5codec_Context->tp_traverse) { - e = __pyx_ptype_6cpyamf_5codec_Context->tp_traverse(o, v, a); if (e) return e; - } - if (p->strings) { - e = (*v)(((PyObject*)p->strings), a); if (e) return e; - } - if (p->classes) { - e = (*v)(p->classes, a); if (e) return e; - } - if (p->class_ref) { - e = (*v)(p->class_ref, a); if (e) return e; - } - if (p->proxied_objects) { - e = (*v)(p->proxied_objects, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6cpyamf_4amf3_Context(PyObject *o) { - struct __pyx_obj_6cpyamf_4amf3_Context *p = (struct __pyx_obj_6cpyamf_4amf3_Context *)o; - PyObject* tmp; - if (__pyx_ptype_6cpyamf_5codec_Context->tp_clear) { - __pyx_ptype_6cpyamf_5codec_Context->tp_clear(o); - } - tmp = ((PyObject*)p->strings); - p->strings = ((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->classes); - p->classes = ((PyObject *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->class_ref); - p->class_ref = ((PyObject *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->proxied_objects); - p->proxied_objects = ((PyObject *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyMethodDef __pyx_methods_6cpyamf_4amf3_Context[] = { - {__Pyx_NAMESTR("clear"), (PyCFunction)__pyx_pf_6cpyamf_4amf3_7Context_clear, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4amf3_7Context_clear)}, - {__Pyx_NAMESTR("getString"), (PyCFunction)__pyx_pf_6cpyamf_4amf3_7Context_getString, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("getStringReference"), (PyCFunction)__pyx_pf_6cpyamf_4amf3_7Context_getStringReference, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("addString"), (PyCFunction)__pyx_pf_6cpyamf_4amf3_7Context_addString, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4amf3_7Context_addString)}, - {__Pyx_NAMESTR("getClassByReference"), (PyCFunction)__pyx_pf_6cpyamf_4amf3_7Context_getClassByReference, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("getClass"), (PyCFunction)__pyx_pf_6cpyamf_4amf3_7Context_getClass, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("addClass"), (PyCFunction)__pyx_pf_6cpyamf_4amf3_7Context_addClass, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("getProxyForObject"), (PyCFunction)__pyx_pf_6cpyamf_4amf3_7Context_getProxyForObject, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4amf3_7Context_getProxyForObject)}, - {__Pyx_NAMESTR("getObjectForProxy"), (PyCFunction)__pyx_pf_6cpyamf_4amf3_7Context_getObjectForProxy, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4amf3_7Context_getObjectForProxy)}, - {__Pyx_NAMESTR("addProxyObject"), (PyCFunction)__pyx_pf_6cpyamf_4amf3_7Context_addProxyObject, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4amf3_7Context_addProxyObject)}, - {0, 0, 0, 0} -}; - -static PyNumberMethods __pyx_tp_as_number_Context = { - 0, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_divide*/ - #endif - 0, /*nb_remainder*/ - 0, /*nb_divmod*/ - 0, /*nb_power*/ - 0, /*nb_negative*/ - 0, /*nb_positive*/ - 0, /*nb_absolute*/ - 0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_coerce*/ - #endif - 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif - 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*nb_hex*/ - #endif - 0, /*nb_inplace_add*/ - 0, /*nb_inplace_subtract*/ - 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_inplace_divide*/ - #endif - 0, /*nb_inplace_remainder*/ - 0, /*nb_inplace_power*/ - 0, /*nb_inplace_lshift*/ - 0, /*nb_inplace_rshift*/ - 0, /*nb_inplace_and*/ - 0, /*nb_inplace_xor*/ - 0, /*nb_inplace_or*/ - 0, /*nb_floor_divide*/ - 0, /*nb_true_divide*/ - 0, /*nb_inplace_floor_divide*/ - 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 - 0, /*nb_index*/ - #endif -}; - -static PySequenceMethods __pyx_tp_as_sequence_Context = { - 0, /*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_Context = { - 0, /*mp_length*/ - 0, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; - -static PyBufferProcs __pyx_tp_as_buffer_Context = { - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif -}; - -PyTypeObject __pyx_type_6cpyamf_4amf3_Context = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cpyamf.amf3.Context"), /*tp_name*/ - sizeof(struct __pyx_obj_6cpyamf_4amf3_Context), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6cpyamf_4amf3_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*/ - &__pyx_tp_as_number_Context, /*tp_as_number*/ - &__pyx_tp_as_sequence_Context, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_Context, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_Context, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("\n I hold the AMF3 context for en/decoding streams.\n "), /*tp_doc*/ - __pyx_tp_traverse_6cpyamf_4amf3_Context, /*tp_traverse*/ - __pyx_tp_clear_6cpyamf_4amf3_Context, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6cpyamf_4amf3_Context, /*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_6cpyamf_4amf3_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*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif -}; -static struct __pyx_vtabstruct_6cpyamf_4amf3_Decoder __pyx_vtable_6cpyamf_4amf3_Decoder; - -static PyObject *__pyx_tp_new_6cpyamf_4amf3_Decoder(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6cpyamf_4amf3_Decoder *p; - PyObject *o = __pyx_ptype_6cpyamf_5codec_Decoder->tp_new(t, a, k); - if (!o) return 0; - p = ((struct __pyx_obj_6cpyamf_4amf3_Decoder *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6cpyamf_5codec_Decoder*)__pyx_vtabptr_6cpyamf_4amf3_Decoder; - p->context = ((struct __pyx_obj_6cpyamf_4amf3_Context *)Py_None); Py_INCREF(Py_None); - return o; -} - -static void __pyx_tp_dealloc_6cpyamf_4amf3_Decoder(PyObject *o) { - struct __pyx_obj_6cpyamf_4amf3_Decoder *p = (struct __pyx_obj_6cpyamf_4amf3_Decoder *)o; - Py_XDECREF(((PyObject *)p->context)); - __pyx_ptype_6cpyamf_5codec_Decoder->tp_dealloc(o); -} - -static int __pyx_tp_traverse_6cpyamf_4amf3_Decoder(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6cpyamf_4amf3_Decoder *p = (struct __pyx_obj_6cpyamf_4amf3_Decoder *)o; - if (__pyx_ptype_6cpyamf_5codec_Decoder->tp_traverse) { - e = __pyx_ptype_6cpyamf_5codec_Decoder->tp_traverse(o, v, a); if (e) return e; - } - if (p->context) { - e = (*v)(((PyObject*)p->context), a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6cpyamf_4amf3_Decoder(PyObject *o) { - struct __pyx_obj_6cpyamf_4amf3_Decoder *p = (struct __pyx_obj_6cpyamf_4amf3_Decoder *)o; - PyObject* tmp; - if (__pyx_ptype_6cpyamf_5codec_Decoder->tp_clear) { - __pyx_ptype_6cpyamf_5codec_Decoder->tp_clear(o); - } - tmp = ((PyObject*)p->context); - p->context = ((struct __pyx_obj_6cpyamf_4amf3_Context *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_6cpyamf_4amf3_7Decoder_use_proxies(PyObject *o, void *x) { - return __pyx_pf_6cpyamf_4amf3_7Decoder_11use_proxies___get__(o); -} - -static int __pyx_setprop_6cpyamf_4amf3_7Decoder_use_proxies(PyObject *o, PyObject *v, void *x) { - if (v) { - return __pyx_pf_6cpyamf_4amf3_7Decoder_11use_proxies___set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6cpyamf_4amf3_7Decoder_context(PyObject *o, void *x) { - return __pyx_pf_6cpyamf_4amf3_7Decoder_7context___get__(o); -} - -static PyMethodDef __pyx_methods_6cpyamf_4amf3_Decoder[] = { - {__Pyx_NAMESTR("readString"), (PyCFunction)__pyx_pf_6cpyamf_4amf3_7Decoder_readString, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4amf3_7Decoder_readString)}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_6cpyamf_4amf3_Decoder[] = { - {(char *)"use_proxies", __pyx_getprop_6cpyamf_4amf3_7Decoder_use_proxies, __pyx_setprop_6cpyamf_4amf3_7Decoder_use_proxies, 0, 0}, - {(char *)"context", __pyx_getprop_6cpyamf_4amf3_7Decoder_context, 0, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyNumberMethods __pyx_tp_as_number_Decoder = { - 0, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_divide*/ - #endif - 0, /*nb_remainder*/ - 0, /*nb_divmod*/ - 0, /*nb_power*/ - 0, /*nb_negative*/ - 0, /*nb_positive*/ - 0, /*nb_absolute*/ - 0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_coerce*/ - #endif - 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif - 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*nb_hex*/ - #endif - 0, /*nb_inplace_add*/ - 0, /*nb_inplace_subtract*/ - 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_inplace_divide*/ - #endif - 0, /*nb_inplace_remainder*/ - 0, /*nb_inplace_power*/ - 0, /*nb_inplace_lshift*/ - 0, /*nb_inplace_rshift*/ - 0, /*nb_inplace_and*/ - 0, /*nb_inplace_xor*/ - 0, /*nb_inplace_or*/ - 0, /*nb_floor_divide*/ - 0, /*nb_true_divide*/ - 0, /*nb_inplace_floor_divide*/ - 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 - 0, /*nb_index*/ - #endif -}; - -static PySequenceMethods __pyx_tp_as_sequence_Decoder = { - 0, /*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_Decoder = { - 0, /*mp_length*/ - 0, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; - -static PyBufferProcs __pyx_tp_as_buffer_Decoder = { - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif -}; - -PyTypeObject __pyx_type_6cpyamf_4amf3_Decoder = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cpyamf.amf3.Decoder"), /*tp_name*/ - sizeof(struct __pyx_obj_6cpyamf_4amf3_Decoder), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6cpyamf_4amf3_Decoder, /*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*/ - &__pyx_tp_as_number_Decoder, /*tp_as_number*/ - &__pyx_tp_as_sequence_Decoder, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_Decoder, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_Decoder, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("\n Decodes an AMF3 data stream.\n "), /*tp_doc*/ - __pyx_tp_traverse_6cpyamf_4amf3_Decoder, /*tp_traverse*/ - __pyx_tp_clear_6cpyamf_4amf3_Decoder, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6cpyamf_4amf3_Decoder, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_6cpyamf_4amf3_Decoder, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pf_6cpyamf_4amf3_7Decoder___init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6cpyamf_4amf3_Decoder, /*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*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif -}; -static struct __pyx_vtabstruct_6cpyamf_4amf3_Encoder __pyx_vtable_6cpyamf_4amf3_Encoder; - -static PyObject *__pyx_tp_new_6cpyamf_4amf3_Encoder(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6cpyamf_4amf3_Encoder *p; - PyObject *o = __pyx_ptype_6cpyamf_5codec_Encoder->tp_new(t, a, k); - if (!o) return 0; - p = ((struct __pyx_obj_6cpyamf_4amf3_Encoder *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6cpyamf_5codec_Encoder*)__pyx_vtabptr_6cpyamf_4amf3_Encoder; - p->context = ((struct __pyx_obj_6cpyamf_4amf3_Context *)Py_None); Py_INCREF(Py_None); - return o; -} - -static void __pyx_tp_dealloc_6cpyamf_4amf3_Encoder(PyObject *o) { - struct __pyx_obj_6cpyamf_4amf3_Encoder *p = (struct __pyx_obj_6cpyamf_4amf3_Encoder *)o; - Py_XDECREF(((PyObject *)p->context)); - __pyx_ptype_6cpyamf_5codec_Encoder->tp_dealloc(o); -} - -static int __pyx_tp_traverse_6cpyamf_4amf3_Encoder(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6cpyamf_4amf3_Encoder *p = (struct __pyx_obj_6cpyamf_4amf3_Encoder *)o; - if (__pyx_ptype_6cpyamf_5codec_Encoder->tp_traverse) { - e = __pyx_ptype_6cpyamf_5codec_Encoder->tp_traverse(o, v, a); if (e) return e; - } - if (p->context) { - e = (*v)(((PyObject*)p->context), a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6cpyamf_4amf3_Encoder(PyObject *o) { - struct __pyx_obj_6cpyamf_4amf3_Encoder *p = (struct __pyx_obj_6cpyamf_4amf3_Encoder *)o; - PyObject* tmp; - if (__pyx_ptype_6cpyamf_5codec_Encoder->tp_clear) { - __pyx_ptype_6cpyamf_5codec_Encoder->tp_clear(o); - } - tmp = ((PyObject*)p->context); - p->context = ((struct __pyx_obj_6cpyamf_4amf3_Context *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_6cpyamf_4amf3_7Encoder_use_proxies(PyObject *o, void *x) { - return __pyx_pf_6cpyamf_4amf3_7Encoder_11use_proxies___get__(o); -} - -static int __pyx_setprop_6cpyamf_4amf3_7Encoder_use_proxies(PyObject *o, PyObject *v, void *x) { - if (v) { - return __pyx_pf_6cpyamf_4amf3_7Encoder_11use_proxies___set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6cpyamf_4amf3_7Encoder_context(PyObject *o, void *x) { - return __pyx_pf_6cpyamf_4amf3_7Encoder_7context___get__(o); -} - -static PyMethodDef __pyx_methods_6cpyamf_4amf3_Encoder[] = { - {__Pyx_NAMESTR("serialiseString"), (PyCFunction)__pyx_pf_6cpyamf_4amf3_7Encoder_serialiseString, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4amf3_7Encoder_serialiseString)}, - {__Pyx_NAMESTR("writeList"), (PyCFunction)__pyx_pf_6cpyamf_4amf3_7Encoder_writeList, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("writeObject"), (PyCFunction)__pyx_pf_6cpyamf_4amf3_7Encoder_writeObject, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_6cpyamf_4amf3_Encoder[] = { - {(char *)"use_proxies", __pyx_getprop_6cpyamf_4amf3_7Encoder_use_proxies, __pyx_setprop_6cpyamf_4amf3_7Encoder_use_proxies, 0, 0}, - {(char *)"context", __pyx_getprop_6cpyamf_4amf3_7Encoder_context, 0, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyNumberMethods __pyx_tp_as_number_Encoder = { - 0, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_divide*/ - #endif - 0, /*nb_remainder*/ - 0, /*nb_divmod*/ - 0, /*nb_power*/ - 0, /*nb_negative*/ - 0, /*nb_positive*/ - 0, /*nb_absolute*/ - 0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_coerce*/ - #endif - 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif - 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*nb_hex*/ - #endif - 0, /*nb_inplace_add*/ - 0, /*nb_inplace_subtract*/ - 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_inplace_divide*/ - #endif - 0, /*nb_inplace_remainder*/ - 0, /*nb_inplace_power*/ - 0, /*nb_inplace_lshift*/ - 0, /*nb_inplace_rshift*/ - 0, /*nb_inplace_and*/ - 0, /*nb_inplace_xor*/ - 0, /*nb_inplace_or*/ - 0, /*nb_floor_divide*/ - 0, /*nb_true_divide*/ - 0, /*nb_inplace_floor_divide*/ - 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 - 0, /*nb_index*/ - #endif -}; - -static PySequenceMethods __pyx_tp_as_sequence_Encoder = { - 0, /*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_Encoder = { - 0, /*mp_length*/ - 0, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; - -static PyBufferProcs __pyx_tp_as_buffer_Encoder = { - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif -}; - -PyTypeObject __pyx_type_6cpyamf_4amf3_Encoder = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cpyamf.amf3.Encoder"), /*tp_name*/ - sizeof(struct __pyx_obj_6cpyamf_4amf3_Encoder), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6cpyamf_4amf3_Encoder, /*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*/ - &__pyx_tp_as_number_Encoder, /*tp_as_number*/ - &__pyx_tp_as_sequence_Encoder, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_Encoder, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_Encoder, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("\n The AMF3 Encoder.\n "), /*tp_doc*/ - __pyx_tp_traverse_6cpyamf_4amf3_Encoder, /*tp_traverse*/ - __pyx_tp_clear_6cpyamf_4amf3_Encoder, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6cpyamf_4amf3_Encoder, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_6cpyamf_4amf3_Encoder, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pf_6cpyamf_4amf3_7Encoder___init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6cpyamf_4amf3_Encoder, /*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*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif -}; - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - PyModuleDef_HEAD_INIT, - __Pyx_NAMESTR("amf3"), - __Pyx_DOCSTR(__pyx_k_25), /* 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_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 1}, - {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0}, - {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0}, - {&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0}, - {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0}, - {&__pyx_n_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 1}, - {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0}, - {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0}, - {&__pyx_kp_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 0}, - {&__pyx_n_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 1}, - {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, - {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0}, - {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0}, - {&__pyx_n_s__ASObject, __pyx_k__ASObject, sizeof(__pyx_k__ASObject), 0, 0, 1, 1}, - {&__pyx_n_s__ByteArray, __pyx_k__ByteArray, sizeof(__pyx_k__ByteArray), 0, 0, 1, 1}, - {&__pyx_n_s__DataInput, __pyx_k__DataInput, sizeof(__pyx_k__DataInput), 0, 0, 1, 1}, - {&__pyx_n_s__DataOutput, __pyx_k__DataOutput, sizeof(__pyx_k__DataOutput), 0, 0, 1, 1}, - {&__pyx_n_s__DecodeError, __pyx_k__DecodeError, sizeof(__pyx_k__DecodeError), 0, 0, 1, 1}, - {&__pyx_n_s__EncodeError, __pyx_k__EncodeError, sizeof(__pyx_k__EncodeError), 0, 0, 1, 1}, - {&__pyx_n_s__ImportError, __pyx_k__ImportError, sizeof(__pyx_k__ImportError), 0, 0, 1, 1}, - {&__pyx_n_s__KeyError, __pyx_k__KeyError, sizeof(__pyx_k__KeyError), 0, 0, 1, 1}, - {&__pyx_n_s__MixedArray, __pyx_k__MixedArray, sizeof(__pyx_k__MixedArray), 0, 0, 1, 1}, - {&__pyx_n_s__ReferenceError, __pyx_k__ReferenceError, sizeof(__pyx_k__ReferenceError), 0, 0, 1, 1}, - {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1}, - {&__pyx_n_s__Undefined, __pyx_k__Undefined, sizeof(__pyx_k__Undefined), 0, 0, 1, 1}, - {&__pyx_n_s__UnknownClassAlias, __pyx_k__UnknownClassAlias, sizeof(__pyx_k__UnknownClassAlias), 0, 0, 1, 1}, - {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1}, - {&__pyx_n_s____class__, __pyx_k____class__, sizeof(__pyx_k____class__), 0, 0, 1, 1}, - {&__pyx_n_s____init__, __pyx_k____init__, sizeof(__pyx_k____init__), 0, 0, 1, 1}, - {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, - {&__pyx_n_s____readamf__, __pyx_k____readamf__, sizeof(__pyx_k____readamf__), 0, 0, 1, 1}, - {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, - {&__pyx_n_s____writeamf__, __pyx_k____writeamf__, sizeof(__pyx_k____writeamf__), 0, 0, 1, 1}, - {&__pyx_n_s___getClassDefinition, __pyx_k___getClassDefinition, sizeof(__pyx_k___getClassDefinition), 0, 0, 1, 1}, - {&__pyx_n_s___readDynamic, __pyx_k___readDynamic, sizeof(__pyx_k___readDynamic), 0, 0, 1, 1}, - {&__pyx_n_s___readStatic, __pyx_k___readStatic, sizeof(__pyx_k___readStatic), 0, 0, 1, 1}, - {&__pyx_n_s__addClass, __pyx_k__addClass, sizeof(__pyx_k__addClass), 0, 0, 1, 1}, - {&__pyx_n_s__addObject, __pyx_k__addObject, sizeof(__pyx_k__addObject), 0, 0, 1, 1}, - {&__pyx_n_s__addProxyObject, __pyx_k__addProxyObject, sizeof(__pyx_k__addProxyObject), 0, 0, 1, 1}, - {&__pyx_n_s__addString, __pyx_k__addString, sizeof(__pyx_k__addString), 0, 0, 1, 1}, - {&__pyx_n_s__alias, __pyx_k__alias, sizeof(__pyx_k__alias), 0, 0, 1, 1}, - {&__pyx_n_s__amf3, __pyx_k__amf3, sizeof(__pyx_k__amf3), 0, 0, 1, 1}, - {&__pyx_n_s__anonymous, __pyx_k__anonymous, sizeof(__pyx_k__anonymous), 0, 0, 1, 1}, - {&__pyx_n_s__append, __pyx_k__append, sizeof(__pyx_k__append), 0, 0, 1, 1}, - {&__pyx_n_s__applyAttributes, __pyx_k__applyAttributes, sizeof(__pyx_k__applyAttributes), 0, 0, 1, 1}, - {&__pyx_n_s__attr_len, __pyx_k__attr_len, sizeof(__pyx_k__attr_len), 0, 0, 1, 1}, - {&__pyx_n_s__class_idx, __pyx_k__class_idx, sizeof(__pyx_k__class_idx), 0, 0, 1, 1}, - {&__pyx_n_s__class_ref, __pyx_k__class_ref, sizeof(__pyx_k__class_ref), 0, 0, 1, 1}, - {&__pyx_n_s__classes, __pyx_k__classes, sizeof(__pyx_k__classes), 0, 0, 1, 1}, - {&__pyx_n_s__clear, __pyx_k__clear, sizeof(__pyx_k__clear), 0, 0, 1, 1}, - {&__pyx_n_s__codec, __pyx_k__codec, sizeof(__pyx_k__codec), 0, 0, 1, 1}, - {&__pyx_n_s__compile, __pyx_k__compile, sizeof(__pyx_k__compile), 0, 0, 1, 1}, - {&__pyx_n_s__compressed, __pyx_k__compressed, sizeof(__pyx_k__compressed), 0, 0, 1, 1}, - {&__pyx_n_s__context, __pyx_k__context, sizeof(__pyx_k__context), 0, 0, 1, 1}, - {&__pyx_n_s__createInstance, __pyx_k__createInstance, sizeof(__pyx_k__createInstance), 0, 0, 1, 1}, - {&__pyx_n_s__decode, __pyx_k__decode, sizeof(__pyx_k__decode), 0, 0, 1, 1}, - {&__pyx_n_s__decompress, __pyx_k__decompress, sizeof(__pyx_k__decompress), 0, 0, 1, 1}, - {&__pyx_n_s__dynamic, __pyx_k__dynamic, sizeof(__pyx_k__dynamic), 0, 0, 1, 1}, - {&__pyx_n_s__encode, __pyx_k__encode, sizeof(__pyx_k__encode), 0, 0, 1, 1}, - {&__pyx_n_s__encoded_ref, __pyx_k__encoded_ref, sizeof(__pyx_k__encoded_ref), 0, 0, 1, 1}, - {&__pyx_n_s__encoded_ref_size, __pyx_k__encoded_ref_size, sizeof(__pyx_k__encoded_ref_size), 0, 0, 1, 1}, - {&__pyx_n_s__encoding, __pyx_k__encoding, sizeof(__pyx_k__encoding), 0, 0, 1, 1}, - {&__pyx_n_s__error, __pyx_k__error, sizeof(__pyx_k__error), 0, 0, 1, 1}, - {&__pyx_n_s__external, __pyx_k__external, sizeof(__pyx_k__external), 0, 0, 1, 1}, - {&__pyx_n_s__flex, __pyx_k__flex, sizeof(__pyx_k__flex), 0, 0, 1, 1}, - {&__pyx_n_s__fromstring, __pyx_k__fromstring, sizeof(__pyx_k__fromstring), 0, 0, 1, 1}, - {&__pyx_n_s__getByReference, __pyx_k__getByReference, sizeof(__pyx_k__getByReference), 0, 0, 1, 1}, - {&__pyx_n_s__getBytesForString, __pyx_k__getBytesForString, sizeof(__pyx_k__getBytesForString), 0, 0, 1, 1}, - {&__pyx_n_s__getClass, __pyx_k__getClass, sizeof(__pyx_k__getClass), 0, 0, 1, 1}, - {&__pyx_n_s__getClassAlias, __pyx_k__getClassAlias, sizeof(__pyx_k__getClassAlias), 0, 0, 1, 1}, - {&__pyx_n_s__getClassByReference, __pyx_k__getClassByReference, sizeof(__pyx_k__getClassByReference), 0, 0, 1, 1}, - {&__pyx_n_s__getObject, __pyx_k__getObject, sizeof(__pyx_k__getObject), 0, 0, 1, 1}, - {&__pyx_n_s__getObjectForProxy, __pyx_k__getObjectForProxy, sizeof(__pyx_k__getObjectForProxy), 0, 0, 1, 1}, - {&__pyx_n_s__getObjectReference, __pyx_k__getObjectReference, sizeof(__pyx_k__getObjectReference), 0, 0, 1, 1}, - {&__pyx_n_s__getProxyForObject, __pyx_k__getProxyForObject, sizeof(__pyx_k__getProxyForObject), 0, 0, 1, 1}, - {&__pyx_n_s__getReferenceTo, __pyx_k__getReferenceTo, sizeof(__pyx_k__getReferenceTo), 0, 0, 1, 1}, - {&__pyx_n_s__getString, __pyx_k__getString, sizeof(__pyx_k__getString), 0, 0, 1, 1}, - {&__pyx_n_s__getStringReference, __pyx_k__getStringReference, sizeof(__pyx_k__getStringReference), 0, 0, 1, 1}, - {&__pyx_n_s__get_datetime, __pyx_k__get_datetime, sizeof(__pyx_k__get_datetime), 0, 0, 1, 1}, - {&__pyx_n_s__get_timestamp, __pyx_k__get_timestamp, sizeof(__pyx_k__get_timestamp), 0, 0, 1, 1}, - {&__pyx_n_s__index, __pyx_k__index, sizeof(__pyx_k__index), 0, 0, 1, 1}, - {&__pyx_n_s__is_proxy, __pyx_k__is_proxy, sizeof(__pyx_k__is_proxy), 0, 0, 1, 1}, - {&__pyx_n_s__keys, __pyx_k__keys, sizeof(__pyx_k__keys), 0, 0, 1, 1}, - {&__pyx_n_s__klass, __pyx_k__klass, sizeof(__pyx_k__klass), 0, 0, 1, 1}, - {&__pyx_n_s__n, __pyx_k__n, sizeof(__pyx_k__n), 0, 0, 1, 1}, - {&__pyx_n_s__obj, __pyx_k__obj, sizeof(__pyx_k__obj), 0, 0, 1, 1}, - {&__pyx_n_s__peek, __pyx_k__peek, sizeof(__pyx_k__peek), 0, 0, 1, 1}, - {&__pyx_n_s__pop, __pyx_k__pop, sizeof(__pyx_k__pop), 0, 0, 1, 1}, - {&__pyx_n_s__proxied, __pyx_k__proxied, sizeof(__pyx_k__proxied), 0, 0, 1, 1}, - {&__pyx_n_s__proxied_objects, __pyx_k__proxied_objects, sizeof(__pyx_k__proxied_objects), 0, 0, 1, 1}, - {&__pyx_n_s__proxy_object, __pyx_k__proxy_object, sizeof(__pyx_k__proxy_object), 0, 0, 1, 1}, - {&__pyx_n_s__pyamf, __pyx_k__pyamf, sizeof(__pyx_k__pyamf), 0, 0, 1, 1}, - {&__pyx_n_s__read, __pyx_k__read, sizeof(__pyx_k__read), 0, 0, 1, 1}, - {&__pyx_n_s__readByteArray, __pyx_k__readByteArray, sizeof(__pyx_k__readByteArray), 0, 0, 1, 1}, - {&__pyx_n_s__readBytes, __pyx_k__readBytes, sizeof(__pyx_k__readBytes), 0, 0, 1, 1}, - {&__pyx_n_s__readDate, __pyx_k__readDate, sizeof(__pyx_k__readDate), 0, 0, 1, 1}, - {&__pyx_n_s__readElement, __pyx_k__readElement, sizeof(__pyx_k__readElement), 0, 0, 1, 1}, - {&__pyx_n_s__readInteger, __pyx_k__readInteger, sizeof(__pyx_k__readInteger), 0, 0, 1, 1}, - {&__pyx_n_s__readList, __pyx_k__readList, sizeof(__pyx_k__readList), 0, 0, 1, 1}, - {&__pyx_n_s__readNumber, __pyx_k__readNumber, sizeof(__pyx_k__readNumber), 0, 0, 1, 1}, - {&__pyx_n_s__readObject, __pyx_k__readObject, sizeof(__pyx_k__readObject), 0, 0, 1, 1}, - {&__pyx_n_s__readProxy, __pyx_k__readProxy, sizeof(__pyx_k__readProxy), 0, 0, 1, 1}, - {&__pyx_n_s__readString, __pyx_k__readString, sizeof(__pyx_k__readString), 0, 0, 1, 1}, - {&__pyx_n_s__readXML, __pyx_k__readXML, sizeof(__pyx_k__readXML), 0, 0, 1, 1}, - {&__pyx_n_s__read_double, __pyx_k__read_double, sizeof(__pyx_k__read_double), 0, 0, 1, 1}, - {&__pyx_n_s__read_uchar, __pyx_k__read_uchar, sizeof(__pyx_k__read_uchar), 0, 0, 1, 1}, - {&__pyx_n_s__ref, __pyx_k__ref, sizeof(__pyx_k__ref), 0, 0, 1, 1}, - {&__pyx_n_s__seek, __pyx_k__seek, sizeof(__pyx_k__seek), 0, 0, 1, 1}, - {&__pyx_n_s__serialiseString, __pyx_k__serialiseString, sizeof(__pyx_k__serialiseString), 0, 0, 1, 1}, - {&__pyx_n_s__static_attrs, __pyx_k__static_attrs, sizeof(__pyx_k__static_attrs), 0, 0, 1, 1}, - {&__pyx_n_s__static_properties, __pyx_k__static_properties, sizeof(__pyx_k__static_properties), 0, 0, 1, 1}, - {&__pyx_n_s__stream, __pyx_k__stream, sizeof(__pyx_k__stream), 0, 0, 1, 1}, - {&__pyx_n_s__strict, __pyx_k__strict, sizeof(__pyx_k__strict), 0, 0, 1, 1}, - {&__pyx_n_s__strings, __pyx_k__strings, sizeof(__pyx_k__strings), 0, 0, 1, 1}, - {&__pyx_n_s__timezone_offset, __pyx_k__timezone_offset, sizeof(__pyx_k__timezone_offset), 0, 0, 1, 1}, - {&__pyx_n_s__tostring, __pyx_k__tostring, sizeof(__pyx_k__tostring), 0, 0, 1, 1}, - {&__pyx_n_s__types, __pyx_k__types, sizeof(__pyx_k__types), 0, 0, 1, 1}, - {&__pyx_n_s__unproxy_object, __pyx_k__unproxy_object, sizeof(__pyx_k__unproxy_object), 0, 0, 1, 1}, - {&__pyx_n_s__use_hash, __pyx_k__use_hash, sizeof(__pyx_k__use_hash), 0, 0, 1, 1}, - {&__pyx_n_s__use_proxies, __pyx_k__use_proxies, sizeof(__pyx_k__use_proxies), 0, 0, 1, 1}, - {&__pyx_n_s__use_proxies_default, __pyx_k__use_proxies_default, sizeof(__pyx_k__use_proxies_default), 0, 0, 1, 1}, - {&__pyx_n_s__util, __pyx_k__util, sizeof(__pyx_k__util), 0, 0, 1, 1}, - {&__pyx_n_s__write, __pyx_k__write, sizeof(__pyx_k__write), 0, 0, 1, 1}, - {&__pyx_n_s__writeByteArray, __pyx_k__writeByteArray, sizeof(__pyx_k__writeByteArray), 0, 0, 1, 1}, - {&__pyx_n_s__writeElement, __pyx_k__writeElement, sizeof(__pyx_k__writeElement), 0, 0, 1, 1}, - {&__pyx_n_s__writeList, __pyx_k__writeList, sizeof(__pyx_k__writeList), 0, 0, 1, 1}, - {&__pyx_n_s__writeNumber, __pyx_k__writeNumber, sizeof(__pyx_k__writeNumber), 0, 0, 1, 1}, - {&__pyx_n_s__writeObject, __pyx_k__writeObject, sizeof(__pyx_k__writeObject), 0, 0, 1, 1}, - {&__pyx_n_s__writeProxy, __pyx_k__writeProxy, sizeof(__pyx_k__writeProxy), 0, 0, 1, 1}, - {&__pyx_n_s__writeReference, __pyx_k__writeReference, sizeof(__pyx_k__writeReference), 0, 0, 1, 1}, - {&__pyx_n_s__writeType, __pyx_k__writeType, sizeof(__pyx_k__writeType), 0, 0, 1, 1}, - {&__pyx_n_s__write_double, __pyx_k__write_double, sizeof(__pyx_k__write_double), 0, 0, 1, 1}, - {&__pyx_n_s__write_uchar, __pyx_k__write_uchar, sizeof(__pyx_k__write_uchar), 0, 0, 1, 1}, - {&__pyx_n_s__xml, __pyx_k__xml, sizeof(__pyx_k__xml), 0, 0, 1, 1}, - {&__pyx_n_s__zlib, __pyx_k__zlib, sizeof(__pyx_k__zlib), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_ImportError = __Pyx_GetName(__pyx_b, __pyx_n_s__ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_n_s__KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":256 - * - * def __init__(self, *args, **kwargs): - * context = kwargs.pop('context', None) # <<<<<<<<<<<<<< - * - * if context is None: - */ - __pyx_k_tuple_2 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_2)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__context)); - PyTuple_SET_ITEM(__pyx_k_tuple_2, 0, ((PyObject *)__pyx_n_s__context)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__context)); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_k_tuple_2, 1, Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":459 - * - * if obj is None: - * raise pyamf.ReferenceError('Unknown reference') # <<<<<<<<<<<<<< - * - * if self.use_proxies == 1: - */ - __pyx_k_tuple_5 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_5)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_4)); - PyTuple_SET_ITEM(__pyx_k_tuple_5, 0, ((PyObject *)__pyx_kp_s_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":487 - * return obj - * else: - * raise pyamf.DecodeError("Unknown object encoding") # <<<<<<<<<<<<<< - * - * alias.applyAttributes(obj, obj_attrs, codec=self) - */ - __pyx_k_tuple_7 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_7)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_6)); - PyTuple_SET_ITEM(__pyx_k_tuple_7, 0, ((PyObject *)__pyx_kp_s_6)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":592 - * return self.readXML() - * - * raise pyamf.DecodeError("Unsupported ActionScript type") # <<<<<<<<<<<<<< - * - * - */ - __pyx_k_tuple_9 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_9)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_8)); - PyTuple_SET_ITEM(__pyx_k_tuple_9, 0, ((PyObject *)__pyx_kp_s_8)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":602 - * def __init__(self, *args, **kwargs): - * self.use_proxies = kwargs.pop('use_proxies', amf3.use_proxies_default) - * context = kwargs.pop('context', None) # <<<<<<<<<<<<<< - * - * if context is None: - */ - __pyx_k_tuple_10 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_10)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__context)); - PyTuple_SET_ITEM(__pyx_k_tuple_10, 0, ((PyObject *)__pyx_n_s__context)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__context)); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_k_tuple_10, 1, Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":639 - * l = PyString_GET_SIZE(u) - * else: - * raise TypeError('Expected str or unicode') # <<<<<<<<<<<<<< - * - * if l == 0: - */ - __pyx_k_tuple_12 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_12)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_11)); - PyTuple_SET_ITEM(__pyx_k_tuple_12, 0, ((PyObject *)__pyx_kp_s_11)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":797 - * # for more info - * if '' in n: - * raise pyamf.EncodeError("dicts cannot contain empty string keys") # <<<<<<<<<<<<<< - * - * if self.use_proxies: - */ - __pyx_k_tuple_15 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_15)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_14)); - PyTuple_SET_ITEM(__pyx_k_tuple_15, 0, ((PyObject *)__pyx_kp_s_14)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":822 - * str_keys.append(x) - * else: - * raise ValueError("Non int/str key value found in dict") # <<<<<<<<<<<<<< - * - * # Make sure the integer keys are within range - */ - __pyx_k_tuple_17 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_17)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_16)); - PyTuple_SET_ITEM(__pyx_k_tuple_17, 0, ((PyObject *)__pyx_kp_s_16)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_16)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":912 - * - * if PyDict_CheckExact(attrs) != 1: - * raise TypeError('Expected dict for encodable attributes') # <<<<<<<<<<<<<< - * - * if definition.attr_len > 0: - */ - __pyx_k_tuple_20 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_20)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_19)); - PyTuple_SET_ITEM(__pyx_k_tuple_20, 0, ((PyObject *)__pyx_kp_s_19)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_19)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_20)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":987 - * self.context.addObject(obj) - * - * s = xml.tostring(obj).encode('utf-8') # <<<<<<<<<<<<<< - * - * if not PyString_CheckExact(s): - */ - __pyx_k_tuple_22 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_22)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_21)); - PyTuple_SET_ITEM(__pyx_k_tuple_22, 0, ((PyObject *)__pyx_kp_s_21)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_21)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":990 - * - * if not PyString_CheckExact(s): - * raise TypeError('Expected string from xml serialization') # <<<<<<<<<<<<<< - * - * i = PyString_GET_SIZE(s) - */ - __pyx_k_tuple_24 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_24)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_23)); - PyTuple_SET_ITEM(__pyx_k_tuple_24, 0, ((PyObject *)__pyx_kp_s_23)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_23)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":59 - * cdef object DataInput = amf3.DataInput - * cdef object DataOutput = amf3.DataOutput - * cdef str empty_string = str('') # <<<<<<<<<<<<<< - * cdef unicode empty_unicode = empty_string.decode('utf-8') - * cdef object undefined = pyamf.Undefined - */ - __pyx_k_tuple_26 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_26)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_13)); - PyTuple_SET_ITEM(__pyx_k_tuple_26, 0, ((PyObject *)__pyx_kp_s_13)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":60 - * cdef object DataOutput = amf3.DataOutput - * cdef str empty_string = str('') - * cdef unicode empty_unicode = empty_string.decode('utf-8') # <<<<<<<<<<<<<< - * cdef object undefined = pyamf.Undefined - * - */ - __pyx_k_tuple_27 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_27)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_21)); - PyTuple_SET_ITEM(__pyx_k_tuple_27, 0, ((PyObject *)__pyx_kp_s_21)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_21)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_27)); - __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_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 initamf3(void); /*proto*/ -PyMODINIT_FUNC initamf3(void) -#else -PyMODINIT_FUNC PyInit_amf3(void); /*proto*/ -PyMODINIT_FUNC PyInit_amf3(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - #if CYTHON_REFNANNY - void* __pyx_refnanny = NULL; - __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"); - } - __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_amf3(void)", __LINE__, __FILE__); - #endif - __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_binding_PyCFunctionType_USED - if (__pyx_binding_PyCFunctionType_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(__Pyx_NAMESTR("amf3"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_25), 0, PYTHON_API_VERSION); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - #if PY_MAJOR_VERSION < 3 - Py_INCREF(__pyx_m); - #endif - __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); - if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__Pyx_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 (__pyx_module_is_main_cpyamf__amf3) { - if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - } - /*--- 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 ---*/ - __pyx_v_6cpyamf_4amf3_ByteArrayType = Py_None; Py_INCREF(Py_None); - __pyx_v_6cpyamf_4amf3_DataInput = Py_None; Py_INCREF(Py_None); - __pyx_v_6cpyamf_4amf3_DataOutput = Py_None; Py_INCREF(Py_None); - __pyx_v_6cpyamf_4amf3_empty_string = ((PyObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_6cpyamf_4amf3_empty_unicode = ((PyObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_6cpyamf_4amf3_undefined = Py_None; Py_INCREF(Py_None); - /*--- Function export code ---*/ - /*--- Type init code ---*/ - __pyx_vtabptr_6cpyamf_4amf3_ClassDefinition = &__pyx_vtable_6cpyamf_4amf3_ClassDefinition; - __pyx_vtable_6cpyamf_4amf3_ClassDefinition.writeReference = (int (*)(struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *, struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *))__pyx_f_6cpyamf_4amf3_15ClassDefinition_writeReference; - if (PyType_Ready(&__pyx_type_6cpyamf_4amf3_ClassDefinition) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6cpyamf_4amf3_ClassDefinition.tp_dict, __pyx_vtabptr_6cpyamf_4amf3_ClassDefinition) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "ClassDefinition", (PyObject *)&__pyx_type_6cpyamf_4amf3_ClassDefinition) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_4amf3_ClassDefinition = &__pyx_type_6cpyamf_4amf3_ClassDefinition; - __pyx_ptype_6cpyamf_5codec_Context = __Pyx_ImportType("cpyamf.codec", "Context", sizeof(struct __pyx_obj_6cpyamf_5codec_Context), 1); if (unlikely(!__pyx_ptype_6cpyamf_5codec_Context)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_6cpyamf_5codec_Context->tp_dict, &__pyx_vtabptr_6cpyamf_5codec_Context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_6cpyamf_4amf3_Context = &__pyx_vtable_6cpyamf_4amf3_Context; - __pyx_vtable_6cpyamf_4amf3_Context.__pyx_base = *__pyx_vtabptr_6cpyamf_5codec_Context; - __pyx_vtable_6cpyamf_4amf3_Context.__pyx_base.clear = (int (*)(struct __pyx_obj_6cpyamf_5codec_Context *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4amf3_7Context_clear; - __pyx_vtable_6cpyamf_4amf3_Context.getString = (PyObject *(*)(struct __pyx_obj_6cpyamf_4amf3_Context *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4amf3_7Context_getString; - __pyx_vtable_6cpyamf_4amf3_Context.getStringReference = (Py_ssize_t (*)(struct __pyx_obj_6cpyamf_4amf3_Context *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4amf3_7Context_getStringReference; - __pyx_vtable_6cpyamf_4amf3_Context.addString = (Py_ssize_t (*)(struct __pyx_obj_6cpyamf_4amf3_Context *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4amf3_7Context_addString; - __pyx_vtable_6cpyamf_4amf3_Context.addProxyObject = (int (*)(struct __pyx_obj_6cpyamf_4amf3_Context *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4amf3_7Context_addProxyObject; - __pyx_vtable_6cpyamf_4amf3_Context.getProxyForObject = (PyObject *(*)(struct __pyx_obj_6cpyamf_4amf3_Context *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4amf3_7Context_getProxyForObject; - __pyx_vtable_6cpyamf_4amf3_Context.getObjectForProxy = (PyObject *(*)(struct __pyx_obj_6cpyamf_4amf3_Context *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4amf3_7Context_getObjectForProxy; - __pyx_vtable_6cpyamf_4amf3_Context.getClassByReference = (PyObject *(*)(struct __pyx_obj_6cpyamf_4amf3_Context *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4amf3_7Context_getClassByReference; - __pyx_vtable_6cpyamf_4amf3_Context.getClass = (struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *(*)(struct __pyx_obj_6cpyamf_4amf3_Context *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4amf3_7Context_getClass; - __pyx_vtable_6cpyamf_4amf3_Context.addClass = (Py_ssize_t (*)(struct __pyx_obj_6cpyamf_4amf3_Context *, struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4amf3_7Context_addClass; - __pyx_type_6cpyamf_4amf3_Context.tp_base = __pyx_ptype_6cpyamf_5codec_Context; - if (PyType_Ready(&__pyx_type_6cpyamf_4amf3_Context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6cpyamf_4amf3_Context.tp_dict, __pyx_vtabptr_6cpyamf_4amf3_Context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Context", (PyObject *)&__pyx_type_6cpyamf_4amf3_Context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_4amf3_Context = &__pyx_type_6cpyamf_4amf3_Context; - __pyx_ptype_6cpyamf_5codec_Decoder = __Pyx_ImportType("cpyamf.codec", "Decoder", sizeof(struct __pyx_obj_6cpyamf_5codec_Decoder), 1); if (unlikely(!__pyx_ptype_6cpyamf_5codec_Decoder)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_6cpyamf_5codec_Decoder->tp_dict, &__pyx_vtabptr_6cpyamf_5codec_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_6cpyamf_4amf3_Decoder = &__pyx_vtable_6cpyamf_4amf3_Decoder; - __pyx_vtable_6cpyamf_4amf3_Decoder.__pyx_base = *__pyx_vtabptr_6cpyamf_5codec_Decoder; - __pyx_vtable_6cpyamf_4amf3_Decoder.__pyx_base.readDate = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *))__pyx_f_6cpyamf_4amf3_7Decoder_readDate; - __pyx_vtable_6cpyamf_4amf3_Decoder.__pyx_base.readString = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4amf3_7Decoder_readString; - __pyx_vtable_6cpyamf_4amf3_Decoder.__pyx_base.readObject = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *))__pyx_f_6cpyamf_4amf3_7Decoder_readObject; - __pyx_vtable_6cpyamf_4amf3_Decoder.__pyx_base.readNumber = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *))__pyx_f_6cpyamf_4amf3_7Decoder_readNumber; - __pyx_vtable_6cpyamf_4amf3_Decoder.__pyx_base.readList = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *))__pyx_f_6cpyamf_4amf3_7Decoder_readList; - __pyx_vtable_6cpyamf_4amf3_Decoder.__pyx_base.readXML = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *))__pyx_f_6cpyamf_4amf3_7Decoder_readXML; - __pyx_vtable_6cpyamf_4amf3_Decoder.__pyx_base.readConcreteElement = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *, char))__pyx_f_6cpyamf_4amf3_7Decoder_readConcreteElement; - __pyx_vtable_6cpyamf_4amf3_Decoder._getClassDefinition = (struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *(*)(struct __pyx_obj_6cpyamf_4amf3_Decoder *, long))__pyx_f_6cpyamf_4amf3_7Decoder__getClassDefinition; - __pyx_vtable_6cpyamf_4amf3_Decoder._readStatic = (int (*)(struct __pyx_obj_6cpyamf_4amf3_Decoder *, struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *, PyObject *))__pyx_f_6cpyamf_4amf3_7Decoder__readStatic; - __pyx_vtable_6cpyamf_4amf3_Decoder._readDynamic = (int (*)(struct __pyx_obj_6cpyamf_4amf3_Decoder *, struct __pyx_obj_6cpyamf_4amf3_ClassDefinition *, PyObject *))__pyx_f_6cpyamf_4amf3_7Decoder__readDynamic; - __pyx_vtable_6cpyamf_4amf3_Decoder.readBytes = (PyObject *(*)(struct __pyx_obj_6cpyamf_4amf3_Decoder *))__pyx_f_6cpyamf_4amf3_7Decoder_readBytes; - __pyx_vtable_6cpyamf_4amf3_Decoder.readInteger = (PyObject *(*)(struct __pyx_obj_6cpyamf_4amf3_Decoder *, struct __pyx_opt_args_6cpyamf_4amf3_7Decoder_readInteger *__pyx_optional_args))__pyx_f_6cpyamf_4amf3_7Decoder_readInteger; - __pyx_vtable_6cpyamf_4amf3_Decoder.readByteArray = (PyObject *(*)(struct __pyx_obj_6cpyamf_4amf3_Decoder *))__pyx_f_6cpyamf_4amf3_7Decoder_readByteArray; - __pyx_vtable_6cpyamf_4amf3_Decoder.readProxy = (PyObject *(*)(struct __pyx_obj_6cpyamf_4amf3_Decoder *, PyObject *))__pyx_f_6cpyamf_4amf3_7Decoder_readProxy; - __pyx_type_6cpyamf_4amf3_Decoder.tp_base = __pyx_ptype_6cpyamf_5codec_Decoder; - if (PyType_Ready(&__pyx_type_6cpyamf_4amf3_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6cpyamf_4amf3_Decoder.tp_dict, __pyx_vtabptr_6cpyamf_4amf3_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Decoder", (PyObject *)&__pyx_type_6cpyamf_4amf3_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_4amf3_Decoder = &__pyx_type_6cpyamf_4amf3_Decoder; - __pyx_ptype_6cpyamf_5codec_Encoder = __Pyx_ImportType("cpyamf.codec", "Encoder", sizeof(struct __pyx_obj_6cpyamf_5codec_Encoder), 1); if (unlikely(!__pyx_ptype_6cpyamf_5codec_Encoder)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_6cpyamf_5codec_Encoder->tp_dict, &__pyx_vtabptr_6cpyamf_5codec_Encoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_6cpyamf_4amf3_Encoder = &__pyx_vtable_6cpyamf_4amf3_Encoder; - __pyx_vtable_6cpyamf_4amf3_Encoder.__pyx_base = *__pyx_vtabptr_6cpyamf_5codec_Encoder; - __pyx_vtable_6cpyamf_4amf3_Encoder.__pyx_base.serialiseString = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4amf3_7Encoder_serialiseString; - __pyx_vtable_6cpyamf_4amf3_Encoder.__pyx_base.writeNull = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf3_7Encoder_writeNull; - __pyx_vtable_6cpyamf_4amf3_Encoder.__pyx_base.writeUndefined = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf3_7Encoder_writeUndefined; - __pyx_vtable_6cpyamf_4amf3_Encoder.__pyx_base.writeString = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf3_7Encoder_writeString; - __pyx_vtable_6cpyamf_4amf3_Encoder.__pyx_base.writeBytes = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf3_7Encoder_writeBytes; - __pyx_vtable_6cpyamf_4amf3_Encoder.__pyx_base.writeBoolean = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf3_7Encoder_writeBoolean; - __pyx_vtable_6cpyamf_4amf3_Encoder.__pyx_base.writeInt = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf3_7Encoder_writeInt; - __pyx_vtable_6cpyamf_4amf3_Encoder.__pyx_base.writeLong = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf3_7Encoder_writeLong; - __pyx_vtable_6cpyamf_4amf3_Encoder.__pyx_base.writeNumber = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf3_7Encoder_writeNumber; - __pyx_vtable_6cpyamf_4amf3_Encoder.__pyx_base.writeDateTime = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf3_7Encoder_writeDateTime; - __pyx_vtable_6cpyamf_4amf3_Encoder.__pyx_base.writeXML = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf3_7Encoder_writeXML; - __pyx_vtable_6cpyamf_4amf3_Encoder.__pyx_base.writeList = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeList *__pyx_optional_args))__pyx_f_6cpyamf_4amf3_7Encoder_writeList; - __pyx_vtable_6cpyamf_4amf3_Encoder.__pyx_base.writeTuple = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf3_7Encoder_writeTuple; - __pyx_vtable_6cpyamf_4amf3_Encoder.__pyx_base.writeObject = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeObject *__pyx_optional_args))__pyx_f_6cpyamf_4amf3_7Encoder_writeObject; - __pyx_vtable_6cpyamf_4amf3_Encoder.__pyx_base.writeDict = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf3_7Encoder_writeDict; - __pyx_vtable_6cpyamf_4amf3_Encoder.__pyx_base.writeMixedArray = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf3_7Encoder_writeMixedArray; - __pyx_vtable_6cpyamf_4amf3_Encoder.__pyx_base.handleBasicTypes = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, PyObject *))__pyx_f_6cpyamf_4amf3_7Encoder_handleBasicTypes; - __pyx_vtable_6cpyamf_4amf3_Encoder.writeByteArray = (int (*)(struct __pyx_obj_6cpyamf_4amf3_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf3_7Encoder_writeByteArray; - __pyx_vtable_6cpyamf_4amf3_Encoder.writeProxy = (int (*)(struct __pyx_obj_6cpyamf_4amf3_Encoder *, PyObject *))__pyx_f_6cpyamf_4amf3_7Encoder_writeProxy; - __pyx_type_6cpyamf_4amf3_Encoder.tp_base = __pyx_ptype_6cpyamf_5codec_Encoder; - if (PyType_Ready(&__pyx_type_6cpyamf_4amf3_Encoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6cpyamf_4amf3_Encoder.tp_dict, __pyx_vtabptr_6cpyamf_4amf3_Encoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Encoder", (PyObject *)&__pyx_type_6cpyamf_4amf3_Encoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_4amf3_Encoder = &__pyx_type_6cpyamf_4amf3_Encoder; - /*--- Type import code ---*/ - __pyx_ptype_6cpyamf_4util_cBufferedByteStream = __Pyx_ImportType("cpyamf.util", "cBufferedByteStream", sizeof(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream), 1); if (unlikely(!__pyx_ptype_6cpyamf_4util_cBufferedByteStream)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_6cpyamf_4util_cBufferedByteStream->tp_dict, &__pyx_vtabptr_6cpyamf_4util_cBufferedByteStream) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_4util_BufferedByteStream = __Pyx_ImportType("cpyamf.util", "BufferedByteStream", sizeof(struct __pyx_obj_6cpyamf_4util_BufferedByteStream), 1); if (unlikely(!__pyx_ptype_6cpyamf_4util_BufferedByteStream)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_6cpyamf_4util_BufferedByteStream->tp_dict, &__pyx_vtabptr_6cpyamf_4util_BufferedByteStream) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_5codec_IndexedCollection = __Pyx_ImportType("cpyamf.codec", "IndexedCollection", sizeof(struct __pyx_obj_6cpyamf_5codec_IndexedCollection), 1); if (unlikely(!__pyx_ptype_6cpyamf_5codec_IndexedCollection)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_6cpyamf_5codec_IndexedCollection->tp_dict, &__pyx_vtabptr_6cpyamf_5codec_IndexedCollection) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_5codec_Codec = __Pyx_ImportType("cpyamf.codec", "Codec", sizeof(struct __pyx_obj_6cpyamf_5codec_Codec), 1); if (unlikely(!__pyx_ptype_6cpyamf_5codec_Codec)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 54; __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;} - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":17 - * from cpyamf.util cimport cBufferedByteStream, BufferedByteStream - * from cpyamf cimport codec - * import pyamf # <<<<<<<<<<<<<< - * from pyamf import util, amf3, xml - * import types - */ - __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__pyamf), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__pyamf, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":18 - * from cpyamf cimport codec - * import pyamf - * from pyamf import util, amf3, xml # <<<<<<<<<<<<<< - * import types - * - */ - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__util)); - PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__util)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__util)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__amf3)); - PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__amf3)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__amf3)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__xml)); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_n_s__xml)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__xml)); - __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__pyamf), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__util); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__util, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__amf3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__amf3, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__xml); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__xml, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __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; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":19 - * import pyamf - * from pyamf import util, amf3, xml - * import types # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__types), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__types, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":22 - * - * - * try: # <<<<<<<<<<<<<< - * import zlib - * except ImportError: - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - __Pyx_XGOTREF(__pyx_save_exc_type); - __Pyx_XGOTREF(__pyx_save_exc_value); - __Pyx_XGOTREF(__pyx_save_exc_tb); - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":23 - * - * try: - * import zlib # <<<<<<<<<<<<<< - * except ImportError: - * zlib = None - */ - __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__zlib), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__zlib, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 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; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":24 - * try: - * import zlib - * except ImportError: # <<<<<<<<<<<<<< - * zlib = None - * - */ - __pyx_t_3 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); - if (__pyx_t_3) { - __Pyx_AddTraceback("cpyamf.amf3"); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_t_4); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":25 - * import zlib - * except ImportError: - * zlib = None # <<<<<<<<<<<<<< - * - * - */ - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__zlib, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L3_exception_handled; - } - __pyx_L4_except_error:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L3_exception_handled:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L9_try_end:; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":28 - * - * - * cdef char TYPE_UNDEFINED = '\x00' # <<<<<<<<<<<<<< - * cdef char TYPE_NULL = '\x01' - * cdef char TYPE_BOOL_FALSE = '\x02' - */ - __pyx_v_6cpyamf_4amf3_TYPE_UNDEFINED = '\x00'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":29 - * - * cdef char TYPE_UNDEFINED = '\x00' - * cdef char TYPE_NULL = '\x01' # <<<<<<<<<<<<<< - * cdef char TYPE_BOOL_FALSE = '\x02' - * cdef char TYPE_BOOL_TRUE = '\x03' - */ - __pyx_v_6cpyamf_4amf3_TYPE_NULL = '\x01'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":30 - * cdef char TYPE_UNDEFINED = '\x00' - * cdef char TYPE_NULL = '\x01' - * cdef char TYPE_BOOL_FALSE = '\x02' # <<<<<<<<<<<<<< - * cdef char TYPE_BOOL_TRUE = '\x03' - * cdef char TYPE_INTEGER = '\x04' - */ - __pyx_v_6cpyamf_4amf3_TYPE_BOOL_FALSE = '\x02'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":31 - * cdef char TYPE_NULL = '\x01' - * cdef char TYPE_BOOL_FALSE = '\x02' - * cdef char TYPE_BOOL_TRUE = '\x03' # <<<<<<<<<<<<<< - * cdef char TYPE_INTEGER = '\x04' - * cdef char TYPE_NUMBER = '\x05' - */ - __pyx_v_6cpyamf_4amf3_TYPE_BOOL_TRUE = '\x03'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":32 - * cdef char TYPE_BOOL_FALSE = '\x02' - * cdef char TYPE_BOOL_TRUE = '\x03' - * cdef char TYPE_INTEGER = '\x04' # <<<<<<<<<<<<<< - * cdef char TYPE_NUMBER = '\x05' - * cdef char TYPE_STRING = '\x06' - */ - __pyx_v_6cpyamf_4amf3_TYPE_INTEGER = '\x04'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":33 - * cdef char TYPE_BOOL_TRUE = '\x03' - * cdef char TYPE_INTEGER = '\x04' - * cdef char TYPE_NUMBER = '\x05' # <<<<<<<<<<<<<< - * cdef char TYPE_STRING = '\x06' - * cdef char TYPE_XML = '\x07' - */ - __pyx_v_6cpyamf_4amf3_TYPE_NUMBER = '\x05'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":34 - * cdef char TYPE_INTEGER = '\x04' - * cdef char TYPE_NUMBER = '\x05' - * cdef char TYPE_STRING = '\x06' # <<<<<<<<<<<<<< - * cdef char TYPE_XML = '\x07' - * cdef char TYPE_DATE = '\x08' - */ - __pyx_v_6cpyamf_4amf3_TYPE_STRING = '\x06'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":35 - * cdef char TYPE_NUMBER = '\x05' - * cdef char TYPE_STRING = '\x06' - * cdef char TYPE_XML = '\x07' # <<<<<<<<<<<<<< - * cdef char TYPE_DATE = '\x08' - * cdef char TYPE_ARRAY = '\x09' - */ - __pyx_v_6cpyamf_4amf3_TYPE_XML = '\x07'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":36 - * cdef char TYPE_STRING = '\x06' - * cdef char TYPE_XML = '\x07' - * cdef char TYPE_DATE = '\x08' # <<<<<<<<<<<<<< - * cdef char TYPE_ARRAY = '\x09' - * cdef char TYPE_OBJECT = '\x0A' - */ - __pyx_v_6cpyamf_4amf3_TYPE_DATE = '\x08'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":37 - * cdef char TYPE_XML = '\x07' - * cdef char TYPE_DATE = '\x08' - * cdef char TYPE_ARRAY = '\x09' # <<<<<<<<<<<<<< - * cdef char TYPE_OBJECT = '\x0A' - * cdef char TYPE_XMLSTRING = '\x0B' - */ - __pyx_v_6cpyamf_4amf3_TYPE_ARRAY = '\t'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":38 - * cdef char TYPE_DATE = '\x08' - * cdef char TYPE_ARRAY = '\x09' - * cdef char TYPE_OBJECT = '\x0A' # <<<<<<<<<<<<<< - * cdef char TYPE_XMLSTRING = '\x0B' - * cdef char TYPE_BYTEARRAY = '\x0C' - */ - __pyx_v_6cpyamf_4amf3_TYPE_OBJECT = '\n'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":39 - * cdef char TYPE_ARRAY = '\x09' - * cdef char TYPE_OBJECT = '\x0A' - * cdef char TYPE_XMLSTRING = '\x0B' # <<<<<<<<<<<<<< - * cdef char TYPE_BYTEARRAY = '\x0C' - * - */ - __pyx_v_6cpyamf_4amf3_TYPE_XMLSTRING = '\x0B'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":40 - * cdef char TYPE_OBJECT = '\x0A' - * cdef char TYPE_XMLSTRING = '\x0B' - * cdef char TYPE_BYTEARRAY = '\x0C' # <<<<<<<<<<<<<< - * - * cdef unsigned int REFERENCE_BIT = 0x01 - */ - __pyx_v_6cpyamf_4amf3_TYPE_BYTEARRAY = '\x0C'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":42 - * cdef char TYPE_BYTEARRAY = '\x0C' - * - * cdef unsigned int REFERENCE_BIT = 0x01 # <<<<<<<<<<<<<< - * cdef char REF_CHAR = '\x01' - * - */ - __pyx_v_6cpyamf_4amf3_REFERENCE_BIT = 0x01; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":43 - * - * cdef unsigned int REFERENCE_BIT = 0x01 - * cdef char REF_CHAR = '\x01' # <<<<<<<<<<<<<< - * - * #: The maximum that can be represented by an signed 29 bit integer. - */ - __pyx_v_6cpyamf_4amf3_REF_CHAR = '\x01'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":46 - * - * #: The maximum that can be represented by an signed 29 bit integer. - * cdef long MAX_29B_INT = 0x0FFFFFFF # <<<<<<<<<<<<<< - * - * #: The minimum that can be represented by an signed 29 bit integer. - */ - __pyx_v_6cpyamf_4amf3_MAX_29B_INT = 0x0FFFFFFF; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":49 - * - * #: The minimum that can be represented by an signed 29 bit integer. - * cdef long MIN_29B_INT = -0x10000000 # <<<<<<<<<<<<<< - * - * cdef int OBJECT_ENCODING_STATIC = 0x00 - */ - __pyx_v_6cpyamf_4amf3_MIN_29B_INT = -268435456; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":51 - * cdef long MIN_29B_INT = -0x10000000 - * - * cdef int OBJECT_ENCODING_STATIC = 0x00 # <<<<<<<<<<<<<< - * cdef int OBJECT_ENCODING_EXTERNAL = 0x01 - * cdef int OBJECT_ENCODING_DYNAMIC = 0x02 - */ - __pyx_v_6cpyamf_4amf3_OBJECT_ENCODING_STATIC = 0x00; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":52 - * - * cdef int OBJECT_ENCODING_STATIC = 0x00 - * cdef int OBJECT_ENCODING_EXTERNAL = 0x01 # <<<<<<<<<<<<<< - * cdef int OBJECT_ENCODING_DYNAMIC = 0x02 - * cdef int OBJECT_ENCODING_PROXY = 0x03 - */ - __pyx_v_6cpyamf_4amf3_OBJECT_ENCODING_EXTERNAL = 0x01; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":53 - * cdef int OBJECT_ENCODING_STATIC = 0x00 - * cdef int OBJECT_ENCODING_EXTERNAL = 0x01 - * cdef int OBJECT_ENCODING_DYNAMIC = 0x02 # <<<<<<<<<<<<<< - * cdef int OBJECT_ENCODING_PROXY = 0x03 - * - */ - __pyx_v_6cpyamf_4amf3_OBJECT_ENCODING_DYNAMIC = 0x02; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":54 - * cdef int OBJECT_ENCODING_EXTERNAL = 0x01 - * cdef int OBJECT_ENCODING_DYNAMIC = 0x02 - * cdef int OBJECT_ENCODING_PROXY = 0x03 # <<<<<<<<<<<<<< - * - * cdef object ByteArrayType = amf3.ByteArray - */ - __pyx_v_6cpyamf_4amf3_OBJECT_ENCODING_PROXY = 0x03; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":56 - * cdef int OBJECT_ENCODING_PROXY = 0x03 - * - * cdef object ByteArrayType = amf3.ByteArray # <<<<<<<<<<<<<< - * cdef object DataInput = amf3.DataInput - * cdef object DataOutput = amf3.DataOutput - */ - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__amf3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__ByteArray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_v_6cpyamf_4amf3_ByteArrayType); - __Pyx_DECREF(__pyx_v_6cpyamf_4amf3_ByteArrayType); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_v_6cpyamf_4amf3_ByteArrayType = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":57 - * - * cdef object ByteArrayType = amf3.ByteArray - * cdef object DataInput = amf3.DataInput # <<<<<<<<<<<<<< - * cdef object DataOutput = amf3.DataOutput - * cdef str empty_string = str('') - */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__amf3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__DataInput); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_v_6cpyamf_4amf3_DataInput); - __Pyx_DECREF(__pyx_v_6cpyamf_4amf3_DataInput); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_v_6cpyamf_4amf3_DataInput = __pyx_t_4; - __pyx_t_4 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":58 - * cdef object ByteArrayType = amf3.ByteArray - * cdef object DataInput = amf3.DataInput - * cdef object DataOutput = amf3.DataOutput # <<<<<<<<<<<<<< - * cdef str empty_string = str('') - * cdef unicode empty_unicode = empty_string.decode('utf-8') - */ - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__amf3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__DataOutput); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_v_6cpyamf_4amf3_DataOutput); - __Pyx_DECREF(__pyx_v_6cpyamf_4amf3_DataOutput); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_v_6cpyamf_4amf3_DataOutput = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":59 - * cdef object DataInput = amf3.DataInput - * cdef object DataOutput = amf3.DataOutput - * cdef str empty_string = str('') # <<<<<<<<<<<<<< - * cdef unicode empty_unicode = empty_string.decode('utf-8') - * cdef object undefined = pyamf.Undefined - */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), ((PyObject *)__pyx_k_tuple_26), NULL); 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 (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_v_6cpyamf_4amf3_empty_string)); - __Pyx_DECREF(((PyObject *)__pyx_v_6cpyamf_4amf3_empty_string)); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_v_6cpyamf_4amf3_empty_string = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":60 - * cdef object DataOutput = amf3.DataOutput - * cdef str empty_string = str('') - * cdef unicode empty_unicode = empty_string.decode('utf-8') # <<<<<<<<<<<<<< - * cdef object undefined = pyamf.Undefined - * - */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_6cpyamf_4amf3_empty_string), __pyx_n_s__decode); 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_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_27), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected unicode, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_v_6cpyamf_4amf3_empty_unicode)); - __Pyx_DECREF(((PyObject *)__pyx_v_6cpyamf_4amf3_empty_unicode)); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_v_6cpyamf_4amf3_empty_unicode = ((PyObject *)__pyx_t_4); - __pyx_t_4 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":61 - * cdef str empty_string = str('') - * cdef unicode empty_unicode = empty_string.decode('utf-8') - * cdef object undefined = pyamf.Undefined # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__Undefined); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_v_6cpyamf_4amf3_undefined); - __Pyx_DECREF(__pyx_v_6cpyamf_4amf3_undefined); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_v_6cpyamf_4amf3_undefined = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/amf3.pyx":1 - * # Copyright (c) The PyAMF Project. # <<<<<<<<<<<<<< - * # See LICENSE.txt for details. - * - */ - __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(((PyObject *)__pyx_t_1)); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/Library/Python/2.6/site-packages/Cython/Includes/cpython/type.pxd":2 - * - * cdef extern from "Python.h": # <<<<<<<<<<<<<< - * # The C structure of the objects used to describe built-in types. - * - */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); - if (__pyx_m) { - __Pyx_AddTraceback("init cpyamf.amf3"); - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init cpyamf.amf3"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -/* Runtime support code */ - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} - -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 *number, *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"; - } - number = (num_expected == 1) ? "" : "s"; - PyErr_Format(PyExc_TypeError, - #if PY_VERSION_HEX < 0x02050000 - "%s() takes %s %d positional argument%s (%d given)", - #else - "%s() takes %s %zd positional argument%s (%zd given)", - #endif - func_name, more_or_less, num_expected, number, 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; - while (PyDict_Next(kwdict, &pos, &key, 0)) { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) - #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) - #endif - goto invalid_keyword_type; - } - if ((!kw_allowed) && unlikely(key)) - goto invalid_keyword; - return 1; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - return 0; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif - 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_AS_STRING(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; - } else { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { - #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { - #endif - goto invalid_keyword_type; - } else { - for (name = first_kw_arg; *name; name++) { - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) break; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) break; - #endif - } - if (*name) { - values[name-argnames] = value; - } else { - /* unexpected keyword found */ - for (name=argnames; name != first_kw_arg; name++) { - if (**name == key) goto arg_passed_twice; - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) goto arg_passed_twice; - #endif - } - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - } - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, **name); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - 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); -} - -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - 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; -} - - -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { - PyObject *local_type, *local_value, *local_tb; - 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; - PyErr_NormalizeException(&local_type, &local_value, &local_tb); - if (unlikely(tstate->curexc_type)) - goto bad; - #if PY_MAJOR_VERSION >= 3 - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) - goto bad; - #endif - *type = local_type; - *value = local_value; - *tb = local_tb; - Py_INCREF(local_type); - Py_INCREF(local_value); - Py_INCREF(local_tb); - 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; - /* Make sure tstate is in a consistent state when we XDECREF - these objects (XDECREF may run arbitrary code). */ - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); - return 0; -bad: - *type = 0; - *value = 0; - *tb = 0; - Py_XDECREF(local_type); - Py_XDECREF(local_value); - Py_XDECREF(local_tb); - return -1; -} - - -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (unlikely(!type)) { - PyErr_Format(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 int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (Py_TYPE(obj) == type) return 1; - } - else { - if (PyObject_TypeCheck(obj, type)) return 1; - } - PyErr_Format(PyExc_TypeError, - "Argument '%s' has incorrect type (expected %s, got %s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); - return 0; -} - - - -static double __Pyx__PyObject_AsDouble(PyObject* obj) { - PyObject* float_value; - if (Py_TYPE(obj)->tp_as_number && Py_TYPE(obj)->tp_as_number->nb_float) { - return PyFloat_AsDouble(obj); - } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) { -#if PY_MAJOR_VERSION >= 3 - float_value = PyFloat_FromString(obj); -#else - float_value = PyFloat_FromString(obj, 0); -#endif - } else { - PyObject* args = PyTuple_New(1); - if (unlikely(!args)) goto bad; - PyTuple_SET_ITEM(args, 0, obj); - float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0); - PyTuple_SET_ITEM(args, 0, 0); - Py_DECREF(args); - } - if (likely(float_value)) { - double value = PyFloat_AS_DOUBLE(float_value); - Py_DECREF(float_value); - return value; - } -bad: - return (double)-1; -} - -static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { - 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); -} - -static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { - 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); -} - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *py_import = 0; - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - py_import = __Pyx_GetAttrString(__pyx_b, "__import__"); - if (!py_import) - goto bad; - 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; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, NULL); -bad: - Py_XDECREF(empty_list); - Py_XDECREF(py_import); - Py_XDECREF(empty_dict); - return module; -} - -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - Py_XINCREF(type); - Py_XINCREF(value); - Py_XINCREF(tb); - /* First, check the traceback argument, replacing None with NULL. */ - if (tb == Py_None) { - Py_DECREF(tb); - tb = 0; - } - else if (tb != NULL && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - /* Next, replace a missing value with None */ - if (value == NULL) { - value = Py_None; - Py_INCREF(value); - } - #if PY_VERSION_HEX < 0x02050000 - if (!PyClass_Check(type)) - #else - if (!PyType_Check(type)) - #endif - { - /* Raising an instance. The value should be a dummy. */ - if (value != Py_None) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - /* Normalize to raise , */ - Py_DECREF(value); - value = type; - #if PY_VERSION_HEX < 0x02050000 - if (PyInstance_Check(type)) { - type = (PyObject*) ((PyInstanceObject*)type)->in_class; - Py_INCREF(type); - } - else { - type = 0; - PyErr_SetString(PyExc_TypeError, - "raise: exception must be an old-style class or instance"); - goto raise_error; - } - #else - 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; - } - #endif - } - - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} - -#else /* Python 3+ */ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - 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)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } - - PyErr_SetObject(type, value); - - if (tb) { - 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); - } - } - -bad: - return; -} -#endif - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { - const unsigned char neg_one = (unsigned char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned char" : - "value too large to convert to unsigned char"); - } - return (unsigned char)-1; - } - return (unsigned char)val; - } - return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { - const unsigned short neg_one = (unsigned short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned short" : - "value too large to convert to unsigned short"); - } - return (unsigned short)-1; - } - return (unsigned short)val; - } - return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { - const unsigned int neg_one = (unsigned int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned int" : - "value too large to convert to unsigned int"); - } - return (unsigned int)-1; - } - return (unsigned int)val; - } - return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { - const char neg_one = (char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to char" : - "value too large to convert to char"); - } - return (char)-1; - } - return (char)val; - } - return (char)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { - const short neg_one = (short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to short" : - "value too large to convert to short"); - } - return (short)-1; - } - return (short)val; - } - return (short)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { - const signed char neg_one = (signed char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed char" : - "value too large to convert to signed char"); - } - return (signed char)-1; - } - return (signed char)val; - } - return (signed char)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { - const signed short neg_one = (signed short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed short" : - "value too large to convert to signed short"); - } - return (signed short)-1; - } - return (signed short)val; - } - return (signed short)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { - const signed int neg_one = (signed int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed int" : - "value too large to convert to signed int"); - } - return (signed int)-1; - } - return (signed int)val; - } - return (signed int)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { - const unsigned long neg_one = (unsigned long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - unsigned long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned long)-1; - val = __Pyx_PyInt_AsUnsignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { - const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - unsigned PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { - const long neg_one = (long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long)-1; - val = __Pyx_PyInt_AsLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { - const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { - const signed long neg_one = (signed long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - signed long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed long)-1; - val = __Pyx_PyInt_AsSignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { - const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - signed PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsSignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static void __Pyx_WriteUnraisable(const char *name) { - PyObject *old_exc, *old_val, *old_tb; - PyObject *ctx; - __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); - #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 int __Pyx_SetVtable(PyObject *dict, void *vtable) { -#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) - PyObject *ob = PyCapsule_New(vtable, 0, 0); -#else - PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); -#endif - if (!ob) - goto bad; - if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0) - goto bad; - Py_DECREF(ob); - return 0; -bad: - Py_XDECREF(ob); - return -1; -} - -#ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - long size, int strict) -{ - PyObject *py_module = 0; - PyObject *result = 0; - PyObject *py_name = 0; - char warning[200]; - - py_module = __Pyx_ImportModule(module_name); - if (!py_module) - goto bad; - #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(class_name); - #else - py_name = PyUnicode_FromString(class_name); - #endif - 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, - "%s.%s is not a type object", - module_name, class_name); - goto bad; - } - if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), - "%s.%s size changed, may indicate binary incompatibility", - module_name, class_name); - #if PY_VERSION_HEX < 0x02050000 - PyErr_Warn(NULL, warning); - #else - PyErr_WarnEx(NULL, warning, 0); - #endif - } - else if (((PyTypeObject *)result)->tp_basicsize != size) { - PyErr_Format(PyExc_ValueError, - "%s.%s has the wrong size, try recompiling", - module_name, class_name); - goto bad; - } - return (PyTypeObject *)result; -bad: - Py_XDECREF(py_module); - Py_XDECREF(result); - return 0; -} -#endif - -#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; - - #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(name); - #else - py_name = PyUnicode_FromString(name); - #endif - 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 - -static int __Pyx_GetVtable(PyObject *dict, void *vtabptr) { - PyObject *ob = PyMapping_GetItemString(dict, (char *)"__pyx_vtable__"); - if (!ob) - goto bad; -#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) - *(void **)vtabptr = PyCapsule_GetPointer(ob, 0); -#else - *(void **)vtabptr = PyCObject_AsVoidPtr(ob); -#endif - if (!*(void **)vtabptr) - goto bad; - Py_DECREF(ob); - return 0; -bad: - Py_XDECREF(ob); - return -1; -} - -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" - -static void __Pyx_AddTraceback(const char *funcname) { - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - PyObject *py_globals = 0; - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(__pyx_filename); - #else - py_srcfile = PyUnicode_FromString(__pyx_filename); - #endif - if (!py_srcfile) goto bad; - if (__pyx_clineno) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #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_globals = PyModule_GetDict(__pyx_m); - if (!py_globals) goto bad; - py_code = PyCode_New( - 0, /*int argcount,*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*int kwonlyargcount,*/ - #endif - 0, /*int nlocals,*/ - 0, /*int stacksize,*/ - 0, /*int flags,*/ - __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,*/ - __pyx_lineno, /*int firstlineno,*/ - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - if (!py_code) goto bad; - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - py_globals, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = __pyx_lineno; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -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 /* Python 3+ has unicode identifiers */ - 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; -} - -/* Type Conversion Functions */ - -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_VERSION_HEX < 0x03000000 - 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_VERSION_HEX < 0x03000000 - 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_VERSION_HEX < 0x03000000 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%s__ returned non-%s (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 = 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) { -#if PY_VERSION_HEX < 0x02050000 - if (ival <= LONG_MAX) - return PyInt_FromLong((long)ival); - else { - unsigned char *bytes = (unsigned char *) &ival; - int one = 1; int little = (int)*(unsigned char*)&one; - return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); - } -#else - return PyInt_FromSize_t(ival); -#endif -} - -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { - unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); - if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { - return (size_t)-1; - } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t)-1; - } - return (size_t)val; -} - - -#endif /* Py_PYTHON_H */ diff --git a/cpyamf/codec.c b/cpyamf/codec.c deleted file mode 100644 index eb305de3..00000000 --- a/cpyamf/codec.c +++ /dev/null @@ -1,11818 +0,0 @@ -/* Generated by Cython 0.13 on Thu Nov 25 19:27:12 2010 */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#else - -#include /* For offsetof */ -#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 - -#if PY_VERSION_HEX < 0x02040000 - #define METH_COEXIST 0 - #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) - #define PyDict_Contains(d,o) PySequence_Contains(d,o) -#endif - -#if PY_VERSION_HEX < 0x02050000 - typedef int Py_ssize_t; - #define PY_SSIZE_T_MAX INT_MAX - #define PY_SSIZE_T_MIN INT_MIN - #define PY_FORMAT_SIZE_T "" - #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) PyInt_AsLong(o) - #define PyNumber_Index(o) PyNumber_Int(o) - #define PyIndex_Check(o) PyNumber_Check(o) - #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - -#endif - -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" -#endif - -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif - -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#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_VERSION_HEX < 0x02060000 - #define PyBytesObject PyStringObject - #define PyBytes_Type PyString_Type - #define PyBytes_Check PyString_Check - #define PyBytes_CheckExact PyString_CheckExact - #define PyBytes_FromString PyString_FromString - #define PyBytes_FromStringAndSize PyString_FromStringAndSize - #define PyBytes_FromFormat PyString_FromFormat - #define PyBytes_DecodeEscape PyString_DecodeEscape - #define PyBytes_AsString PyString_AsString - #define PyBytes_AsStringAndSize PyString_AsStringAndSize - #define PyBytes_Size PyString_Size - #define PyBytes_AS_STRING PyString_AS_STRING - #define PyBytes_GET_SIZE PyString_GET_SIZE - #define PyBytes_Repr PyString_Repr - #define PyBytes_Concat PyString_Concat - #define PyBytes_ConcatAndDel PyString_ConcatAndDel - #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) - #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) -#endif - -#ifndef PySet_CheckExact -# define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif - -#if PY_MAJOR_VERSION >= 3 - #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 -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#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 - -#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) - #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) - #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) -#else - #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) - #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) -#else - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_NAMESTR(n) ((char *)(n)) - #define __Pyx_DOCSTR(n) ((char *)(n)) -#else - #define __Pyx_NAMESTR(n) (n) - #define __Pyx_DOCSTR(n) (n) -#endif - -#ifdef __cplusplus -#define __PYX_EXTERN_C extern "C" -#else -#define __PYX_EXTERN_C extern -#endif - -#if defined(WIN32) || defined(MS_WINDOWS) -#define _USE_MATH_DEFINES -#endif -#include -#define __PYX_HAVE_API__cpyamf__codec -#include "stdio.h" -#include "pythread.h" -#include "datetime.h" - -/* inline attribute */ -#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 - -/* unused attribute */ -#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) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif - -typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ - - -/* Type Conversion Predeclarations */ - -#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) - -#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); -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); - -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) - - -#ifdef __GNUC__ -/* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else /* __GNUC__ > 2 ... */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -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[] = { - "codec.pyx", - "codec.pxd", - "util.pxd", - "bool.pxd", -}; - -/* Type declarations */ - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pxd":28 - * cpdef bint at_eof(self) except -1 - * cpdef inline Py_ssize_t remaining(self) except -1 - * cpdef int seek(self, Py_ssize_t pos, int mode=*) except -1 # <<<<<<<<<<<<<< - * cpdef object getvalue(self) - * cdef Py_ssize_t peek(self, char **buf, Py_ssize_t size) except -1 - */ - -struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_seek { - int __pyx_n; - int mode; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pxd":31 - * cpdef object getvalue(self) - * cdef Py_ssize_t peek(self, char **buf, Py_ssize_t size) except -1 - * cpdef int truncate(self, Py_ssize_t size=?) except -1 # <<<<<<<<<<<<<< - * cpdef int consume(self) except -1 - * cdef int unpack_int(self, unsigned int num_bytes, void *ret) except -1 - */ - -struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_truncate { - int __pyx_n; - Py_ssize_t size; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":102 - * cdef int writeDate(self, object o) except -1 - * cdef int writeXML(self, object o) except -1 - * cpdef int writeList(self, object o, bint is_proxy=?) except -1 # <<<<<<<<<<<<<< - * cdef int writeTuple(self, object o) except -1 - * cdef int writeSequence(self, object iterable) except -1 - */ - -struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeList { - int __pyx_n; - int is_proxy; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":105 - * cdef int writeTuple(self, object o) except -1 - * cdef int writeSequence(self, object iterable) except -1 - * cpdef int writeObject(self, object o, bint is_proxy=?) except -1 # <<<<<<<<<<<<<< - * cdef int writeDict(self, dict o) except -1 - * cdef int writeMixedArray(self, object o) except -1 - */ - -struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeObject { - int __pyx_n; - int is_proxy; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":54 - * - * - * cdef class Codec(object): # <<<<<<<<<<<<<< - * """ - * Base class for Encoder/Decoder classes. Provides base functionality for - */ - -struct __pyx_obj_6cpyamf_5codec_Codec { - PyObject_HEAD - struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *stream; - int strict; - PyObject *timezone_offset; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":65 - * - * - * cdef class Decoder(Codec): # <<<<<<<<<<<<<< - * cdef object readDate(self) - * cpdef object readString(self) - */ - -struct __pyx_obj_6cpyamf_5codec_Decoder { - struct __pyx_obj_6cpyamf_5codec_Codec __pyx_base; - struct __pyx_vtabstruct_6cpyamf_5codec_Decoder *__pyx_vtab; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pxd":5 - * - * - * cdef class cBufferedByteStream: # <<<<<<<<<<<<<< - * """ - * The c version of BufferedByteStream. - */ - -struct __pyx_obj_6cpyamf_4util_cBufferedByteStream { - PyObject_HEAD - struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *__pyx_vtab; - char endian; - char *buffer; - int closed; - Py_ssize_t pos; - Py_ssize_t size; - Py_ssize_t length; - Py_ssize_t min_buf_size; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pxd":61 - * - * - * cdef class BufferedByteStream(cBufferedByteStream): # <<<<<<<<<<<<<< - * """ - * A file like object that mimics StringIO with some extra helper methods. - */ - -struct __pyx_obj_6cpyamf_4util_BufferedByteStream { - struct __pyx_obj_6cpyamf_4util_cBufferedByteStream __pyx_base; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":619 - * - * - * cdef class _CustomTypeFunc(object): # <<<<<<<<<<<<<< - * """ - * Support for custom type mappings when encoding. - */ - -struct __pyx_obj_6cpyamf_5codec__CustomTypeFunc { - PyObject_HEAD - struct __pyx_obj_6cpyamf_5codec_Encoder *encoder; - PyObject *func; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":11 - * from cpyamf cimport util - * - * cdef class IndexedCollection(object): # <<<<<<<<<<<<<< - * """ - * Provides reference functionality for amf contexts. - */ - -struct __pyx_obj_6cpyamf_5codec_IndexedCollection { - PyObject_HEAD - struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *__pyx_vtab; - int use_hash; - PyObject **data; - PyObject *refs; - Py_ssize_t size; - Py_ssize_t length; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":32 - * - * - * cdef class Context(object): # <<<<<<<<<<<<<< - * """ - * C based version of ``pyamf.BaseContext`` - */ - -struct __pyx_obj_6cpyamf_5codec_Context { - PyObject_HEAD - struct __pyx_vtabstruct_6cpyamf_5codec_Context *__pyx_vtab; - PyObject *class_aliases; - struct __pyx_obj_6cpyamf_5codec_IndexedCollection *objects; - PyObject *unicodes; - PyObject *_strings; - PyObject *extra; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":81 - * - * - * cdef class Encoder(Codec): # <<<<<<<<<<<<<< - * """ - * """ - */ - -struct __pyx_obj_6cpyamf_5codec_Encoder { - struct __pyx_obj_6cpyamf_5codec_Codec __pyx_base; - struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *__pyx_vtab; - PyObject *func_cache; - PyObject *use_write_object; - PyObject *bucket; -}; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":196 - * - * - * cdef class Context(object): # <<<<<<<<<<<<<< - * """ - * I hold the AMF context for en/decoding streams. - */ - -struct __pyx_vtabstruct_6cpyamf_5codec_Context { - int (*clear)(struct __pyx_obj_6cpyamf_5codec_Context *, int __pyx_skip_dispatch); - PyObject *(*getClassAlias)(struct __pyx_obj_6cpyamf_5codec_Context *, PyObject *, int __pyx_skip_dispatch); - PyObject *(*getObject)(struct __pyx_obj_6cpyamf_5codec_Context *, Py_ssize_t, int __pyx_skip_dispatch); - Py_ssize_t (*getObjectReference)(struct __pyx_obj_6cpyamf_5codec_Context *, PyObject *, int __pyx_skip_dispatch); - Py_ssize_t (*addObject)(struct __pyx_obj_6cpyamf_5codec_Context *, PyObject *, int __pyx_skip_dispatch); - PyObject *(*getStringForBytes)(struct __pyx_obj_6cpyamf_5codec_Context *, PyObject *, int __pyx_skip_dispatch); - PyObject *(*getBytesForString)(struct __pyx_obj_6cpyamf_5codec_Context *, PyObject *, int __pyx_skip_dispatch); -}; -static struct __pyx_vtabstruct_6cpyamf_5codec_Context *__pyx_vtabptr_6cpyamf_5codec_Context; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":330 - * - * - * cdef class Decoder(Codec): # <<<<<<<<<<<<<< - * """ - * Base AMF decoder. - */ - -struct __pyx_vtabstruct_6cpyamf_5codec_Decoder { - PyObject *(*readDate)(struct __pyx_obj_6cpyamf_5codec_Decoder *); - PyObject *(*readString)(struct __pyx_obj_6cpyamf_5codec_Decoder *, int __pyx_skip_dispatch); - PyObject *(*readObject)(struct __pyx_obj_6cpyamf_5codec_Decoder *); - PyObject *(*readNumber)(struct __pyx_obj_6cpyamf_5codec_Decoder *); - PyObject *(*readNull)(struct __pyx_obj_6cpyamf_5codec_Decoder *); - PyObject *(*readUndefined)(struct __pyx_obj_6cpyamf_5codec_Decoder *); - PyObject *(*readList)(struct __pyx_obj_6cpyamf_5codec_Decoder *); - PyObject *(*readXML)(struct __pyx_obj_6cpyamf_5codec_Decoder *); - PyObject *(*readElement)(struct __pyx_obj_6cpyamf_5codec_Decoder *, int __pyx_skip_dispatch); - PyObject *(*readConcreteElement)(struct __pyx_obj_6cpyamf_5codec_Decoder *, char); - int (*send)(struct __pyx_obj_6cpyamf_5codec_Decoder *, PyObject *, int __pyx_skip_dispatch); -}; -static struct __pyx_vtabstruct_6cpyamf_5codec_Decoder *__pyx_vtabptr_6cpyamf_5codec_Decoder; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pxd":5 - * - * - * cdef class cBufferedByteStream: # <<<<<<<<<<<<<< - * """ - * The c version of BufferedByteStream. - */ - -struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream { - Py_ssize_t (*tell)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - int (*write)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, char *, Py_ssize_t); - int (*_init_buffer)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *); - int (*_actually_increase_buffer)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t); - int (*_increase_buffer)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t); - int (*has_available)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t); - int (*read)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, char **, Py_ssize_t); - int (*at_eof)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - Py_ssize_t (*remaining)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - int (*seek)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_seek *__pyx_optional_args); - PyObject *(*getvalue)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - Py_ssize_t (*peek)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, char **, Py_ssize_t); - int (*truncate)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_truncate *__pyx_optional_args); - int (*consume)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - int (*unpack_int)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned int, void *); - int (*pack_int)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int, long); - int (*pack_uint)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int, unsigned long); - unsigned char (*read_uchar)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - char (*read_char)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - unsigned short (*read_ushort)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - short (*read_short)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - unsigned long (*read_24bit_uint)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - long (*read_24bit_int)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - unsigned long (*read_ulong)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - long (*read_long)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - int (*write_uchar)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned char, int __pyx_skip_dispatch); - int (*write_char)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, char, int __pyx_skip_dispatch); - int (*write_ushort)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned short, int __pyx_skip_dispatch); - int (*write_short)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, short, int __pyx_skip_dispatch); - int (*write_24bit_uint)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned long, int __pyx_skip_dispatch); - int (*write_24bit_int)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, long, int __pyx_skip_dispatch); - int (*write_ulong)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned long, int __pyx_skip_dispatch); - int (*write_long)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, long, int __pyx_skip_dispatch); - PyObject *(*read_utf8_string)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t, int __pyx_skip_dispatch); - int (*write_utf8_string)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, PyObject *, int __pyx_skip_dispatch); - int (*read_double)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, double *); - int (*write_double)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, double, int __pyx_skip_dispatch); - int (*read_float)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, float *); - int (*write_float)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, float, int __pyx_skip_dispatch); - int (*append)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, PyObject *, int __pyx_skip_dispatch); -}; -static struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *__pyx_vtabptr_6cpyamf_4util_cBufferedByteStream; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":38 - * - * - * cdef class IndexedCollection(object): # <<<<<<<<<<<<<< - * """ - * Provides reference functionality for amf contexts. - */ - -struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection { - int (*_actually_increase_size)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *); - int (*_increase_size)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *); - void (*_clear)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *); - int (*clear)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *, int __pyx_skip_dispatch); - PyObject *(*_ref)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *, PyObject *); - PyObject *(*getByReference)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *, Py_ssize_t, int __pyx_skip_dispatch); - Py_ssize_t (*getReferenceTo)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *, PyObject *, int __pyx_skip_dispatch); - Py_ssize_t (*append)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *, PyObject *, int __pyx_skip_dispatch); -}; -static struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *__pyx_vtabptr_6cpyamf_5codec_IndexedCollection; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pxd":61 - * - * - * cdef class BufferedByteStream(cBufferedByteStream): # <<<<<<<<<<<<<< - * """ - * A file like object that mimics StringIO with some extra helper methods. - */ - -struct __pyx_vtabstruct_6cpyamf_4util_BufferedByteStream { - struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream __pyx_base; -}; -static struct __pyx_vtabstruct_6cpyamf_4util_BufferedByteStream *__pyx_vtabptr_6cpyamf_4util_BufferedByteStream; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":404 - * - * - * cdef class Encoder(Codec): # <<<<<<<<<<<<<< - * """ - * Base AMF encoder. - */ - -struct __pyx_vtabstruct_6cpyamf_5codec_Encoder { - int (*serialiseString)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch); - int (*writeType)(struct __pyx_obj_6cpyamf_5codec_Encoder *, char); - int (*writeNull)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeUndefined)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeString)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeBytes)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeBoolean)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeInt)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeLong)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeNumber)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeDateTime)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeDate)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeXML)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeList)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeList *__pyx_optional_args); - int (*writeTuple)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeSequence)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeObject)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeObject *__pyx_optional_args); - int (*writeDict)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeMixedArray)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*writeGenerator)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *); - int (*handleBasicTypes)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, PyObject *); - int (*checkBadTypes)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, PyObject *); - int (*writeElement)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch); - int (*send)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch); -}; -static struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *__pyx_vtabptr_6cpyamf_5codec_Encoder; - -#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) { - 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; - } - #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) - #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_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0) -#else - #define __Pyx_RefNannySetupContext(name) - #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_XDECREF(r) Py_XDECREF(r) -#endif /* CYTHON_REFNANNY */ -#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) -#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, PyObject* kw_name); /*proto*/ - -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); /*proto*/ - -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ - -static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { - PyObject* value; -#if PY_MAJOR_VERSION >= 3 - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (unlikely(PyErr_Occurred())) - return NULL; - value = default_value; - } - Py_INCREF(value); -#else - if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { - /* these presumably have safe hash functions */ - value = PyDict_GetItem(d, key); - if (unlikely(!value)) { - value = default_value; - } - Py_INCREF(value); - } else { - PyObject *m; - m = __Pyx_GetAttrString(d, "get"); - if (!m) return NULL; - value = PyObject_CallFunctionObjArgs(m, key, - (default_value == Py_None) ? NULL : default_value, NULL); - Py_DECREF(m); - } -#endif - return value; -} - -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ - -static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, - const char* function_name, int kw_allowed); /*proto*/ - -static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void); - -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { - PyObject *value; - if (unlikely(d == Py_None)) { - __Pyx_RaiseNoneIndexingError(); - return NULL; - } - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (!PyErr_Occurred()) - PyErr_SetObject(PyExc_KeyError, key); - return NULL; - } - Py_INCREF(value); - return value; -} -#else - #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) -#endif - -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); /*proto*/ - -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); - -static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/ -static int __Pyx_EndUnpack(PyObject *, Py_ssize_t expected); /*proto*/ - -static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ -static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /*proto*/ - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); - -static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ - -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict); /*proto*/ - -static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ - -static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/ - -static void __Pyx_AddTraceback(const char *funcname); /*proto*/ - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -/* Module declarations from cpyamf */ - -/* Module declarations from cpyamf.util */ - -static PyTypeObject *__pyx_ptype_6cpyamf_4util_cBufferedByteStream = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_4util_BufferedByteStream = 0; -/* 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 cpython.type */ - -/* 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 cpython.complex */ - -/* 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.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 cpyamf.codec */ - -static PyTypeObject *__pyx_ptype_6cpyamf_5codec_IndexedCollection = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_5codec_Context = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_5codec_Codec = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_5codec_Decoder = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_5codec_Encoder = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_5codec__CustomTypeFunc = 0; -static PyObject *__pyx_v_6cpyamf_5codec_MixedArray = 0; -static PyObject *__pyx_v_6cpyamf_5codec_Undefined = 0; -static PyObject *__pyx_v_6cpyamf_5codec_BuiltinFunctionType = 0; -static PyObject *__pyx_v_6cpyamf_5codec_GeneratorType = 0; -static PyObject *__pyx_f_6cpyamf_5codec_get_custom_type_func(PyObject *, PyObject *); /*proto*/ -#define __Pyx_MODULE_NAME "cpyamf.codec" -int __pyx_module_is_main_cpyamf__codec = 0; - -/* Implementation of cpyamf.codec */ -static PyObject *__pyx_builtin_NotImplementedError; -static PyObject *__pyx_builtin_KeyError; -static PyObject *__pyx_builtin_basestring; -static PyObject *__pyx_builtin_IOError; -static PyObject *__pyx_builtin_StopIteration; -static PyObject *__pyx_builtin_AttributeError; -static PyObject *__pyx_builtin_IndexError; -static PyObject *__pyx_builtin_TypeError; -static PyObject *__pyx_builtin_callable; -static char __pyx_k_2[] = "_actually_increase_size"; -static char __pyx_k_3[] = "utf-8"; -static char __pyx_k_8[] = "Cannot encode modules"; -static char __pyx_k_10[] = "Cannot encode methods"; -static char __pyx_k_12[] = "Cannot encode functions"; -static char __pyx_k_14[] = "Cannot encode class objects"; -static char __pyx_k_16[] = "A datetime.time instance was found but AMF has no way to encode time objects. Please use datetime.datetime instead"; -static char __pyx_k_19[] = "\nC-extension for L{pyamf.amf3} Python module in L{PyAMF}.\n\n@since: 0.4\n"; -static char __pyx_k__o[] = "o"; -static char __pyx_k__pop[] = "pop"; -static char __pyx_k__xml[] = "xml"; -static char __pyx_k___ref[] = "_ref"; -static char __pyx_k__data[] = "data"; -static char __pyx_k__func[] = "func"; -static char __pyx_k__next[] = "next"; -static char __pyx_k__read[] = "read"; -static char __pyx_k__refs[] = "refs"; -static char __pyx_k__seek[] = "seek"; -static char __pyx_k__send[] = "send"; -static char __pyx_k__size[] = "size"; -static char __pyx_k__tell[] = "tell"; -static char __pyx_k__time[] = "time"; -static char __pyx_k__util[] = "util"; -static char __pyx_k__clear[] = "clear"; -static char __pyx_k__defer[] = "defer"; -static char __pyx_k__extra[] = "extra"; -static char __pyx_k__pyamf[] = "pyamf"; -static char __pyx_k__types[] = "types"; -static char __pyx_k__write[] = "write"; -static char __pyx_k___clear[] = "_clear"; -static char __pyx_k__append[] = "append"; -static char __pyx_k__at_eof[] = "at_eof"; -static char __pyx_k__bucket[] = "bucket"; -static char __pyx_k__decode[] = "decode"; -static char __pyx_k__encode[] = "encode"; -static char __pyx_k__is_xml[] = "is_xml"; -static char __pyx_k__length[] = "length"; -static char __pyx_k__stream[] = "stream"; -static char __pyx_k__strict[] = "strict"; -static char __pyx_k__IOError[] = "IOError"; -static char __pyx_k__combine[] = "combine"; -static char __pyx_k__context[] = "context"; -static char __pyx_k__encoder[] = "encoder"; -static char __pyx_k__objects[] = "objects"; -static char __pyx_k__EOStream[] = "EOStream"; -static char __pyx_k__KeyError[] = "KeyError"; -static char __pyx_k__TYPE_MAP[] = "TYPE_MAP"; -static char __pyx_k____main__[] = "__main__"; -static char __pyx_k____test__[] = "__test__"; -static char __pyx_k___strings[] = "_strings"; -static char __pyx_k__callable[] = "callable"; -static char __pyx_k__datetime[] = "datetime"; -static char __pyx_k__external[] = "external"; -static char __pyx_k__is_proxy[] = "is_proxy"; -static char __pyx_k__unicodes[] = "unicodes"; -static char __pyx_k__use_hash[] = "use_hash"; -static char __pyx_k__writeInt[] = "writeInt"; -static char __pyx_k__writeXML[] = "writeXML"; -static char __pyx_k__TypeError[] = "TypeError"; -static char __pyx_k__Undefined[] = "Undefined"; -static char __pyx_k____class__[] = "__class__"; -static char __pyx_k__addObject[] = "addObject"; -static char __pyx_k__getObject[] = "getObject"; -static char __pyx_k__iteritems[] = "iteritems"; -static char __pyx_k__read_char[] = "read_char"; -static char __pyx_k__writeDate[] = "writeDate"; -static char __pyx_k__writeDict[] = "writeDict"; -static char __pyx_k__writeList[] = "writeList"; -static char __pyx_k__writeLong[] = "writeLong"; -static char __pyx_k__writeNull[] = "writeNull"; -static char __pyx_k__ClassAlias[] = "ClassAlias"; -static char __pyx_k__IndexError[] = "IndexError"; -static char __pyx_k__MixedArray[] = "MixedArray"; -static char __pyx_k__basestring[] = "basestring"; -static char __pyx_k__func_cache[] = "func_cache"; -static char __pyx_k__readString[] = "readString"; -static char __pyx_k__writeBytes[] = "writeBytes"; -static char __pyx_k__writeTuple[] = "writeTuple"; -static char __pyx_k__EncodeError[] = "EncodeError"; -static char __pyx_k__readElement[] = "readElement"; -static char __pyx_k__writeNumber[] = "writeNumber"; -static char __pyx_k__writeObject[] = "writeObject"; -static char __pyx_k__writeString[] = "writeString"; -static char __pyx_k__writeBoolean[] = "writeBoolean"; -static char __pyx_k__writeElement[] = "writeElement"; -static char __pyx_k__GeneratorType[] = "GeneratorType"; -static char __pyx_k__StopIteration[] = "StopIteration"; -static char __pyx_k__checkBadTypes[] = "checkBadTypes"; -static char __pyx_k__class_aliases[] = "class_aliases"; -static char __pyx_k__getClassAlias[] = "getClassAlias"; -static char __pyx_k__writeDateTime[] = "writeDateTime"; -static char __pyx_k__writeSequence[] = "writeSequence"; -static char __pyx_k__AttributeError[] = "AttributeError"; -static char __pyx_k___increase_size[] = "_increase_size"; -static char __pyx_k__getByReference[] = "getByReference"; -static char __pyx_k__getReferenceTo[] = "getReferenceTo"; -static char __pyx_k__get_class_meta[] = "get_class_meta"; -static char __pyx_k__writeGenerator[] = "writeGenerator"; -static char __pyx_k__writeUndefined[] = "writeUndefined"; -static char __pyx_k__get_class_alias[] = "get_class_alias"; -static char __pyx_k__serialiseString[] = "serialiseString"; -static char __pyx_k__timezone_offset[] = "timezone_offset"; -static char __pyx_k__writeMixedArray[] = "writeMixedArray"; -static char __pyx_k__handleBasicTypes[] = "handleBasicTypes"; -static char __pyx_k__use_write_object[] = "use_write_object"; -static char __pyx_k__UnknownClassAlias[] = "UnknownClassAlias"; -static char __pyx_k__getBytesForString[] = "getBytesForString"; -static char __pyx_k__getStringForBytes[] = "getStringForBytes"; -static char __pyx_k__getObjectReference[] = "getObjectReference"; -static char __pyx_k__BuiltinFunctionType[] = "BuiltinFunctionType"; -static char __pyx_k__NotImplementedError[] = "NotImplementedError"; -static char __pyx_k__readConcreteElement[] = "readConcreteElement"; -static PyObject *__pyx_kp_s_10; -static PyObject *__pyx_kp_s_12; -static PyObject *__pyx_kp_s_14; -static PyObject *__pyx_kp_s_16; -static PyObject *__pyx_n_s_2; -static PyObject *__pyx_kp_s_3; -static PyObject *__pyx_kp_s_8; -static PyObject *__pyx_n_s__AttributeError; -static PyObject *__pyx_n_s__BuiltinFunctionType; -static PyObject *__pyx_n_s__ClassAlias; -static PyObject *__pyx_n_s__EOStream; -static PyObject *__pyx_n_s__EncodeError; -static PyObject *__pyx_n_s__GeneratorType; -static PyObject *__pyx_n_s__IOError; -static PyObject *__pyx_n_s__IndexError; -static PyObject *__pyx_n_s__KeyError; -static PyObject *__pyx_n_s__MixedArray; -static PyObject *__pyx_n_s__NotImplementedError; -static PyObject *__pyx_n_s__StopIteration; -static PyObject *__pyx_n_s__TYPE_MAP; -static PyObject *__pyx_n_s__TypeError; -static PyObject *__pyx_n_s__Undefined; -static PyObject *__pyx_n_s__UnknownClassAlias; -static PyObject *__pyx_n_s____class__; -static PyObject *__pyx_n_s____main__; -static PyObject *__pyx_n_s____test__; -static PyObject *__pyx_n_s___clear; -static PyObject *__pyx_n_s___increase_size; -static PyObject *__pyx_n_s___ref; -static PyObject *__pyx_n_s___strings; -static PyObject *__pyx_n_s__addObject; -static PyObject *__pyx_n_s__append; -static PyObject *__pyx_n_s__at_eof; -static PyObject *__pyx_n_s__basestring; -static PyObject *__pyx_n_s__bucket; -static PyObject *__pyx_n_s__callable; -static PyObject *__pyx_n_s__checkBadTypes; -static PyObject *__pyx_n_s__class_aliases; -static PyObject *__pyx_n_s__clear; -static PyObject *__pyx_n_s__combine; -static PyObject *__pyx_n_s__context; -static PyObject *__pyx_n_s__data; -static PyObject *__pyx_n_s__datetime; -static PyObject *__pyx_n_s__decode; -static PyObject *__pyx_n_s__defer; -static PyObject *__pyx_n_s__encode; -static PyObject *__pyx_n_s__encoder; -static PyObject *__pyx_n_s__external; -static PyObject *__pyx_n_s__extra; -static PyObject *__pyx_n_s__func; -static PyObject *__pyx_n_s__func_cache; -static PyObject *__pyx_n_s__getByReference; -static PyObject *__pyx_n_s__getBytesForString; -static PyObject *__pyx_n_s__getClassAlias; -static PyObject *__pyx_n_s__getObject; -static PyObject *__pyx_n_s__getObjectReference; -static PyObject *__pyx_n_s__getReferenceTo; -static PyObject *__pyx_n_s__getStringForBytes; -static PyObject *__pyx_n_s__get_class_alias; -static PyObject *__pyx_n_s__get_class_meta; -static PyObject *__pyx_n_s__handleBasicTypes; -static PyObject *__pyx_n_s__is_proxy; -static PyObject *__pyx_n_s__is_xml; -static PyObject *__pyx_n_s__iteritems; -static PyObject *__pyx_n_s__length; -static PyObject *__pyx_n_s__next; -static PyObject *__pyx_n_s__o; -static PyObject *__pyx_n_s__objects; -static PyObject *__pyx_n_s__pop; -static PyObject *__pyx_n_s__pyamf; -static PyObject *__pyx_n_s__read; -static PyObject *__pyx_n_s__readConcreteElement; -static PyObject *__pyx_n_s__readElement; -static PyObject *__pyx_n_s__readString; -static PyObject *__pyx_n_s__read_char; -static PyObject *__pyx_n_s__refs; -static PyObject *__pyx_n_s__seek; -static PyObject *__pyx_n_s__send; -static PyObject *__pyx_n_s__serialiseString; -static PyObject *__pyx_n_s__size; -static PyObject *__pyx_n_s__stream; -static PyObject *__pyx_n_s__strict; -static PyObject *__pyx_n_s__tell; -static PyObject *__pyx_n_s__time; -static PyObject *__pyx_n_s__timezone_offset; -static PyObject *__pyx_n_s__types; -static PyObject *__pyx_n_s__unicodes; -static PyObject *__pyx_n_s__use_hash; -static PyObject *__pyx_n_s__use_write_object; -static PyObject *__pyx_n_s__util; -static PyObject *__pyx_n_s__write; -static PyObject *__pyx_n_s__writeBoolean; -static PyObject *__pyx_n_s__writeBytes; -static PyObject *__pyx_n_s__writeDate; -static PyObject *__pyx_n_s__writeDateTime; -static PyObject *__pyx_n_s__writeDict; -static PyObject *__pyx_n_s__writeElement; -static PyObject *__pyx_n_s__writeGenerator; -static PyObject *__pyx_n_s__writeInt; -static PyObject *__pyx_n_s__writeList; -static PyObject *__pyx_n_s__writeLong; -static PyObject *__pyx_n_s__writeMixedArray; -static PyObject *__pyx_n_s__writeNull; -static PyObject *__pyx_n_s__writeNumber; -static PyObject *__pyx_n_s__writeObject; -static PyObject *__pyx_n_s__writeSequence; -static PyObject *__pyx_n_s__writeString; -static PyObject *__pyx_n_s__writeTuple; -static PyObject *__pyx_n_s__writeUndefined; -static PyObject *__pyx_n_s__writeXML; -static PyObject *__pyx_n_s__xml; -static PyObject *__pyx_int_0; -static PyObject *__pyx_k_1; -static PyObject *__pyx_k_6; -static PyObject *__pyx_k_tuple_4; -static PyObject *__pyx_k_tuple_5; -static PyObject *__pyx_k_tuple_7; -static PyObject *__pyx_k_tuple_9; -static PyObject *__pyx_k_tuple_11; -static PyObject *__pyx_k_tuple_13; -static PyObject *__pyx_k_tuple_15; -static PyObject *__pyx_k_tuple_17; -static PyObject *__pyx_k_tuple_18; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":45 - * """ - * - * def __cinit__(self, bint use_hash=0): # <<<<<<<<<<<<<< - * self.use_hash = use_hash - * - */ - -static int __pyx_pf_6cpyamf_5codec_17IndexedCollection___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6cpyamf_5codec_17IndexedCollection___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - int __pyx_v_use_hash; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__use_hash,0}; - __Pyx_RefNannySetupContext("__cinit__"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[1] = {0}; - 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; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__use_hash); - if (value) { values[0] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - if (values[0]) { - __pyx_v_use_hash = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_use_hash == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_use_hash = ((int)0); - } - } else { - __pyx_v_use_hash = ((int)0); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 1: __pyx_v_use_hash = __Pyx_PyObject_IsTrue(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_use_hash == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.codec.IndexedCollection.__cinit__"); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":46 - * - * def __cinit__(self, bint use_hash=0): - * self.use_hash = use_hash # <<<<<<<<<<<<<< - * - * self.data = NULL - */ - ((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self)->use_hash = __pyx_v_use_hash; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":48 - * self.use_hash = use_hash - * - * self.data = NULL # <<<<<<<<<<<<<< - * self.refs = {} - * self.size = -1 - */ - ((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self)->data = NULL; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":49 - * - * self.data = NULL - * self.refs = {} # <<<<<<<<<<<<<< - * self.size = -1 - * self.length = -1 - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self)->refs); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self)->refs)); - ((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self)->refs = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":50 - * self.data = NULL - * self.refs = {} - * self.size = -1 # <<<<<<<<<<<<<< - * self.length = -1 - * - */ - ((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self)->size = -1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":51 - * self.refs = {} - * self.size = -1 - * self.length = -1 # <<<<<<<<<<<<<< - * - * def __init__(self, use_hash=False): - */ - ((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self)->length = -1; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.codec.IndexedCollection.__cinit__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":53 - * self.length = -1 - * - * def __init__(self, use_hash=False): # <<<<<<<<<<<<<< - * self.use_hash = use_hash - * - */ - -static int __pyx_pf_6cpyamf_5codec_17IndexedCollection___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6cpyamf_5codec_17IndexedCollection___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_use_hash = 0; - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__use_hash,0}; - __Pyx_RefNannySetupContext("__init__"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[1] = {0}; - values[0] = __pyx_k_1; - 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; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__use_hash); - if (value) { values[0] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_use_hash = values[0]; - } else { - __pyx_v_use_hash = __pyx_k_1; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 1: __pyx_v_use_hash = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.codec.IndexedCollection.__init__"); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":54 - * - * def __init__(self, use_hash=False): - * self.use_hash = use_hash # <<<<<<<<<<<<<< - * - * self.clear() - */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_use_hash); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self)->use_hash = __pyx_t_1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":56 - * self.use_hash = use_hash - * - * self.clear() # <<<<<<<<<<<<<< - * - * cdef void _clear(self): - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *)((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self)->__pyx_vtab)->clear(((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self), 0); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.IndexedCollection.__init__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":58 - * self.clear() - * - * cdef void _clear(self): # <<<<<<<<<<<<<< - * cdef Py_ssize_t i - * - */ - -static void __pyx_f_6cpyamf_5codec_17IndexedCollection__clear(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *__pyx_v_self) { - Py_ssize_t __pyx_v_i; - int __pyx_t_1; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3; - __Pyx_RefNannySetupContext("_clear"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":61 - * cdef Py_ssize_t i - * - * if self.data != NULL: # <<<<<<<<<<<<<< - * for i from 0 <= i < self.length: - * Py_DECREF(self.data[i]) - */ - __pyx_t_1 = (__pyx_v_self->data != NULL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":62 - * - * if self.data != NULL: - * for i from 0 <= i < self.length: # <<<<<<<<<<<<<< - * Py_DECREF(self.data[i]) - * - */ - __pyx_t_2 = __pyx_v_self->length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":63 - * if self.data != NULL: - * for i from 0 <= i < self.length: - * Py_DECREF(self.data[i]) # <<<<<<<<<<<<<< - * - * PyMem_Free(self.data) - */ - __pyx_t_3 = (__pyx_v_self->data[__pyx_v_i]); - Py_DECREF(((PyObject *)__pyx_t_3)); - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":65 - * Py_DECREF(self.data[i]) - * - * PyMem_Free(self.data) # <<<<<<<<<<<<<< - * self.data = NULL - * - */ - PyMem_Free(__pyx_v_self->data); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":66 - * - * PyMem_Free(self.data) - * self.data = NULL # <<<<<<<<<<<<<< - * - * def __dealloc__(self): - */ - __pyx_v_self->data = NULL; - goto __pyx_L3; - } - __pyx_L3:; - - __Pyx_RefNannyFinishContext(); -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":68 - * self.data = NULL - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * self._clear() - * - */ - -static void __pyx_pf_6cpyamf_5codec_17IndexedCollection___dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pf_6cpyamf_5codec_17IndexedCollection___dealloc__(PyObject *__pyx_v_self) { - __Pyx_RefNannySetupContext("__dealloc__"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":69 - * - * def __dealloc__(self): - * self._clear() # <<<<<<<<<<<<<< - * - * cdef int _actually_increase_size(self) except -1: - */ - ((struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *)((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self)->__pyx_vtab)->_clear(((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self)); - - __Pyx_RefNannyFinishContext(); -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":71 - * self._clear() - * - * cdef int _actually_increase_size(self) except -1: # <<<<<<<<<<<<<< - * cdef Py_ssize_t new_len = self.length - * cdef Py_ssize_t current_size = self.size - */ - -static int __pyx_f_6cpyamf_5codec_17IndexedCollection__actually_increase_size(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *__pyx_v_self) { - Py_ssize_t __pyx_v_new_len; - Py_ssize_t __pyx_v_current_size; - PyObject **__pyx_v_cpy; - int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2; - __Pyx_RefNannySetupContext("_actually_increase_size"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":72 - * - * cdef int _actually_increase_size(self) except -1: - * cdef Py_ssize_t new_len = self.length # <<<<<<<<<<<<<< - * cdef Py_ssize_t current_size = self.size - * cdef PyObject **cpy - */ - __pyx_v_new_len = __pyx_v_self->length; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":73 - * cdef int _actually_increase_size(self) except -1: - * cdef Py_ssize_t new_len = self.length - * cdef Py_ssize_t current_size = self.size # <<<<<<<<<<<<<< - * cdef PyObject **cpy - * - */ - __pyx_v_current_size = __pyx_v_self->size; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":76 - * cdef PyObject **cpy - * - * while new_len >= current_size: # <<<<<<<<<<<<<< - * current_size *= 2 - * - */ - while (1) { - __pyx_t_1 = (__pyx_v_new_len >= __pyx_v_current_size); - if (!__pyx_t_1) break; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":77 - * - * while new_len >= current_size: - * current_size *= 2 # <<<<<<<<<<<<<< - * - * if current_size != self.size: - */ - __pyx_v_current_size = (__pyx_v_current_size * 2); - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":79 - * current_size *= 2 - * - * if current_size != self.size: # <<<<<<<<<<<<<< - * self.size = current_size - * - */ - __pyx_t_1 = (__pyx_v_current_size != __pyx_v_self->size); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":80 - * - * if current_size != self.size: - * self.size = current_size # <<<<<<<<<<<<<< - * - * cpy = PyMem_Realloc(self.data, sizeof(PyObject *) * self.size) - */ - __pyx_v_self->size = __pyx_v_current_size; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":82 - * self.size = current_size - * - * cpy = PyMem_Realloc(self.data, sizeof(PyObject *) * self.size) # <<<<<<<<<<<<<< - * - * if cpy == NULL: - */ - __pyx_v_cpy = ((PyObject **)PyMem_Realloc(__pyx_v_self->data, ((sizeof(PyObject *)) * __pyx_v_self->size))); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":84 - * cpy = PyMem_Realloc(self.data, sizeof(PyObject *) * self.size) - * - * if cpy == NULL: # <<<<<<<<<<<<<< - * self._clear() - * - */ - __pyx_t_1 = (__pyx_v_cpy == NULL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":85 - * - * if cpy == NULL: - * self._clear() # <<<<<<<<<<<<<< - * - * PyErr_NoMemory() - */ - ((struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *)__pyx_v_self->__pyx_vtab)->_clear(__pyx_v_self); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":87 - * self._clear() - * - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * - * self.data = cpy - */ - __pyx_t_2 = PyErr_NoMemory(); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":89 - * PyErr_NoMemory() - * - * self.data = cpy # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_v_self->data = __pyx_v_cpy; - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":91 - * self.data = cpy - * - * return 0 # <<<<<<<<<<<<<< - * - * cdef inline int _increase_size(self) except -1: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.IndexedCollection._actually_increase_size"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":93 - * return 0 - * - * cdef inline int _increase_size(self) except -1: # <<<<<<<<<<<<<< - * if self.length < self.size: - * return 0 - */ - -static CYTHON_INLINE int __pyx_f_6cpyamf_5codec_17IndexedCollection__increase_size(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *__pyx_v_self) { - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("_increase_size"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":94 - * - * cdef inline int _increase_size(self) except -1: - * if self.length < self.size: # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_t_1 = (__pyx_v_self->length < __pyx_v_self->size); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":95 - * cdef inline int _increase_size(self) except -1: - * if self.length < self.size: - * return 0 # <<<<<<<<<<<<<< - * - * return self._actually_increase_size() - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":97 - * return 0 - * - * return self._actually_increase_size() # <<<<<<<<<<<<<< - * - * cpdef int clear(self) except -1: - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *)__pyx_v_self->__pyx_vtab)->_actually_increase_size(__pyx_v_self); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_2; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.IndexedCollection._increase_size"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":99 - * return self._actually_increase_size() - * - * cpdef int clear(self) except -1: # <<<<<<<<<<<<<< - * self._clear() - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_17IndexedCollection_clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static int __pyx_f_6cpyamf_5codec_17IndexedCollection_clear(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *__pyx_v_self, int __pyx_skip_dispatch) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5; - __Pyx_RefNannySetupContext("clear"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__clear); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_5codec_17IndexedCollection_clear)) { - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":100 - * - * cpdef int clear(self) except -1: - * self._clear() # <<<<<<<<<<<<<< - * - * self.length = 0 - */ - ((struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *)__pyx_v_self->__pyx_vtab)->_clear(__pyx_v_self); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":102 - * self._clear() - * - * self.length = 0 # <<<<<<<<<<<<<< - * self.size = 64 - * - */ - __pyx_v_self->length = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":103 - * - * self.length = 0 - * self.size = 64 # <<<<<<<<<<<<<< - * - * self.data = PyMem_Malloc(sizeof(PyObject *) * self.size) - */ - __pyx_v_self->size = 64; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":105 - * self.size = 64 - * - * self.data = PyMem_Malloc(sizeof(PyObject *) * self.size) # <<<<<<<<<<<<<< - * - * if self.data == NULL: - */ - __pyx_v_self->data = ((PyObject **)PyMem_Malloc(((sizeof(PyObject *)) * __pyx_v_self->size))); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":107 - * self.data = PyMem_Malloc(sizeof(PyObject *) * self.size) - * - * if self.data == NULL: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * - */ - __pyx_t_4 = (__pyx_v_self->data == NULL); - if (__pyx_t_4) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":108 - * - * if self.data == NULL: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * - * self.refs = {} - */ - __pyx_t_5 = PyErr_NoMemory(); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":110 - * PyErr_NoMemory() - * - * self.refs = {} # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __Pyx_GOTREF(__pyx_v_self->refs); - __Pyx_DECREF(((PyObject *)__pyx_v_self->refs)); - __pyx_v_self->refs = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":112 - * self.refs = {} - * - * return 0 # <<<<<<<<<<<<<< - * - * cpdef object getByReference(self, Py_ssize_t ref): - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.codec.IndexedCollection.clear"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":99 - * return self._actually_increase_size() - * - * cpdef int clear(self) except -1: # <<<<<<<<<<<<<< - * self._clear() - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_17IndexedCollection_clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_17IndexedCollection_clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("clear"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *)((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self)->__pyx_vtab)->clear(((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self), 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.codec.IndexedCollection.clear"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":114 - * return 0 - * - * cpdef object getByReference(self, Py_ssize_t ref): # <<<<<<<<<<<<<< - * if ref < 0 or ref >= self.length: - * return None - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_17IndexedCollection_getByReference(PyObject *__pyx_v_self, PyObject *__pyx_arg_ref); /*proto*/ -static PyObject *__pyx_f_6cpyamf_5codec_17IndexedCollection_getByReference(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *__pyx_v_self, Py_ssize_t __pyx_v_ref, int __pyx_skip_dispatch) { - PyObject *__pyx_r = NULL; - 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; - PyObject *__pyx_t_7; - __Pyx_RefNannySetupContext("getByReference"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__getByReference); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_5codec_17IndexedCollection_getByReference)) { - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_ref); 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); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__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 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); 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); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":115 - * - * cpdef object getByReference(self, Py_ssize_t ref): - * if ref < 0 or ref >= self.length: # <<<<<<<<<<<<<< - * return None - * - */ - __pyx_t_4 = (__pyx_v_ref < 0); - if (!__pyx_t_4) { - __pyx_t_5 = (__pyx_v_ref >= __pyx_v_self->length); - __pyx_t_6 = __pyx_t_5; - } else { - __pyx_t_6 = __pyx_t_4; - } - if (__pyx_t_6) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":116 - * cpdef object getByReference(self, Py_ssize_t ref): - * if ref < 0 or ref >= self.length: - * return None # <<<<<<<<<<<<<< - * - * return self.data[ref] - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":118 - * return None - * - * return self.data[ref] # <<<<<<<<<<<<<< - * - * cdef inline object _ref(self, object obj): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = (__pyx_v_self->data[__pyx_v_ref]); - __Pyx_INCREF(((PyObject *)__pyx_t_7)); - __pyx_r = ((PyObject *)__pyx_t_7); - goto __pyx_L0; - - __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_3); - __Pyx_AddTraceback("cpyamf.codec.IndexedCollection.getByReference"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":114 - * return 0 - * - * cpdef object getByReference(self, Py_ssize_t ref): # <<<<<<<<<<<<<< - * if ref < 0 or ref >= self.length: - * return None - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_17IndexedCollection_getByReference(PyObject *__pyx_v_self, PyObject *__pyx_arg_ref); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_17IndexedCollection_getByReference(PyObject *__pyx_v_self, PyObject *__pyx_arg_ref) { - Py_ssize_t __pyx_v_ref; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("getByReference"); - assert(__pyx_arg_ref); { - __pyx_v_ref = __Pyx_PyIndex_AsSsize_t(__pyx_arg_ref); if (unlikely((__pyx_v_ref == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.codec.IndexedCollection.getByReference"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *)((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self)->__pyx_vtab)->getByReference(((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self), __pyx_v_ref, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.codec.IndexedCollection.getByReference"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":120 - * return self.data[ref] - * - * cdef inline object _ref(self, object obj): # <<<<<<<<<<<<<< - * if self.use_hash: - * return hash(obj) - */ - -static CYTHON_INLINE PyObject *__pyx_f_6cpyamf_5codec_17IndexedCollection__ref(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *__pyx_v_self, PyObject *__pyx_v_obj) { - PyObject *__pyx_r = NULL; - long __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("_ref"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":121 - * - * cdef inline object _ref(self, object obj): - * if self.use_hash: # <<<<<<<<<<<<<< - * return hash(obj) - * - */ - if (__pyx_v_self->use_hash) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":122 - * cdef inline object _ref(self, object obj): - * if self.use_hash: - * return hash(obj) # <<<<<<<<<<<<<< - * - * return PyLong_FromVoidPtr(obj) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_Hash(__pyx_v_obj); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":124 - * return hash(obj) - * - * return PyLong_FromVoidPtr(obj) # <<<<<<<<<<<<<< - * - * cpdef Py_ssize_t getReferenceTo(self, object obj) except -2: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyLong_FromVoidPtr(((void *)__pyx_v_obj)); 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_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.codec.IndexedCollection._ref"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":126 - * return PyLong_FromVoidPtr(obj) - * - * cpdef Py_ssize_t getReferenceTo(self, object obj) except -2: # <<<<<<<<<<<<<< - * cdef object p = self.refs.get(self._ref(obj), None) - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_17IndexedCollection_getReferenceTo(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/ -static Py_ssize_t __pyx_f_6cpyamf_5codec_17IndexedCollection_getReferenceTo(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) { - PyObject *__pyx_v_p = 0; - Py_ssize_t __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("getReferenceTo"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__getReferenceTo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_5codec_17IndexedCollection_getReferenceTo)) { - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_obj); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj); - __Pyx_GIVEREF(__pyx_v_obj); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":127 - * - * cpdef Py_ssize_t getReferenceTo(self, object obj) except -2: - * cdef object p = self.refs.get(self._ref(obj), None) # <<<<<<<<<<<<<< - * - * if p is None: - */ - if (unlikely(__pyx_v_self->refs == Py_None)) { - PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'get'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *)__pyx_v_self->__pyx_vtab)->_ref(__pyx_v_self, __pyx_v_obj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_self->refs), __pyx_t_1, Py_None); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_p = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":129 - * cdef object p = self.refs.get(self._ref(obj), None) - * - * if p is None: # <<<<<<<<<<<<<< - * return -1 - * - */ - __pyx_t_5 = (__pyx_v_p == Py_None); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":130 - * - * if p is None: - * return -1 # <<<<<<<<<<<<<< - * - * return PyInt_AS_LONG(p) - */ - __pyx_r = -1; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":132 - * return -1 - * - * return PyInt_AS_LONG(p) # <<<<<<<<<<<<<< - * - * cpdef Py_ssize_t append(self, object obj) except -1: - */ - __pyx_r = ((Py_ssize_t)PyInt_AS_LONG(__pyx_v_p)); - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.codec.IndexedCollection.getReferenceTo"); - __pyx_r = -2; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_p); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":126 - * return PyLong_FromVoidPtr(obj) - * - * cpdef Py_ssize_t getReferenceTo(self, object obj) except -2: # <<<<<<<<<<<<<< - * cdef object p = self.refs.get(self._ref(obj), None) - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_17IndexedCollection_getReferenceTo(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_17IndexedCollection_getReferenceTo(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) { - PyObject *__pyx_r = NULL; - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("getReferenceTo"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *)((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self)->__pyx_vtab)->getReferenceTo(((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self), __pyx_v_obj, 1); if (unlikely(__pyx_t_1 == -2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.codec.IndexedCollection.getReferenceTo"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":134 - * return PyInt_AS_LONG(p) - * - * cpdef Py_ssize_t append(self, object obj) except -1: # <<<<<<<<<<<<<< - * self._increase_size() - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_17IndexedCollection_append(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/ -static Py_ssize_t __pyx_f_6cpyamf_5codec_17IndexedCollection_append(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) { - PyObject *__pyx_v_h = 0; - Py_ssize_t __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("append"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__append); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_5codec_17IndexedCollection_append)) { - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_obj); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj); - __Pyx_GIVEREF(__pyx_v_obj); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":135 - * - * cpdef Py_ssize_t append(self, object obj) except -1: - * self._increase_size() # <<<<<<<<<<<<<< - * - * cdef object h = self._ref(obj) - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *)__pyx_v_self->__pyx_vtab)->_increase_size(__pyx_v_self); if (unlikely(__pyx_t_5 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":137 - * self._increase_size() - * - * cdef object h = self._ref(obj) # <<<<<<<<<<<<<< - * - * self.refs[h] = self.length - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *)__pyx_v_self->__pyx_vtab)->_ref(__pyx_v_self, __pyx_v_obj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_h = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":139 - * cdef object h = self._ref(obj) - * - * self.refs[h] = self.length # <<<<<<<<<<<<<< - * self.data[self.length] = obj - * Py_INCREF(obj) - */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(((PyObject *)__pyx_v_self->refs), __pyx_v_h, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":140 - * - * self.refs[h] = self.length - * self.data[self.length] = obj # <<<<<<<<<<<<<< - * Py_INCREF(obj) - * - */ - (__pyx_v_self->data[__pyx_v_self->length]) = ((PyObject *)__pyx_v_obj); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":141 - * self.refs[h] = self.length - * self.data[self.length] = obj - * Py_INCREF(obj) # <<<<<<<<<<<<<< - * - * self.length += 1 - */ - Py_INCREF(__pyx_v_obj); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":143 - * Py_INCREF(obj) - * - * self.length += 1 # <<<<<<<<<<<<<< - * - * return self.length - 1 - */ - __pyx_v_self->length = (__pyx_v_self->length + 1); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":145 - * self.length += 1 - * - * return self.length - 1 # <<<<<<<<<<<<<< - * - * def __iter__(self): - */ - __pyx_r = (__pyx_v_self->length - 1); - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.codec.IndexedCollection.append"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_h); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":134 - * return PyInt_AS_LONG(p) - * - * cpdef Py_ssize_t append(self, object obj) except -1: # <<<<<<<<<<<<<< - * self._increase_size() - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_17IndexedCollection_append(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_17IndexedCollection_append(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) { - PyObject *__pyx_r = NULL; - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("append"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *)((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self)->__pyx_vtab)->append(((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self), __pyx_v_obj, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.codec.IndexedCollection.append"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":147 - * return self.length - 1 - * - * def __iter__(self): # <<<<<<<<<<<<<< - * cdef list x = [] - * cdef Py_ssize_t idx - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_17IndexedCollection___iter__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_17IndexedCollection___iter__(PyObject *__pyx_v_self) { - PyObject *__pyx_v_x = 0; - Py_ssize_t __pyx_v_idx; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("__iter__"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":148 - * - * def __iter__(self): - * cdef list x = [] # <<<<<<<<<<<<<< - * cdef Py_ssize_t idx - * - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_v_x = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":151 - * cdef Py_ssize_t idx - * - * for idx from 0 <= idx < self.length: # <<<<<<<<<<<<<< - * x.append(self.data[idx]) - * - */ - __pyx_t_2 = ((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self)->length; - for (__pyx_v_idx = 0; __pyx_v_idx < __pyx_t_2; __pyx_v_idx++) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":152 - * - * for idx from 0 <= idx < self.length: - * x.append(self.data[idx]) # <<<<<<<<<<<<<< - * - * return iter(x) - */ - if (unlikely(__pyx_v_x == Py_None)) { - PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_3 = (((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self)->data[__pyx_v_idx]); - __pyx_t_4 = PyList_Append(__pyx_v_x, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":154 - * x.append(self.data[idx]) - * - * return iter(x) # <<<<<<<<<<<<<< - * - * def __len__(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_x)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.codec.IndexedCollection.__iter__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_x); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":156 - * return iter(x) - * - * def __len__(self): # <<<<<<<<<<<<<< - * return self.length - * - */ - -static Py_ssize_t __pyx_pf_6cpyamf_5codec_17IndexedCollection___len__(PyObject *__pyx_v_self); /*proto*/ -static Py_ssize_t __pyx_pf_6cpyamf_5codec_17IndexedCollection___len__(PyObject *__pyx_v_self) { - Py_ssize_t __pyx_r; - __Pyx_RefNannySetupContext("__len__"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":157 - * - * def __len__(self): - * return self.length # <<<<<<<<<<<<<< - * - * def __richcmp__(self, object other, int op): - */ - __pyx_r = ((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self)->length; - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":159 - * return self.length - * - * def __richcmp__(self, object other, int op): # <<<<<<<<<<<<<< - * cdef int equal - * cdef Py_ssize_t i - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_17IndexedCollection___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_17IndexedCollection___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { - int __pyx_v_equal; - Py_ssize_t __pyx_v_i; - struct __pyx_obj_6cpyamf_5codec_IndexedCollection *__pyx_v_s = 0; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5; - PyObject *__pyx_t_6; - __Pyx_RefNannySetupContext("__richcmp__"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":162 - * cdef int equal - * cdef Py_ssize_t i - * cdef IndexedCollection s = self # this is necessary because cython does not see the c-space vars of the class for this func # <<<<<<<<<<<<<< - * - * if PyDict_Check(other) == 1: - */ - if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_6cpyamf_5codec_IndexedCollection))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_INCREF(__pyx_v_self); - __pyx_v_s = ((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":164 - * cdef IndexedCollection s = self # this is necessary because cython does not see the c-space vars of the class for this func - * - * if PyDict_Check(other) == 1: # <<<<<<<<<<<<<< - * equal = s.refs == other - * elif PyList_Check(other) != 1: - */ - __pyx_t_1 = (PyDict_Check(__pyx_v_other) == 1); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":165 - * - * if PyDict_Check(other) == 1: - * equal = s.refs == other # <<<<<<<<<<<<<< - * elif PyList_Check(other) != 1: - * equal = 0 - */ - __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_s->refs), __pyx_v_other, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_equal = __pyx_t_3; - goto __pyx_L5; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":166 - * if PyDict_Check(other) == 1: - * equal = s.refs == other - * elif PyList_Check(other) != 1: # <<<<<<<<<<<<<< - * equal = 0 - * else: - */ - __pyx_t_1 = (PyList_Check(__pyx_v_other) != 1); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":167 - * equal = s.refs == other - * elif PyList_Check(other) != 1: - * equal = 0 # <<<<<<<<<<<<<< - * else: - * equal = 0 - */ - __pyx_v_equal = 0; - goto __pyx_L5; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":169 - * equal = 0 - * else: - * equal = 0 # <<<<<<<<<<<<<< - * - * if PyList_GET_SIZE(other) == s.length: - */ - __pyx_v_equal = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":171 - * equal = 0 - * - * if PyList_GET_SIZE(other) == s.length: # <<<<<<<<<<<<<< - * equal = 1 - * - */ - __pyx_t_1 = (PyList_GET_SIZE(__pyx_v_other) == __pyx_v_s->length); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":172 - * - * if PyList_GET_SIZE(other) == s.length: - * equal = 1 # <<<<<<<<<<<<<< - * - * for i from 0 <= i < s.length: - */ - __pyx_v_equal = 1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":174 - * equal = 1 - * - * for i from 0 <= i < s.length: # <<<<<<<<<<<<<< - * if PyList_GET_ITEM(other, i) != s.data[i]: - * equal = 0 - */ - __pyx_t_4 = __pyx_v_s->length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":175 - * - * for i from 0 <= i < s.length: - * if PyList_GET_ITEM(other, i) != s.data[i]: # <<<<<<<<<<<<<< - * equal = 0 - * - */ - __pyx_t_5 = PyList_GET_ITEM(__pyx_v_other, __pyx_v_i); - __pyx_t_6 = (__pyx_v_s->data[__pyx_v_i]); - __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_6), Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":176 - * for i from 0 <= i < s.length: - * if PyList_GET_ITEM(other, i) != s.data[i]: - * equal = 0 # <<<<<<<<<<<<<< - * - * break - */ - __pyx_v_equal = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":178 - * equal = 0 - * - * break # <<<<<<<<<<<<<< - * - * if op == 2: # == - */ - goto __pyx_L8_break; - goto __pyx_L9; - } - __pyx_L9:; - } - __pyx_L8_break:; - goto __pyx_L6; - } - __pyx_L6:; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":182 - * if op == 2: # == - * return equal - * elif op == 3: # != # <<<<<<<<<<<<<< - * return not equal - * else: - */ - switch (__pyx_v_op) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":180 - * break - * - * if op == 2: # == # <<<<<<<<<<<<<< - * return equal - * elif op == 3: # != - */ - case 2: - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":181 - * - * if op == 2: # == - * return equal # <<<<<<<<<<<<<< - * elif op == 3: # != - * return not equal - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyInt_FromLong(__pyx_v_equal); 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_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - break; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":182 - * if op == 2: # == - * return equal - * elif op == 3: # != # <<<<<<<<<<<<<< - * return not equal - * else: - */ - case 3: - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":183 - * return equal - * elif op == 3: # != - * return not equal # <<<<<<<<<<<<<< - * else: - * raise NotImplementedError - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyBool_FromLong((!__pyx_v_equal)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - break; - default: - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":185 - * return not equal - * else: - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * def __getitem__(self, idx): - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.codec.IndexedCollection.__richcmp__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_s); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":187 - * raise NotImplementedError - * - * def __getitem__(self, idx): # <<<<<<<<<<<<<< - * return self.getByReference(idx) - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_17IndexedCollection___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_17IndexedCollection___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx) { - PyObject *__pyx_r = NULL; - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("__getitem__"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":188 - * - * def __getitem__(self, idx): - * return self.getByReference(idx) # <<<<<<<<<<<<<< - * - * def __copy__(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *)((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self)->__pyx_vtab)->getByReference(((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self), __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.codec.IndexedCollection.__getitem__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":190 - * return self.getByReference(idx) - * - * def __copy__(self): # <<<<<<<<<<<<<< - * cdef IndexedCollection n = IndexedCollection(self.use_hash) - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_17IndexedCollection___copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_17IndexedCollection___copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - struct __pyx_obj_6cpyamf_5codec_IndexedCollection *__pyx_v_n = 0; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("__copy__"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":191 - * - * def __copy__(self): - * cdef IndexedCollection n = IndexedCollection(self.use_hash) # <<<<<<<<<<<<<< - * - * return n - */ - __pyx_t_1 = __Pyx_PyBool_FromLong(((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self)->use_hash); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __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 = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__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 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6cpyamf_5codec_IndexedCollection)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_v_n = ((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":193 - * cdef IndexedCollection n = IndexedCollection(self.use_hash) - * - * return n # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_n)); - __pyx_r = ((PyObject *)__pyx_v_n); - goto __pyx_L0; - - __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("cpyamf.codec.IndexedCollection.__copy__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_n); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":16 - * """ - * - * cdef public bint use_hash # <<<<<<<<<<<<<< - * cdef PyObject **data - * cdef dict refs - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_17IndexedCollection_8use_hash___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_17IndexedCollection_8use_hash___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self)->use_hash); 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); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.codec.IndexedCollection.use_hash.__get__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6cpyamf_5codec_17IndexedCollection_8use_hash___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pf_6cpyamf_5codec_17IndexedCollection_8use_hash___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("__set__"); - __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 = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_v_self)->use_hash = __pyx_t_1; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.IndexedCollection.use_hash.__set__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":206 - * """ - * - * def __cinit__(self): # <<<<<<<<<<<<<< - * self.objects = IndexedCollection() - * - */ - -static int __pyx_pf_6cpyamf_5codec_7Context___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6cpyamf_5codec_7Context___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - __Pyx_RefNannySetupContext("__cinit__"); - 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; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":207 - * - * def __cinit__(self): - * self.objects = IndexedCollection() # <<<<<<<<<<<<<< - * - * self.clear() - */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6cpyamf_5codec_IndexedCollection)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self)->objects); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self)->objects)); - ((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self)->objects = ((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":209 - * self.objects = IndexedCollection() - * - * self.clear() # <<<<<<<<<<<<<< - * - * def __init__(self): - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Context *)((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self)->__pyx_vtab)->clear(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self), 0); if (unlikely(__pyx_t_2 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.codec.Context.__cinit__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":211 - * self.clear() - * - * def __init__(self): # <<<<<<<<<<<<<< - * self.clear() - * - */ - -static int __pyx_pf_6cpyamf_5codec_7Context___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6cpyamf_5codec_7Context___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - int __pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("__init__"); - if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { - __Pyx_RaiseArgtupleInvalid("__init__", 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, "__init__", 0))) return -1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":212 - * - * def __init__(self): - * self.clear() # <<<<<<<<<<<<<< - * - * cpdef int clear(self) except -1: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Context *)((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self)->__pyx_vtab)->clear(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self), 0); if (unlikely(__pyx_t_1 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.Context.__init__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":214 - * self.clear() - * - * cpdef int clear(self) except -1: # <<<<<<<<<<<<<< - * self.objects.clear() - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Context_clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static int __pyx_f_6cpyamf_5codec_7Context_clear(struct __pyx_obj_6cpyamf_5codec_Context *__pyx_v_self, int __pyx_skip_dispatch) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - __Pyx_RefNannySetupContext("clear"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__clear); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_5codec_7Context_clear)) { - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":215 - * - * cpdef int clear(self) except -1: - * self.objects.clear() # <<<<<<<<<<<<<< - * - * self.class_aliases = {} - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *)__pyx_v_self->objects->__pyx_vtab)->clear(__pyx_v_self->objects, 0); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":217 - * self.objects.clear() - * - * self.class_aliases = {} # <<<<<<<<<<<<<< - * self.unicodes = {} - * self._strings = {} - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __Pyx_GOTREF(__pyx_v_self->class_aliases); - __Pyx_DECREF(((PyObject *)__pyx_v_self->class_aliases)); - __pyx_v_self->class_aliases = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":218 - * - * self.class_aliases = {} - * self.unicodes = {} # <<<<<<<<<<<<<< - * self._strings = {} - * self.extra = {} - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __Pyx_GOTREF(__pyx_v_self->unicodes); - __Pyx_DECREF(((PyObject *)__pyx_v_self->unicodes)); - __pyx_v_self->unicodes = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":219 - * self.class_aliases = {} - * self.unicodes = {} - * self._strings = {} # <<<<<<<<<<<<<< - * self.extra = {} - * - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __Pyx_GOTREF(__pyx_v_self->_strings); - __Pyx_DECREF(((PyObject *)__pyx_v_self->_strings)); - __pyx_v_self->_strings = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":220 - * self.unicodes = {} - * self._strings = {} - * self.extra = {} # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __Pyx_GOTREF(__pyx_v_self->extra); - __Pyx_DECREF(((PyObject *)__pyx_v_self->extra)); - __pyx_v_self->extra = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":222 - * self.extra = {} - * - * return 0 # <<<<<<<<<<<<<< - * - * cpdef inline object getObject(self, Py_ssize_t ref): - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.codec.Context.clear"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":214 - * self.clear() - * - * cpdef int clear(self) except -1: # <<<<<<<<<<<<<< - * self.objects.clear() - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Context_clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_7Context_clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("clear"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Context *)((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self)->__pyx_vtab)->clear(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self), 1); if (unlikely(__pyx_t_1 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.codec.Context.clear"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":224 - * return 0 - * - * cpdef inline object getObject(self, Py_ssize_t ref): # <<<<<<<<<<<<<< - * return self.objects.getByReference(ref) - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Context_getObject(PyObject *__pyx_v_self, PyObject *__pyx_arg_ref); /*proto*/ -static CYTHON_INLINE PyObject *__pyx_f_6cpyamf_5codec_7Context_getObject(struct __pyx_obj_6cpyamf_5codec_Context *__pyx_v_self, Py_ssize_t __pyx_v_ref, int __pyx_skip_dispatch) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("getObject"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__getObject); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_5codec_7Context_getObject)) { - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_ref); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __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[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__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 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":225 - * - * cpdef inline object getObject(self, Py_ssize_t ref): - * return self.objects.getByReference(ref) # <<<<<<<<<<<<<< - * - * cpdef inline Py_ssize_t getObjectReference(self, object obj) except -2: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *)__pyx_v_self->objects->__pyx_vtab)->getByReference(__pyx_v_self->objects, __pyx_v_ref, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __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_3); - __Pyx_AddTraceback("cpyamf.codec.Context.getObject"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":224 - * return 0 - * - * cpdef inline object getObject(self, Py_ssize_t ref): # <<<<<<<<<<<<<< - * return self.objects.getByReference(ref) - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Context_getObject(PyObject *__pyx_v_self, PyObject *__pyx_arg_ref); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_7Context_getObject(PyObject *__pyx_v_self, PyObject *__pyx_arg_ref) { - Py_ssize_t __pyx_v_ref; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("getObject"); - assert(__pyx_arg_ref); { - __pyx_v_ref = __Pyx_PyIndex_AsSsize_t(__pyx_arg_ref); if (unlikely((__pyx_v_ref == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.codec.Context.getObject"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Context *)((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self)->__pyx_vtab)->getObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self), __pyx_v_ref, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.codec.Context.getObject"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":227 - * return self.objects.getByReference(ref) - * - * cpdef inline Py_ssize_t getObjectReference(self, object obj) except -2: # <<<<<<<<<<<<<< - * return self.objects.getReferenceTo(obj) - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Context_getObjectReference(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/ -static CYTHON_INLINE Py_ssize_t __pyx_f_6cpyamf_5codec_7Context_getObjectReference(struct __pyx_obj_6cpyamf_5codec_Context *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) { - Py_ssize_t __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - __Pyx_RefNannySetupContext("getObjectReference"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__getObjectReference); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_5codec_7Context_getObjectReference)) { - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_obj); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj); - __Pyx_GIVEREF(__pyx_v_obj); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); 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(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":228 - * - * cpdef inline Py_ssize_t getObjectReference(self, object obj) except -2: - * return self.objects.getReferenceTo(obj) # <<<<<<<<<<<<<< - * - * cpdef inline Py_ssize_t addObject(self, object obj) except -1: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *)__pyx_v_self->objects->__pyx_vtab)->getReferenceTo(__pyx_v_self->objects, __pyx_v_obj, 0); if (unlikely(__pyx_t_4 == -2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.codec.Context.getObjectReference"); - __pyx_r = -2; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":227 - * return self.objects.getByReference(ref) - * - * cpdef inline Py_ssize_t getObjectReference(self, object obj) except -2: # <<<<<<<<<<<<<< - * return self.objects.getReferenceTo(obj) - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Context_getObjectReference(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_7Context_getObjectReference(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) { - PyObject *__pyx_r = NULL; - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("getObjectReference"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Context *)((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self)->__pyx_vtab)->getObjectReference(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self), __pyx_v_obj, 1); if (unlikely(__pyx_t_1 == -2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.codec.Context.getObjectReference"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":230 - * return self.objects.getReferenceTo(obj) - * - * cpdef inline Py_ssize_t addObject(self, object obj) except -1: # <<<<<<<<<<<<<< - * return self.objects.append(obj) - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Context_addObject(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/ -static CYTHON_INLINE Py_ssize_t __pyx_f_6cpyamf_5codec_7Context_addObject(struct __pyx_obj_6cpyamf_5codec_Context *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) { - Py_ssize_t __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - __Pyx_RefNannySetupContext("addObject"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__addObject); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_5codec_7Context_addObject)) { - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_obj); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj); - __Pyx_GIVEREF(__pyx_v_obj); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":231 - * - * cpdef inline Py_ssize_t addObject(self, object obj) except -1: - * return self.objects.append(obj) # <<<<<<<<<<<<<< - * - * cpdef object getClassAlias(self, object klass): - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection *)__pyx_v_self->objects->__pyx_vtab)->append(__pyx_v_self->objects, __pyx_v_obj, 0); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.codec.Context.addObject"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":230 - * return self.objects.getReferenceTo(obj) - * - * cpdef inline Py_ssize_t addObject(self, object obj) except -1: # <<<<<<<<<<<<<< - * return self.objects.append(obj) - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Context_addObject(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_7Context_addObject(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) { - PyObject *__pyx_r = NULL; - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("addObject"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Context *)((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self)->__pyx_vtab)->addObject(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self), __pyx_v_obj, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.codec.Context.addObject"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":233 - * return self.objects.append(obj) - * - * cpdef object getClassAlias(self, object klass): # <<<<<<<<<<<<<< - * """ - * Gets a class alias based on the supplied C{klass}. - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Context_getClassAlias(PyObject *__pyx_v_self, PyObject *__pyx_v_klass); /*proto*/ -static PyObject *__pyx_f_6cpyamf_5codec_7Context_getClassAlias(struct __pyx_obj_6cpyamf_5codec_Context *__pyx_v_self, PyObject *__pyx_v_klass, int __pyx_skip_dispatch) { - PyObject *__pyx_v_alias; - PyObject *__pyx_v_meta; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - 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; - __Pyx_RefNannySetupContext("getClassAlias"); - __pyx_v_alias = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_meta = Py_None; __Pyx_INCREF(Py_None); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__getClassAlias); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_5codec_7Context_getClassAlias)) { - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_klass); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_klass); - __Pyx_GIVEREF(__pyx_v_klass); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":240 - * @return: The L{ClassAlias} that is linked to C{klass} - * """ - * try: # <<<<<<<<<<<<<< - * return self.class_aliases[klass] - * except KeyError: - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - __Pyx_XGOTREF(__pyx_save_exc_type); - __Pyx_XGOTREF(__pyx_save_exc_value); - __Pyx_XGOTREF(__pyx_save_exc_tb); - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":241 - * """ - * try: - * return self.class_aliases[klass] # <<<<<<<<<<<<<< - * except KeyError: - * pass - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->class_aliases), __pyx_v_klass); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L7_try_return; - } - __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L10_try_end; - __pyx_L7_try_return:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L0; - __pyx_L3_error:; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":242 - * try: - * return self.class_aliases[klass] - * except KeyError: # <<<<<<<<<<<<<< - * pass - * - */ - __pyx_t_4 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); - if (__pyx_t_4) { - PyErr_Restore(0,0,0); - goto __pyx_L4_exception_handled; - } - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L4_exception_handled:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L10_try_end:; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":245 - * pass - * - * try: # <<<<<<<<<<<<<< - * alias = pyamf.get_class_alias(klass) - * except pyamf.UnknownClassAlias: - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - __Pyx_XGOTREF(__pyx_save_exc_type); - __Pyx_XGOTREF(__pyx_save_exc_value); - __Pyx_XGOTREF(__pyx_save_exc_tb); - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":246 - * - * try: - * alias = pyamf.get_class_alias(klass) # <<<<<<<<<<<<<< - * except pyamf.UnknownClassAlias: - * if isinstance(klass, basestring): - */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L11_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__get_class_alias); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L11_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L11_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_klass); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_klass); - __Pyx_GIVEREF(__pyx_v_klass); - __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L11_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_v_alias); - __pyx_v_alias = __pyx_t_2; - __pyx_t_2 = 0; - } - __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L18_try_end; - __pyx_L11_error:; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":247 - * try: - * alias = pyamf.get_class_alias(klass) - * except pyamf.UnknownClassAlias: # <<<<<<<<<<<<<< - * if isinstance(klass, basestring): - * raise - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__UnknownClassAlias); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = PyErr_ExceptionMatches(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_4) { - __Pyx_AddTraceback("cpyamf.codec.Context.getClassAlias"); - if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_t_3); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":248 - * alias = pyamf.get_class_alias(klass) - * except pyamf.UnknownClassAlias: - * if isinstance(klass, basestring): # <<<<<<<<<<<<<< - * raise - * - */ - __pyx_t_5 = PyObject_IsInstance(__pyx_v_klass, __pyx_builtin_basestring); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":249 - * except pyamf.UnknownClassAlias: - * if isinstance(klass, basestring): - * raise # <<<<<<<<<<<<<< - * - * # no alias has been found yet .. check subclasses - */ - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - __Pyx_ErrRestore(__pyx_t_1, __pyx_t_2, __pyx_t_3); - __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - goto __pyx_L21; - } - __pyx_L21:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":252 - * - * # no alias has been found yet .. check subclasses - * alias = util.get_class_alias(klass) or pyamf.ClassAlias # <<<<<<<<<<<<<< - * meta = util.get_class_meta(klass) - * alias = alias(klass, defer=True, **meta) - */ - __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__util); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__get_class_alias); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __Pyx_INCREF(__pyx_v_klass); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_klass); - __Pyx_GIVEREF(__pyx_v_klass); - __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - if (!__pyx_t_5) { - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__ClassAlias); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __pyx_t_7; - __pyx_t_7 = 0; - } else { - __pyx_t_6 = __pyx_t_8; - __pyx_t_8 = 0; - } - __Pyx_DECREF(__pyx_v_alias); - __pyx_v_alias = __pyx_t_6; - __pyx_t_6 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":253 - * # no alias has been found yet .. check subclasses - * alias = util.get_class_alias(klass) or pyamf.ClassAlias - * meta = util.get_class_meta(klass) # <<<<<<<<<<<<<< - * alias = alias(klass, defer=True, **meta) - * - */ - __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__util); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__get_class_meta); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __Pyx_INCREF(__pyx_v_klass); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_klass); - __Pyx_GIVEREF(__pyx_v_klass); - __pyx_t_7 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_v_meta); - __pyx_v_meta = __pyx_t_7; - __pyx_t_7 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":254 - * alias = util.get_class_alias(klass) or pyamf.ClassAlias - * meta = util.get_class_meta(klass) - * alias = alias(klass, defer=True, **meta) # <<<<<<<<<<<<<< - * - * self.class_aliases[klass] = alias - */ - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - __Pyx_INCREF(__pyx_v_klass); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_klass); - __Pyx_GIVEREF(__pyx_v_klass); - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __pyx_t_8 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__defer), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_Update(((PyObject *)__pyx_t_6), __pyx_v_meta) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_v_alias, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_v_alias); - __pyx_v_alias = __pyx_t_8; - __pyx_t_8 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":256 - * alias = alias(klass, defer=True, **meta) - * - * self.class_aliases[klass] = alias # <<<<<<<<<<<<<< - * - * return alias - */ - if (PyDict_SetItem(((PyObject *)__pyx_v_self->class_aliases), __pyx_v_klass, __pyx_v_alias) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L12_exception_handled; - } - __pyx_L13_except_error:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L12_exception_handled:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L18_try_end:; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":258 - * self.class_aliases[klass] = alias - * - * return alias # <<<<<<<<<<<<<< - * - * cpdef unicode getStringForBytes(self, object s): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_alias); - __pyx_r = __pyx_v_alias; - goto __pyx_L0; - - __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_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("cpyamf.codec.Context.getClassAlias"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_alias); - __Pyx_DECREF(__pyx_v_meta); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":233 - * return self.objects.append(obj) - * - * cpdef object getClassAlias(self, object klass): # <<<<<<<<<<<<<< - * """ - * Gets a class alias based on the supplied C{klass}. - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Context_getClassAlias(PyObject *__pyx_v_self, PyObject *__pyx_v_klass); /*proto*/ -static char __pyx_doc_6cpyamf_5codec_7Context_getClassAlias[] = "\n Gets a class alias based on the supplied C{klass}.\n\n @param klass: The class object.\n @return: The L{ClassAlias} that is linked to C{klass}\n "; -static PyObject *__pyx_pf_6cpyamf_5codec_7Context_getClassAlias(PyObject *__pyx_v_self, PyObject *__pyx_v_klass) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("getClassAlias"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Context *)((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self)->__pyx_vtab)->getClassAlias(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self), __pyx_v_klass, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.codec.Context.getClassAlias"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":260 - * return alias - * - * cpdef unicode getStringForBytes(self, object s): # <<<<<<<<<<<<<< - * """ - * Returns the corresponding unicode object for a given string. If there - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Context_getStringForBytes(PyObject *__pyx_v_self, PyObject *__pyx_v_s); /*proto*/ -static PyObject *__pyx_f_6cpyamf_5codec_7Context_getStringForBytes(struct __pyx_obj_6cpyamf_5codec_Context *__pyx_v_self, PyObject *__pyx_v_s, int __pyx_skip_dispatch) { - PyObject *__pyx_v_ret = 0; - PyObject *__pyx_v_u = 0; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("getStringForBytes"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__getStringForBytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_5codec_7Context_getStringForBytes)) { - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_s); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_s); - __Pyx_GIVEREF(__pyx_v_s); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected unicode, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = ((PyObject *)__pyx_t_3); - __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":267 - * @since: 0.6 - * """ - * cdef object ret = self.unicodes.get(s, None) # <<<<<<<<<<<<<< - * - * if ret is not None: - */ - if (unlikely(__pyx_v_self->unicodes == Py_None)) { - PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'get'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_self->unicodes), __pyx_v_s, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_ret = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":269 - * cdef object ret = self.unicodes.get(s, None) - * - * if ret is not None: # <<<<<<<<<<<<<< - * return ret - * - */ - __pyx_t_4 = (__pyx_v_ret != Py_None); - if (__pyx_t_4) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":270 - * - * if ret is not None: - * return ret # <<<<<<<<<<<<<< - * - * cdef unicode u = s.decode('utf-8') - */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - if (!(likely(PyUnicode_CheckExact(__pyx_v_ret))||((__pyx_v_ret) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected unicode, got %.200s", Py_TYPE(__pyx_v_ret)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_INCREF(__pyx_v_ret); - __pyx_r = ((PyObject *)__pyx_v_ret); - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":272 - * return ret - * - * cdef unicode u = s.decode('utf-8') # <<<<<<<<<<<<<< - * - * self.unicodes[s] = u - */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_s, __pyx_n_s__decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected unicode, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_u = ((PyObject *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":274 - * cdef unicode u = s.decode('utf-8') - * - * self.unicodes[s] = u # <<<<<<<<<<<<<< - * self._strings[u] = s - * - */ - if (PyDict_SetItem(((PyObject *)__pyx_v_self->unicodes), __pyx_v_s, ((PyObject *)__pyx_v_u)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":275 - * - * self.unicodes[s] = u - * self._strings[u] = s # <<<<<<<<<<<<<< - * - * return u - */ - if (PyDict_SetItem(((PyObject *)__pyx_v_self->_strings), ((PyObject *)__pyx_v_u), __pyx_v_s) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":277 - * self._strings[u] = s - * - * return u # <<<<<<<<<<<<<< - * - * cpdef str getBytesForString(self, object u): - */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __Pyx_INCREF(((PyObject *)__pyx_v_u)); - __pyx_r = __pyx_v_u; - goto __pyx_L0; - - __pyx_r = ((PyObject *)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_3); - __Pyx_AddTraceback("cpyamf.codec.Context.getStringForBytes"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_ret); - __Pyx_XDECREF(__pyx_v_u); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":260 - * return alias - * - * cpdef unicode getStringForBytes(self, object s): # <<<<<<<<<<<<<< - * """ - * Returns the corresponding unicode object for a given string. If there - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Context_getStringForBytes(PyObject *__pyx_v_self, PyObject *__pyx_v_s); /*proto*/ -static char __pyx_doc_6cpyamf_5codec_7Context_getStringForBytes[] = "\n Returns the corresponding unicode object for a given string. If there\n is no unicode object, one is created.\n\n @since: 0.6\n "; -static PyObject *__pyx_pf_6cpyamf_5codec_7Context_getStringForBytes(PyObject *__pyx_v_self, PyObject *__pyx_v_s) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("getStringForBytes"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6cpyamf_5codec_Context *)((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self)->__pyx_vtab)->getStringForBytes(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self), __pyx_v_s, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.codec.Context.getStringForBytes"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":279 - * return u - * - * cpdef str getBytesForString(self, object u): # <<<<<<<<<<<<<< - * """ - * Returns the corresponding utf-8 encoded string for a given unicode - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Context_getBytesForString(PyObject *__pyx_v_self, PyObject *__pyx_v_u); /*proto*/ -static PyObject *__pyx_f_6cpyamf_5codec_7Context_getBytesForString(struct __pyx_obj_6cpyamf_5codec_Context *__pyx_v_self, PyObject *__pyx_v_u, int __pyx_skip_dispatch) { - PyObject *__pyx_v_ret = 0; - PyObject *__pyx_v_s = 0; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("getBytesForString"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__getBytesForString); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_5codec_7Context_getBytesForString)) { - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_u); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_u); - __Pyx_GIVEREF(__pyx_v_u); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = ((PyObject *)__pyx_t_3); - __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":286 - * @since: 0.6 - * """ - * cdef object ret = self._strings.get(u, None) # <<<<<<<<<<<<<< - * - * if ret is not None: - */ - if (unlikely(__pyx_v_self->_strings == Py_None)) { - PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'get'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_self->_strings), __pyx_v_u, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_ret = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":288 - * cdef object ret = self._strings.get(u, None) - * - * if ret is not None: # <<<<<<<<<<<<<< - * return ret - * - */ - __pyx_t_4 = (__pyx_v_ret != Py_None); - if (__pyx_t_4) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":289 - * - * if ret is not None: - * return ret # <<<<<<<<<<<<<< - * - * cdef str s = u.encode('utf-8') - */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - if (!(likely(PyString_CheckExact(__pyx_v_ret))||((__pyx_v_ret) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_v_ret)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_INCREF(__pyx_v_ret); - __pyx_r = ((PyObject *)__pyx_v_ret); - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":291 - * return ret - * - * cdef str s = u.encode('utf-8') # <<<<<<<<<<<<<< - * - * self.unicodes[s] = u - */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_u, __pyx_n_s__encode); 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_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_s = ((PyObject *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":293 - * cdef str s = u.encode('utf-8') - * - * self.unicodes[s] = u # <<<<<<<<<<<<<< - * self._strings[u] = s - * - */ - if (PyDict_SetItem(((PyObject *)__pyx_v_self->unicodes), ((PyObject *)__pyx_v_s), __pyx_v_u) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":294 - * - * self.unicodes[s] = u - * self._strings[u] = s # <<<<<<<<<<<<<< - * - * return s - */ - if (PyDict_SetItem(((PyObject *)__pyx_v_self->_strings), __pyx_v_u, ((PyObject *)__pyx_v_s)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":296 - * self._strings[u] = s - * - * return s # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __Pyx_INCREF(((PyObject *)__pyx_v_s)); - __pyx_r = __pyx_v_s; - goto __pyx_L0; - - __pyx_r = ((PyObject *)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_3); - __Pyx_AddTraceback("cpyamf.codec.Context.getBytesForString"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_ret); - __Pyx_XDECREF(__pyx_v_s); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":279 - * return u - * - * cpdef str getBytesForString(self, object u): # <<<<<<<<<<<<<< - * """ - * Returns the corresponding utf-8 encoded string for a given unicode - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Context_getBytesForString(PyObject *__pyx_v_self, PyObject *__pyx_v_u); /*proto*/ -static char __pyx_doc_6cpyamf_5codec_7Context_getBytesForString[] = "\n Returns the corresponding utf-8 encoded string for a given unicode\n object. If there is no string, one is encoded.\n\n @since: 0.6\n "; -static PyObject *__pyx_pf_6cpyamf_5codec_7Context_getBytesForString(PyObject *__pyx_v_self, PyObject *__pyx_v_u) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("getBytesForString"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6cpyamf_5codec_Context *)((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self)->__pyx_vtab)->getBytesForString(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self), __pyx_v_u, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.codec.Context.getBytesForString"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":41 - * cdef dict unicodes - * cdef dict _strings - * cdef public dict extra # <<<<<<<<<<<<<< - * - * cpdef int clear(self) except? -1 - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Context_5extra___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_7Context_5extra___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self)->extra)); - __pyx_r = ((PyObject *)((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self)->extra); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6cpyamf_5codec_7Context_5extra___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pf_6cpyamf_5codec_7Context_5extra___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannySetupContext("__set__"); - if (!(likely(PyDict_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self)->extra); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self)->extra)); - ((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self)->extra = ((PyObject *)__pyx_v_value); - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.Context.extra.__set__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6cpyamf_5codec_7Context_5extra___del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pf_6cpyamf_5codec_7Context_5extra___del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannySetupContext("__del__"); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self)->extra); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self)->extra)); - ((struct __pyx_obj_6cpyamf_5codec_Context *)__pyx_v_self)->extra = ((PyObject *)Py_None); - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":306 - * - * property stream: - * def __get__(self): # <<<<<<<<<<<<<< - * return self.stream - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_5Codec_6stream___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_5Codec_6stream___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("__get__"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":307 - * property stream: - * def __get__(self): - * return self.stream # <<<<<<<<<<<<<< - * - * def __set__(self, value): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6cpyamf_4util_BufferedByteStream *)((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->stream))); - __pyx_r = ((PyObject *)((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->stream); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":309 - * return self.stream - * - * def __set__(self, value): # <<<<<<<<<<<<<< - * if not isinstance(value, BufferedByteStream): - * value = BufferedByteStream(value) - */ - -static int __pyx_pf_6cpyamf_5codec_5Codec_6stream___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pf_6cpyamf_5codec_5Codec_6stream___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("__set__"); - __Pyx_INCREF(__pyx_v_value); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":310 - * - * def __set__(self, value): - * if not isinstance(value, BufferedByteStream): # <<<<<<<<<<<<<< - * value = BufferedByteStream(value) - * - */ - __pyx_t_1 = PyObject_TypeCheck(__pyx_v_value, ((PyTypeObject *)((PyObject*)__pyx_ptype_6cpyamf_4util_BufferedByteStream))); - __pyx_t_2 = (!__pyx_t_1); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":311 - * def __set__(self, value): - * if not isinstance(value, BufferedByteStream): - * value = BufferedByteStream(value) # <<<<<<<<<<<<<< - * - * self.stream = value - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_value); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6cpyamf_4util_BufferedByteStream)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_v_value); - __pyx_v_value = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":313 - * value = BufferedByteStream(value) - * - * self.stream = value # <<<<<<<<<<<<<< - * - * def __cinit__(self): - */ - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_value))); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->stream); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->stream)); - ((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->stream = ((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_value); - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("cpyamf.codec.Codec.stream.__set__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_value); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":315 - * self.stream = value - * - * def __cinit__(self): # <<<<<<<<<<<<<< - * self.stream = None - * self.strict = 0 - */ - -static int __pyx_pf_6cpyamf_5codec_5Codec___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6cpyamf_5codec_5Codec___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - int __pyx_r; - __Pyx_RefNannySetupContext("__cinit__"); - 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; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":316 - * - * def __cinit__(self): - * self.stream = None # <<<<<<<<<<<<<< - * self.strict = 0 - * self.timezone_offset = None - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->stream); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->stream)); - ((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->stream = ((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":317 - * def __cinit__(self): - * self.stream = None - * self.strict = 0 # <<<<<<<<<<<<<< - * self.timezone_offset = None - * - */ - ((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->strict = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":318 - * self.stream = None - * self.strict = 0 - * self.timezone_offset = None # <<<<<<<<<<<<<< - * - * def __init__(self, stream=None, strict=False, timezone_offset=None): - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->timezone_offset); - __Pyx_DECREF(((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->timezone_offset); - ((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->timezone_offset = Py_None; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":320 - * self.timezone_offset = None - * - * def __init__(self, stream=None, strict=False, timezone_offset=None): # <<<<<<<<<<<<<< - * if not isinstance(stream, BufferedByteStream): - * stream = BufferedByteStream(stream) - */ - -static int __pyx_pf_6cpyamf_5codec_5Codec___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6cpyamf_5codec_5Codec___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_stream = 0; - PyObject *__pyx_v_strict = 0; - PyObject *__pyx_v_timezone_offset = 0; - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__stream,&__pyx_n_s__strict,&__pyx_n_s__timezone_offset,0}; - __Pyx_RefNannySetupContext("__init__"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[3] = {0,0,0}; - values[0] = ((PyObject *)Py_None); - values[1] = __pyx_k_6; - values[2] = ((PyObject *)Py_None); - 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; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stream); - if (value) { values[0] = value; kw_args--; } - } - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__strict); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__timezone_offset); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_stream = values[0]; - __pyx_v_strict = values[1]; - __pyx_v_timezone_offset = values[2]; - } else { - __pyx_v_stream = ((PyObject *)Py_None); - __pyx_v_strict = __pyx_k_6; - __pyx_v_timezone_offset = ((PyObject *)Py_None); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: __pyx_v_timezone_offset = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: __pyx_v_strict = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: __pyx_v_stream = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - } - 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 = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.codec.Codec.__init__"); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __Pyx_INCREF(__pyx_v_stream); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":321 - * - * def __init__(self, stream=None, strict=False, timezone_offset=None): - * if not isinstance(stream, BufferedByteStream): # <<<<<<<<<<<<<< - * stream = BufferedByteStream(stream) - * - */ - __pyx_t_1 = PyObject_TypeCheck(__pyx_v_stream, ((PyTypeObject *)((PyObject*)__pyx_ptype_6cpyamf_4util_BufferedByteStream))); - __pyx_t_2 = (!__pyx_t_1); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":322 - * def __init__(self, stream=None, strict=False, timezone_offset=None): - * if not isinstance(stream, BufferedByteStream): - * stream = BufferedByteStream(stream) # <<<<<<<<<<<<<< - * - * self.stream = stream - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_stream); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_stream); - __Pyx_GIVEREF(__pyx_v_stream); - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6cpyamf_4util_BufferedByteStream)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_v_stream); - __pyx_v_stream = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L6; - } - __pyx_L6:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":324 - * stream = BufferedByteStream(stream) - * - * self.stream = stream # <<<<<<<<<<<<<< - * self.strict = strict - * - */ - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_stream))); - __Pyx_GIVEREF(__pyx_v_stream); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->stream); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->stream)); - ((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->stream = ((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_stream); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":325 - * - * self.stream = stream - * self.strict = strict # <<<<<<<<<<<<<< - * - * self.timezone_offset = timezone_offset - */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_strict); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->strict = __pyx_t_2; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":327 - * self.strict = strict - * - * self.timezone_offset = timezone_offset # <<<<<<<<<<<<<< - * - * - */ - __Pyx_INCREF(__pyx_v_timezone_offset); - __Pyx_GIVEREF(__pyx_v_timezone_offset); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->timezone_offset); - __Pyx_DECREF(((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->timezone_offset); - ((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->timezone_offset = __pyx_v_timezone_offset; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("cpyamf.codec.Codec.__init__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_stream); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":61 - * - * cdef util.cBufferedByteStream stream - * cdef public bint strict # <<<<<<<<<<<<<< - * cdef public object timezone_offset - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_5Codec_6strict___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_5Codec_6strict___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->strict); 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; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.codec.Codec.strict.__get__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6cpyamf_5codec_5Codec_6strict___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pf_6cpyamf_5codec_5Codec_6strict___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("__set__"); - __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 = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->strict = __pyx_t_1; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.Codec.strict.__set__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pxd":62 - * cdef util.cBufferedByteStream stream - * cdef public bint strict - * cdef public object timezone_offset # <<<<<<<<<<<<<< - * - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_5Codec_15timezone_offset___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_5Codec_15timezone_offset___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->timezone_offset); - __pyx_r = ((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->timezone_offset; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6cpyamf_5codec_5Codec_15timezone_offset___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pf_6cpyamf_5codec_5Codec_15timezone_offset___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannySetupContext("__set__"); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->timezone_offset); - __Pyx_DECREF(((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->timezone_offset); - ((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->timezone_offset = __pyx_v_value; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6cpyamf_5codec_5Codec_15timezone_offset___del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pf_6cpyamf_5codec_5Codec_15timezone_offset___del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannySetupContext("__del__"); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->timezone_offset); - __Pyx_DECREF(((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->timezone_offset); - ((struct __pyx_obj_6cpyamf_5codec_Codec *)__pyx_v_self)->timezone_offset = Py_None; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":335 - * """ - * - * cdef object readDate(self): # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static PyObject *__pyx_f_6cpyamf_5codec_7Decoder_readDate(struct __pyx_obj_6cpyamf_5codec_Decoder *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("readDate"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":336 - * - * cdef object readDate(self): - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cpdef object readString(self): - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.Decoder.readDate"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":338 - * raise NotImplementedError - * - * cpdef object readString(self): # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Decoder_readString(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_f_6cpyamf_5codec_7Decoder_readString(struct __pyx_obj_6cpyamf_5codec_Decoder *__pyx_v_self, int __pyx_skip_dispatch) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("readString"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__readString); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_5codec_7Decoder_readString)) { - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __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; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":339 - * - * cpdef object readString(self): - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cdef object readObject(self): - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __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("cpyamf.codec.Decoder.readString"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":338 - * raise NotImplementedError - * - * cpdef object readString(self): # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Decoder_readString(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_7Decoder_readString(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("readString"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Decoder *)((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self)->__pyx_vtab)->readString(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.codec.Decoder.readString"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":341 - * raise NotImplementedError - * - * cdef object readObject(self): # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static PyObject *__pyx_f_6cpyamf_5codec_7Decoder_readObject(struct __pyx_obj_6cpyamf_5codec_Decoder *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("readObject"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":342 - * - * cdef object readObject(self): - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cdef object readNumber(self): - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.Decoder.readObject"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":344 - * raise NotImplementedError - * - * cdef object readNumber(self): # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static PyObject *__pyx_f_6cpyamf_5codec_7Decoder_readNumber(struct __pyx_obj_6cpyamf_5codec_Decoder *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("readNumber"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":345 - * - * cdef object readNumber(self): - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cdef inline object readNull(self): - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.Decoder.readNumber"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":347 - * raise NotImplementedError - * - * cdef inline object readNull(self): # <<<<<<<<<<<<<< - * return None - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_6cpyamf_5codec_7Decoder_readNull(struct __pyx_obj_6cpyamf_5codec_Decoder *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("readNull"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":348 - * - * cdef inline object readNull(self): - * return None # <<<<<<<<<<<<<< - * - * cdef inline object readUndefined(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":350 - * return None - * - * cdef inline object readUndefined(self): # <<<<<<<<<<<<<< - * return Undefined - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_6cpyamf_5codec_7Decoder_readUndefined(struct __pyx_obj_6cpyamf_5codec_Decoder *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("readUndefined"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":351 - * - * cdef inline object readUndefined(self): - * return Undefined # <<<<<<<<<<<<<< - * - * cdef object readList(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_6cpyamf_5codec_Undefined); - __pyx_r = __pyx_v_6cpyamf_5codec_Undefined; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":353 - * return Undefined - * - * cdef object readList(self): # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static PyObject *__pyx_f_6cpyamf_5codec_7Decoder_readList(struct __pyx_obj_6cpyamf_5codec_Decoder *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("readList"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":354 - * - * cdef object readList(self): - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cdef object readXML(self): - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.Decoder.readList"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":356 - * raise NotImplementedError - * - * cdef object readXML(self): # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static PyObject *__pyx_f_6cpyamf_5codec_7Decoder_readXML(struct __pyx_obj_6cpyamf_5codec_Decoder *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("readXML"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":357 - * - * cdef object readXML(self): - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cpdef object readElement(self): - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.Decoder.readXML"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":359 - * raise NotImplementedError - * - * cpdef object readElement(self): # <<<<<<<<<<<<<< - * """ - * Reads an element from the data stream. - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Decoder_readElement(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_f_6cpyamf_5codec_7Decoder_readElement(struct __pyx_obj_6cpyamf_5codec_Decoder *__pyx_v_self, int __pyx_skip_dispatch) { - Py_ssize_t __pyx_v_pos; - char __pyx_v_t; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - int __pyx_t_4; - char __pyx_t_5; - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - __Pyx_RefNannySetupContext("readElement"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__readElement); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_5codec_7Decoder_readElement)) { - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __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; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":363 - * Reads an element from the data stream. - * """ - * cdef Py_ssize_t pos = self.stream.tell() # <<<<<<<<<<<<<< - * cdef char t - * - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.stream->__pyx_vtab)->tell(__pyx_v_self->__pyx_base.stream, 0); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_pos = __pyx_t_3; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":366 - * cdef char t - * - * if self.stream.at_eof(): # <<<<<<<<<<<<<< - * raise pyamf.EOStream - * - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.stream->__pyx_vtab)->at_eof(__pyx_v_self->__pyx_base.stream, 0); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_4) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":367 - * - * if self.stream.at_eof(): - * raise pyamf.EOStream # <<<<<<<<<<<<<< - * - * t = self.stream.read_char() - */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__EOStream); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":369 - * raise pyamf.EOStream - * - * t = self.stream.read_char() # <<<<<<<<<<<<<< - * - * try: - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.stream->__pyx_vtab)->read_char(__pyx_v_self->__pyx_base.stream, 0); if (unlikely(__pyx_t_5 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_t = __pyx_t_5; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":371 - * t = self.stream.read_char() - * - * try: # <<<<<<<<<<<<<< - * return self.readConcreteElement(t) - * except IOError: - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - __Pyx_XGOTREF(__pyx_save_exc_type); - __Pyx_XGOTREF(__pyx_save_exc_value); - __Pyx_XGOTREF(__pyx_save_exc_tb); - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":372 - * - * try: - * return self.readConcreteElement(t) # <<<<<<<<<<<<<< - * except IOError: - * self.stream.seek(pos) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Decoder *)__pyx_v_self->__pyx_vtab)->readConcreteElement(__pyx_v_self, __pyx_v_t); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L4_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L8_try_return; - } - __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L11_try_end; - __pyx_L8_try_return:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L0; - __pyx_L4_error:; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":373 - * try: - * return self.readConcreteElement(t) - * except IOError: # <<<<<<<<<<<<<< - * self.stream.seek(pos) - * - */ - __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_IOError); - if (__pyx_t_6) { - __Pyx_AddTraceback("cpyamf.codec.Decoder.readElement"); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_t_7); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":374 - * return self.readConcreteElement(t) - * except IOError: - * self.stream.seek(pos) # <<<<<<<<<<<<<< - * - * raise - */ - __pyx_t_6 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.stream->__pyx_vtab)->seek(__pyx_v_self->__pyx_base.stream, __pyx_v_pos, 0, NULL); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":376 - * self.stream.seek(pos) - * - * raise # <<<<<<<<<<<<<< - * - * cdef object readConcreteElement(self, char t): - */ - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_7); - __Pyx_ErrRestore(__pyx_t_2, __pyx_t_1, __pyx_t_7); - __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_7 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L5_exception_handled; - } - __pyx_L6_except_error:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L5_exception_handled:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L11_try_end:; - } - - __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_7); - __Pyx_AddTraceback("cpyamf.codec.Decoder.readElement"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":359 - * raise NotImplementedError - * - * cpdef object readElement(self): # <<<<<<<<<<<<<< - * """ - * Reads an element from the data stream. - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Decoder_readElement(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6cpyamf_5codec_7Decoder_readElement[] = "\n Reads an element from the data stream.\n "; -static PyObject *__pyx_pf_6cpyamf_5codec_7Decoder_readElement(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("readElement"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Decoder *)((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self)->__pyx_vtab)->readElement(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.codec.Decoder.readElement"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":378 - * raise - * - * cdef object readConcreteElement(self, char t): # <<<<<<<<<<<<<< - * """ - * The workhorse function. Overridden in subclasses - */ - -static PyObject *__pyx_f_6cpyamf_5codec_7Decoder_readConcreteElement(struct __pyx_obj_6cpyamf_5codec_Decoder *__pyx_v_self, char __pyx_v_t) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("readConcreteElement"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":382 - * The workhorse function. Overridden in subclasses - * """ - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cpdef int send(self, data) except -1: - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.Decoder.readConcreteElement"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":384 - * raise NotImplementedError - * - * cpdef int send(self, data) except -1: # <<<<<<<<<<<<<< - * """ - * Add data for the decoder to work on. - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Decoder_send(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/ -static int __pyx_f_6cpyamf_5codec_7Decoder_send(struct __pyx_obj_6cpyamf_5codec_Decoder *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_skip_dispatch) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("send"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__send); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_5codec_7Decoder_send)) { - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_data); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data); - __Pyx_GIVEREF(__pyx_v_data); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":388 - * Add data for the decoder to work on. - * """ - * return self.stream.append(data) # <<<<<<<<<<<<<< - * - * def __next__(self): - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.stream->__pyx_vtab)->append(__pyx_v_self->__pyx_base.stream, __pyx_v_data, 0); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.codec.Decoder.send"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":384 - * raise NotImplementedError - * - * cpdef int send(self, data) except -1: # <<<<<<<<<<<<<< - * """ - * Add data for the decoder to work on. - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Decoder_send(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/ -static char __pyx_doc_6cpyamf_5codec_7Decoder_send[] = "\n Add data for the decoder to work on.\n "; -static PyObject *__pyx_pf_6cpyamf_5codec_7Decoder_send(PyObject *__pyx_v_self, PyObject *__pyx_v_data) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("send"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Decoder *)((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self)->__pyx_vtab)->send(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self), __pyx_v_data, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.codec.Decoder.send"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":390 - * return self.stream.append(data) - * - * def __next__(self): # <<<<<<<<<<<<<< - * """ - * Part of the iterator protocol. - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Decoder___next__(PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_6cpyamf_5codec_7Decoder___next__[] = "\n Part of the iterator protocol.\n "; -struct wrapperbase __pyx_wrapperbase_6cpyamf_5codec_7Decoder___next__; -static PyObject *__pyx_pf_6cpyamf_5codec_7Decoder___next__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("__next__"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":394 - * Part of the iterator protocol. - * """ - * try: # <<<<<<<<<<<<<< - * return self.readElement() - * except pyamf.EOStream: - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - __Pyx_XGOTREF(__pyx_save_exc_type); - __Pyx_XGOTREF(__pyx_save_exc_value); - __Pyx_XGOTREF(__pyx_save_exc_tb); - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":395 - * """ - * try: - * return self.readElement() # <<<<<<<<<<<<<< - * except pyamf.EOStream: - * # all data was successfully decoded from the stream - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Decoder *)((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self)->__pyx_vtab)->readElement(((struct __pyx_obj_6cpyamf_5codec_Decoder *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L5_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L9_try_return; - } - __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L12_try_end; - __pyx_L9_try_return:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L0; - __pyx_L5_error:; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":396 - * try: - * return self.readElement() - * except pyamf.EOStream: # <<<<<<<<<<<<<< - * # all data was successfully decoded from the stream - * raise StopIteration - */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__EOStream); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = PyErr_ExceptionMatches(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_3) { - __Pyx_AddTraceback("cpyamf.codec.Decoder.__next__"); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_t_4); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":398 - * except pyamf.EOStream: - * # all data was successfully decoded from the stream - * raise StopIteration # <<<<<<<<<<<<<< - * - * def __iter__(self): - */ - __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L6_exception_handled; - } - __pyx_L7_except_error:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L6_exception_handled:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L12_try_end:; - } - - __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_4); - __Pyx_AddTraceback("cpyamf.codec.Decoder.__next__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":400 - * raise StopIteration - * - * def __iter__(self): # <<<<<<<<<<<<<< - * return self - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Decoder___iter__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_7Decoder___iter__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("__iter__"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":401 - * - * def __iter__(self): - * return self # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self); - __pyx_r = __pyx_v_self; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":409 - * """ - * - * def __cinit__(self): # <<<<<<<<<<<<<< - * self.func_cache = {} - * self.use_write_object = [] - */ - -static int __pyx_pf_6cpyamf_5codec_7Encoder___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6cpyamf_5codec_7Encoder___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__cinit__"); - 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; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":410 - * - * def __cinit__(self): - * self.func_cache = {} # <<<<<<<<<<<<<< - * self.use_write_object = [] - * self.bucket = [] - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->func_cache); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->func_cache)); - ((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->func_cache = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":411 - * def __cinit__(self): - * self.func_cache = {} - * self.use_write_object = [] # <<<<<<<<<<<<<< - * self.bucket = [] - * - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->use_write_object); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->use_write_object)); - ((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->use_write_object = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":412 - * self.func_cache = {} - * self.use_write_object = [] - * self.bucket = [] # <<<<<<<<<<<<<< - * - * cpdef int serialiseString(self, u) except -1: - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->bucket); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->bucket)); - ((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->bucket = __pyx_t_1; - __pyx_t_1 = 0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.codec.Encoder.__cinit__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":414 - * self.bucket = [] - * - * cpdef int serialiseString(self, u) except -1: # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Encoder_serialiseString(PyObject *__pyx_v_self, PyObject *__pyx_v_u); /*proto*/ -static int __pyx_f_6cpyamf_5codec_7Encoder_serialiseString(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, PyObject *__pyx_v_u, int __pyx_skip_dispatch) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("serialiseString"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__serialiseString); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_5codec_7Encoder_serialiseString)) { - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_u); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_u); - __Pyx_GIVEREF(__pyx_v_u); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":415 - * - * cpdef int serialiseString(self, u) except -1: - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cdef inline int writeType(self, char type) except -1: - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.codec.Encoder.serialiseString"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":414 - * self.bucket = [] - * - * cpdef int serialiseString(self, u) except -1: # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Encoder_serialiseString(PyObject *__pyx_v_self, PyObject *__pyx_v_u); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_7Encoder_serialiseString(PyObject *__pyx_v_self, PyObject *__pyx_v_u) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("serialiseString"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->__pyx_vtab)->serialiseString(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_u, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.codec.Encoder.serialiseString"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":417 - * raise NotImplementedError - * - * cdef inline int writeType(self, char type) except -1: # <<<<<<<<<<<<<< - * return self.stream.write(&type, 1) - * - */ - -static CYTHON_INLINE int __pyx_f_6cpyamf_5codec_7Encoder_writeType(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, char __pyx_v_type) { - int __pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("writeType"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":418 - * - * cdef inline int writeType(self, char type) except -1: - * return self.stream.write(&type, 1) # <<<<<<<<<<<<<< - * - * cdef int writeNull(self, object o) except -1: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_base.stream->__pyx_vtab)->write(__pyx_v_self->__pyx_base.stream, (&__pyx_v_type), 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_1; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeType"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":420 - * return self.stream.write(&type, 1) - * - * cdef int writeNull(self, object o) except -1: # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static int __pyx_f_6cpyamf_5codec_7Encoder_writeNull(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, PyObject *__pyx_v_o) { - int __pyx_r; - __Pyx_RefNannySetupContext("writeNull"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":421 - * - * cdef int writeNull(self, object o) except -1: - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cdef int writeUndefined(self, object o) except -1: - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeNull"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":423 - * raise NotImplementedError - * - * cdef int writeUndefined(self, object o) except -1: # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static int __pyx_f_6cpyamf_5codec_7Encoder_writeUndefined(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, PyObject *__pyx_v_o) { - int __pyx_r; - __Pyx_RefNannySetupContext("writeUndefined"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":424 - * - * cdef int writeUndefined(self, object o) except -1: - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cdef int writeString(self, object o) except -1: - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeUndefined"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":426 - * raise NotImplementedError - * - * cdef int writeString(self, object o) except -1: # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static int __pyx_f_6cpyamf_5codec_7Encoder_writeString(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, PyObject *__pyx_v_o) { - int __pyx_r; - __Pyx_RefNannySetupContext("writeString"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":427 - * - * cdef int writeString(self, object o) except -1: - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cdef int writeBytes(self, object o) except -1: - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeString"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":429 - * raise NotImplementedError - * - * cdef int writeBytes(self, object o) except -1: # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static int __pyx_f_6cpyamf_5codec_7Encoder_writeBytes(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, PyObject *__pyx_v_o) { - int __pyx_r; - __Pyx_RefNannySetupContext("writeBytes"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":430 - * - * cdef int writeBytes(self, object o) except -1: - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cdef int writeBoolean(self, object o) except -1: - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeBytes"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":432 - * raise NotImplementedError - * - * cdef int writeBoolean(self, object o) except -1: # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static int __pyx_f_6cpyamf_5codec_7Encoder_writeBoolean(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, PyObject *__pyx_v_o) { - int __pyx_r; - __Pyx_RefNannySetupContext("writeBoolean"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":433 - * - * cdef int writeBoolean(self, object o) except -1: - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cdef int writeInt(self, object o) except -1: - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeBoolean"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":435 - * raise NotImplementedError - * - * cdef int writeInt(self, object o) except -1: # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static int __pyx_f_6cpyamf_5codec_7Encoder_writeInt(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, PyObject *__pyx_v_o) { - int __pyx_r; - __Pyx_RefNannySetupContext("writeInt"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":436 - * - * cdef int writeInt(self, object o) except -1: - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cdef int writeLong(self, object o) except -1: - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeInt"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":438 - * raise NotImplementedError - * - * cdef int writeLong(self, object o) except -1: # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static int __pyx_f_6cpyamf_5codec_7Encoder_writeLong(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, PyObject *__pyx_v_o) { - int __pyx_r; - __Pyx_RefNannySetupContext("writeLong"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":439 - * - * cdef int writeLong(self, object o) except -1: - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cdef int writeNumber(self, object o) except -1: - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeLong"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":441 - * raise NotImplementedError - * - * cdef int writeNumber(self, object o) except -1: # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static int __pyx_f_6cpyamf_5codec_7Encoder_writeNumber(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, PyObject *__pyx_v_o) { - int __pyx_r; - __Pyx_RefNannySetupContext("writeNumber"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":442 - * - * cdef int writeNumber(self, object o) except -1: - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cdef int writeDateTime(self, object o) except -1: - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeNumber"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":444 - * raise NotImplementedError - * - * cdef int writeDateTime(self, object o) except -1: # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static int __pyx_f_6cpyamf_5codec_7Encoder_writeDateTime(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, PyObject *__pyx_v_o) { - int __pyx_r; - __Pyx_RefNannySetupContext("writeDateTime"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":445 - * - * cdef int writeDateTime(self, object o) except -1: - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cdef int writeDate(self, object o) except -1: - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeDateTime"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":447 - * raise NotImplementedError - * - * cdef int writeDate(self, object o) except -1: # <<<<<<<<<<<<<< - * o = datetime.datetime.combine(o, datetime.time(0, 0, 0, 0)) - * - */ - -static int __pyx_f_6cpyamf_5codec_7Encoder_writeDate(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, PyObject *__pyx_v_o) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("writeDate"); - __Pyx_INCREF(__pyx_v_o); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":448 - * - * cdef int writeDate(self, object o) except -1: - * o = datetime.datetime.combine(o, datetime.time(0, 0, 0, 0)) # <<<<<<<<<<<<<< - * - * self.writeDateTime(o) - */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__combine); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __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_GetName(__pyx_m, __pyx_n_s__datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_o); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o); - __Pyx_GIVEREF(__pyx_v_o); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_v_o); - __pyx_v_o = __pyx_t_2; - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":450 - * o = datetime.datetime.combine(o, datetime.time(0, 0, 0, 0)) - * - * self.writeDateTime(o) # <<<<<<<<<<<<<< - * - * cdef int writeXML(self, object o) except -1: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeDateTime(__pyx_v_self, __pyx_v_o); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeDate"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_o); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":452 - * self.writeDateTime(o) - * - * cdef int writeXML(self, object o) except -1: # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static int __pyx_f_6cpyamf_5codec_7Encoder_writeXML(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, PyObject *__pyx_v_o) { - int __pyx_r; - __Pyx_RefNannySetupContext("writeXML"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":453 - * - * cdef int writeXML(self, object o) except -1: - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cpdef int writeList(self, object o, bint is_proxy=0) except -1: - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeXML"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":455 - * raise NotImplementedError - * - * cpdef int writeList(self, object o, bint is_proxy=0) except -1: # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Encoder_writeList(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_f_6cpyamf_5codec_7Encoder_writeList(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, PyObject *__pyx_v_o, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeList *__pyx_optional_args) { - int __pyx_v_is_proxy = ((int)0); - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("writeList"); - if (__pyx_optional_args) { - if (__pyx_optional_args->__pyx_n > 0) { - __pyx_v_is_proxy = __pyx_optional_args->is_proxy; - } - } - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__writeList); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_5codec_7Encoder_writeList)) { - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_is_proxy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_o); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o); - __Pyx_GIVEREF(__pyx_v_o); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":456 - * - * cpdef int writeList(self, object o, bint is_proxy=0) except -1: - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cdef int writeTuple(self, object o) except -1: - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeList"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":455 - * raise NotImplementedError - * - * cpdef int writeList(self, object o, bint is_proxy=0) except -1: # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Encoder_writeList(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_7Encoder_writeList(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_o = 0; - int __pyx_v_is_proxy; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeList __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__o,&__pyx_n_s__is_proxy,0}; - __Pyx_RefNannySetupContext("writeList"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - 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; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__o); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__is_proxy); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "writeList") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_o = values[0]; - if (values[1]) { - __pyx_v_is_proxy = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_is_proxy == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_is_proxy = ((int)0); - } - } else { - __pyx_v_is_proxy = ((int)0); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: __pyx_v_is_proxy = __Pyx_PyObject_IsTrue(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_is_proxy == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 1: __pyx_v_o = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("writeList", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeList"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_2.__pyx_n = 1; - __pyx_t_2.is_proxy = __pyx_v_is_proxy; - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->__pyx_vtab)->writeList(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_o, 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeList"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":458 - * raise NotImplementedError - * - * cdef int writeTuple(self, object o) except -1: # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static int __pyx_f_6cpyamf_5codec_7Encoder_writeTuple(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, PyObject *__pyx_v_o) { - int __pyx_r; - __Pyx_RefNannySetupContext("writeTuple"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":459 - * - * cdef int writeTuple(self, object o) except -1: - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cdef int writeDict(self, dict o) except -1: - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeTuple"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":461 - * raise NotImplementedError - * - * cdef int writeDict(self, dict o) except -1: # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static int __pyx_f_6cpyamf_5codec_7Encoder_writeDict(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, PyObject *__pyx_v_o) { - int __pyx_r; - __Pyx_RefNannySetupContext("writeDict"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":462 - * - * cdef int writeDict(self, dict o) except -1: - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cdef int writeGenerator(self, object o) except -1: - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeDict"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":464 - * raise NotImplementedError - * - * cdef int writeGenerator(self, object o) except -1: # <<<<<<<<<<<<<< - * cdef object n = getattr(o, 'next') - * - */ - -static int __pyx_f_6cpyamf_5codec_7Encoder_writeGenerator(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, PyObject *__pyx_v_o) { - PyObject *__pyx_v_n = 0; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("writeGenerator"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":465 - * - * cdef int writeGenerator(self, object o) except -1: - * cdef object n = getattr(o, 'next') # <<<<<<<<<<<<<< - * - * while True: - */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_o, ((PyObject *)__pyx_n_s__next)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_n = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":467 - * cdef object n = getattr(o, 'next') - * - * while True: # <<<<<<<<<<<<<< - * try: - * self.writeElement(n()) - */ - while (1) { - if (!1) break; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":468 - * - * while True: - * try: # <<<<<<<<<<<<<< - * self.writeElement(n()) - * except StopIteration: - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - __Pyx_XGOTREF(__pyx_save_exc_type); - __Pyx_XGOTREF(__pyx_save_exc_value); - __Pyx_XGOTREF(__pyx_save_exc_tb); - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":469 - * while True: - * try: - * self.writeElement(n()) # <<<<<<<<<<<<<< - * except StopIteration: - * return 0 - */ - __pyx_t_1 = PyObject_Call(__pyx_v_n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L5_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeElement(__pyx_v_self, __pyx_t_1, 0); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L5_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L12_try_end; - __pyx_L5_error:; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":470 - * try: - * self.writeElement(n()) - * except StopIteration: # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_t_2 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration); - if (__pyx_t_2) { - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeGenerator"); - if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GOTREF(__pyx_t_4); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":471 - * self.writeElement(n()) - * except StopIteration: - * return 0 # <<<<<<<<<<<<<< - * - * cdef int writeSequence(self, object iterable) except -1: - */ - __pyx_r = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L8_except_return; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L6_exception_handled; - } - __pyx_L7_except_error:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L8_except_return:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L0; - __pyx_L6_exception_handled:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L12_try_end:; - } - } - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeGenerator"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_n); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":473 - * return 0 - * - * cdef int writeSequence(self, object iterable) except -1: # <<<<<<<<<<<<<< - * """ - * Encodes an iterable. The default is to write If the iterable has an al - */ - -static int __pyx_f_6cpyamf_5codec_7Encoder_writeSequence(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, PyObject *__pyx_v_iterable) { - PyObject *__pyx_v_alias; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("writeSequence"); - __pyx_v_alias = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":477 - * Encodes an iterable. The default is to write If the iterable has an al - * """ - * try: # <<<<<<<<<<<<<< - * alias = self.context.getClassAlias(iterable.__class__) - * except (AttributeError, pyamf.UnknownClassAlias): - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - __Pyx_XGOTREF(__pyx_save_exc_type); - __Pyx_XGOTREF(__pyx_save_exc_value); - __Pyx_XGOTREF(__pyx_save_exc_tb); - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":478 - * """ - * try: - * alias = self.context.getClassAlias(iterable.__class__) # <<<<<<<<<<<<<< - * except (AttributeError, pyamf.UnknownClassAlias): - * return self.writeList(iterable) - */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__context); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__getClassAlias); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_iterable, __pyx_n_s____class__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_v_alias); - __pyx_v_alias = __pyx_t_1; - __pyx_t_1 = 0; - } - __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":479 - * try: - * alias = self.context.getClassAlias(iterable.__class__) - * except (AttributeError, pyamf.UnknownClassAlias): # <<<<<<<<<<<<<< - * return self.writeList(iterable) - * - */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__UnknownClassAlias); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || PyErr_ExceptionMatches(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_4) { - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeSequence"); - if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_t_2); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":480 - * alias = self.context.getClassAlias(iterable.__class__) - * except (AttributeError, pyamf.UnknownClassAlias): - * return self.writeList(iterable) # <<<<<<<<<<<<<< - * - * if alias.external: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeList(__pyx_v_self, __pyx_v_iterable, 0, NULL); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L6_except_return; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L4_exception_handled; - } - __pyx_L5_except_error:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L6_except_return:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L0; - __pyx_L4_exception_handled:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L10_try_end:; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":482 - * return self.writeList(iterable) - * - * if alias.external: # <<<<<<<<<<<<<< - * # a is a subclassed list with a registered alias - push to the - * # correct method - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_alias, __pyx_n_s__external); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":485 - * # a is a subclassed list with a registered alias - push to the - * # correct method - * self.use_write_object.append(type(iterable)) # <<<<<<<<<<<<<< - * - * return self.writeObject(iterable) - */ - if (unlikely(__pyx_v_self->use_write_object == Py_None)) { - PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_4 = PyList_Append(__pyx_v_self->use_write_object, ((PyObject *)Py_TYPE(__pyx_v_iterable))); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":487 - * self.use_write_object.append(type(iterable)) - * - * return self.writeObject(iterable) # <<<<<<<<<<<<<< - * - * return self.writeList(iterable) - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeObject(__pyx_v_self, __pyx_v_iterable, 0, NULL); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - goto __pyx_L13; - } - __pyx_L13:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":489 - * return self.writeObject(iterable) - * - * return self.writeList(iterable) # <<<<<<<<<<<<<< - * - * cpdef int writeObject(self, object o, bint is_proxy=0) except -1: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeList(__pyx_v_self, __pyx_v_iterable, 0, NULL); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeSequence"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_alias); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":491 - * return self.writeList(iterable) - * - * cpdef int writeObject(self, object o, bint is_proxy=0) except -1: # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Encoder_writeObject(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_f_6cpyamf_5codec_7Encoder_writeObject(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, PyObject *__pyx_v_o, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeObject *__pyx_optional_args) { - int __pyx_v_is_proxy = ((int)0); - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("writeObject"); - if (__pyx_optional_args) { - if (__pyx_optional_args->__pyx_n > 0) { - __pyx_v_is_proxy = __pyx_optional_args->is_proxy; - } - } - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__writeObject); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_5codec_7Encoder_writeObject)) { - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_is_proxy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_o); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o); - __Pyx_GIVEREF(__pyx_v_o); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":492 - * - * cpdef int writeObject(self, object o, bint is_proxy=0) except -1: - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cdef int writeMixedArray(self, object o) except -1: - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeObject"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":491 - * return self.writeList(iterable) - * - * cpdef int writeObject(self, object o, bint is_proxy=0) except -1: # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Encoder_writeObject(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_7Encoder_writeObject(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_o = 0; - int __pyx_v_is_proxy; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeObject __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__o,&__pyx_n_s__is_proxy,0}; - __Pyx_RefNannySetupContext("writeObject"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - 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; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__o); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__is_proxy); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "writeObject") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_o = values[0]; - if (values[1]) { - __pyx_v_is_proxy = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_is_proxy == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_is_proxy = ((int)0); - } - } else { - __pyx_v_is_proxy = ((int)0); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: __pyx_v_is_proxy = __Pyx_PyObject_IsTrue(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_is_proxy == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 1: __pyx_v_o = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("writeObject", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeObject"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_2.__pyx_n = 1; - __pyx_t_2.is_proxy = __pyx_v_is_proxy; - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->__pyx_vtab)->writeObject(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_o, 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeObject"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":494 - * raise NotImplementedError - * - * cdef int writeMixedArray(self, object o) except -1: # <<<<<<<<<<<<<< - * raise NotImplementedError - * - */ - -static int __pyx_f_6cpyamf_5codec_7Encoder_writeMixedArray(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, PyObject *__pyx_v_o) { - int __pyx_r; - __Pyx_RefNannySetupContext("writeMixedArray"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":495 - * - * cdef int writeMixedArray(self, object o) except -1: - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cdef inline int handleBasicTypes(self, object element, object py_type) except -1: - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeMixedArray"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":497 - * raise NotImplementedError - * - * cdef inline int handleBasicTypes(self, object element, object py_type) except -1: # <<<<<<<<<<<<<< - * """ - * @return: 0 = handled, -1 = error, 1 = not handled - */ - -static CYTHON_INLINE int __pyx_f_6cpyamf_5codec_7Encoder_handleBasicTypes(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, PyObject *__pyx_v_element, PyObject *__pyx_v_py_type) { - int __pyx_v_ret; - int __pyx_r; - int __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; - __Pyx_RefNannySetupContext("handleBasicTypes"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":501 - * @return: 0 = handled, -1 = error, 1 = not handled - * """ - * cdef int ret = 1 # <<<<<<<<<<<<<< - * - * if PyString_Check(element): - */ - __pyx_v_ret = 1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":503 - * cdef int ret = 1 - * - * if PyString_Check(element): # <<<<<<<<<<<<<< - * ret = self.writeBytes(element) - * elif PyUnicode_Check(element): - */ - __pyx_t_1 = PyString_Check(__pyx_v_element); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":504 - * - * if PyString_Check(element): - * ret = self.writeBytes(element) # <<<<<<<<<<<<<< - * elif PyUnicode_Check(element): - * ret = self.writeString(element) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeBytes(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ret = __pyx_t_2; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":505 - * if PyString_Check(element): - * ret = self.writeBytes(element) - * elif PyUnicode_Check(element): # <<<<<<<<<<<<<< - * ret = self.writeString(element) - * elif element is None: - */ - __pyx_t_1 = PyUnicode_Check(__pyx_v_element); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":506 - * ret = self.writeBytes(element) - * elif PyUnicode_Check(element): - * ret = self.writeString(element) # <<<<<<<<<<<<<< - * elif element is None: - * ret = self.writeNull(element) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeString(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ret = __pyx_t_2; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":507 - * elif PyUnicode_Check(element): - * ret = self.writeString(element) - * elif element is None: # <<<<<<<<<<<<<< - * ret = self.writeNull(element) - * elif PyBool_Check(element): - */ - __pyx_t_1 = (__pyx_v_element == Py_None); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":508 - * ret = self.writeString(element) - * elif element is None: - * ret = self.writeNull(element) # <<<<<<<<<<<<<< - * elif PyBool_Check(element): - * ret = self.writeBoolean(element) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeNull(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ret = __pyx_t_2; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":509 - * elif element is None: - * ret = self.writeNull(element) - * elif PyBool_Check(element): # <<<<<<<<<<<<<< - * ret = self.writeBoolean(element) - * elif PyInt_CheckExact(element): - */ - __pyx_t_1 = PyBool_Check(__pyx_v_element); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":510 - * ret = self.writeNull(element) - * elif PyBool_Check(element): - * ret = self.writeBoolean(element) # <<<<<<<<<<<<<< - * elif PyInt_CheckExact(element): - * ret = self.writeInt(element) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeBoolean(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ret = __pyx_t_2; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":511 - * elif PyBool_Check(element): - * ret = self.writeBoolean(element) - * elif PyInt_CheckExact(element): # <<<<<<<<<<<<<< - * ret = self.writeInt(element) - * elif PyLong_CheckExact(element): - */ - __pyx_t_1 = PyInt_CheckExact(__pyx_v_element); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":512 - * ret = self.writeBoolean(element) - * elif PyInt_CheckExact(element): - * ret = self.writeInt(element) # <<<<<<<<<<<<<< - * elif PyLong_CheckExact(element): - * ret = self.writeLong(element) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeInt(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ret = __pyx_t_2; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":513 - * elif PyInt_CheckExact(element): - * ret = self.writeInt(element) - * elif PyLong_CheckExact(element): # <<<<<<<<<<<<<< - * ret = self.writeLong(element) - * elif PyFloat_CheckExact(element): - */ - __pyx_t_1 = PyLong_CheckExact(__pyx_v_element); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":514 - * ret = self.writeInt(element) - * elif PyLong_CheckExact(element): - * ret = self.writeLong(element) # <<<<<<<<<<<<<< - * elif PyFloat_CheckExact(element): - * ret = self.writeNumber(element) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeLong(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ret = __pyx_t_2; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":515 - * elif PyLong_CheckExact(element): - * ret = self.writeLong(element) - * elif PyFloat_CheckExact(element): # <<<<<<<<<<<<<< - * ret = self.writeNumber(element) - * elif PyList_CheckExact(element): - */ - __pyx_t_1 = PyFloat_CheckExact(__pyx_v_element); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":516 - * ret = self.writeLong(element) - * elif PyFloat_CheckExact(element): - * ret = self.writeNumber(element) # <<<<<<<<<<<<<< - * elif PyList_CheckExact(element): - * ret = self.writeList(element) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeNumber(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ret = __pyx_t_2; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":517 - * elif PyFloat_CheckExact(element): - * ret = self.writeNumber(element) - * elif PyList_CheckExact(element): # <<<<<<<<<<<<<< - * ret = self.writeList(element) - * elif PyTuple_CheckExact(element): - */ - __pyx_t_1 = PyList_CheckExact(__pyx_v_element); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":518 - * ret = self.writeNumber(element) - * elif PyList_CheckExact(element): - * ret = self.writeList(element) # <<<<<<<<<<<<<< - * elif PyTuple_CheckExact(element): - * ret = self.writeTuple(element) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeList(__pyx_v_self, __pyx_v_element, 0, NULL); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ret = __pyx_t_2; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":519 - * elif PyList_CheckExact(element): - * ret = self.writeList(element) - * elif PyTuple_CheckExact(element): # <<<<<<<<<<<<<< - * ret = self.writeTuple(element) - * elif element is Undefined: - */ - __pyx_t_1 = PyTuple_CheckExact(__pyx_v_element); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":520 - * ret = self.writeList(element) - * elif PyTuple_CheckExact(element): - * ret = self.writeTuple(element) # <<<<<<<<<<<<<< - * elif element is Undefined: - * ret = self.writeUndefined(element) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeTuple(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ret = __pyx_t_2; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":521 - * elif PyTuple_CheckExact(element): - * ret = self.writeTuple(element) - * elif element is Undefined: # <<<<<<<<<<<<<< - * ret = self.writeUndefined(element) - * elif PyDict_CheckExact(element): - */ - __pyx_t_1 = (__pyx_v_element == __pyx_v_6cpyamf_5codec_Undefined); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":522 - * ret = self.writeTuple(element) - * elif element is Undefined: - * ret = self.writeUndefined(element) # <<<<<<<<<<<<<< - * elif PyDict_CheckExact(element): - * ret = self.writeDict(element) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeUndefined(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ret = __pyx_t_2; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":523 - * elif element is Undefined: - * ret = self.writeUndefined(element) - * elif PyDict_CheckExact(element): # <<<<<<<<<<<<<< - * ret = self.writeDict(element) - * elif PyDateTime_CheckExact(element): - */ - __pyx_t_1 = PyDict_CheckExact(__pyx_v_element); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":524 - * ret = self.writeUndefined(element) - * elif PyDict_CheckExact(element): - * ret = self.writeDict(element) # <<<<<<<<<<<<<< - * elif PyDateTime_CheckExact(element): - * ret = self.writeDateTime(element) - */ - if (!(likely(PyDict_CheckExact(__pyx_v_element))||((__pyx_v_element) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_v_element)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeDict(__pyx_v_self, ((PyObject *)__pyx_v_element)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ret = __pyx_t_2; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":525 - * elif PyDict_CheckExact(element): - * ret = self.writeDict(element) - * elif PyDateTime_CheckExact(element): # <<<<<<<<<<<<<< - * ret = self.writeDateTime(element) - * elif PyDate_CheckExact(element): - */ - __pyx_t_2 = PyDateTime_CheckExact(__pyx_v_element); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":526 - * ret = self.writeDict(element) - * elif PyDateTime_CheckExact(element): - * ret = self.writeDateTime(element) # <<<<<<<<<<<<<< - * elif PyDate_CheckExact(element): - * ret = self.writeDate(element) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeDateTime(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ret = __pyx_t_2; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":527 - * elif PyDateTime_CheckExact(element): - * ret = self.writeDateTime(element) - * elif PyDate_CheckExact(element): # <<<<<<<<<<<<<< - * ret = self.writeDate(element) - * elif py_type is MixedArray: - */ - __pyx_t_2 = PyDate_CheckExact(__pyx_v_element); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":528 - * ret = self.writeDateTime(element) - * elif PyDate_CheckExact(element): - * ret = self.writeDate(element) # <<<<<<<<<<<<<< - * elif py_type is MixedArray: - * ret = self.writeMixedArray(element) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeDate(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ret = __pyx_t_2; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":529 - * elif PyDate_CheckExact(element): - * ret = self.writeDate(element) - * elif py_type is MixedArray: # <<<<<<<<<<<<<< - * ret = self.writeMixedArray(element) - * elif py_type is GeneratorType: - */ - __pyx_t_1 = (__pyx_v_py_type == __pyx_v_6cpyamf_5codec_MixedArray); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":530 - * ret = self.writeDate(element) - * elif py_type is MixedArray: - * ret = self.writeMixedArray(element) # <<<<<<<<<<<<<< - * elif py_type is GeneratorType: - * ret = self.writeGenerator(element) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeMixedArray(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ret = __pyx_t_2; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":531 - * elif py_type is MixedArray: - * ret = self.writeMixedArray(element) - * elif py_type is GeneratorType: # <<<<<<<<<<<<<< - * ret = self.writeGenerator(element) - * elif PySequence_Contains(self.use_write_object, py_type): - */ - __pyx_t_1 = (__pyx_v_py_type == __pyx_v_6cpyamf_5codec_GeneratorType); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":532 - * ret = self.writeMixedArray(element) - * elif py_type is GeneratorType: - * ret = self.writeGenerator(element) # <<<<<<<<<<<<<< - * elif PySequence_Contains(self.use_write_object, py_type): - * ret = self.writeObject(element) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeGenerator(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ret = __pyx_t_2; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":533 - * elif py_type is GeneratorType: - * ret = self.writeGenerator(element) - * elif PySequence_Contains(self.use_write_object, py_type): # <<<<<<<<<<<<<< - * ret = self.writeObject(element) - * elif isinstance(element, (list, tuple)): - */ - __pyx_t_2 = PySequence_Contains(((PyObject *)__pyx_v_self->use_write_object), __pyx_v_py_type); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":534 - * ret = self.writeGenerator(element) - * elif PySequence_Contains(self.use_write_object, py_type): - * ret = self.writeObject(element) # <<<<<<<<<<<<<< - * elif isinstance(element, (list, tuple)): - * ret = self.writeSequence(element) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeObject(__pyx_v_self, __pyx_v_element, 0, NULL); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ret = __pyx_t_2; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":535 - * elif PySequence_Contains(self.use_write_object, py_type): - * ret = self.writeObject(element) - * elif isinstance(element, (list, tuple)): # <<<<<<<<<<<<<< - * ret = self.writeSequence(element) - * elif xml.is_xml(element): - */ - __Pyx_INCREF(__pyx_v_element); - __pyx_t_3 = __pyx_v_element; - __pyx_t_1 = PyList_Check(__pyx_t_3); - if (!__pyx_t_1) { - __pyx_t_4 = PyTuple_Check(__pyx_t_3); - __pyx_t_5 = __pyx_t_4; - } else { - __pyx_t_5 = __pyx_t_1; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":536 - * ret = self.writeObject(element) - * elif isinstance(element, (list, tuple)): - * ret = self.writeSequence(element) # <<<<<<<<<<<<<< - * elif xml.is_xml(element): - * ret = self.writeXML(element) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeSequence(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ret = __pyx_t_2; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":537 - * elif isinstance(element, (list, tuple)): - * ret = self.writeSequence(element) - * elif xml.is_xml(element): # <<<<<<<<<<<<<< - * ret = self.writeXML(element) - * - */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__xml); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__is_xml); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_element); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_element); - __Pyx_GIVEREF(__pyx_v_element); - __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":538 - * ret = self.writeSequence(element) - * elif xml.is_xml(element): - * ret = self.writeXML(element) # <<<<<<<<<<<<<< - * - * return ret - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeXML(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ret = __pyx_t_2; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":540 - * ret = self.writeXML(element) - * - * return ret # <<<<<<<<<<<<<< - * - * cdef int checkBadTypes(self, object element, object py_type) except -1: - */ - __pyx_r = __pyx_v_ret; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("cpyamf.codec.Encoder.handleBasicTypes"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":542 - * return ret - * - * cdef int checkBadTypes(self, object element, object py_type) except -1: # <<<<<<<<<<<<<< - * if PyModule_CheckExact(element): - * raise pyamf.EncodeError("Cannot encode modules") - */ - -static int __pyx_f_6cpyamf_5codec_7Encoder_checkBadTypes(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, PyObject *__pyx_v_element, PyObject *__pyx_v_py_type) { - int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - __Pyx_RefNannySetupContext("checkBadTypes"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":543 - * - * cdef int checkBadTypes(self, object element, object py_type) except -1: - * if PyModule_CheckExact(element): # <<<<<<<<<<<<<< - * raise pyamf.EncodeError("Cannot encode modules") - * elif PyMethod_Check(element): - */ - __pyx_t_1 = PyModule_CheckExact(__pyx_v_element); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":544 - * cdef int checkBadTypes(self, object element, object py_type) except -1: - * if PyModule_CheckExact(element): - * raise pyamf.EncodeError("Cannot encode modules") # <<<<<<<<<<<<<< - * elif PyMethod_Check(element): - * raise pyamf.EncodeError("Cannot encode methods") - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__EncodeError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __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); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":545 - * if PyModule_CheckExact(element): - * raise pyamf.EncodeError("Cannot encode modules") - * elif PyMethod_Check(element): # <<<<<<<<<<<<<< - * raise pyamf.EncodeError("Cannot encode methods") - * elif PyFunction_Check(element) or py_type is BuiltinFunctionType: - */ - __pyx_t_1 = PyMethod_Check(__pyx_v_element); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":546 - * raise pyamf.EncodeError("Cannot encode modules") - * elif PyMethod_Check(element): - * raise pyamf.EncodeError("Cannot encode methods") # <<<<<<<<<<<<<< - * elif PyFunction_Check(element) or py_type is BuiltinFunctionType: - * raise pyamf.EncodeError("Cannot encode functions") - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__EncodeError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __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); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":547 - * elif PyMethod_Check(element): - * raise pyamf.EncodeError("Cannot encode methods") - * elif PyFunction_Check(element) or py_type is BuiltinFunctionType: # <<<<<<<<<<<<<< - * raise pyamf.EncodeError("Cannot encode functions") - * elif PyClass_Check(element) or PyType_CheckExact(element): - */ - __pyx_t_1 = PyFunction_Check(__pyx_v_element); - if (!__pyx_t_1) { - __pyx_t_4 = (__pyx_v_py_type == __pyx_v_6cpyamf_5codec_BuiltinFunctionType); - __pyx_t_5 = __pyx_t_4; - } else { - __pyx_t_5 = __pyx_t_1; - } - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":548 - * raise pyamf.EncodeError("Cannot encode methods") - * elif PyFunction_Check(element) or py_type is BuiltinFunctionType: - * raise pyamf.EncodeError("Cannot encode functions") # <<<<<<<<<<<<<< - * elif PyClass_Check(element) or PyType_CheckExact(element): - * raise pyamf.EncodeError("Cannot encode class objects") - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__EncodeError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __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); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":549 - * elif PyFunction_Check(element) or py_type is BuiltinFunctionType: - * raise pyamf.EncodeError("Cannot encode functions") - * elif PyClass_Check(element) or PyType_CheckExact(element): # <<<<<<<<<<<<<< - * raise pyamf.EncodeError("Cannot encode class objects") - * elif PyTime_CheckExact(element): - */ - __pyx_t_5 = PyClass_Check(__pyx_v_element); - if (!__pyx_t_5) { - __pyx_t_1 = PyType_CheckExact(__pyx_v_element); - __pyx_t_4 = __pyx_t_1; - } else { - __pyx_t_4 = __pyx_t_5; - } - if (__pyx_t_4) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":550 - * raise pyamf.EncodeError("Cannot encode functions") - * elif PyClass_Check(element) or PyType_CheckExact(element): - * raise pyamf.EncodeError("Cannot encode class objects") # <<<<<<<<<<<<<< - * elif PyTime_CheckExact(element): - * raise pyamf.EncodeError('A datetime.time instance was found but ' - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__EncodeError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __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); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":551 - * elif PyClass_Check(element) or PyType_CheckExact(element): - * raise pyamf.EncodeError("Cannot encode class objects") - * elif PyTime_CheckExact(element): # <<<<<<<<<<<<<< - * raise pyamf.EncodeError('A datetime.time instance was found but ' - * 'AMF has no way to encode time objects. Please use ' - */ - __pyx_t_6 = PyTime_CheckExact(__pyx_v_element); - if (__pyx_t_6) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":552 - * raise pyamf.EncodeError("Cannot encode class objects") - * elif PyTime_CheckExact(element): - * raise pyamf.EncodeError('A datetime.time instance was found but ' # <<<<<<<<<<<<<< - * 'AMF has no way to encode time objects. Please use ' - * 'datetime.datetime instead') - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__EncodeError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_17), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __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); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":556 - * 'datetime.datetime instead') - * - * return 0 # <<<<<<<<<<<<<< - * - * cpdef int writeElement(self, object element) except -1: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.codec.Encoder.checkBadTypes"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":558 - * return 0 - * - * cpdef int writeElement(self, object element) except -1: # <<<<<<<<<<<<<< - * cdef int ret = 0 - * cdef object py_type = type(element) - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Encoder_writeElement(PyObject *__pyx_v_self, PyObject *__pyx_v_element); /*proto*/ -static int __pyx_f_6cpyamf_5codec_7Encoder_writeElement(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, PyObject *__pyx_v_element, int __pyx_skip_dispatch) { - int __pyx_v_ret; - PyObject *__pyx_v_py_type = 0; - PyObject *__pyx_v_func = 0; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("writeElement"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__writeElement); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_5codec_7Encoder_writeElement)) { - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_element); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_element); - __Pyx_GIVEREF(__pyx_v_element); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":559 - * - * cpdef int writeElement(self, object element) except -1: - * cdef int ret = 0 # <<<<<<<<<<<<<< - * cdef object py_type = type(element) - * cdef object func = None - */ - __pyx_v_ret = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":560 - * cpdef int writeElement(self, object element) except -1: - * cdef int ret = 0 - * cdef object py_type = type(element) # <<<<<<<<<<<<<< - * cdef object func = None - * cdef int use_proxy - */ - __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_element))); - __pyx_v_py_type = ((PyObject *)Py_TYPE(__pyx_v_element)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":561 - * cdef int ret = 0 - * cdef object py_type = type(element) - * cdef object func = None # <<<<<<<<<<<<<< - * cdef int use_proxy - * - */ - __Pyx_INCREF(Py_None); - __pyx_v_func = Py_None; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":564 - * cdef int use_proxy - * - * ret = self.handleBasicTypes(element, py_type) # <<<<<<<<<<<<<< - * - * if ret == 1: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->handleBasicTypes(__pyx_v_self, __pyx_v_element, __pyx_v_py_type); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ret = __pyx_t_4; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":566 - * ret = self.handleBasicTypes(element, py_type) - * - * if ret == 1: # <<<<<<<<<<<<<< - * # encoding was not handled by basic types - * func = self.func_cache.get(py_type, None) - */ - __pyx_t_5 = (__pyx_v_ret == 1); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":568 - * if ret == 1: - * # encoding was not handled by basic types - * func = self.func_cache.get(py_type, None) # <<<<<<<<<<<<<< - * - * if func is None: - */ - if (unlikely(__pyx_v_self->func_cache == Py_None)) { - PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'get'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_self->func_cache), __pyx_v_py_type, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_v_func); - __pyx_v_func = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":570 - * func = self.func_cache.get(py_type, None) - * - * if func is None: # <<<<<<<<<<<<<< - * func = get_custom_type_func(self, element) - * - */ - __pyx_t_5 = (__pyx_v_func == Py_None); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":571 - * - * if func is None: - * func = get_custom_type_func(self, element) # <<<<<<<<<<<<<< - * - * if func is None: - */ - __pyx_t_1 = __pyx_f_6cpyamf_5codec_get_custom_type_func(((PyObject *)__pyx_v_self), __pyx_v_element); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_v_func); - __pyx_v_func = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":573 - * func = get_custom_type_func(self, element) - * - * if func is None: # <<<<<<<<<<<<<< - * self.checkBadTypes(element, py_type) - * self.use_write_object.append(py_type) - */ - __pyx_t_5 = (__pyx_v_func == Py_None); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":574 - * - * if func is None: - * self.checkBadTypes(element, py_type) # <<<<<<<<<<<<<< - * self.use_write_object.append(py_type) - * - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->checkBadTypes(__pyx_v_self, __pyx_v_element, __pyx_v_py_type); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":575 - * if func is None: - * self.checkBadTypes(element, py_type) - * self.use_write_object.append(py_type) # <<<<<<<<<<<<<< - * - * return self.writeObject(element) - */ - if (unlikely(__pyx_v_self->use_write_object == Py_None)) { - PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_4 = PyList_Append(__pyx_v_self->use_write_object, __pyx_v_py_type); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":577 - * self.use_write_object.append(py_type) - * - * return self.writeObject(element) # <<<<<<<<<<<<<< - * - * self.func_cache[py_type] = func - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)__pyx_v_self->__pyx_vtab)->writeObject(__pyx_v_self, __pyx_v_element, 0, NULL); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":579 - * return self.writeObject(element) - * - * self.func_cache[py_type] = func # <<<<<<<<<<<<<< - * - * func(element) - */ - if (PyDict_SetItem(((PyObject *)__pyx_v_self->func_cache), __pyx_v_py_type, __pyx_v_func) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":581 - * self.func_cache[py_type] = func - * - * func(element) # <<<<<<<<<<<<<< - * - * return ret - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_element); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_element); - __Pyx_GIVEREF(__pyx_v_element); - __pyx_t_3 = PyObject_Call(__pyx_v_func, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":583 - * func(element) - * - * return ret # <<<<<<<<<<<<<< - * - * cpdef int send(self, data) except -1: - */ - __pyx_r = __pyx_v_ret; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeElement"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_py_type); - __Pyx_XDECREF(__pyx_v_func); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":558 - * return 0 - * - * cpdef int writeElement(self, object element) except -1: # <<<<<<<<<<<<<< - * cdef int ret = 0 - * cdef object py_type = type(element) - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Encoder_writeElement(PyObject *__pyx_v_self, PyObject *__pyx_v_element); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_7Encoder_writeElement(PyObject *__pyx_v_self, PyObject *__pyx_v_element) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("writeElement"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->__pyx_vtab)->writeElement(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_element, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.codec.Encoder.writeElement"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":585 - * return ret - * - * cpdef int send(self, data) except -1: # <<<<<<<<<<<<<< - * """ - * Add data for the decoder to work on. - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Encoder_send(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/ -static int __pyx_f_6cpyamf_5codec_7Encoder_send(struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_skip_dispatch) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("send"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__send); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_5codec_7Encoder_send)) { - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_data); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data); - __Pyx_GIVEREF(__pyx_v_data); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":589 - * Add data for the decoder to work on. - * """ - * self.bucket.append(data) # <<<<<<<<<<<<<< - * - * def __next__(self): - */ - if (unlikely(__pyx_v_self->bucket == Py_None)) { - PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_4 = PyList_Append(__pyx_v_self->bucket, __pyx_v_data); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.codec.Encoder.send"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":585 - * return ret - * - * cpdef int send(self, data) except -1: # <<<<<<<<<<<<<< - * """ - * Add data for the decoder to work on. - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Encoder_send(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/ -static char __pyx_doc_6cpyamf_5codec_7Encoder_send[] = "\n Add data for the decoder to work on.\n "; -static PyObject *__pyx_pf_6cpyamf_5codec_7Encoder_send(PyObject *__pyx_v_self, PyObject *__pyx_v_data) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("send"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->__pyx_vtab)->send(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_data, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.codec.Encoder.send"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":591 - * self.bucket.append(data) - * - * def __next__(self): # <<<<<<<<<<<<<< - * """ - * Part of the iterator protocol. - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Encoder___next__(PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_6cpyamf_5codec_7Encoder___next__[] = "\n Part of the iterator protocol.\n "; -struct wrapperbase __pyx_wrapperbase_6cpyamf_5codec_7Encoder___next__; -static PyObject *__pyx_pf_6cpyamf_5codec_7Encoder___next__(PyObject *__pyx_v_self) { - Py_ssize_t __pyx_v_start_pos; - Py_ssize_t __pyx_v_end_pos; - char *__pyx_v_buf; - PyObject *__pyx_v_element; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - __Pyx_RefNannySetupContext("__next__"); - __pyx_v_element = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":598 - * cdef char *buf - * - * try: # <<<<<<<<<<<<<< - * element = self.bucket.pop(0) - * except IndexError: - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - __Pyx_XGOTREF(__pyx_save_exc_type); - __Pyx_XGOTREF(__pyx_save_exc_value); - __Pyx_XGOTREF(__pyx_save_exc_tb); - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":599 - * - * try: - * element = self.bucket.pop(0) # <<<<<<<<<<<<<< - * except IndexError: - * raise StopIteration - */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->bucket), __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L5_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_18), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L5_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_v_element); - __pyx_v_element = __pyx_t_2; - __pyx_t_2 = 0; - } - __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L12_try_end; - __pyx_L5_error:; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":600 - * try: - * element = self.bucket.pop(0) - * except IndexError: # <<<<<<<<<<<<<< - * raise StopIteration - * - */ - __pyx_t_3 = PyErr_ExceptionMatches(__pyx_builtin_IndexError); - if (__pyx_t_3) { - __Pyx_AddTraceback("cpyamf.codec.Encoder.__next__"); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_t_4); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":601 - * element = self.bucket.pop(0) - * except IndexError: - * raise StopIteration # <<<<<<<<<<<<<< - * - * start_pos = self.stream.tell() - */ - __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L6_exception_handled; - } - __pyx_L7_except_error:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L6_exception_handled:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L12_try_end:; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":603 - * raise StopIteration - * - * start_pos = self.stream.tell() # <<<<<<<<<<<<<< - * - * self.writeElement(element) - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->__pyx_base.stream->__pyx_vtab)->tell(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->__pyx_base.stream, 0); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_start_pos = __pyx_t_5; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":605 - * start_pos = self.stream.tell() - * - * self.writeElement(element) # <<<<<<<<<<<<<< - * - * end_pos = self.stream.tell() - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->__pyx_vtab)->writeElement(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self), __pyx_v_element, 0); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":607 - * self.writeElement(element) - * - * end_pos = self.stream.tell() # <<<<<<<<<<<<<< - * - * self.stream.seek(start_pos) - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->__pyx_base.stream->__pyx_vtab)->tell(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->__pyx_base.stream, 0); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_end_pos = __pyx_t_5; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":609 - * end_pos = self.stream.tell() - * - * self.stream.seek(start_pos) # <<<<<<<<<<<<<< - * - * self.stream.read(&buf, end_pos - start_pos) - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->__pyx_base.stream->__pyx_vtab)->seek(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->__pyx_base.stream, __pyx_v_start_pos, 0, NULL); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":611 - * self.stream.seek(start_pos) - * - * self.stream.read(&buf, end_pos - start_pos) # <<<<<<<<<<<<<< - * - * return PyString_FromStringAndSize(buf, end_pos - start_pos) - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->__pyx_base.stream->__pyx_vtab)->read(((struct __pyx_obj_6cpyamf_5codec_Encoder *)__pyx_v_self)->__pyx_base.stream, (&__pyx_v_buf), (__pyx_v_end_pos - __pyx_v_start_pos)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":613 - * self.stream.read(&buf, end_pos - start_pos) - * - * return PyString_FromStringAndSize(buf, end_pos - start_pos) # <<<<<<<<<<<<<< - * - * def __iter__(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyString_FromStringAndSize(__pyx_v_buf, (__pyx_v_end_pos - __pyx_v_start_pos)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - __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_4); - __Pyx_AddTraceback("cpyamf.codec.Encoder.__next__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_element); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":615 - * return PyString_FromStringAndSize(buf, end_pos - start_pos) - * - * def __iter__(self): # <<<<<<<<<<<<<< - * return self - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_7Encoder___iter__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_7Encoder___iter__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("__iter__"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":616 - * - * def __iter__(self): - * return self # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self); - __pyx_r = __pyx_v_self; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":627 - * cdef object func - * - * def __cinit__(self, Encoder encoder, func): # <<<<<<<<<<<<<< - * self.encoder = encoder - * self.func = func - */ - -static int __pyx_pf_6cpyamf_5codec_15_CustomTypeFunc___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6cpyamf_5codec_15_CustomTypeFunc___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - struct __pyx_obj_6cpyamf_5codec_Encoder *__pyx_v_encoder = 0; - PyObject *__pyx_v_func = 0; - int __pyx_r; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__encoder,&__pyx_n_s__func,0}; - __Pyx_RefNannySetupContext("__cinit__"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - 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; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__encoder); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__func); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_encoder = ((struct __pyx_obj_6cpyamf_5codec_Encoder *)values[0]); - __pyx_v_func = values[1]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_encoder = ((struct __pyx_obj_6cpyamf_5codec_Encoder *)PyTuple_GET_ITEM(__pyx_args, 0)); - __pyx_v_func = PyTuple_GET_ITEM(__pyx_args, 1); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.codec._CustomTypeFunc.__cinit__"); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoder), __pyx_ptype_6cpyamf_5codec_Encoder, 1, "encoder", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":628 - * - * def __cinit__(self, Encoder encoder, func): - * self.encoder = encoder # <<<<<<<<<<<<<< - * self.func = func - * - */ - __Pyx_INCREF(((PyObject *)__pyx_v_encoder)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_encoder)); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_5codec__CustomTypeFunc *)__pyx_v_self)->encoder); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6cpyamf_5codec__CustomTypeFunc *)__pyx_v_self)->encoder)); - ((struct __pyx_obj_6cpyamf_5codec__CustomTypeFunc *)__pyx_v_self)->encoder = __pyx_v_encoder; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":629 - * def __cinit__(self, Encoder encoder, func): - * self.encoder = encoder - * self.func = func # <<<<<<<<<<<<<< - * - * def __call__(self, data, **kwargs): - */ - __Pyx_INCREF(__pyx_v_func); - __Pyx_GIVEREF(__pyx_v_func); - __Pyx_GOTREF(((struct __pyx_obj_6cpyamf_5codec__CustomTypeFunc *)__pyx_v_self)->func); - __Pyx_DECREF(((struct __pyx_obj_6cpyamf_5codec__CustomTypeFunc *)__pyx_v_self)->func); - ((struct __pyx_obj_6cpyamf_5codec__CustomTypeFunc *)__pyx_v_self)->func = __pyx_v_func; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.codec._CustomTypeFunc.__cinit__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":631 - * self.func = func - * - * def __call__(self, data, **kwargs): # <<<<<<<<<<<<<< - * ret = self.func(data, encoder=self.encoder) - * - */ - -static PyObject *__pyx_pf_6cpyamf_5codec_15_CustomTypeFunc___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_5codec_15_CustomTypeFunc___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_data = 0; - PyObject *__pyx_v_kwargs = 0; - PyObject *__pyx_v_ret; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__data,0}; - __Pyx_RefNannySetupContext("__call__"); - __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; - __Pyx_GOTREF(__pyx_v_kwargs); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[1] = {0}; - 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; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, PyTuple_GET_SIZE(__pyx_args), "__call__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_data = values[0]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_data = PyTuple_GET_ITEM(__pyx_args, 0); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_DECREF(__pyx_v_kwargs); - __Pyx_AddTraceback("cpyamf.codec._CustomTypeFunc.__call__"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_ret = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":632 - * - * def __call__(self, data, **kwargs): - * ret = self.func(data, encoder=self.encoder) # <<<<<<<<<<<<<< - * - * if ret is not None: - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__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 = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__encoder), ((PyObject *)((struct __pyx_obj_6cpyamf_5codec__CustomTypeFunc *)__pyx_v_self)->encoder)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyEval_CallObjectWithKeywords(((struct __pyx_obj_6cpyamf_5codec__CustomTypeFunc *)__pyx_v_self)->func, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_v_ret); - __pyx_v_ret = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":634 - * ret = self.func(data, encoder=self.encoder) - * - * if ret is not None: # <<<<<<<<<<<<<< - * self.encoder.writeElement(ret) - * - */ - __pyx_t_4 = (__pyx_v_ret != Py_None); - if (__pyx_t_4) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":635 - * - * if ret is not None: - * self.encoder.writeElement(ret) # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_5codec_Encoder *)((struct __pyx_obj_6cpyamf_5codec__CustomTypeFunc *)__pyx_v_self)->encoder->__pyx_vtab)->writeElement(((struct __pyx_obj_6cpyamf_5codec__CustomTypeFunc *)__pyx_v_self)->encoder, __pyx_v_ret, 0); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - __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_3); - __Pyx_AddTraceback("cpyamf.codec._CustomTypeFunc.__call__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_kwargs); - __Pyx_DECREF(__pyx_v_ret); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":638 - * - * - * cdef object get_custom_type_func(object encoder, object data): # <<<<<<<<<<<<<< - * cdef _CustomTypeFunc ret - * - */ - -static PyObject *__pyx_f_6cpyamf_5codec_get_custom_type_func(PyObject *__pyx_v_encoder, PyObject *__pyx_v_data) { - PyObject *__pyx_v_type_; - PyObject *__pyx_v_func; - PyObject *__pyx_r = NULL; - Py_ssize_t __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_t_7; - int __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - int __pyx_t_11; - __Pyx_RefNannySetupContext("get_custom_type_func"); - __pyx_v_type_ = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_func = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":641 - * cdef _CustomTypeFunc ret - * - * for type_, func in pyamf.TYPE_MAP.iteritems(): # <<<<<<<<<<<<<< - * try: - * if isinstance(data, type_): - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__TYPE_MAP); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_1 = 0; __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); - } else { - __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; - } else if (likely(PyTuple_CheckExact(__pyx_t_2))) { - if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; - } else { - __pyx_t_3 = PyIter_Next(__pyx_t_2); - if (!__pyx_t_3) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) { - PyObject* tuple = __pyx_t_3; - __pyx_t_4 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_4); - __pyx_t_5 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_v_type_); - __pyx_v_type_ = __pyx_t_4; - __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_v_func); - __pyx_v_func = __pyx_t_5; - __pyx_t_5 = 0; - } else { - __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_6, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_6, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_EndUnpack(__pyx_t_6, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_v_type_); - __pyx_v_type_ = __pyx_t_4; - __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_v_func); - __pyx_v_func = __pyx_t_5; - __pyx_t_5 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":642 - * - * for type_, func in pyamf.TYPE_MAP.iteritems(): - * try: # <<<<<<<<<<<<<< - * if isinstance(data, type_): - * return _CustomTypeFunc(encoder, func) - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - __Pyx_XGOTREF(__pyx_save_exc_type); - __Pyx_XGOTREF(__pyx_save_exc_value); - __Pyx_XGOTREF(__pyx_save_exc_tb); - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":643 - * for type_, func in pyamf.TYPE_MAP.iteritems(): - * try: - * if isinstance(data, type_): # <<<<<<<<<<<<<< - * return _CustomTypeFunc(encoder, func) - * except TypeError: - */ - __pyx_t_7 = PyObject_IsInstance(__pyx_v_data, __pyx_v_type_); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L5_error;} - if (__pyx_t_7) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":644 - * try: - * if isinstance(data, type_): - * return _CustomTypeFunc(encoder, func) # <<<<<<<<<<<<<< - * except TypeError: - * if callable(type_) and type_(data): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L5_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_encoder); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_encoder); - __Pyx_GIVEREF(__pyx_v_encoder); - __Pyx_INCREF(__pyx_v_func); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_func); - __Pyx_GIVEREF(__pyx_v_func); - __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6cpyamf_5codec__CustomTypeFunc)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L5_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L9_try_return; - goto __pyx_L13; - } - __pyx_L13:; - } - __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L12_try_end; - __pyx_L9_try_return:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L0; - __pyx_L5_error:; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":645 - * if isinstance(data, type_): - * return _CustomTypeFunc(encoder, func) - * except TypeError: # <<<<<<<<<<<<<< - * if callable(type_) and type_(data): - * return _CustomTypeFunc(encoder, func) - */ - __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); - if (__pyx_t_8) { - __Pyx_AddTraceback("cpyamf.codec.get_custom_type_func"); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GOTREF(__pyx_t_4); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":646 - * return _CustomTypeFunc(encoder, func) - * except TypeError: - * if callable(type_) and type_(data): # <<<<<<<<<<<<<< - * return _CustomTypeFunc(encoder, func) - * - */ - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __Pyx_INCREF(__pyx_v_type_); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_type_); - __Pyx_GIVEREF(__pyx_v_type_); - __pyx_t_9 = PyObject_Call(__pyx_builtin_callable, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (__pyx_t_7) { - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); - __Pyx_INCREF(__pyx_v_data); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_data); - __Pyx_GIVEREF(__pyx_v_data); - __pyx_t_6 = PyObject_Call(__pyx_v_type_, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_11 = __pyx_t_10; - } else { - __pyx_t_11 = __pyx_t_7; - } - if (__pyx_t_11) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":647 - * except TypeError: - * if callable(type_) and type_(data): - * return _CustomTypeFunc(encoder, func) # <<<<<<<<<<<<<< - * - * return None - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __Pyx_INCREF(__pyx_v_encoder); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_encoder); - __Pyx_GIVEREF(__pyx_v_encoder); - __Pyx_INCREF(__pyx_v_func); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_func); - __Pyx_GIVEREF(__pyx_v_func); - __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6cpyamf_5codec__CustomTypeFunc)), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __pyx_r = __pyx_t_9; - __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L8_except_return; - goto __pyx_L16; - } - __pyx_L16:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L6_exception_handled; - } - __pyx_L7_except_error:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L8_except_return:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L0; - __pyx_L6_exception_handled:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L12_try_end:; - } - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":649 - * return _CustomTypeFunc(encoder, func) - * - * return None # <<<<<<<<<<<<<< - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - - __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_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("cpyamf.codec.get_custom_type_func"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_type_); - __Pyx_DECREF(__pyx_v_func); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static struct __pyx_vtabstruct_6cpyamf_5codec_IndexedCollection __pyx_vtable_6cpyamf_5codec_IndexedCollection; - -static PyObject *__pyx_tp_new_6cpyamf_5codec_IndexedCollection(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6cpyamf_5codec_IndexedCollection *p; - PyObject *o = (*t->tp_alloc)(t, 0); - if (!o) return 0; - p = ((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)o); - p->__pyx_vtab = __pyx_vtabptr_6cpyamf_5codec_IndexedCollection; - p->refs = ((PyObject *)Py_None); Py_INCREF(Py_None); - if (__pyx_pf_6cpyamf_5codec_17IndexedCollection___cinit__(o, a, k) < 0) { - Py_DECREF(o); o = 0; - } - return o; -} - -static void __pyx_tp_dealloc_6cpyamf_5codec_IndexedCollection(PyObject *o) { - struct __pyx_obj_6cpyamf_5codec_IndexedCollection *p = (struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)o; - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pf_6cpyamf_5codec_17IndexedCollection___dealloc__(o); - if (PyErr_Occurred()) PyErr_WriteUnraisable(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); - } - Py_XDECREF(((PyObject *)p->refs)); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_6cpyamf_5codec_IndexedCollection(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6cpyamf_5codec_IndexedCollection *p = (struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)o; - if (p->refs) { - e = (*v)(p->refs, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6cpyamf_5codec_IndexedCollection(PyObject *o) { - struct __pyx_obj_6cpyamf_5codec_IndexedCollection *p = (struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)o; - PyObject* tmp; - tmp = ((PyObject*)p->refs); - p->refs = ((PyObject *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} -static PyObject *__pyx_sq_item_6cpyamf_5codec_IndexedCollection(PyObject *o, Py_ssize_t i) { - PyObject *r; - PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; - r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); - Py_DECREF(x); - return r; -} - -static PyObject *__pyx_getprop_6cpyamf_5codec_17IndexedCollection_use_hash(PyObject *o, void *x) { - return __pyx_pf_6cpyamf_5codec_17IndexedCollection_8use_hash___get__(o); -} - -static int __pyx_setprop_6cpyamf_5codec_17IndexedCollection_use_hash(PyObject *o, PyObject *v, void *x) { - if (v) { - return __pyx_pf_6cpyamf_5codec_17IndexedCollection_8use_hash___set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyMethodDef __pyx_methods_6cpyamf_5codec_IndexedCollection[] = { - {__Pyx_NAMESTR("clear"), (PyCFunction)__pyx_pf_6cpyamf_5codec_17IndexedCollection_clear, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("getByReference"), (PyCFunction)__pyx_pf_6cpyamf_5codec_17IndexedCollection_getByReference, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("getReferenceTo"), (PyCFunction)__pyx_pf_6cpyamf_5codec_17IndexedCollection_getReferenceTo, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("append"), (PyCFunction)__pyx_pf_6cpyamf_5codec_17IndexedCollection_append, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("__copy__"), (PyCFunction)__pyx_pf_6cpyamf_5codec_17IndexedCollection___copy__, METH_NOARGS, __Pyx_DOCSTR(0)}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_6cpyamf_5codec_IndexedCollection[] = { - {(char *)"use_hash", __pyx_getprop_6cpyamf_5codec_17IndexedCollection_use_hash, __pyx_setprop_6cpyamf_5codec_17IndexedCollection_use_hash, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyNumberMethods __pyx_tp_as_number_IndexedCollection = { - 0, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_divide*/ - #endif - 0, /*nb_remainder*/ - 0, /*nb_divmod*/ - 0, /*nb_power*/ - 0, /*nb_negative*/ - 0, /*nb_positive*/ - 0, /*nb_absolute*/ - 0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_coerce*/ - #endif - 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif - 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*nb_hex*/ - #endif - 0, /*nb_inplace_add*/ - 0, /*nb_inplace_subtract*/ - 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_inplace_divide*/ - #endif - 0, /*nb_inplace_remainder*/ - 0, /*nb_inplace_power*/ - 0, /*nb_inplace_lshift*/ - 0, /*nb_inplace_rshift*/ - 0, /*nb_inplace_and*/ - 0, /*nb_inplace_xor*/ - 0, /*nb_inplace_or*/ - 0, /*nb_floor_divide*/ - 0, /*nb_true_divide*/ - 0, /*nb_inplace_floor_divide*/ - 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 - 0, /*nb_index*/ - #endif -}; - -static PySequenceMethods __pyx_tp_as_sequence_IndexedCollection = { - __pyx_pf_6cpyamf_5codec_17IndexedCollection___len__, /*sq_length*/ - 0, /*sq_concat*/ - 0, /*sq_repeat*/ - __pyx_sq_item_6cpyamf_5codec_IndexedCollection, /*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_IndexedCollection = { - __pyx_pf_6cpyamf_5codec_17IndexedCollection___len__, /*mp_length*/ - __pyx_pf_6cpyamf_5codec_17IndexedCollection___getitem__, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; - -static PyBufferProcs __pyx_tp_as_buffer_IndexedCollection = { - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif -}; - -PyTypeObject __pyx_type_6cpyamf_5codec_IndexedCollection = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cpyamf.codec.IndexedCollection"), /*tp_name*/ - sizeof(struct __pyx_obj_6cpyamf_5codec_IndexedCollection), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6cpyamf_5codec_IndexedCollection, /*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*/ - &__pyx_tp_as_number_IndexedCollection, /*tp_as_number*/ - &__pyx_tp_as_sequence_IndexedCollection, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_IndexedCollection, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_IndexedCollection, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("\n Provides reference functionality for amf contexts.\n\n @see: L{pyamf.codec.IndexedCollection} for complete documentation\n "), /*tp_doc*/ - __pyx_tp_traverse_6cpyamf_5codec_IndexedCollection, /*tp_traverse*/ - __pyx_tp_clear_6cpyamf_5codec_IndexedCollection, /*tp_clear*/ - __pyx_pf_6cpyamf_5codec_17IndexedCollection___richcmp__, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - __pyx_pf_6cpyamf_5codec_17IndexedCollection___iter__, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6cpyamf_5codec_IndexedCollection, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_6cpyamf_5codec_IndexedCollection, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pf_6cpyamf_5codec_17IndexedCollection___init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6cpyamf_5codec_IndexedCollection, /*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*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif -}; -static struct __pyx_vtabstruct_6cpyamf_5codec_Context __pyx_vtable_6cpyamf_5codec_Context; - -static PyObject *__pyx_tp_new_6cpyamf_5codec_Context(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6cpyamf_5codec_Context *p; - PyObject *o = (*t->tp_alloc)(t, 0); - if (!o) return 0; - p = ((struct __pyx_obj_6cpyamf_5codec_Context *)o); - p->__pyx_vtab = __pyx_vtabptr_6cpyamf_5codec_Context; - p->class_aliases = ((PyObject *)Py_None); Py_INCREF(Py_None); - p->objects = ((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)Py_None); Py_INCREF(Py_None); - p->unicodes = ((PyObject *)Py_None); Py_INCREF(Py_None); - p->_strings = ((PyObject *)Py_None); Py_INCREF(Py_None); - p->extra = ((PyObject *)Py_None); Py_INCREF(Py_None); - if (__pyx_pf_6cpyamf_5codec_7Context___cinit__(o, __pyx_empty_tuple, NULL) < 0) { - Py_DECREF(o); o = 0; - } - return o; -} - -static void __pyx_tp_dealloc_6cpyamf_5codec_Context(PyObject *o) { - struct __pyx_obj_6cpyamf_5codec_Context *p = (struct __pyx_obj_6cpyamf_5codec_Context *)o; - Py_XDECREF(((PyObject *)p->class_aliases)); - Py_XDECREF(((PyObject *)p->objects)); - Py_XDECREF(((PyObject *)p->unicodes)); - Py_XDECREF(((PyObject *)p->_strings)); - Py_XDECREF(((PyObject *)p->extra)); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_6cpyamf_5codec_Context(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6cpyamf_5codec_Context *p = (struct __pyx_obj_6cpyamf_5codec_Context *)o; - if (p->class_aliases) { - e = (*v)(p->class_aliases, a); if (e) return e; - } - if (p->objects) { - e = (*v)(((PyObject*)p->objects), a); if (e) return e; - } - if (p->unicodes) { - e = (*v)(p->unicodes, a); if (e) return e; - } - if (p->_strings) { - e = (*v)(p->_strings, a); if (e) return e; - } - if (p->extra) { - e = (*v)(p->extra, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6cpyamf_5codec_Context(PyObject *o) { - struct __pyx_obj_6cpyamf_5codec_Context *p = (struct __pyx_obj_6cpyamf_5codec_Context *)o; - PyObject* tmp; - tmp = ((PyObject*)p->class_aliases); - p->class_aliases = ((PyObject *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->objects); - p->objects = ((struct __pyx_obj_6cpyamf_5codec_IndexedCollection *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->unicodes); - p->unicodes = ((PyObject *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->_strings); - p->_strings = ((PyObject *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->extra); - p->extra = ((PyObject *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_6cpyamf_5codec_7Context_extra(PyObject *o, void *x) { - return __pyx_pf_6cpyamf_5codec_7Context_5extra___get__(o); -} - -static int __pyx_setprop_6cpyamf_5codec_7Context_extra(PyObject *o, PyObject *v, void *x) { - if (v) { - return __pyx_pf_6cpyamf_5codec_7Context_5extra___set__(o, v); - } - else { - return __pyx_pf_6cpyamf_5codec_7Context_5extra___del__(o); - } -} - -static PyMethodDef __pyx_methods_6cpyamf_5codec_Context[] = { - {__Pyx_NAMESTR("clear"), (PyCFunction)__pyx_pf_6cpyamf_5codec_7Context_clear, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("getObject"), (PyCFunction)__pyx_pf_6cpyamf_5codec_7Context_getObject, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("getObjectReference"), (PyCFunction)__pyx_pf_6cpyamf_5codec_7Context_getObjectReference, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("addObject"), (PyCFunction)__pyx_pf_6cpyamf_5codec_7Context_addObject, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("getClassAlias"), (PyCFunction)__pyx_pf_6cpyamf_5codec_7Context_getClassAlias, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_5codec_7Context_getClassAlias)}, - {__Pyx_NAMESTR("getStringForBytes"), (PyCFunction)__pyx_pf_6cpyamf_5codec_7Context_getStringForBytes, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_5codec_7Context_getStringForBytes)}, - {__Pyx_NAMESTR("getBytesForString"), (PyCFunction)__pyx_pf_6cpyamf_5codec_7Context_getBytesForString, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_5codec_7Context_getBytesForString)}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_6cpyamf_5codec_Context[] = { - {(char *)"extra", __pyx_getprop_6cpyamf_5codec_7Context_extra, __pyx_setprop_6cpyamf_5codec_7Context_extra, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyNumberMethods __pyx_tp_as_number_Context = { - 0, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_divide*/ - #endif - 0, /*nb_remainder*/ - 0, /*nb_divmod*/ - 0, /*nb_power*/ - 0, /*nb_negative*/ - 0, /*nb_positive*/ - 0, /*nb_absolute*/ - 0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_coerce*/ - #endif - 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif - 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*nb_hex*/ - #endif - 0, /*nb_inplace_add*/ - 0, /*nb_inplace_subtract*/ - 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_inplace_divide*/ - #endif - 0, /*nb_inplace_remainder*/ - 0, /*nb_inplace_power*/ - 0, /*nb_inplace_lshift*/ - 0, /*nb_inplace_rshift*/ - 0, /*nb_inplace_and*/ - 0, /*nb_inplace_xor*/ - 0, /*nb_inplace_or*/ - 0, /*nb_floor_divide*/ - 0, /*nb_true_divide*/ - 0, /*nb_inplace_floor_divide*/ - 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 - 0, /*nb_index*/ - #endif -}; - -static PySequenceMethods __pyx_tp_as_sequence_Context = { - 0, /*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_Context = { - 0, /*mp_length*/ - 0, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; - -static PyBufferProcs __pyx_tp_as_buffer_Context = { - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif -}; - -PyTypeObject __pyx_type_6cpyamf_5codec_Context = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cpyamf.codec.Context"), /*tp_name*/ - sizeof(struct __pyx_obj_6cpyamf_5codec_Context), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6cpyamf_5codec_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*/ - &__pyx_tp_as_number_Context, /*tp_as_number*/ - &__pyx_tp_as_sequence_Context, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_Context, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_Context, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("\n I hold the AMF context for en/decoding streams.\n\n @ivar objects: An indexed collection of referencable objects encountered\n during en/decoding.\n @type objects: L{util.IndexedCollection}\n @ivar class_aliases: A L{dict} of C{class} to L{ClassAlias}\n "), /*tp_doc*/ - __pyx_tp_traverse_6cpyamf_5codec_Context, /*tp_traverse*/ - __pyx_tp_clear_6cpyamf_5codec_Context, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6cpyamf_5codec_Context, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_6cpyamf_5codec_Context, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pf_6cpyamf_5codec_7Context___init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6cpyamf_5codec_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*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif -}; - -static PyObject *__pyx_tp_new_6cpyamf_5codec_Codec(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6cpyamf_5codec_Codec *p; - PyObject *o = (*t->tp_alloc)(t, 0); - if (!o) return 0; - p = ((struct __pyx_obj_6cpyamf_5codec_Codec *)o); - p->stream = ((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)Py_None); Py_INCREF(Py_None); - p->timezone_offset = Py_None; Py_INCREF(Py_None); - if (__pyx_pf_6cpyamf_5codec_5Codec___cinit__(o, __pyx_empty_tuple, NULL) < 0) { - Py_DECREF(o); o = 0; - } - return o; -} - -static void __pyx_tp_dealloc_6cpyamf_5codec_Codec(PyObject *o) { - struct __pyx_obj_6cpyamf_5codec_Codec *p = (struct __pyx_obj_6cpyamf_5codec_Codec *)o; - Py_XDECREF(((PyObject *)p->stream)); - Py_XDECREF(p->timezone_offset); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_6cpyamf_5codec_Codec(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6cpyamf_5codec_Codec *p = (struct __pyx_obj_6cpyamf_5codec_Codec *)o; - if (p->stream) { - e = (*v)(((PyObject*)p->stream), a); if (e) return e; - } - if (p->timezone_offset) { - e = (*v)(p->timezone_offset, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6cpyamf_5codec_Codec(PyObject *o) { - struct __pyx_obj_6cpyamf_5codec_Codec *p = (struct __pyx_obj_6cpyamf_5codec_Codec *)o; - PyObject* tmp; - tmp = ((PyObject*)p->stream); - p->stream = ((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->timezone_offset); - p->timezone_offset = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_6cpyamf_5codec_5Codec_stream(PyObject *o, void *x) { - return __pyx_pf_6cpyamf_5codec_5Codec_6stream___get__(o); -} - -static int __pyx_setprop_6cpyamf_5codec_5Codec_stream(PyObject *o, PyObject *v, void *x) { - if (v) { - return __pyx_pf_6cpyamf_5codec_5Codec_6stream___set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6cpyamf_5codec_5Codec_strict(PyObject *o, void *x) { - return __pyx_pf_6cpyamf_5codec_5Codec_6strict___get__(o); -} - -static int __pyx_setprop_6cpyamf_5codec_5Codec_strict(PyObject *o, PyObject *v, void *x) { - if (v) { - return __pyx_pf_6cpyamf_5codec_5Codec_6strict___set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6cpyamf_5codec_5Codec_timezone_offset(PyObject *o, void *x) { - return __pyx_pf_6cpyamf_5codec_5Codec_15timezone_offset___get__(o); -} - -static int __pyx_setprop_6cpyamf_5codec_5Codec_timezone_offset(PyObject *o, PyObject *v, void *x) { - if (v) { - return __pyx_pf_6cpyamf_5codec_5Codec_15timezone_offset___set__(o, v); - } - else { - return __pyx_pf_6cpyamf_5codec_5Codec_15timezone_offset___del__(o); - } -} - -static PyMethodDef __pyx_methods_6cpyamf_5codec_Codec[] = { - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_6cpyamf_5codec_Codec[] = { - {(char *)"stream", __pyx_getprop_6cpyamf_5codec_5Codec_stream, __pyx_setprop_6cpyamf_5codec_5Codec_stream, 0, 0}, - {(char *)"strict", __pyx_getprop_6cpyamf_5codec_5Codec_strict, __pyx_setprop_6cpyamf_5codec_5Codec_strict, 0, 0}, - {(char *)"timezone_offset", __pyx_getprop_6cpyamf_5codec_5Codec_timezone_offset, __pyx_setprop_6cpyamf_5codec_5Codec_timezone_offset, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyNumberMethods __pyx_tp_as_number_Codec = { - 0, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_divide*/ - #endif - 0, /*nb_remainder*/ - 0, /*nb_divmod*/ - 0, /*nb_power*/ - 0, /*nb_negative*/ - 0, /*nb_positive*/ - 0, /*nb_absolute*/ - 0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_coerce*/ - #endif - 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif - 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*nb_hex*/ - #endif - 0, /*nb_inplace_add*/ - 0, /*nb_inplace_subtract*/ - 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_inplace_divide*/ - #endif - 0, /*nb_inplace_remainder*/ - 0, /*nb_inplace_power*/ - 0, /*nb_inplace_lshift*/ - 0, /*nb_inplace_rshift*/ - 0, /*nb_inplace_and*/ - 0, /*nb_inplace_xor*/ - 0, /*nb_inplace_or*/ - 0, /*nb_floor_divide*/ - 0, /*nb_true_divide*/ - 0, /*nb_inplace_floor_divide*/ - 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 - 0, /*nb_index*/ - #endif -}; - -static PySequenceMethods __pyx_tp_as_sequence_Codec = { - 0, /*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_Codec = { - 0, /*mp_length*/ - 0, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; - -static PyBufferProcs __pyx_tp_as_buffer_Codec = { - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif -}; - -PyTypeObject __pyx_type_6cpyamf_5codec_Codec = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cpyamf.codec.Codec"), /*tp_name*/ - sizeof(struct __pyx_obj_6cpyamf_5codec_Codec), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6cpyamf_5codec_Codec, /*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*/ - &__pyx_tp_as_number_Codec, /*tp_as_number*/ - &__pyx_tp_as_sequence_Codec, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_Codec, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_Codec, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("\n Base class for Encoder/Decoder classes. Provides base functionality for\n managing codecs.\n "), /*tp_doc*/ - __pyx_tp_traverse_6cpyamf_5codec_Codec, /*tp_traverse*/ - __pyx_tp_clear_6cpyamf_5codec_Codec, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6cpyamf_5codec_Codec, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_6cpyamf_5codec_Codec, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pf_6cpyamf_5codec_5Codec___init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6cpyamf_5codec_Codec, /*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*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif -}; -static struct __pyx_vtabstruct_6cpyamf_5codec_Decoder __pyx_vtable_6cpyamf_5codec_Decoder; - -static PyObject *__pyx_tp_new_6cpyamf_5codec_Decoder(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6cpyamf_5codec_Decoder *p; - PyObject *o = __pyx_tp_new_6cpyamf_5codec_Codec(t, a, k); - if (!o) return 0; - p = ((struct __pyx_obj_6cpyamf_5codec_Decoder *)o); - p->__pyx_vtab = __pyx_vtabptr_6cpyamf_5codec_Decoder; - return o; -} - -static PyMethodDef __pyx_methods_6cpyamf_5codec_Decoder[] = { - {__Pyx_NAMESTR("readString"), (PyCFunction)__pyx_pf_6cpyamf_5codec_7Decoder_readString, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("readElement"), (PyCFunction)__pyx_pf_6cpyamf_5codec_7Decoder_readElement, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_5codec_7Decoder_readElement)}, - {__Pyx_NAMESTR("send"), (PyCFunction)__pyx_pf_6cpyamf_5codec_7Decoder_send, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_5codec_7Decoder_send)}, - {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_6cpyamf_5codec_7Decoder___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_6cpyamf_5codec_7Decoder___next__)}, - {0, 0, 0, 0} -}; - -static PyNumberMethods __pyx_tp_as_number_Decoder = { - 0, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_divide*/ - #endif - 0, /*nb_remainder*/ - 0, /*nb_divmod*/ - 0, /*nb_power*/ - 0, /*nb_negative*/ - 0, /*nb_positive*/ - 0, /*nb_absolute*/ - 0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_coerce*/ - #endif - 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif - 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*nb_hex*/ - #endif - 0, /*nb_inplace_add*/ - 0, /*nb_inplace_subtract*/ - 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_inplace_divide*/ - #endif - 0, /*nb_inplace_remainder*/ - 0, /*nb_inplace_power*/ - 0, /*nb_inplace_lshift*/ - 0, /*nb_inplace_rshift*/ - 0, /*nb_inplace_and*/ - 0, /*nb_inplace_xor*/ - 0, /*nb_inplace_or*/ - 0, /*nb_floor_divide*/ - 0, /*nb_true_divide*/ - 0, /*nb_inplace_floor_divide*/ - 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 - 0, /*nb_index*/ - #endif -}; - -static PySequenceMethods __pyx_tp_as_sequence_Decoder = { - 0, /*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_Decoder = { - 0, /*mp_length*/ - 0, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; - -static PyBufferProcs __pyx_tp_as_buffer_Decoder = { - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif -}; - -PyTypeObject __pyx_type_6cpyamf_5codec_Decoder = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cpyamf.codec.Decoder"), /*tp_name*/ - sizeof(struct __pyx_obj_6cpyamf_5codec_Decoder), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6cpyamf_5codec_Codec, /*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*/ - &__pyx_tp_as_number_Decoder, /*tp_as_number*/ - &__pyx_tp_as_sequence_Decoder, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_Decoder, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_Decoder, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("\n Base AMF decoder.\n "), /*tp_doc*/ - __pyx_tp_traverse_6cpyamf_5codec_Codec, /*tp_traverse*/ - __pyx_tp_clear_6cpyamf_5codec_Codec, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - __pyx_pf_6cpyamf_5codec_7Decoder___iter__, /*tp_iter*/ - __pyx_pf_6cpyamf_5codec_7Decoder___next__, /*tp_iternext*/ - __pyx_methods_6cpyamf_5codec_Decoder, /*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_6cpyamf_5codec_Decoder, /*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*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif -}; -static struct __pyx_vtabstruct_6cpyamf_5codec_Encoder __pyx_vtable_6cpyamf_5codec_Encoder; - -static PyObject *__pyx_tp_new_6cpyamf_5codec_Encoder(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6cpyamf_5codec_Encoder *p; - PyObject *o = __pyx_tp_new_6cpyamf_5codec_Codec(t, a, k); - if (!o) return 0; - p = ((struct __pyx_obj_6cpyamf_5codec_Encoder *)o); - p->__pyx_vtab = __pyx_vtabptr_6cpyamf_5codec_Encoder; - p->func_cache = ((PyObject *)Py_None); Py_INCREF(Py_None); - p->use_write_object = ((PyObject *)Py_None); Py_INCREF(Py_None); - p->bucket = ((PyObject *)Py_None); Py_INCREF(Py_None); - if (__pyx_pf_6cpyamf_5codec_7Encoder___cinit__(o, __pyx_empty_tuple, NULL) < 0) { - Py_DECREF(o); o = 0; - } - return o; -} - -static void __pyx_tp_dealloc_6cpyamf_5codec_Encoder(PyObject *o) { - struct __pyx_obj_6cpyamf_5codec_Encoder *p = (struct __pyx_obj_6cpyamf_5codec_Encoder *)o; - Py_XDECREF(((PyObject *)p->func_cache)); - Py_XDECREF(((PyObject *)p->use_write_object)); - Py_XDECREF(((PyObject *)p->bucket)); - __pyx_tp_dealloc_6cpyamf_5codec_Codec(o); -} - -static int __pyx_tp_traverse_6cpyamf_5codec_Encoder(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6cpyamf_5codec_Encoder *p = (struct __pyx_obj_6cpyamf_5codec_Encoder *)o; - e = __pyx_tp_traverse_6cpyamf_5codec_Codec(o, v, a); if (e) return e; - if (p->func_cache) { - e = (*v)(p->func_cache, a); if (e) return e; - } - if (p->use_write_object) { - e = (*v)(p->use_write_object, a); if (e) return e; - } - if (p->bucket) { - e = (*v)(p->bucket, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6cpyamf_5codec_Encoder(PyObject *o) { - struct __pyx_obj_6cpyamf_5codec_Encoder *p = (struct __pyx_obj_6cpyamf_5codec_Encoder *)o; - PyObject* tmp; - __pyx_tp_clear_6cpyamf_5codec_Codec(o); - tmp = ((PyObject*)p->func_cache); - p->func_cache = ((PyObject *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->use_write_object); - p->use_write_object = ((PyObject *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->bucket); - p->bucket = ((PyObject *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyMethodDef __pyx_methods_6cpyamf_5codec_Encoder[] = { - {__Pyx_NAMESTR("serialiseString"), (PyCFunction)__pyx_pf_6cpyamf_5codec_7Encoder_serialiseString, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("writeList"), (PyCFunction)__pyx_pf_6cpyamf_5codec_7Encoder_writeList, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("writeObject"), (PyCFunction)__pyx_pf_6cpyamf_5codec_7Encoder_writeObject, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("writeElement"), (PyCFunction)__pyx_pf_6cpyamf_5codec_7Encoder_writeElement, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("send"), (PyCFunction)__pyx_pf_6cpyamf_5codec_7Encoder_send, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_5codec_7Encoder_send)}, - {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_6cpyamf_5codec_7Encoder___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_6cpyamf_5codec_7Encoder___next__)}, - {0, 0, 0, 0} -}; - -static PyNumberMethods __pyx_tp_as_number_Encoder = { - 0, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_divide*/ - #endif - 0, /*nb_remainder*/ - 0, /*nb_divmod*/ - 0, /*nb_power*/ - 0, /*nb_negative*/ - 0, /*nb_positive*/ - 0, /*nb_absolute*/ - 0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_coerce*/ - #endif - 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif - 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*nb_hex*/ - #endif - 0, /*nb_inplace_add*/ - 0, /*nb_inplace_subtract*/ - 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_inplace_divide*/ - #endif - 0, /*nb_inplace_remainder*/ - 0, /*nb_inplace_power*/ - 0, /*nb_inplace_lshift*/ - 0, /*nb_inplace_rshift*/ - 0, /*nb_inplace_and*/ - 0, /*nb_inplace_xor*/ - 0, /*nb_inplace_or*/ - 0, /*nb_floor_divide*/ - 0, /*nb_true_divide*/ - 0, /*nb_inplace_floor_divide*/ - 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 - 0, /*nb_index*/ - #endif -}; - -static PySequenceMethods __pyx_tp_as_sequence_Encoder = { - 0, /*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_Encoder = { - 0, /*mp_length*/ - 0, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; - -static PyBufferProcs __pyx_tp_as_buffer_Encoder = { - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif -}; - -PyTypeObject __pyx_type_6cpyamf_5codec_Encoder = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cpyamf.codec.Encoder"), /*tp_name*/ - sizeof(struct __pyx_obj_6cpyamf_5codec_Encoder), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6cpyamf_5codec_Encoder, /*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*/ - &__pyx_tp_as_number_Encoder, /*tp_as_number*/ - &__pyx_tp_as_sequence_Encoder, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_Encoder, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_Encoder, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("\n Base AMF encoder.\n "), /*tp_doc*/ - __pyx_tp_traverse_6cpyamf_5codec_Encoder, /*tp_traverse*/ - __pyx_tp_clear_6cpyamf_5codec_Encoder, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - __pyx_pf_6cpyamf_5codec_7Encoder___iter__, /*tp_iter*/ - __pyx_pf_6cpyamf_5codec_7Encoder___next__, /*tp_iternext*/ - __pyx_methods_6cpyamf_5codec_Encoder, /*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_6cpyamf_5codec_Encoder, /*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*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif -}; - -static PyObject *__pyx_tp_new_6cpyamf_5codec__CustomTypeFunc(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6cpyamf_5codec__CustomTypeFunc *p; - PyObject *o = (*t->tp_alloc)(t, 0); - if (!o) return 0; - p = ((struct __pyx_obj_6cpyamf_5codec__CustomTypeFunc *)o); - p->encoder = ((struct __pyx_obj_6cpyamf_5codec_Encoder *)Py_None); Py_INCREF(Py_None); - p->func = Py_None; Py_INCREF(Py_None); - if (__pyx_pf_6cpyamf_5codec_15_CustomTypeFunc___cinit__(o, a, k) < 0) { - Py_DECREF(o); o = 0; - } - return o; -} - -static void __pyx_tp_dealloc_6cpyamf_5codec__CustomTypeFunc(PyObject *o) { - struct __pyx_obj_6cpyamf_5codec__CustomTypeFunc *p = (struct __pyx_obj_6cpyamf_5codec__CustomTypeFunc *)o; - Py_XDECREF(((PyObject *)p->encoder)); - Py_XDECREF(p->func); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_6cpyamf_5codec__CustomTypeFunc(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6cpyamf_5codec__CustomTypeFunc *p = (struct __pyx_obj_6cpyamf_5codec__CustomTypeFunc *)o; - if (p->encoder) { - e = (*v)(((PyObject*)p->encoder), a); if (e) return e; - } - if (p->func) { - e = (*v)(p->func, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6cpyamf_5codec__CustomTypeFunc(PyObject *o) { - struct __pyx_obj_6cpyamf_5codec__CustomTypeFunc *p = (struct __pyx_obj_6cpyamf_5codec__CustomTypeFunc *)o; - PyObject* tmp; - tmp = ((PyObject*)p->encoder); - p->encoder = ((struct __pyx_obj_6cpyamf_5codec_Encoder *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->func); - p->func = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyMethodDef __pyx_methods_6cpyamf_5codec__CustomTypeFunc[] = { - {0, 0, 0, 0} -}; - -static PyNumberMethods __pyx_tp_as_number__CustomTypeFunc = { - 0, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_divide*/ - #endif - 0, /*nb_remainder*/ - 0, /*nb_divmod*/ - 0, /*nb_power*/ - 0, /*nb_negative*/ - 0, /*nb_positive*/ - 0, /*nb_absolute*/ - 0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_coerce*/ - #endif - 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif - 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*nb_hex*/ - #endif - 0, /*nb_inplace_add*/ - 0, /*nb_inplace_subtract*/ - 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_inplace_divide*/ - #endif - 0, /*nb_inplace_remainder*/ - 0, /*nb_inplace_power*/ - 0, /*nb_inplace_lshift*/ - 0, /*nb_inplace_rshift*/ - 0, /*nb_inplace_and*/ - 0, /*nb_inplace_xor*/ - 0, /*nb_inplace_or*/ - 0, /*nb_floor_divide*/ - 0, /*nb_true_divide*/ - 0, /*nb_inplace_floor_divide*/ - 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 - 0, /*nb_index*/ - #endif -}; - -static PySequenceMethods __pyx_tp_as_sequence__CustomTypeFunc = { - 0, /*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__CustomTypeFunc = { - 0, /*mp_length*/ - 0, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; - -static PyBufferProcs __pyx_tp_as_buffer__CustomTypeFunc = { - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif -}; - -PyTypeObject __pyx_type_6cpyamf_5codec__CustomTypeFunc = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cpyamf.codec._CustomTypeFunc"), /*tp_name*/ - sizeof(struct __pyx_obj_6cpyamf_5codec__CustomTypeFunc), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6cpyamf_5codec__CustomTypeFunc, /*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*/ - &__pyx_tp_as_number__CustomTypeFunc, /*tp_as_number*/ - &__pyx_tp_as_sequence__CustomTypeFunc, /*tp_as_sequence*/ - &__pyx_tp_as_mapping__CustomTypeFunc, /*tp_as_mapping*/ - 0, /*tp_hash*/ - __pyx_pf_6cpyamf_5codec_15_CustomTypeFunc___call__, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - &__pyx_tp_as_buffer__CustomTypeFunc, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("\n Support for custom type mappings when encoding.\n "), /*tp_doc*/ - __pyx_tp_traverse_6cpyamf_5codec__CustomTypeFunc, /*tp_traverse*/ - __pyx_tp_clear_6cpyamf_5codec__CustomTypeFunc, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6cpyamf_5codec__CustomTypeFunc, /*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_6cpyamf_5codec__CustomTypeFunc, /*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*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif -}; - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - PyModuleDef_HEAD_INIT, - __Pyx_NAMESTR("codec"), - __Pyx_DOCSTR(__pyx_k_19), /* 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_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0}, - {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0}, - {&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0}, - {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0}, - {&__pyx_n_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 1}, - {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, - {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0}, - {&__pyx_n_s__AttributeError, __pyx_k__AttributeError, sizeof(__pyx_k__AttributeError), 0, 0, 1, 1}, - {&__pyx_n_s__BuiltinFunctionType, __pyx_k__BuiltinFunctionType, sizeof(__pyx_k__BuiltinFunctionType), 0, 0, 1, 1}, - {&__pyx_n_s__ClassAlias, __pyx_k__ClassAlias, sizeof(__pyx_k__ClassAlias), 0, 0, 1, 1}, - {&__pyx_n_s__EOStream, __pyx_k__EOStream, sizeof(__pyx_k__EOStream), 0, 0, 1, 1}, - {&__pyx_n_s__EncodeError, __pyx_k__EncodeError, sizeof(__pyx_k__EncodeError), 0, 0, 1, 1}, - {&__pyx_n_s__GeneratorType, __pyx_k__GeneratorType, sizeof(__pyx_k__GeneratorType), 0, 0, 1, 1}, - {&__pyx_n_s__IOError, __pyx_k__IOError, sizeof(__pyx_k__IOError), 0, 0, 1, 1}, - {&__pyx_n_s__IndexError, __pyx_k__IndexError, sizeof(__pyx_k__IndexError), 0, 0, 1, 1}, - {&__pyx_n_s__KeyError, __pyx_k__KeyError, sizeof(__pyx_k__KeyError), 0, 0, 1, 1}, - {&__pyx_n_s__MixedArray, __pyx_k__MixedArray, sizeof(__pyx_k__MixedArray), 0, 0, 1, 1}, - {&__pyx_n_s__NotImplementedError, __pyx_k__NotImplementedError, sizeof(__pyx_k__NotImplementedError), 0, 0, 1, 1}, - {&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 0, 0, 1, 1}, - {&__pyx_n_s__TYPE_MAP, __pyx_k__TYPE_MAP, sizeof(__pyx_k__TYPE_MAP), 0, 0, 1, 1}, - {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1}, - {&__pyx_n_s__Undefined, __pyx_k__Undefined, sizeof(__pyx_k__Undefined), 0, 0, 1, 1}, - {&__pyx_n_s__UnknownClassAlias, __pyx_k__UnknownClassAlias, sizeof(__pyx_k__UnknownClassAlias), 0, 0, 1, 1}, - {&__pyx_n_s____class__, __pyx_k____class__, sizeof(__pyx_k____class__), 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}, - {&__pyx_n_s___clear, __pyx_k___clear, sizeof(__pyx_k___clear), 0, 0, 1, 1}, - {&__pyx_n_s___increase_size, __pyx_k___increase_size, sizeof(__pyx_k___increase_size), 0, 0, 1, 1}, - {&__pyx_n_s___ref, __pyx_k___ref, sizeof(__pyx_k___ref), 0, 0, 1, 1}, - {&__pyx_n_s___strings, __pyx_k___strings, sizeof(__pyx_k___strings), 0, 0, 1, 1}, - {&__pyx_n_s__addObject, __pyx_k__addObject, sizeof(__pyx_k__addObject), 0, 0, 1, 1}, - {&__pyx_n_s__append, __pyx_k__append, sizeof(__pyx_k__append), 0, 0, 1, 1}, - {&__pyx_n_s__at_eof, __pyx_k__at_eof, sizeof(__pyx_k__at_eof), 0, 0, 1, 1}, - {&__pyx_n_s__basestring, __pyx_k__basestring, sizeof(__pyx_k__basestring), 0, 0, 1, 1}, - {&__pyx_n_s__bucket, __pyx_k__bucket, sizeof(__pyx_k__bucket), 0, 0, 1, 1}, - {&__pyx_n_s__callable, __pyx_k__callable, sizeof(__pyx_k__callable), 0, 0, 1, 1}, - {&__pyx_n_s__checkBadTypes, __pyx_k__checkBadTypes, sizeof(__pyx_k__checkBadTypes), 0, 0, 1, 1}, - {&__pyx_n_s__class_aliases, __pyx_k__class_aliases, sizeof(__pyx_k__class_aliases), 0, 0, 1, 1}, - {&__pyx_n_s__clear, __pyx_k__clear, sizeof(__pyx_k__clear), 0, 0, 1, 1}, - {&__pyx_n_s__combine, __pyx_k__combine, sizeof(__pyx_k__combine), 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__datetime, __pyx_k__datetime, sizeof(__pyx_k__datetime), 0, 0, 1, 1}, - {&__pyx_n_s__decode, __pyx_k__decode, sizeof(__pyx_k__decode), 0, 0, 1, 1}, - {&__pyx_n_s__defer, __pyx_k__defer, sizeof(__pyx_k__defer), 0, 0, 1, 1}, - {&__pyx_n_s__encode, __pyx_k__encode, sizeof(__pyx_k__encode), 0, 0, 1, 1}, - {&__pyx_n_s__encoder, __pyx_k__encoder, sizeof(__pyx_k__encoder), 0, 0, 1, 1}, - {&__pyx_n_s__external, __pyx_k__external, sizeof(__pyx_k__external), 0, 0, 1, 1}, - {&__pyx_n_s__extra, __pyx_k__extra, sizeof(__pyx_k__extra), 0, 0, 1, 1}, - {&__pyx_n_s__func, __pyx_k__func, sizeof(__pyx_k__func), 0, 0, 1, 1}, - {&__pyx_n_s__func_cache, __pyx_k__func_cache, sizeof(__pyx_k__func_cache), 0, 0, 1, 1}, - {&__pyx_n_s__getByReference, __pyx_k__getByReference, sizeof(__pyx_k__getByReference), 0, 0, 1, 1}, - {&__pyx_n_s__getBytesForString, __pyx_k__getBytesForString, sizeof(__pyx_k__getBytesForString), 0, 0, 1, 1}, - {&__pyx_n_s__getClassAlias, __pyx_k__getClassAlias, sizeof(__pyx_k__getClassAlias), 0, 0, 1, 1}, - {&__pyx_n_s__getObject, __pyx_k__getObject, sizeof(__pyx_k__getObject), 0, 0, 1, 1}, - {&__pyx_n_s__getObjectReference, __pyx_k__getObjectReference, sizeof(__pyx_k__getObjectReference), 0, 0, 1, 1}, - {&__pyx_n_s__getReferenceTo, __pyx_k__getReferenceTo, sizeof(__pyx_k__getReferenceTo), 0, 0, 1, 1}, - {&__pyx_n_s__getStringForBytes, __pyx_k__getStringForBytes, sizeof(__pyx_k__getStringForBytes), 0, 0, 1, 1}, - {&__pyx_n_s__get_class_alias, __pyx_k__get_class_alias, sizeof(__pyx_k__get_class_alias), 0, 0, 1, 1}, - {&__pyx_n_s__get_class_meta, __pyx_k__get_class_meta, sizeof(__pyx_k__get_class_meta), 0, 0, 1, 1}, - {&__pyx_n_s__handleBasicTypes, __pyx_k__handleBasicTypes, sizeof(__pyx_k__handleBasicTypes), 0, 0, 1, 1}, - {&__pyx_n_s__is_proxy, __pyx_k__is_proxy, sizeof(__pyx_k__is_proxy), 0, 0, 1, 1}, - {&__pyx_n_s__is_xml, __pyx_k__is_xml, sizeof(__pyx_k__is_xml), 0, 0, 1, 1}, - {&__pyx_n_s__iteritems, __pyx_k__iteritems, sizeof(__pyx_k__iteritems), 0, 0, 1, 1}, - {&__pyx_n_s__length, __pyx_k__length, sizeof(__pyx_k__length), 0, 0, 1, 1}, - {&__pyx_n_s__next, __pyx_k__next, sizeof(__pyx_k__next), 0, 0, 1, 1}, - {&__pyx_n_s__o, __pyx_k__o, sizeof(__pyx_k__o), 0, 0, 1, 1}, - {&__pyx_n_s__objects, __pyx_k__objects, sizeof(__pyx_k__objects), 0, 0, 1, 1}, - {&__pyx_n_s__pop, __pyx_k__pop, sizeof(__pyx_k__pop), 0, 0, 1, 1}, - {&__pyx_n_s__pyamf, __pyx_k__pyamf, sizeof(__pyx_k__pyamf), 0, 0, 1, 1}, - {&__pyx_n_s__read, __pyx_k__read, sizeof(__pyx_k__read), 0, 0, 1, 1}, - {&__pyx_n_s__readConcreteElement, __pyx_k__readConcreteElement, sizeof(__pyx_k__readConcreteElement), 0, 0, 1, 1}, - {&__pyx_n_s__readElement, __pyx_k__readElement, sizeof(__pyx_k__readElement), 0, 0, 1, 1}, - {&__pyx_n_s__readString, __pyx_k__readString, sizeof(__pyx_k__readString), 0, 0, 1, 1}, - {&__pyx_n_s__read_char, __pyx_k__read_char, sizeof(__pyx_k__read_char), 0, 0, 1, 1}, - {&__pyx_n_s__refs, __pyx_k__refs, sizeof(__pyx_k__refs), 0, 0, 1, 1}, - {&__pyx_n_s__seek, __pyx_k__seek, sizeof(__pyx_k__seek), 0, 0, 1, 1}, - {&__pyx_n_s__send, __pyx_k__send, sizeof(__pyx_k__send), 0, 0, 1, 1}, - {&__pyx_n_s__serialiseString, __pyx_k__serialiseString, sizeof(__pyx_k__serialiseString), 0, 0, 1, 1}, - {&__pyx_n_s__size, __pyx_k__size, sizeof(__pyx_k__size), 0, 0, 1, 1}, - {&__pyx_n_s__stream, __pyx_k__stream, sizeof(__pyx_k__stream), 0, 0, 1, 1}, - {&__pyx_n_s__strict, __pyx_k__strict, sizeof(__pyx_k__strict), 0, 0, 1, 1}, - {&__pyx_n_s__tell, __pyx_k__tell, sizeof(__pyx_k__tell), 0, 0, 1, 1}, - {&__pyx_n_s__time, __pyx_k__time, sizeof(__pyx_k__time), 0, 0, 1, 1}, - {&__pyx_n_s__timezone_offset, __pyx_k__timezone_offset, sizeof(__pyx_k__timezone_offset), 0, 0, 1, 1}, - {&__pyx_n_s__types, __pyx_k__types, sizeof(__pyx_k__types), 0, 0, 1, 1}, - {&__pyx_n_s__unicodes, __pyx_k__unicodes, sizeof(__pyx_k__unicodes), 0, 0, 1, 1}, - {&__pyx_n_s__use_hash, __pyx_k__use_hash, sizeof(__pyx_k__use_hash), 0, 0, 1, 1}, - {&__pyx_n_s__use_write_object, __pyx_k__use_write_object, sizeof(__pyx_k__use_write_object), 0, 0, 1, 1}, - {&__pyx_n_s__util, __pyx_k__util, sizeof(__pyx_k__util), 0, 0, 1, 1}, - {&__pyx_n_s__write, __pyx_k__write, sizeof(__pyx_k__write), 0, 0, 1, 1}, - {&__pyx_n_s__writeBoolean, __pyx_k__writeBoolean, sizeof(__pyx_k__writeBoolean), 0, 0, 1, 1}, - {&__pyx_n_s__writeBytes, __pyx_k__writeBytes, sizeof(__pyx_k__writeBytes), 0, 0, 1, 1}, - {&__pyx_n_s__writeDate, __pyx_k__writeDate, sizeof(__pyx_k__writeDate), 0, 0, 1, 1}, - {&__pyx_n_s__writeDateTime, __pyx_k__writeDateTime, sizeof(__pyx_k__writeDateTime), 0, 0, 1, 1}, - {&__pyx_n_s__writeDict, __pyx_k__writeDict, sizeof(__pyx_k__writeDict), 0, 0, 1, 1}, - {&__pyx_n_s__writeElement, __pyx_k__writeElement, sizeof(__pyx_k__writeElement), 0, 0, 1, 1}, - {&__pyx_n_s__writeGenerator, __pyx_k__writeGenerator, sizeof(__pyx_k__writeGenerator), 0, 0, 1, 1}, - {&__pyx_n_s__writeInt, __pyx_k__writeInt, sizeof(__pyx_k__writeInt), 0, 0, 1, 1}, - {&__pyx_n_s__writeList, __pyx_k__writeList, sizeof(__pyx_k__writeList), 0, 0, 1, 1}, - {&__pyx_n_s__writeLong, __pyx_k__writeLong, sizeof(__pyx_k__writeLong), 0, 0, 1, 1}, - {&__pyx_n_s__writeMixedArray, __pyx_k__writeMixedArray, sizeof(__pyx_k__writeMixedArray), 0, 0, 1, 1}, - {&__pyx_n_s__writeNull, __pyx_k__writeNull, sizeof(__pyx_k__writeNull), 0, 0, 1, 1}, - {&__pyx_n_s__writeNumber, __pyx_k__writeNumber, sizeof(__pyx_k__writeNumber), 0, 0, 1, 1}, - {&__pyx_n_s__writeObject, __pyx_k__writeObject, sizeof(__pyx_k__writeObject), 0, 0, 1, 1}, - {&__pyx_n_s__writeSequence, __pyx_k__writeSequence, sizeof(__pyx_k__writeSequence), 0, 0, 1, 1}, - {&__pyx_n_s__writeString, __pyx_k__writeString, sizeof(__pyx_k__writeString), 0, 0, 1, 1}, - {&__pyx_n_s__writeTuple, __pyx_k__writeTuple, sizeof(__pyx_k__writeTuple), 0, 0, 1, 1}, - {&__pyx_n_s__writeUndefined, __pyx_k__writeUndefined, sizeof(__pyx_k__writeUndefined), 0, 0, 1, 1}, - {&__pyx_n_s__writeXML, __pyx_k__writeXML, sizeof(__pyx_k__writeXML), 0, 0, 1, 1}, - {&__pyx_n_s__xml, __pyx_k__xml, sizeof(__pyx_k__xml), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_NotImplementedError = __Pyx_GetName(__pyx_b, __pyx_n_s__NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_n_s__KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_basestring = __Pyx_GetName(__pyx_b, __pyx_n_s__basestring); if (!__pyx_builtin_basestring) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_IOError = __Pyx_GetName(__pyx_b, __pyx_n_s__IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_AttributeError = __Pyx_GetName(__pyx_b, __pyx_n_s__AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_IndexError = __Pyx_GetName(__pyx_b, __pyx_n_s__IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_callable = __Pyx_GetName(__pyx_b, __pyx_n_s__callable); if (!__pyx_builtin_callable) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":272 - * return ret - * - * cdef unicode u = s.decode('utf-8') # <<<<<<<<<<<<<< - * - * self.unicodes[s] = u - */ - __pyx_k_tuple_4 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_4)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_3)); - PyTuple_SET_ITEM(__pyx_k_tuple_4, 0, ((PyObject *)__pyx_kp_s_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":291 - * return ret - * - * cdef str s = u.encode('utf-8') # <<<<<<<<<<<<<< - * - * self.unicodes[s] = u - */ - __pyx_k_tuple_5 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_5)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_3)); - PyTuple_SET_ITEM(__pyx_k_tuple_5, 0, ((PyObject *)__pyx_kp_s_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":448 - * - * cdef int writeDate(self, object o) except -1: - * o = datetime.datetime.combine(o, datetime.time(0, 0, 0, 0)) # <<<<<<<<<<<<<< - * - * self.writeDateTime(o) - */ - __pyx_k_tuple_7 = PyTuple_New(4); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_7)); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_k_tuple_7, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_k_tuple_7, 1, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_k_tuple_7, 2, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_k_tuple_7, 3, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":544 - * cdef int checkBadTypes(self, object element, object py_type) except -1: - * if PyModule_CheckExact(element): - * raise pyamf.EncodeError("Cannot encode modules") # <<<<<<<<<<<<<< - * elif PyMethod_Check(element): - * raise pyamf.EncodeError("Cannot encode methods") - */ - __pyx_k_tuple_9 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_9)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_8)); - PyTuple_SET_ITEM(__pyx_k_tuple_9, 0, ((PyObject *)__pyx_kp_s_8)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":546 - * raise pyamf.EncodeError("Cannot encode modules") - * elif PyMethod_Check(element): - * raise pyamf.EncodeError("Cannot encode methods") # <<<<<<<<<<<<<< - * elif PyFunction_Check(element) or py_type is BuiltinFunctionType: - * raise pyamf.EncodeError("Cannot encode functions") - */ - __pyx_k_tuple_11 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_11)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_10)); - PyTuple_SET_ITEM(__pyx_k_tuple_11, 0, ((PyObject *)__pyx_kp_s_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":548 - * raise pyamf.EncodeError("Cannot encode methods") - * elif PyFunction_Check(element) or py_type is BuiltinFunctionType: - * raise pyamf.EncodeError("Cannot encode functions") # <<<<<<<<<<<<<< - * elif PyClass_Check(element) or PyType_CheckExact(element): - * raise pyamf.EncodeError("Cannot encode class objects") - */ - __pyx_k_tuple_13 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_13)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_12)); - PyTuple_SET_ITEM(__pyx_k_tuple_13, 0, ((PyObject *)__pyx_kp_s_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":550 - * raise pyamf.EncodeError("Cannot encode functions") - * elif PyClass_Check(element) or PyType_CheckExact(element): - * raise pyamf.EncodeError("Cannot encode class objects") # <<<<<<<<<<<<<< - * elif PyTime_CheckExact(element): - * raise pyamf.EncodeError('A datetime.time instance was found but ' - */ - __pyx_k_tuple_15 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_15)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_14)); - PyTuple_SET_ITEM(__pyx_k_tuple_15, 0, ((PyObject *)__pyx_kp_s_14)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":552 - * raise pyamf.EncodeError("Cannot encode class objects") - * elif PyTime_CheckExact(element): - * raise pyamf.EncodeError('A datetime.time instance was found but ' # <<<<<<<<<<<<<< - * 'AMF has no way to encode time objects. Please use ' - * 'datetime.datetime instead') - */ - __pyx_k_tuple_17 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_17)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_16)); - PyTuple_SET_ITEM(__pyx_k_tuple_17, 0, ((PyObject *)__pyx_kp_s_16)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_16)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":599 - * - * try: - * element = self.bucket.pop(0) # <<<<<<<<<<<<<< - * except IndexError: - * raise StopIteration - */ - __pyx_k_tuple_18 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_18)); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_k_tuple_18, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_18)); - __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;}; - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initcodec(void); /*proto*/ -PyMODINIT_FUNC initcodec(void) -#else -PyMODINIT_FUNC PyInit_codec(void); /*proto*/ -PyMODINIT_FUNC PyInit_codec(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - #if CYTHON_REFNANNY - void* __pyx_refnanny = NULL; - __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"); - } - __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_codec(void)", __LINE__, __FILE__); - #endif - __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_binding_PyCFunctionType_USED - if (__pyx_binding_PyCFunctionType_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(__Pyx_NAMESTR("codec"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_19), 0, PYTHON_API_VERSION); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - #if PY_MAJOR_VERSION < 3 - Py_INCREF(__pyx_m); - #endif - __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); - if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__Pyx_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 (__pyx_module_is_main_cpyamf__codec) { - if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - } - /*--- 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 ---*/ - __pyx_v_6cpyamf_5codec_MixedArray = Py_None; Py_INCREF(Py_None); - __pyx_v_6cpyamf_5codec_Undefined = Py_None; Py_INCREF(Py_None); - __pyx_v_6cpyamf_5codec_BuiltinFunctionType = Py_None; Py_INCREF(Py_None); - __pyx_v_6cpyamf_5codec_GeneratorType = Py_None; Py_INCREF(Py_None); - /*--- Function export code ---*/ - /*--- Type init code ---*/ - __pyx_vtabptr_6cpyamf_5codec_IndexedCollection = &__pyx_vtable_6cpyamf_5codec_IndexedCollection; - __pyx_vtable_6cpyamf_5codec_IndexedCollection._actually_increase_size = (int (*)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *))__pyx_f_6cpyamf_5codec_17IndexedCollection__actually_increase_size; - __pyx_vtable_6cpyamf_5codec_IndexedCollection._increase_size = (int (*)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *))__pyx_f_6cpyamf_5codec_17IndexedCollection__increase_size; - __pyx_vtable_6cpyamf_5codec_IndexedCollection._clear = (void (*)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *))__pyx_f_6cpyamf_5codec_17IndexedCollection__clear; - __pyx_vtable_6cpyamf_5codec_IndexedCollection.clear = (int (*)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_5codec_17IndexedCollection_clear; - __pyx_vtable_6cpyamf_5codec_IndexedCollection._ref = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *, PyObject *))__pyx_f_6cpyamf_5codec_17IndexedCollection__ref; - __pyx_vtable_6cpyamf_5codec_IndexedCollection.getByReference = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6cpyamf_5codec_17IndexedCollection_getByReference; - __pyx_vtable_6cpyamf_5codec_IndexedCollection.getReferenceTo = (Py_ssize_t (*)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_5codec_17IndexedCollection_getReferenceTo; - __pyx_vtable_6cpyamf_5codec_IndexedCollection.append = (Py_ssize_t (*)(struct __pyx_obj_6cpyamf_5codec_IndexedCollection *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_5codec_17IndexedCollection_append; - if (PyType_Ready(&__pyx_type_6cpyamf_5codec_IndexedCollection) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6cpyamf_5codec_IndexedCollection.tp_dict, __pyx_vtabptr_6cpyamf_5codec_IndexedCollection) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "IndexedCollection", (PyObject *)&__pyx_type_6cpyamf_5codec_IndexedCollection) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_5codec_IndexedCollection = &__pyx_type_6cpyamf_5codec_IndexedCollection; - __pyx_vtabptr_6cpyamf_5codec_Context = &__pyx_vtable_6cpyamf_5codec_Context; - __pyx_vtable_6cpyamf_5codec_Context.clear = (int (*)(struct __pyx_obj_6cpyamf_5codec_Context *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_5codec_7Context_clear; - __pyx_vtable_6cpyamf_5codec_Context.getClassAlias = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Context *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_5codec_7Context_getClassAlias; - __pyx_vtable_6cpyamf_5codec_Context.getObject = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Context *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6cpyamf_5codec_7Context_getObject; - __pyx_vtable_6cpyamf_5codec_Context.getObjectReference = (Py_ssize_t (*)(struct __pyx_obj_6cpyamf_5codec_Context *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_5codec_7Context_getObjectReference; - __pyx_vtable_6cpyamf_5codec_Context.addObject = (Py_ssize_t (*)(struct __pyx_obj_6cpyamf_5codec_Context *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_5codec_7Context_addObject; - __pyx_vtable_6cpyamf_5codec_Context.getStringForBytes = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Context *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_5codec_7Context_getStringForBytes; - __pyx_vtable_6cpyamf_5codec_Context.getBytesForString = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Context *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_5codec_7Context_getBytesForString; - if (PyType_Ready(&__pyx_type_6cpyamf_5codec_Context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6cpyamf_5codec_Context.tp_dict, __pyx_vtabptr_6cpyamf_5codec_Context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Context", (PyObject *)&__pyx_type_6cpyamf_5codec_Context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_5codec_Context = &__pyx_type_6cpyamf_5codec_Context; - if (PyType_Ready(&__pyx_type_6cpyamf_5codec_Codec) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Codec", (PyObject *)&__pyx_type_6cpyamf_5codec_Codec) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_5codec_Codec = &__pyx_type_6cpyamf_5codec_Codec; - __pyx_vtabptr_6cpyamf_5codec_Decoder = &__pyx_vtable_6cpyamf_5codec_Decoder; - __pyx_vtable_6cpyamf_5codec_Decoder.readDate = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *))__pyx_f_6cpyamf_5codec_7Decoder_readDate; - __pyx_vtable_6cpyamf_5codec_Decoder.readString = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_5codec_7Decoder_readString; - __pyx_vtable_6cpyamf_5codec_Decoder.readObject = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *))__pyx_f_6cpyamf_5codec_7Decoder_readObject; - __pyx_vtable_6cpyamf_5codec_Decoder.readNumber = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *))__pyx_f_6cpyamf_5codec_7Decoder_readNumber; - __pyx_vtable_6cpyamf_5codec_Decoder.readNull = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *))__pyx_f_6cpyamf_5codec_7Decoder_readNull; - __pyx_vtable_6cpyamf_5codec_Decoder.readUndefined = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *))__pyx_f_6cpyamf_5codec_7Decoder_readUndefined; - __pyx_vtable_6cpyamf_5codec_Decoder.readList = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *))__pyx_f_6cpyamf_5codec_7Decoder_readList; - __pyx_vtable_6cpyamf_5codec_Decoder.readXML = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *))__pyx_f_6cpyamf_5codec_7Decoder_readXML; - __pyx_vtable_6cpyamf_5codec_Decoder.readElement = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_5codec_7Decoder_readElement; - __pyx_vtable_6cpyamf_5codec_Decoder.readConcreteElement = (PyObject *(*)(struct __pyx_obj_6cpyamf_5codec_Decoder *, char))__pyx_f_6cpyamf_5codec_7Decoder_readConcreteElement; - __pyx_vtable_6cpyamf_5codec_Decoder.send = (int (*)(struct __pyx_obj_6cpyamf_5codec_Decoder *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_5codec_7Decoder_send; - __pyx_type_6cpyamf_5codec_Decoder.tp_base = __pyx_ptype_6cpyamf_5codec_Codec; - if (PyType_Ready(&__pyx_type_6cpyamf_5codec_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - { - PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_6cpyamf_5codec_Decoder, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { - __pyx_wrapperbase_6cpyamf_5codec_7Decoder___next__ = *((PyWrapperDescrObject *)wrapper)->d_base; - __pyx_wrapperbase_6cpyamf_5codec_7Decoder___next__.doc = __pyx_doc_6cpyamf_5codec_7Decoder___next__; - ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6cpyamf_5codec_7Decoder___next__; - } - } - if (__Pyx_SetVtable(__pyx_type_6cpyamf_5codec_Decoder.tp_dict, __pyx_vtabptr_6cpyamf_5codec_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Decoder", (PyObject *)&__pyx_type_6cpyamf_5codec_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_5codec_Decoder = &__pyx_type_6cpyamf_5codec_Decoder; - __pyx_vtabptr_6cpyamf_5codec_Encoder = &__pyx_vtable_6cpyamf_5codec_Encoder; - __pyx_vtable_6cpyamf_5codec_Encoder.serialiseString = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_5codec_7Encoder_serialiseString; - __pyx_vtable_6cpyamf_5codec_Encoder.writeType = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, char))__pyx_f_6cpyamf_5codec_7Encoder_writeType; - __pyx_vtable_6cpyamf_5codec_Encoder.writeNull = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_5codec_7Encoder_writeNull; - __pyx_vtable_6cpyamf_5codec_Encoder.writeUndefined = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_5codec_7Encoder_writeUndefined; - __pyx_vtable_6cpyamf_5codec_Encoder.writeString = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_5codec_7Encoder_writeString; - __pyx_vtable_6cpyamf_5codec_Encoder.writeBytes = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_5codec_7Encoder_writeBytes; - __pyx_vtable_6cpyamf_5codec_Encoder.writeBoolean = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_5codec_7Encoder_writeBoolean; - __pyx_vtable_6cpyamf_5codec_Encoder.writeInt = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_5codec_7Encoder_writeInt; - __pyx_vtable_6cpyamf_5codec_Encoder.writeLong = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_5codec_7Encoder_writeLong; - __pyx_vtable_6cpyamf_5codec_Encoder.writeNumber = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_5codec_7Encoder_writeNumber; - __pyx_vtable_6cpyamf_5codec_Encoder.writeDateTime = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_5codec_7Encoder_writeDateTime; - __pyx_vtable_6cpyamf_5codec_Encoder.writeDate = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_5codec_7Encoder_writeDate; - __pyx_vtable_6cpyamf_5codec_Encoder.writeXML = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_5codec_7Encoder_writeXML; - __pyx_vtable_6cpyamf_5codec_Encoder.writeList = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeList *__pyx_optional_args))__pyx_f_6cpyamf_5codec_7Encoder_writeList; - __pyx_vtable_6cpyamf_5codec_Encoder.writeTuple = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_5codec_7Encoder_writeTuple; - __pyx_vtable_6cpyamf_5codec_Encoder.writeSequence = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_5codec_7Encoder_writeSequence; - __pyx_vtable_6cpyamf_5codec_Encoder.writeObject = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_5codec_7Encoder_writeObject *__pyx_optional_args))__pyx_f_6cpyamf_5codec_7Encoder_writeObject; - __pyx_vtable_6cpyamf_5codec_Encoder.writeDict = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_5codec_7Encoder_writeDict; - __pyx_vtable_6cpyamf_5codec_Encoder.writeMixedArray = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_5codec_7Encoder_writeMixedArray; - __pyx_vtable_6cpyamf_5codec_Encoder.writeGenerator = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *))__pyx_f_6cpyamf_5codec_7Encoder_writeGenerator; - __pyx_vtable_6cpyamf_5codec_Encoder.handleBasicTypes = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, PyObject *))__pyx_f_6cpyamf_5codec_7Encoder_handleBasicTypes; - __pyx_vtable_6cpyamf_5codec_Encoder.checkBadTypes = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, PyObject *))__pyx_f_6cpyamf_5codec_7Encoder_checkBadTypes; - __pyx_vtable_6cpyamf_5codec_Encoder.writeElement = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_5codec_7Encoder_writeElement; - __pyx_vtable_6cpyamf_5codec_Encoder.send = (int (*)(struct __pyx_obj_6cpyamf_5codec_Encoder *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_5codec_7Encoder_send; - __pyx_type_6cpyamf_5codec_Encoder.tp_base = __pyx_ptype_6cpyamf_5codec_Codec; - if (PyType_Ready(&__pyx_type_6cpyamf_5codec_Encoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - { - PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_6cpyamf_5codec_Encoder, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { - __pyx_wrapperbase_6cpyamf_5codec_7Encoder___next__ = *((PyWrapperDescrObject *)wrapper)->d_base; - __pyx_wrapperbase_6cpyamf_5codec_7Encoder___next__.doc = __pyx_doc_6cpyamf_5codec_7Encoder___next__; - ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6cpyamf_5codec_7Encoder___next__; - } - } - if (__Pyx_SetVtable(__pyx_type_6cpyamf_5codec_Encoder.tp_dict, __pyx_vtabptr_6cpyamf_5codec_Encoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Encoder", (PyObject *)&__pyx_type_6cpyamf_5codec_Encoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_5codec_Encoder = &__pyx_type_6cpyamf_5codec_Encoder; - if (PyType_Ready(&__pyx_type_6cpyamf_5codec__CustomTypeFunc) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "_CustomTypeFunc", (PyObject *)&__pyx_type_6cpyamf_5codec__CustomTypeFunc) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_5codec__CustomTypeFunc = &__pyx_type_6cpyamf_5codec__CustomTypeFunc; - /*--- Type import code ---*/ - __pyx_ptype_6cpyamf_4util_cBufferedByteStream = __Pyx_ImportType("cpyamf.util", "cBufferedByteStream", sizeof(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream), 1); if (unlikely(!__pyx_ptype_6cpyamf_4util_cBufferedByteStream)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_6cpyamf_4util_cBufferedByteStream->tp_dict, &__pyx_vtabptr_6cpyamf_4util_cBufferedByteStream) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_4util_BufferedByteStream = __Pyx_ImportType("cpyamf.util", "BufferedByteStream", sizeof(struct __pyx_obj_6cpyamf_4util_BufferedByteStream), 1); if (unlikely(!__pyx_ptype_6cpyamf_4util_BufferedByteStream)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_6cpyamf_4util_BufferedByteStream->tp_dict, &__pyx_vtabptr_6cpyamf_4util_BufferedByteStream) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __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[3]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":24 - * from cpyamf.util cimport cBufferedByteStream, BufferedByteStream - * - * import types # <<<<<<<<<<<<<< - * import pyamf - * from pyamf import util, xml - */ - __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__types), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__types, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":25 - * - * import types - * import pyamf # <<<<<<<<<<<<<< - * from pyamf import util, xml - * import datetime - */ - __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__pyamf), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__pyamf, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":26 - * import types - * import pyamf - * from pyamf import util, xml # <<<<<<<<<<<<<< - * import datetime - * - */ - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__util)); - PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__util)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__util)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__xml)); - PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__xml)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__xml)); - __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__pyamf), ((PyObject *)__pyx_t_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(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__util); 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 (PyObject_SetAttr(__pyx_m, __pyx_n_s__util, __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 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__xml); 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 (PyObject_SetAttr(__pyx_m, __pyx_n_s__xml, __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; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":27 - * import pyamf - * from pyamf import util, xml - * import datetime # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__datetime), 0); 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 (PyObject_SetAttr(__pyx_m, __pyx_n_s__datetime, __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; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":30 - * - * - * cdef object MixedArray = pyamf.MixedArray # <<<<<<<<<<<<<< - * cdef object Undefined = pyamf.Undefined - * cdef object BuiltinFunctionType = types.BuiltinFunctionType - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__MixedArray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_v_6cpyamf_5codec_MixedArray); - __Pyx_DECREF(__pyx_v_6cpyamf_5codec_MixedArray); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_v_6cpyamf_5codec_MixedArray = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":31 - * - * cdef object MixedArray = pyamf.MixedArray - * cdef object Undefined = pyamf.Undefined # <<<<<<<<<<<<<< - * cdef object BuiltinFunctionType = types.BuiltinFunctionType - * cdef object GeneratorType = types.GeneratorType - */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__pyamf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__Undefined); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_v_6cpyamf_5codec_Undefined); - __Pyx_DECREF(__pyx_v_6cpyamf_5codec_Undefined); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_v_6cpyamf_5codec_Undefined = __pyx_t_2; - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":32 - * cdef object MixedArray = pyamf.MixedArray - * cdef object Undefined = pyamf.Undefined - * cdef object BuiltinFunctionType = types.BuiltinFunctionType # <<<<<<<<<<<<<< - * cdef object GeneratorType = types.GeneratorType - * - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__types); 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_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__BuiltinFunctionType); 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_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_v_6cpyamf_5codec_BuiltinFunctionType); - __Pyx_DECREF(__pyx_v_6cpyamf_5codec_BuiltinFunctionType); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_v_6cpyamf_5codec_BuiltinFunctionType = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":33 - * cdef object Undefined = pyamf.Undefined - * cdef object BuiltinFunctionType = types.BuiltinFunctionType - * cdef object GeneratorType = types.GeneratorType # <<<<<<<<<<<<<< - * - * PyDateTime_IMPORT - */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__types); 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_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__GeneratorType); 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_GOTREF(__pyx_v_6cpyamf_5codec_GeneratorType); - __Pyx_DECREF(__pyx_v_6cpyamf_5codec_GeneratorType); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_v_6cpyamf_5codec_GeneratorType = __pyx_t_2; - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":35 - * cdef object GeneratorType = types.GeneratorType - * - * PyDateTime_IMPORT # <<<<<<<<<<<<<< - * - * - */ - PyDateTime_IMPORT; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":53 - * self.length = -1 - * - * def __init__(self, use_hash=False): # <<<<<<<<<<<<<< - * self.use_hash = use_hash - * - */ - __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_k_1 = __pyx_t_2; - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":320 - * self.timezone_offset = None - * - * def __init__(self, stream=None, strict=False, timezone_offset=None): # <<<<<<<<<<<<<< - * if not isinstance(stream, BufferedByteStream): - * stream = BufferedByteStream(stream) - */ - __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_k_6 = __pyx_t_2; - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/codec.pyx":1 - * # cython: boundscheck=False # <<<<<<<<<<<<<< - * # Copyright (c) The PyAMF Project. - * # See LICENSE.txt for details. - */ - __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(((PyObject *)__pyx_t_2)); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/Library/Python/2.6/site-packages/Cython/Includes/cpython/type.pxd":2 - * - * cdef extern from "Python.h": # <<<<<<<<<<<<<< - * # The C structure of the objects used to describe built-in types. - * - */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - if (__pyx_m) { - __Pyx_AddTraceback("init cpyamf.codec"); - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init cpyamf.codec"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -/* Runtime support code */ - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - 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_AS_STRING(kw_name)); - #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 *number, *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"; - } - number = (num_expected == 1) ? "" : "s"; - PyErr_Format(PyExc_TypeError, - #if PY_VERSION_HEX < 0x02050000 - "%s() takes %s %d positional argument%s (%d given)", - #else - "%s() takes %s %zd positional argument%s (%zd given)", - #endif - func_name, more_or_less, num_expected, number, num_found); -} - -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; - } else { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { - #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { - #endif - goto invalid_keyword_type; - } else { - for (name = first_kw_arg; *name; name++) { - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) break; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) break; - #endif - } - if (*name) { - values[name-argnames] = value; - } else { - /* unexpected keyword found */ - for (name=argnames; name != first_kw_arg; name++) { - if (**name == key) goto arg_passed_twice; - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) goto arg_passed_twice; - #endif - } - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - } - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, **name); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (unlikely(!type)) { - PyErr_Format(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 CYTHON_INLINE int __Pyx_CheckKeywordStrings( - PyObject *kwdict, - const char* function_name, - int kw_allowed) -{ - PyObject* key = 0; - Py_ssize_t pos = 0; - while (PyDict_Next(kwdict, &pos, &key, 0)) { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) - #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) - #endif - goto invalid_keyword_type; - } - if ((!kw_allowed) && unlikely(key)) - goto invalid_keyword; - return 1; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - return 0; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif - return 0; -} - -static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is unsubscriptable"); -} - -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { - PyObject *local_type, *local_value, *local_tb; - 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; - PyErr_NormalizeException(&local_type, &local_value, &local_tb); - if (unlikely(tstate->curexc_type)) - goto bad; - #if PY_MAJOR_VERSION >= 3 - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) - goto bad; - #endif - *type = local_type; - *value = local_value; - *tb = local_tb; - Py_INCREF(local_type); - Py_INCREF(local_value); - Py_INCREF(local_tb); - 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; - /* Make sure tstate is in a consistent state when we XDECREF - these objects (XDECREF may run arbitrary code). */ - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); - 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_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (Py_TYPE(obj) == type) return 1; - } - else { - if (PyObject_TypeCheck(obj, type)) return 1; - } - PyErr_Format(PyExc_TypeError, - "Argument '%s' has incorrect type (expected %s, got %s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); - return 0; -} - -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, - #if PY_VERSION_HEX < 0x02050000 - "need more than %d value%s to unpack", (int)index, - #else - "need more than %zd value%s to unpack", index, - #endif - (index == 1) ? "" : "s"); -} - -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { - PyErr_Format(PyExc_ValueError, - #if PY_VERSION_HEX < 0x02050000 - "too many values to unpack (expected %d)", (int)expected); - #else - "too many values to unpack (expected %zd)", expected); - #endif -} - -static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) { - PyObject *item; - if (!(item = PyIter_Next(iter))) { - if (!PyErr_Occurred()) { - __Pyx_RaiseNeedMoreValuesError(index); - } - } - return item; -} - -static int __Pyx_EndUnpack(PyObject *iter, Py_ssize_t expected) { - PyObject *item; - if ((item = PyIter_Next(iter))) { - Py_DECREF(item); - __Pyx_RaiseTooManyValuesError(expected); - return -1; - } - else if (!PyErr_Occurred()) - return 0; - else - return -1; -} - -static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { - 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); -} - -static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { - 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); -} - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *py_import = 0; - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - py_import = __Pyx_GetAttrString(__pyx_b, "__import__"); - if (!py_import) - goto bad; - 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; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, NULL); -bad: - Py_XDECREF(empty_list); - Py_XDECREF(py_import); - Py_XDECREF(empty_dict); - return module; -} - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - 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); -} - -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - 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; -} - - -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - Py_XINCREF(type); - Py_XINCREF(value); - Py_XINCREF(tb); - /* First, check the traceback argument, replacing None with NULL. */ - if (tb == Py_None) { - Py_DECREF(tb); - tb = 0; - } - else if (tb != NULL && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - /* Next, replace a missing value with None */ - if (value == NULL) { - value = Py_None; - Py_INCREF(value); - } - #if PY_VERSION_HEX < 0x02050000 - if (!PyClass_Check(type)) - #else - if (!PyType_Check(type)) - #endif - { - /* Raising an instance. The value should be a dummy. */ - if (value != Py_None) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - /* Normalize to raise , */ - Py_DECREF(value); - value = type; - #if PY_VERSION_HEX < 0x02050000 - if (PyInstance_Check(type)) { - type = (PyObject*) ((PyInstanceObject*)type)->in_class; - Py_INCREF(type); - } - else { - type = 0; - PyErr_SetString(PyExc_TypeError, - "raise: exception must be an old-style class or instance"); - goto raise_error; - } - #else - 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; - } - #endif - } - - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} - -#else /* Python 3+ */ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - 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)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } - - PyErr_SetObject(type, value); - - if (tb) { - 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); - } - } - -bad: - return; -} -#endif - -static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { - PyObject *r = PyObject_GetAttr(o, n); - if (!r) { - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) - goto bad; - PyErr_Clear(); - r = d; - Py_INCREF(d); - } - return r; -bad: - return NULL; -} - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { - const unsigned char neg_one = (unsigned char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned char" : - "value too large to convert to unsigned char"); - } - return (unsigned char)-1; - } - return (unsigned char)val; - } - return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { - const unsigned short neg_one = (unsigned short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned short" : - "value too large to convert to unsigned short"); - } - return (unsigned short)-1; - } - return (unsigned short)val; - } - return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { - const unsigned int neg_one = (unsigned int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned int" : - "value too large to convert to unsigned int"); - } - return (unsigned int)-1; - } - return (unsigned int)val; - } - return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { - const char neg_one = (char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to char" : - "value too large to convert to char"); - } - return (char)-1; - } - return (char)val; - } - return (char)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { - const short neg_one = (short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to short" : - "value too large to convert to short"); - } - return (short)-1; - } - return (short)val; - } - return (short)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { - const signed char neg_one = (signed char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed char" : - "value too large to convert to signed char"); - } - return (signed char)-1; - } - return (signed char)val; - } - return (signed char)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { - const signed short neg_one = (signed short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed short" : - "value too large to convert to signed short"); - } - return (signed short)-1; - } - return (signed short)val; - } - return (signed short)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { - const signed int neg_one = (signed int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed int" : - "value too large to convert to signed int"); - } - return (signed int)-1; - } - return (signed int)val; - } - return (signed int)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { - const unsigned long neg_one = (unsigned long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - unsigned long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned long)-1; - val = __Pyx_PyInt_AsUnsignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { - const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - unsigned PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { - const long neg_one = (long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long)-1; - val = __Pyx_PyInt_AsLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { - const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { - const signed long neg_one = (signed long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - signed long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed long)-1; - val = __Pyx_PyInt_AsSignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { - const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - signed PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsSignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static int __Pyx_SetVtable(PyObject *dict, void *vtable) { -#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) - PyObject *ob = PyCapsule_New(vtable, 0, 0); -#else - PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); -#endif - if (!ob) - goto bad; - if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0) - goto bad; - Py_DECREF(ob); - return 0; -bad: - Py_XDECREF(ob); - return -1; -} - -#ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - long size, int strict) -{ - PyObject *py_module = 0; - PyObject *result = 0; - PyObject *py_name = 0; - char warning[200]; - - py_module = __Pyx_ImportModule(module_name); - if (!py_module) - goto bad; - #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(class_name); - #else - py_name = PyUnicode_FromString(class_name); - #endif - 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, - "%s.%s is not a type object", - module_name, class_name); - goto bad; - } - if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), - "%s.%s size changed, may indicate binary incompatibility", - module_name, class_name); - #if PY_VERSION_HEX < 0x02050000 - PyErr_Warn(NULL, warning); - #else - PyErr_WarnEx(NULL, warning, 0); - #endif - } - else if (((PyTypeObject *)result)->tp_basicsize != size) { - PyErr_Format(PyExc_ValueError, - "%s.%s has the wrong size, try recompiling", - module_name, class_name); - goto bad; - } - return (PyTypeObject *)result; -bad: - Py_XDECREF(py_module); - Py_XDECREF(result); - return 0; -} -#endif - -#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; - - #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(name); - #else - py_name = PyUnicode_FromString(name); - #endif - 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 - -static int __Pyx_GetVtable(PyObject *dict, void *vtabptr) { - PyObject *ob = PyMapping_GetItemString(dict, (char *)"__pyx_vtable__"); - if (!ob) - goto bad; -#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) - *(void **)vtabptr = PyCapsule_GetPointer(ob, 0); -#else - *(void **)vtabptr = PyCObject_AsVoidPtr(ob); -#endif - if (!*(void **)vtabptr) - goto bad; - Py_DECREF(ob); - return 0; -bad: - Py_XDECREF(ob); - return -1; -} - -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" - -static void __Pyx_AddTraceback(const char *funcname) { - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - PyObject *py_globals = 0; - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(__pyx_filename); - #else - py_srcfile = PyUnicode_FromString(__pyx_filename); - #endif - if (!py_srcfile) goto bad; - if (__pyx_clineno) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #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_globals = PyModule_GetDict(__pyx_m); - if (!py_globals) goto bad; - py_code = PyCode_New( - 0, /*int argcount,*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*int kwonlyargcount,*/ - #endif - 0, /*int nlocals,*/ - 0, /*int stacksize,*/ - 0, /*int flags,*/ - __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,*/ - __pyx_lineno, /*int firstlineno,*/ - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - if (!py_code) goto bad; - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - py_globals, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = __pyx_lineno; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -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 /* Python 3+ has unicode identifiers */ - 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; -} - -/* Type Conversion Functions */ - -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_VERSION_HEX < 0x03000000 - 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_VERSION_HEX < 0x03000000 - 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_VERSION_HEX < 0x03000000 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%s__ returned non-%s (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 = 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) { -#if PY_VERSION_HEX < 0x02050000 - if (ival <= LONG_MAX) - return PyInt_FromLong((long)ival); - else { - unsigned char *bytes = (unsigned char *) &ival; - int one = 1; int little = (int)*(unsigned char*)&one; - return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); - } -#else - return PyInt_FromSize_t(ival); -#endif -} - -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { - unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); - if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { - return (size_t)-1; - } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t)-1; - } - return (size_t)val; -} - - -#endif /* Py_PYTHON_H */ diff --git a/cpyamf/util.c b/cpyamf/util.c deleted file mode 100644 index 848e16fb..00000000 --- a/cpyamf/util.c +++ /dev/null @@ -1,12458 +0,0 @@ -/* Generated by Cython 0.13 on Thu Nov 25 19:27:13 2010 */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#else - -#include /* For offsetof */ -#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 - -#if PY_VERSION_HEX < 0x02040000 - #define METH_COEXIST 0 - #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) - #define PyDict_Contains(d,o) PySequence_Contains(d,o) -#endif - -#if PY_VERSION_HEX < 0x02050000 - typedef int Py_ssize_t; - #define PY_SSIZE_T_MAX INT_MAX - #define PY_SSIZE_T_MIN INT_MIN - #define PY_FORMAT_SIZE_T "" - #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) PyInt_AsLong(o) - #define PyNumber_Index(o) PyNumber_Int(o) - #define PyIndex_Check(o) PyNumber_Check(o) - #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - -#endif - -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" -#endif - -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif - -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#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_VERSION_HEX < 0x02060000 - #define PyBytesObject PyStringObject - #define PyBytes_Type PyString_Type - #define PyBytes_Check PyString_Check - #define PyBytes_CheckExact PyString_CheckExact - #define PyBytes_FromString PyString_FromString - #define PyBytes_FromStringAndSize PyString_FromStringAndSize - #define PyBytes_FromFormat PyString_FromFormat - #define PyBytes_DecodeEscape PyString_DecodeEscape - #define PyBytes_AsString PyString_AsString - #define PyBytes_AsStringAndSize PyString_AsStringAndSize - #define PyBytes_Size PyString_Size - #define PyBytes_AS_STRING PyString_AS_STRING - #define PyBytes_GET_SIZE PyString_GET_SIZE - #define PyBytes_Repr PyString_Repr - #define PyBytes_Concat PyString_Concat - #define PyBytes_ConcatAndDel PyString_ConcatAndDel - #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) - #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) -#endif - -#ifndef PySet_CheckExact -# define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif - -#if PY_MAJOR_VERSION >= 3 - #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 -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#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 - -#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) - #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) - #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) -#else - #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) - #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) -#else - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_NAMESTR(n) ((char *)(n)) - #define __Pyx_DOCSTR(n) ((char *)(n)) -#else - #define __Pyx_NAMESTR(n) (n) - #define __Pyx_DOCSTR(n) (n) -#endif - -#ifdef __cplusplus -#define __PYX_EXTERN_C extern "C" -#else -#define __PYX_EXTERN_C extern -#endif - -#if defined(WIN32) || defined(MS_WINDOWS) -#define _USE_MATH_DEFINES -#endif -#include -#define __PYX_HAVE_API__cpyamf__util -#include "stdio.h" -#include "pythread.h" -#include "stdlib.h" -#include "string.h" - -/* inline attribute */ -#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 - -/* unused attribute */ -#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) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif - -typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ - - -/* Type Conversion Predeclarations */ - -#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) - -#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); -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); - -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) - - -#ifdef __GNUC__ -/* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else /* __GNUC__ > 2 ... */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -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[] = { - "util.pyx", - "bool.pxd", -}; - -/* Type declarations */ - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pxd":28 - * cpdef bint at_eof(self) except -1 - * cpdef inline Py_ssize_t remaining(self) except -1 - * cpdef int seek(self, Py_ssize_t pos, int mode=*) except -1 # <<<<<<<<<<<<<< - * cpdef object getvalue(self) - * cdef Py_ssize_t peek(self, char **buf, Py_ssize_t size) except -1 - */ - -struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_seek { - int __pyx_n; - int mode; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pxd":31 - * cpdef object getvalue(self) - * cdef Py_ssize_t peek(self, char **buf, Py_ssize_t size) except -1 - * cpdef int truncate(self, Py_ssize_t size=?) except -1 # <<<<<<<<<<<<<< - * cpdef int consume(self) except -1 - * cdef int unpack_int(self, unsigned int num_bytes, void *ret) except -1 - */ - -struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_truncate { - int __pyx_n; - Py_ssize_t size; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pxd":5 - * - * - * cdef class cBufferedByteStream: # <<<<<<<<<<<<<< - * """ - * The c version of BufferedByteStream. - */ - -struct __pyx_obj_6cpyamf_4util_cBufferedByteStream { - PyObject_HEAD - struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *__pyx_vtab; - char endian; - char *buffer; - int closed; - Py_ssize_t pos; - Py_ssize_t size; - Py_ssize_t length; - Py_ssize_t min_buf_size; -}; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pxd":61 - * - * - * cdef class BufferedByteStream(cBufferedByteStream): # <<<<<<<<<<<<<< - * """ - * A file like object that mimics StringIO with some extra helper methods. - */ - -struct __pyx_obj_6cpyamf_4util_BufferedByteStream { - struct __pyx_obj_6cpyamf_4util_cBufferedByteStream __pyx_base; -}; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":190 - * - * - * cdef class cBufferedByteStream(object): # <<<<<<<<<<<<<< - * """ - * A file like object that can be read/written to. Supports data type - */ - -struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream { - Py_ssize_t (*tell)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - int (*write)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, char *, Py_ssize_t); - int (*_init_buffer)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *); - int (*_actually_increase_buffer)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t); - int (*_increase_buffer)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t); - int (*has_available)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t); - int (*read)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, char **, Py_ssize_t); - int (*at_eof)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - Py_ssize_t (*remaining)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - int (*seek)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_seek *__pyx_optional_args); - PyObject *(*getvalue)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - Py_ssize_t (*peek)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, char **, Py_ssize_t); - int (*truncate)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_truncate *__pyx_optional_args); - int (*consume)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - int (*unpack_int)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned int, void *); - int (*pack_int)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int, long); - int (*pack_uint)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int, unsigned long); - unsigned char (*read_uchar)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - char (*read_char)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - unsigned short (*read_ushort)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - short (*read_short)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - unsigned long (*read_24bit_uint)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - long (*read_24bit_int)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - unsigned long (*read_ulong)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - long (*read_long)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch); - int (*write_uchar)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned char, int __pyx_skip_dispatch); - int (*write_char)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, char, int __pyx_skip_dispatch); - int (*write_ushort)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned short, int __pyx_skip_dispatch); - int (*write_short)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, short, int __pyx_skip_dispatch); - int (*write_24bit_uint)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned long, int __pyx_skip_dispatch); - int (*write_24bit_int)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, long, int __pyx_skip_dispatch); - int (*write_ulong)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned long, int __pyx_skip_dispatch); - int (*write_long)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, long, int __pyx_skip_dispatch); - PyObject *(*read_utf8_string)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t, int __pyx_skip_dispatch); - int (*write_utf8_string)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, PyObject *, int __pyx_skip_dispatch); - int (*read_double)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, double *); - int (*write_double)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, double, int __pyx_skip_dispatch); - int (*read_float)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, float *); - int (*write_float)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, float, int __pyx_skip_dispatch); - int (*append)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, PyObject *, int __pyx_skip_dispatch); -}; -static struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *__pyx_vtabptr_6cpyamf_4util_cBufferedByteStream; - - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":907 - * - * - * cdef class BufferedByteStream(cBufferedByteStream): # <<<<<<<<<<<<<< - * """ - * A Python exposed version of cBufferedByteStream. This exists because of - */ - -struct __pyx_vtabstruct_6cpyamf_4util_BufferedByteStream { - struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream __pyx_base; -}; -static struct __pyx_vtabstruct_6cpyamf_4util_BufferedByteStream *__pyx_vtabptr_6cpyamf_4util_BufferedByteStream; - -#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) { - 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; - } - #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) - #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_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0) -#else - #define __Pyx_RefNannySetupContext(name) - #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_XDECREF(r) Py_XDECREF(r) -#endif /* CYTHON_REFNANNY */ -#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) -#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -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); /*proto*/ - -static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, - const char* function_name, int kw_allowed); /*proto*/ - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, PyObject* kw_name); /*proto*/ - -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ -static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); - -static void __Pyx_WriteUnraisable(const char *name); /*proto*/ - -static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ - -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict); /*proto*/ - -static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ - -static void __Pyx_AddTraceback(const char *funcname); /*proto*/ - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*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.stdio */ - -/* Module declarations from cpython.object */ - -/* Module declarations from cpython.sequence */ - -/* Module declarations from cpython.mapping */ - -/* Module declarations from cpython.iterator */ - -/* Module declarations from cpython.type */ - -/* 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 cpython.complex */ - -/* 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.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 libc.stdlib */ - -/* Module declarations from libc.string */ - -/* Module declarations from cython */ - -/* Module declarations from cpyamf.util */ - -static PyTypeObject *__pyx_ptype_6cpyamf_4util_cBufferedByteStream = 0; -static PyTypeObject *__pyx_ptype_6cpyamf_4util_BufferedByteStream = 0; -static char __pyx_v_6cpyamf_4util_SYSTEM_ENDIAN; -static int __pyx_v_6cpyamf_4util_float_broken; -static unsigned char *__pyx_v_6cpyamf_4util_NaN; -static unsigned char *__pyx_v_6cpyamf_4util_NegInf; -static unsigned char *__pyx_v_6cpyamf_4util_PosInf; -static double __pyx_v_6cpyamf_4util_platform_nan; -static double __pyx_v_6cpyamf_4util_platform_posinf; -static double __pyx_v_6cpyamf_4util_platform_neginf; -static double __pyx_v_6cpyamf_4util_system_nan; -static double __pyx_v_6cpyamf_4util_system_posinf; -static double __pyx_v_6cpyamf_4util_system_neginf; -static PyObject *__pyx_v_6cpyamf_4util_pyamf_NaN = 0; -static PyObject *__pyx_v_6cpyamf_4util_pyamf_NegInf = 0; -static PyObject *__pyx_v_6cpyamf_4util_pyamf_PosInf = 0; -static PyObject *__pyx_v_6cpyamf_4util_empty_unicode = 0; -static int __pyx_f_6cpyamf_4util__memcpy_ensure_endian(void *, void *, unsigned int); /*proto*/ -static int __pyx_f_6cpyamf_4util_build_platform_exceptional_floats(void); /*proto*/ -static char __pyx_f_6cpyamf_4util_get_native_endian(void); /*proto*/ -static CYTHON_INLINE int __pyx_f_6cpyamf_4util_is_big_endian(char); /*proto*/ -static CYTHON_INLINE int __pyx_f_6cpyamf_4util_is_native_endian(char); /*proto*/ -static CYTHON_INLINE int __pyx_f_6cpyamf_4util_swap_bytes(unsigned char *, Py_ssize_t); /*proto*/ -static int __pyx_f_6cpyamf_4util_is_broken_float(void); /*proto*/ -#define __Pyx_MODULE_NAME "cpyamf.util" -int __pyx_module_is_main_cpyamf__util = 0; - -/* Implementation of cpyamf.util */ -static PyObject *__pyx_builtin_SystemError; -static PyObject *__pyx_builtin_IOError; -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_OverflowError; -static PyObject *__pyx_builtin_TypeError; -static char __pyx_k_1[] = "_actually_increase_buffer"; -static char __pyx_k_2[] = "buf cannot be NULL"; -static char __pyx_k_3[] = "Bad value for mode"; -static char __pyx_k_5[] = "Max 4 bytes to unpack"; -static char __pyx_k_7[] = "integer out of range"; -static char __pyx_k_10[] = "value must be Unicode or str"; -static char __pyx_k_13[] = "Unable to coerce buf->StringIO"; -static char __pyx_k_15[] = "String value expected"; -static char __pyx_k_17[] = "!"; -static char __pyx_k_18[] = "@"; -static char __pyx_k_19[] = "<"; -static char __pyx_k_20[] = ">"; -static char __pyx_k_21[] = "Not a valid endian type"; -static char __pyx_k_23[] = "expected int for x"; -static char __pyx_k_28[] = "Expecting float for val"; -static char __pyx_k_31[] = "\nC-extension for L{pyamf.util} Python module in L{PyAMF}.\n\n@since: 0.4\n"; -static char __pyx_k_32[] = "\377\370\000\000\000\000\000\000"; -static char __pyx_k_33[] = "\377\360\000\000\000\000\000\000"; -static char __pyx_k_34[] = "\360\000\000\000\000\000\000"; -static char __pyx_k_35[] = ""; -static char __pyx_k_37[] = "Unable to initialise cpyamf.util"; -static char __pyx_k__x[] = "x"; -static char __pyx_k__NaN[] = "NaN"; -static char __pyx_k__buf[] = "buf"; -static char __pyx_k__pos[] = "pos"; -static char __pyx_k__mode[] = "mode"; -static char __pyx_k__peek[] = "peek"; -static char __pyx_k__read[] = "read"; -static char __pyx_k__seek[] = "seek"; -static char __pyx_k__size[] = "size"; -static char __pyx_k__tell[] = "tell"; -static char __pyx_k__pyamf[] = "pyamf"; -static char __pyx_k__write[] = "write"; -static char __pyx_k__NegInf[] = "NegInf"; -static char __pyx_k__PosInf[] = "PosInf"; -static char __pyx_k__append[] = "append"; -static char __pyx_k__at_eof[] = "at_eof"; -static char __pyx_k__buffer[] = "buffer"; -static char __pyx_k__endian[] = "endian"; -static char __pyx_k__length[] = "length"; -static char __pyx_k__python[] = "python"; -static char __pyx_k__strict[] = "strict"; -static char __pyx_k__IOError[] = "IOError"; -static char __pyx_k__consume[] = "consume"; -static char __pyx_k____main__[] = "__main__"; -static char __pyx_k____test__[] = "__test__"; -static char __pyx_k__getvalue[] = "getvalue"; -static char __pyx_k__pack_int[] = "pack_int"; -static char __pyx_k__truncate[] = "truncate"; -static char __pyx_k__TypeError[] = "TypeError"; -static char __pyx_k__pack_uint[] = "pack_uint"; -static char __pyx_k__read_char[] = "read_char"; -static char __pyx_k__read_long[] = "read_long"; -static char __pyx_k__remaining[] = "remaining"; -static char __pyx_k__ValueError[] = "ValueError"; -static char __pyx_k__read_short[] = "read_short"; -static char __pyx_k__read_uchar[] = "read_uchar"; -static char __pyx_k__read_ulong[] = "read_ulong"; -static char __pyx_k__unpack_int[] = "unpack_int"; -static char __pyx_k__write_char[] = "write_char"; -static char __pyx_k__write_long[] = "write_long"; -static char __pyx_k__SystemError[] = "SystemError"; -static char __pyx_k__read_ushort[] = "read_ushort"; -static char __pyx_k__write_float[] = "write_float"; -static char __pyx_k__write_short[] = "write_short"; -static char __pyx_k__write_uchar[] = "write_uchar"; -static char __pyx_k__write_ulong[] = "write_ulong"; -static char __pyx_k___init_buffer[] = "_init_buffer"; -static char __pyx_k__min_buf_size[] = "min_buf_size"; -static char __pyx_k__write_double[] = "write_double"; -static char __pyx_k__write_ushort[] = "write_ushort"; -static char __pyx_k__OverflowError[] = "OverflowError"; -static char __pyx_k__has_available[] = "has_available"; -static char __pyx_k__read_24bit_int[] = "read_24bit_int"; -static char __pyx_k__read_24bit_uint[] = "read_24bit_uint"; -static char __pyx_k__write_24bit_int[] = "write_24bit_int"; -static char __pyx_k___increase_buffer[] = "_increase_buffer"; -static char __pyx_k__read_utf8_string[] = "read_utf8_string"; -static char __pyx_k__write_24bit_uint[] = "write_24bit_uint"; -static char __pyx_k__write_utf8_string[] = "write_utf8_string"; -static PyObject *__pyx_n_s_1; -static PyObject *__pyx_kp_s_10; -static PyObject *__pyx_kp_s_13; -static PyObject *__pyx_kp_s_15; -static PyObject *__pyx_kp_b_17; -static PyObject *__pyx_kp_b_18; -static PyObject *__pyx_kp_b_19; -static PyObject *__pyx_kp_s_2; -static PyObject *__pyx_kp_b_20; -static PyObject *__pyx_kp_s_21; -static PyObject *__pyx_kp_s_23; -static PyObject *__pyx_kp_s_28; -static PyObject *__pyx_kp_s_3; -static PyObject *__pyx_kp_s_35; -static PyObject *__pyx_kp_s_37; -static PyObject *__pyx_kp_s_5; -static PyObject *__pyx_kp_s_7; -static PyObject *__pyx_n_s__IOError; -static PyObject *__pyx_n_s__NaN; -static PyObject *__pyx_n_s__NegInf; -static PyObject *__pyx_n_s__OverflowError; -static PyObject *__pyx_n_s__PosInf; -static PyObject *__pyx_n_s__SystemError; -static PyObject *__pyx_n_s__TypeError; -static PyObject *__pyx_n_s__ValueError; -static PyObject *__pyx_n_s____main__; -static PyObject *__pyx_n_s____test__; -static PyObject *__pyx_n_s___increase_buffer; -static PyObject *__pyx_n_s___init_buffer; -static PyObject *__pyx_n_s__append; -static PyObject *__pyx_n_s__at_eof; -static PyObject *__pyx_n_s__buf; -static PyObject *__pyx_n_s__buffer; -static PyObject *__pyx_n_s__consume; -static PyObject *__pyx_n_s__endian; -static PyObject *__pyx_n_s__getvalue; -static PyObject *__pyx_n_s__has_available; -static PyObject *__pyx_n_s__length; -static PyObject *__pyx_n_s__min_buf_size; -static PyObject *__pyx_n_s__mode; -static PyObject *__pyx_n_s__pack_int; -static PyObject *__pyx_n_s__pack_uint; -static PyObject *__pyx_n_s__peek; -static PyObject *__pyx_n_s__pos; -static PyObject *__pyx_n_s__pyamf; -static PyObject *__pyx_n_s__python; -static PyObject *__pyx_n_s__read; -static PyObject *__pyx_n_s__read_24bit_int; -static PyObject *__pyx_n_s__read_24bit_uint; -static PyObject *__pyx_n_s__read_char; -static PyObject *__pyx_n_s__read_long; -static PyObject *__pyx_n_s__read_short; -static PyObject *__pyx_n_s__read_uchar; -static PyObject *__pyx_n_s__read_ulong; -static PyObject *__pyx_n_s__read_ushort; -static PyObject *__pyx_n_s__read_utf8_string; -static PyObject *__pyx_n_s__remaining; -static PyObject *__pyx_n_s__seek; -static PyObject *__pyx_n_s__size; -static PyObject *__pyx_n_s__tell; -static PyObject *__pyx_n_s__truncate; -static PyObject *__pyx_n_s__unpack_int; -static PyObject *__pyx_n_s__write; -static PyObject *__pyx_n_s__write_24bit_int; -static PyObject *__pyx_n_s__write_24bit_uint; -static PyObject *__pyx_n_s__write_char; -static PyObject *__pyx_n_s__write_double; -static PyObject *__pyx_n_s__write_float; -static PyObject *__pyx_n_s__write_long; -static PyObject *__pyx_n_s__write_short; -static PyObject *__pyx_n_s__write_uchar; -static PyObject *__pyx_n_s__write_ulong; -static PyObject *__pyx_n_s__write_ushort; -static PyObject *__pyx_n_s__write_utf8_string; -static PyObject *__pyx_n_s__x; -static PyObject *__pyx_int_0; -static PyObject *__pyx_int_neg_1; -static PyObject *__pyx_int_512; -static PyObject *__pyx_int_2147483648; -static PyObject *__pyx_int_4294967295L; -static PyObject *__pyx_k_tuple_4; -static PyObject *__pyx_k_tuple_6; -static PyObject *__pyx_k_tuple_8; -static PyObject *__pyx_k_tuple_9; -static PyObject *__pyx_k_tuple_11; -static PyObject *__pyx_k_tuple_12; -static PyObject *__pyx_k_tuple_14; -static PyObject *__pyx_k_tuple_16; -static PyObject *__pyx_k_tuple_22; -static PyObject *__pyx_k_tuple_24; -static PyObject *__pyx_k_tuple_25; -static PyObject *__pyx_k_tuple_26; -static PyObject *__pyx_k_tuple_27; -static PyObject *__pyx_k_tuple_29; -static PyObject *__pyx_k_tuple_30; -static PyObject *__pyx_k_tuple_36; -static PyObject *__pyx_k_tuple_38; - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":59 - * - * @cython.profile(False) - * cdef int _memcpy_ensure_endian(void *src, void *dest, unsigned int size) nogil: # <<<<<<<<<<<<<< - * """ - * """ - */ - -static int __pyx_f_6cpyamf_4util__memcpy_ensure_endian(void *__pyx_v_src, void *__pyx_v_dest, unsigned int __pyx_v_size) { - unsigned char *__pyx_v_buf; - int __pyx_r; - int __pyx_t_1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":62 - * """ - * """ - * cdef unsigned char *buf = malloc(size) # <<<<<<<<<<<<<< - * - * if buf == NULL: - */ - __pyx_v_buf = ((unsigned char *)malloc(__pyx_v_size)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":64 - * cdef unsigned char *buf = malloc(size) - * - * if buf == NULL: # <<<<<<<<<<<<<< - * return -1 - * - */ - __pyx_t_1 = (__pyx_v_buf == NULL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":65 - * - * if buf == NULL: - * return -1 # <<<<<<<<<<<<<< - * - * memcpy(buf, src, size) - */ - __pyx_r = -1; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":67 - * return -1 - * - * memcpy(buf, src, size) # <<<<<<<<<<<<<< - * - * if not is_big_endian(SYSTEM_ENDIAN): - */ - memcpy(__pyx_v_buf, __pyx_v_src, __pyx_v_size); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":69 - * memcpy(buf, src, size) - * - * if not is_big_endian(SYSTEM_ENDIAN): # <<<<<<<<<<<<<< - * if swap_bytes(buf, size) == -1: - * free(buf) - */ - __pyx_t_1 = (!__pyx_f_6cpyamf_4util_is_big_endian(__pyx_v_6cpyamf_4util_SYSTEM_ENDIAN)); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":70 - * - * if not is_big_endian(SYSTEM_ENDIAN): - * if swap_bytes(buf, size) == -1: # <<<<<<<<<<<<<< - * free(buf) - * - */ - __pyx_t_1 = (__pyx_f_6cpyamf_4util_swap_bytes(__pyx_v_buf, __pyx_v_size) == -1); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":71 - * if not is_big_endian(SYSTEM_ENDIAN): - * if swap_bytes(buf, size) == -1: - * free(buf) # <<<<<<<<<<<<<< - * - * return -1 - */ - free(__pyx_v_buf); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":73 - * free(buf) - * - * return -1 # <<<<<<<<<<<<<< - * - * memcpy(dest, buf, size) - */ - __pyx_r = -1; - goto __pyx_L0; - goto __pyx_L5; - } - __pyx_L5:; - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":75 - * return -1 - * - * memcpy(dest, buf, size) # <<<<<<<<<<<<<< - * free(buf) - * - */ - memcpy(__pyx_v_dest, __pyx_v_buf, __pyx_v_size); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":76 - * - * memcpy(dest, buf, size) - * free(buf) # <<<<<<<<<<<<<< - * - * return 0 - */ - free(__pyx_v_buf); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":78 - * free(buf) - * - * return 0 # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":81 - * - * - * cdef int build_platform_exceptional_floats() except -1: # <<<<<<<<<<<<<< - * global platform_nan, platform_posinf, platform_neginf - * global system_nan, system_posinf, system_neginf - */ - -static int __pyx_f_6cpyamf_4util_build_platform_exceptional_floats(void) { - int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2; - double __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - __Pyx_RefNannySetupContext("build_platform_exceptional_floats"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":85 - * global system_nan, system_posinf, system_neginf - * - * if _memcpy_ensure_endian(NaN, &system_nan, 8) == -1: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * - */ - __pyx_t_1 = (__pyx_f_6cpyamf_4util__memcpy_ensure_endian(__pyx_v_6cpyamf_4util_NaN, (&__pyx_v_6cpyamf_4util_system_nan), 8) == -1); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":86 - * - * if _memcpy_ensure_endian(NaN, &system_nan, 8) == -1: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * - * if _memcpy_ensure_endian(NegInf, &system_neginf, 8) == -1: - */ - __pyx_t_2 = PyErr_NoMemory(); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":88 - * PyErr_NoMemory() - * - * if _memcpy_ensure_endian(NegInf, &system_neginf, 8) == -1: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * - */ - __pyx_t_1 = (__pyx_f_6cpyamf_4util__memcpy_ensure_endian(__pyx_v_6cpyamf_4util_NegInf, (&__pyx_v_6cpyamf_4util_system_neginf), 8) == -1); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":89 - * - * if _memcpy_ensure_endian(NegInf, &system_neginf, 8) == -1: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * - * if _memcpy_ensure_endian(PosInf, &system_posinf, 8) == -1: - */ - __pyx_t_2 = PyErr_NoMemory(); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":91 - * PyErr_NoMemory() - * - * if _memcpy_ensure_endian(PosInf, &system_posinf, 8) == -1: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * - */ - __pyx_t_1 = (__pyx_f_6cpyamf_4util__memcpy_ensure_endian(__pyx_v_6cpyamf_4util_PosInf, (&__pyx_v_6cpyamf_4util_system_posinf), 8) == -1); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":92 - * - * if _memcpy_ensure_endian(PosInf, &system_posinf, 8) == -1: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * - * if float_broken == 1: - */ - __pyx_t_2 = PyErr_NoMemory(); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":94 - * PyErr_NoMemory() - * - * if float_broken == 1: # <<<<<<<<<<<<<< - * try: - * _PyFloat_Unpack8(&NaN, not is_big_endian(SYSTEM_ENDIAN)) - */ - __pyx_t_1 = (__pyx_v_6cpyamf_4util_float_broken == 1); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":95 - * - * if float_broken == 1: - * try: # <<<<<<<<<<<<<< - * _PyFloat_Unpack8(&NaN, not is_big_endian(SYSTEM_ENDIAN)) - * except: - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - __Pyx_XGOTREF(__pyx_save_exc_type); - __Pyx_XGOTREF(__pyx_save_exc_value); - __Pyx_XGOTREF(__pyx_save_exc_tb); - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":96 - * if float_broken == 1: - * try: - * _PyFloat_Unpack8(&NaN, not is_big_endian(SYSTEM_ENDIAN)) # <<<<<<<<<<<<<< - * except: - * raise - */ - __pyx_t_3 = _PyFloat_Unpack8(((unsigned char *)(&__pyx_v_6cpyamf_4util_NaN)), (!__pyx_f_6cpyamf_4util_is_big_endian(__pyx_v_6cpyamf_4util_SYSTEM_ENDIAN))); if (unlikely(__pyx_t_3 == (-1.0) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - } - /*else:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":100 - * raise - * else: - * memcpy(&platform_nan, &system_nan, 8) # <<<<<<<<<<<<<< - * - * try: - */ - memcpy((&__pyx_v_6cpyamf_4util_platform_nan), (&__pyx_v_6cpyamf_4util_system_nan), 8); - } - __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L14_try_end; - __pyx_L7_error:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":97 - * try: - * _PyFloat_Unpack8(&NaN, not is_big_endian(SYSTEM_ENDIAN)) - * except: # <<<<<<<<<<<<<< - * raise - * else: - */ - /*except:*/ { - __Pyx_AddTraceback("cpyamf.util.build_platform_exceptional_floats"); - if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":98 - * _PyFloat_Unpack8(&NaN, not is_big_endian(SYSTEM_ENDIAN)) - * except: - * raise # <<<<<<<<<<<<<< - * else: - * memcpy(&platform_nan, &system_nan, 8) - */ - __Pyx_GIVEREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_6); - __Pyx_ErrRestore(__pyx_t_4, __pyx_t_5, __pyx_t_6); - __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - goto __pyx_L8_exception_handled; - } - __pyx_L9_except_error:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L8_exception_handled:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L14_try_end:; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":102 - * memcpy(&platform_nan, &system_nan, 8) - * - * try: # <<<<<<<<<<<<<< - * _PyFloat_Unpack8(&PosInf, not is_big_endian(SYSTEM_ENDIAN)) - * except: - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - __Pyx_XGOTREF(__pyx_save_exc_type); - __Pyx_XGOTREF(__pyx_save_exc_value); - __Pyx_XGOTREF(__pyx_save_exc_tb); - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":103 - * - * try: - * _PyFloat_Unpack8(&PosInf, not is_big_endian(SYSTEM_ENDIAN)) # <<<<<<<<<<<<<< - * except: - * raise - */ - __pyx_t_3 = _PyFloat_Unpack8(((unsigned char *)(&__pyx_v_6cpyamf_4util_PosInf)), (!__pyx_f_6cpyamf_4util_is_big_endian(__pyx_v_6cpyamf_4util_SYSTEM_ENDIAN))); if (unlikely(__pyx_t_3 == (-1.0) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L17_error;} - } - /*else:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":107 - * raise - * else: - * memcpy(&platform_posinf, &system_posinf, 8) # <<<<<<<<<<<<<< - * - * try: - */ - memcpy((&__pyx_v_6cpyamf_4util_platform_posinf), (&__pyx_v_6cpyamf_4util_system_posinf), 8); - } - __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L24_try_end; - __pyx_L17_error:; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":104 - * try: - * _PyFloat_Unpack8(&PosInf, not is_big_endian(SYSTEM_ENDIAN)) - * except: # <<<<<<<<<<<<<< - * raise - * else: - */ - /*except:*/ { - __Pyx_AddTraceback("cpyamf.util.build_platform_exceptional_floats"); - if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_4); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":105 - * _PyFloat_Unpack8(&PosInf, not is_big_endian(SYSTEM_ENDIAN)) - * except: - * raise # <<<<<<<<<<<<<< - * else: - * memcpy(&platform_posinf, &system_posinf, 8) - */ - __Pyx_GIVEREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_4); - __Pyx_ErrRestore(__pyx_t_6, __pyx_t_5, __pyx_t_4); - __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L18_exception_handled; - } - __pyx_L19_except_error:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L18_exception_handled:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L24_try_end:; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":109 - * memcpy(&platform_posinf, &system_posinf, 8) - * - * try: # <<<<<<<<<<<<<< - * _PyFloat_Unpack8(&NegInf, not is_big_endian(SYSTEM_ENDIAN)) - * except: - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - __Pyx_XGOTREF(__pyx_save_exc_type); - __Pyx_XGOTREF(__pyx_save_exc_value); - __Pyx_XGOTREF(__pyx_save_exc_tb); - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":110 - * - * try: - * _PyFloat_Unpack8(&NegInf, not is_big_endian(SYSTEM_ENDIAN)) # <<<<<<<<<<<<<< - * except: - * raise - */ - __pyx_t_3 = _PyFloat_Unpack8(((unsigned char *)(&__pyx_v_6cpyamf_4util_NegInf)), (!__pyx_f_6cpyamf_4util_is_big_endian(__pyx_v_6cpyamf_4util_SYSTEM_ENDIAN))); if (unlikely(__pyx_t_3 == (-1.0) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L27_error;} - } - /*else:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":114 - * raise - * else: - * memcpy(&platform_neginf, &system_neginf, 8) # <<<<<<<<<<<<<< - * - * return 0 - */ - memcpy((&__pyx_v_6cpyamf_4util_platform_neginf), (&__pyx_v_6cpyamf_4util_system_neginf), 8); - } - __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L34_try_end; - __pyx_L27_error:; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":111 - * try: - * _PyFloat_Unpack8(&NegInf, not is_big_endian(SYSTEM_ENDIAN)) - * except: # <<<<<<<<<<<<<< - * raise - * else: - */ - /*except:*/ { - __Pyx_AddTraceback("cpyamf.util.build_platform_exceptional_floats"); - if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":112 - * _PyFloat_Unpack8(&NegInf, not is_big_endian(SYSTEM_ENDIAN)) - * except: - * raise # <<<<<<<<<<<<<< - * else: - * memcpy(&platform_neginf, &system_neginf, 8) - */ - __Pyx_GIVEREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_6); - __Pyx_ErrRestore(__pyx_t_4, __pyx_t_5, __pyx_t_6); - __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - goto __pyx_L28_exception_handled; - } - __pyx_L29_except_error:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L28_exception_handled:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L34_try_end:; - } - goto __pyx_L6; - } - __pyx_L6:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":116 - * memcpy(&platform_neginf, &system_neginf, 8) - * - * return 0 # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("cpyamf.util.build_platform_exceptional_floats"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":120 - * - * @cython.profile(False) - * cdef char get_native_endian() nogil: # <<<<<<<<<<<<<< - * """ - * A quick hack to determine the system's endian-ness ... - */ - -static char __pyx_f_6cpyamf_4util_get_native_endian(void) { - unsigned int __pyx_v_one; - int __pyx_v_big_endian; - char __pyx_r; - int __pyx_t_1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":126 - * @return: Either L{ENDIAN_LITTLE} or L{ENDIAN_BIG} - * """ - * cdef unsigned int one = 1 # <<<<<<<<<<<<<< - * cdef int big_endian = (&one)[0] != 1 - * - */ - __pyx_v_one = 1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":127 - * """ - * cdef unsigned int one = 1 - * cdef int big_endian = (&one)[0] != 1 # <<<<<<<<<<<<<< - * - * if big_endian == 1: - */ - __pyx_v_big_endian = ((((char *)(&__pyx_v_one))[0]) != 1); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":129 - * cdef int big_endian = (&one)[0] != 1 - * - * if big_endian == 1: # <<<<<<<<<<<<<< - * return ENDIAN_BIG - * else: - */ - __pyx_t_1 = (__pyx_v_big_endian == 1); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":130 - * - * if big_endian == 1: - * return ENDIAN_BIG # <<<<<<<<<<<<<< - * else: - * return ENDIAN_LITTLE - */ - __pyx_r = '>'; - goto __pyx_L0; - goto __pyx_L3; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":132 - * return ENDIAN_BIG - * else: - * return ENDIAN_LITTLE # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = '<'; - goto __pyx_L0; - } - __pyx_L3:; - - __pyx_r = 0; - __pyx_L0:; - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":136 - * - * @cython.profile(False) - * cdef inline bint is_big_endian(char endian) nogil: # <<<<<<<<<<<<<< - * """ - * Returns a boolean value whether the supplied C{endian} is big. - */ - -static CYTHON_INLINE int __pyx_f_6cpyamf_4util_is_big_endian(char __pyx_v_endian) { - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":140 - * Returns a boolean value whether the supplied C{endian} is big. - * """ - * if endian == ENDIAN_NATIVE: # <<<<<<<<<<<<<< - * return SYSTEM_ENDIAN == ENDIAN_BIG - * - */ - __pyx_t_1 = (__pyx_v_endian == '@'); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":141 - * """ - * if endian == ENDIAN_NATIVE: - * return SYSTEM_ENDIAN == ENDIAN_BIG # <<<<<<<<<<<<<< - * - * return endian == ENDIAN_NETWORK or endian == ENDIAN_BIG - */ - __pyx_r = (__pyx_v_6cpyamf_4util_SYSTEM_ENDIAN == '>'); - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":143 - * return SYSTEM_ENDIAN == ENDIAN_BIG - * - * return endian == ENDIAN_NETWORK or endian == ENDIAN_BIG # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = (__pyx_v_endian == '!'); - if (!__pyx_t_1) { - __pyx_t_2 = (__pyx_v_endian == '>'); - __pyx_t_3 = __pyx_t_2; - } else { - __pyx_t_3 = __pyx_t_1; - } - __pyx_r = __pyx_t_3; - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":147 - * - * @cython.profile(False) - * cdef inline int is_native_endian(char endian) nogil: # <<<<<<<<<<<<<< - * if endian == ENDIAN_NATIVE: - * return 1 - */ - -static CYTHON_INLINE int __pyx_f_6cpyamf_4util_is_native_endian(char __pyx_v_endian) { - int __pyx_r; - int __pyx_t_1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":148 - * @cython.profile(False) - * cdef inline int is_native_endian(char endian) nogil: - * if endian == ENDIAN_NATIVE: # <<<<<<<<<<<<<< - * return 1 - * - */ - __pyx_t_1 = (__pyx_v_endian == '@'); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":149 - * cdef inline int is_native_endian(char endian) nogil: - * if endian == ENDIAN_NATIVE: - * return 1 # <<<<<<<<<<<<<< - * - * if endian == ENDIAN_NETWORK: - */ - __pyx_r = 1; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":151 - * return 1 - * - * if endian == ENDIAN_NETWORK: # <<<<<<<<<<<<<< - * endian = ENDIAN_BIG - * - */ - __pyx_t_1 = (__pyx_v_endian == '!'); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":152 - * - * if endian == ENDIAN_NETWORK: - * endian = ENDIAN_BIG # <<<<<<<<<<<<<< - * - * return endian == SYSTEM_ENDIAN - */ - __pyx_v_endian = '>'; - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":154 - * endian = ENDIAN_BIG - * - * return endian == SYSTEM_ENDIAN # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = (__pyx_v_endian == __pyx_v_6cpyamf_4util_SYSTEM_ENDIAN); - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":158 - * - * @cython.profile(False) - * cdef inline int swap_bytes(unsigned char *buffer, Py_ssize_t size) nogil: # <<<<<<<<<<<<<< - * cdef unsigned char *buf = malloc(size) - * - */ - -static CYTHON_INLINE int __pyx_f_6cpyamf_4util_swap_bytes(unsigned char *__pyx_v_buffer, Py_ssize_t __pyx_v_size) { - unsigned char *__pyx_v_buf; - Py_ssize_t __pyx_v_i; - int __pyx_r; - int __pyx_t_1; - Py_ssize_t __pyx_t_2; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":159 - * @cython.profile(False) - * cdef inline int swap_bytes(unsigned char *buffer, Py_ssize_t size) nogil: - * cdef unsigned char *buf = malloc(size) # <<<<<<<<<<<<<< - * - * if buf == NULL: - */ - __pyx_v_buf = ((unsigned char *)malloc(__pyx_v_size)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":161 - * cdef unsigned char *buf = malloc(size) - * - * if buf == NULL: # <<<<<<<<<<<<<< - * return -1 - * - */ - __pyx_t_1 = (__pyx_v_buf == NULL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":162 - * - * if buf == NULL: - * return -1 # <<<<<<<<<<<<<< - * - * cdef Py_ssize_t i - */ - __pyx_r = -1; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":166 - * cdef Py_ssize_t i - * - * for i from 0 <= i < size: # <<<<<<<<<<<<<< - * buf[i] = buffer[size - i - 1] - * - */ - __pyx_t_2 = __pyx_v_size; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":167 - * - * for i from 0 <= i < size: - * buf[i] = buffer[size - i - 1] # <<<<<<<<<<<<<< - * - * memcpy(buffer, buf, size) - */ - (__pyx_v_buf[__pyx_v_i]) = (__pyx_v_buffer[((__pyx_v_size - __pyx_v_i) - 1)]); - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":169 - * buf[i] = buffer[size - i - 1] - * - * memcpy(buffer, buf, size) # <<<<<<<<<<<<<< - * free(buf) - * - */ - memcpy(__pyx_v_buffer, __pyx_v_buf, __pyx_v_size); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":170 - * - * memcpy(buffer, buf, size) - * free(buf) # <<<<<<<<<<<<<< - * - * return 0 - */ - free(__pyx_v_buf); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":172 - * free(buf) - * - * return 0 # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":175 - * - * - * cdef bint is_broken_float() except -1: # <<<<<<<<<<<<<< - * cdef double test = _PyFloat_Unpack8(NaN, 0) - * - */ - -static int __pyx_f_6cpyamf_4util_is_broken_float(void) { - double __pyx_v_test; - int __pyx_v_result; - unsigned char *__pyx_v_buf; - int __pyx_r; - double __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3; - __Pyx_RefNannySetupContext("is_broken_float"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":176 - * - * cdef bint is_broken_float() except -1: - * cdef double test = _PyFloat_Unpack8(NaN, 0) # <<<<<<<<<<<<<< - * - * cdef int result - */ - __pyx_t_1 = _PyFloat_Unpack8(__pyx_v_6cpyamf_4util_NaN, 0); if (unlikely(__pyx_t_1 == (-1.0) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_test = __pyx_t_1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":179 - * - * cdef int result - * cdef unsigned char *buf = &test # <<<<<<<<<<<<<< - * - * if not is_big_endian(SYSTEM_ENDIAN): - */ - __pyx_v_buf = ((unsigned char *)(&__pyx_v_test)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":181 - * cdef unsigned char *buf = &test - * - * if not is_big_endian(SYSTEM_ENDIAN): # <<<<<<<<<<<<<< - * if swap_bytes(buf, 8) == -1: - * PyErr_NoMemory() - */ - __pyx_t_2 = (!__pyx_f_6cpyamf_4util_is_big_endian(__pyx_v_6cpyamf_4util_SYSTEM_ENDIAN)); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":182 - * - * if not is_big_endian(SYSTEM_ENDIAN): - * if swap_bytes(buf, 8) == -1: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * - */ - __pyx_t_2 = (__pyx_f_6cpyamf_4util_swap_bytes(__pyx_v_buf, 8) == -1); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":183 - * if not is_big_endian(SYSTEM_ENDIAN): - * if swap_bytes(buf, 8) == -1: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * - * result = memcmp(NaN, buf, 8) - */ - __pyx_t_3 = PyErr_NoMemory(); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":185 - * PyErr_NoMemory() - * - * result = memcmp(NaN, buf, 8) # <<<<<<<<<<<<<< - * - * return result != 0 - */ - __pyx_v_result = memcmp(__pyx_v_6cpyamf_4util_NaN, __pyx_v_buf, 8); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":187 - * result = memcmp(NaN, buf, 8) - * - * return result != 0 # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = (__pyx_v_result != 0); - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.util.is_broken_float"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":198 - * """ - * - * def __cinit__(self): # <<<<<<<<<<<<<< - * self.endian = ENDIAN_NETWORK - * self.buffer = NULL - */ - -static int __pyx_pf_6cpyamf_4util_19cBufferedByteStream___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6cpyamf_4util_19cBufferedByteStream___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - int __pyx_r; - __Pyx_RefNannySetupContext("__cinit__"); - 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; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":199 - * - * def __cinit__(self): - * self.endian = ENDIAN_NETWORK # <<<<<<<<<<<<<< - * self.buffer = NULL - * self.min_buf_size = 512 - */ - ((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->endian = '!'; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":200 - * def __cinit__(self): - * self.endian = ENDIAN_NETWORK - * self.buffer = NULL # <<<<<<<<<<<<<< - * self.min_buf_size = 512 - * self.size = 0 - */ - ((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->buffer = NULL; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":201 - * self.endian = ENDIAN_NETWORK - * self.buffer = NULL - * self.min_buf_size = 512 # <<<<<<<<<<<<<< - * self.size = 0 - * - */ - ((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->min_buf_size = 512; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":202 - * self.buffer = NULL - * self.min_buf_size = 512 - * self.size = 0 # <<<<<<<<<<<<<< - * - * def __dealloc__(self): - */ - ((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->size = 0; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":204 - * self.size = 0 - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * if self.buffer != NULL: - * free(self.buffer) - */ - -static void __pyx_pf_6cpyamf_4util_19cBufferedByteStream___dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pf_6cpyamf_4util_19cBufferedByteStream___dealloc__(PyObject *__pyx_v_self) { - int __pyx_t_1; - __Pyx_RefNannySetupContext("__dealloc__"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":205 - * - * def __dealloc__(self): - * if self.buffer != NULL: # <<<<<<<<<<<<<< - * free(self.buffer) - * - */ - __pyx_t_1 = (((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->buffer != NULL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":206 - * def __dealloc__(self): - * if self.buffer != NULL: - * free(self.buffer) # <<<<<<<<<<<<<< - * - * self.buffer = NULL - */ - free(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->buffer); - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":208 - * free(self.buffer) - * - * self.buffer = NULL # <<<<<<<<<<<<<< - * - * cdef inline int _init_buffer(self) except -1: - */ - ((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->buffer = NULL; - - __Pyx_RefNannyFinishContext(); -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":210 - * self.buffer = NULL - * - * cdef inline int _init_buffer(self) except -1: # <<<<<<<<<<<<<< - * if self.buffer != NULL: - * free(self.buffer) - */ - -static CYTHON_INLINE int __pyx_f_6cpyamf_4util_19cBufferedByteStream__init_buffer(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self) { - int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2; - __Pyx_RefNannySetupContext("_init_buffer"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":211 - * - * cdef inline int _init_buffer(self) except -1: - * if self.buffer != NULL: # <<<<<<<<<<<<<< - * free(self.buffer) - * - */ - __pyx_t_1 = (__pyx_v_self->buffer != NULL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":212 - * cdef inline int _init_buffer(self) except -1: - * if self.buffer != NULL: - * free(self.buffer) # <<<<<<<<<<<<<< - * - * self.buffer = NULL - */ - free(__pyx_v_self->buffer); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":214 - * free(self.buffer) - * - * self.buffer = NULL # <<<<<<<<<<<<<< - * - * self.pos = 0 - */ - __pyx_v_self->buffer = NULL; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":216 - * self.buffer = NULL - * - * self.pos = 0 # <<<<<<<<<<<<<< - * self.length = 0 - * self.size = self.min_buf_size - */ - __pyx_v_self->pos = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":217 - * - * self.pos = 0 - * self.length = 0 # <<<<<<<<<<<<<< - * self.size = self.min_buf_size - * - */ - __pyx_v_self->length = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":218 - * self.pos = 0 - * self.length = 0 - * self.size = self.min_buf_size # <<<<<<<<<<<<<< - * - * self.buffer = malloc(self.size) - */ - __pyx_v_self->size = __pyx_v_self->min_buf_size; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":220 - * self.size = self.min_buf_size - * - * self.buffer = malloc(self.size) # <<<<<<<<<<<<<< - * - * if self.buffer == NULL: - */ - __pyx_v_self->buffer = ((char *)malloc(__pyx_v_self->size)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":222 - * self.buffer = malloc(self.size) - * - * if self.buffer == NULL: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * - */ - __pyx_t_1 = (__pyx_v_self->buffer == NULL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":223 - * - * if self.buffer == NULL: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_2 = PyErr_NoMemory(); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":225 - * PyErr_NoMemory() - * - * return 0 # <<<<<<<<<<<<<< - * - * cpdef inline Py_ssize_t tell(self): - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_WriteUnraisable("cpyamf.util.cBufferedByteStream._init_buffer"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":227 - * return 0 - * - * cpdef inline Py_ssize_t tell(self): # <<<<<<<<<<<<<< - * """ - * Returns the position of the stream pointer. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_tell(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static CYTHON_INLINE Py_ssize_t __pyx_f_6cpyamf_4util_19cBufferedByteStream_tell(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, int __pyx_skip_dispatch) { - Py_ssize_t __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - __Pyx_RefNannySetupContext("tell"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__tell); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_tell)) { - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":231 - * Returns the position of the stream pointer. - * """ - * return self.pos # <<<<<<<<<<<<<< - * - * cdef int _actually_increase_buffer(self, Py_ssize_t new_size) except -1: - */ - __pyx_r = __pyx_v_self->pos; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.tell"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":227 - * return 0 - * - * cpdef inline Py_ssize_t tell(self): # <<<<<<<<<<<<<< - * """ - * Returns the position of the stream pointer. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_tell(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_tell[] = "\n Returns the position of the stream pointer.\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_tell(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("tell"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->tell(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.tell"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":233 - * return self.pos - * - * cdef int _actually_increase_buffer(self, Py_ssize_t new_size) except -1: # <<<<<<<<<<<<<< - * if self.size == 0: - * self._init_buffer() - */ - -static int __pyx_f_6cpyamf_4util_19cBufferedByteStream__actually_increase_buffer(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, Py_ssize_t __pyx_v_new_size) { - Py_ssize_t __pyx_v_requested_size; - char *__pyx_v_buf; - int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2; - __Pyx_RefNannySetupContext("_actually_increase_buffer"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":234 - * - * cdef int _actually_increase_buffer(self, Py_ssize_t new_size) except -1: - * if self.size == 0: # <<<<<<<<<<<<<< - * self._init_buffer() - * - */ - __pyx_t_1 = (__pyx_v_self->size == 0); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":235 - * cdef int _actually_increase_buffer(self, Py_ssize_t new_size) except -1: - * if self.size == 0: - * self._init_buffer() # <<<<<<<<<<<<<< - * - * cdef Py_ssize_t requested_size = self.size - */ - ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->_init_buffer(__pyx_v_self); - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":237 - * self._init_buffer() - * - * cdef Py_ssize_t requested_size = self.size # <<<<<<<<<<<<<< - * cdef char *buf - * - */ - __pyx_v_requested_size = __pyx_v_self->size; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":240 - * cdef char *buf - * - * while new_size > requested_size: # <<<<<<<<<<<<<< - * requested_size *= 2 - * - */ - while (1) { - __pyx_t_1 = (__pyx_v_new_size > __pyx_v_requested_size); - if (!__pyx_t_1) break; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":241 - * - * while new_size > requested_size: - * requested_size *= 2 # <<<<<<<<<<<<<< - * - * if requested_size > new_size + MAX_BUFFER_EXTENSION: - */ - __pyx_v_requested_size = (__pyx_v_requested_size * 2); - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":243 - * requested_size *= 2 - * - * if requested_size > new_size + MAX_BUFFER_EXTENSION: # <<<<<<<<<<<<<< - * requested_size = new_size + MAX_BUFFER_EXTENSION - * - */ - __pyx_t_1 = (__pyx_v_requested_size > (__pyx_v_new_size + 16384)); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":244 - * - * if requested_size > new_size + MAX_BUFFER_EXTENSION: - * requested_size = new_size + MAX_BUFFER_EXTENSION # <<<<<<<<<<<<<< - * - * buf = realloc(self.buffer, sizeof(char *) * requested_size) - */ - __pyx_v_requested_size = (__pyx_v_new_size + 16384); - goto __pyx_L6; - } - __pyx_L6:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":246 - * requested_size = new_size + MAX_BUFFER_EXTENSION - * - * buf = realloc(self.buffer, sizeof(char *) * requested_size) # <<<<<<<<<<<<<< - * - * if buf == NULL: - */ - __pyx_v_buf = ((char *)realloc(__pyx_v_self->buffer, ((sizeof(char *)) * __pyx_v_requested_size))); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":248 - * buf = realloc(self.buffer, sizeof(char *) * requested_size) - * - * if buf == NULL: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * - */ - __pyx_t_1 = (__pyx_v_buf == NULL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":249 - * - * if buf == NULL: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * - * self.buffer = buf - */ - __pyx_t_2 = PyErr_NoMemory(); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":251 - * PyErr_NoMemory() - * - * self.buffer = buf # <<<<<<<<<<<<<< - * self.size = requested_size - * - */ - __pyx_v_self->buffer = __pyx_v_buf; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":252 - * - * self.buffer = buf - * self.size = requested_size # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_v_self->size = __pyx_v_requested_size; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":254 - * self.size = requested_size - * - * return 0 # <<<<<<<<<<<<<< - * - * cdef inline int _increase_buffer(self, Py_ssize_t size) except -1: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream._actually_increase_buffer"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":256 - * return 0 - * - * cdef inline int _increase_buffer(self, Py_ssize_t size) except -1: # <<<<<<<<<<<<<< - * """ - * Request to increase the buffer by C{size} - */ - -static CYTHON_INLINE int __pyx_f_6cpyamf_4util_19cBufferedByteStream__increase_buffer(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, Py_ssize_t __pyx_v_size) { - Py_ssize_t __pyx_v_new_len; - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("_increase_buffer"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":260 - * Request to increase the buffer by C{size} - * """ - * cdef Py_ssize_t new_len = self.length + size # <<<<<<<<<<<<<< - * - * if new_len <= self.size: - */ - __pyx_v_new_len = (__pyx_v_self->length + __pyx_v_size); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":262 - * cdef Py_ssize_t new_len = self.length + size - * - * if new_len <= self.size: # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_t_1 = (__pyx_v_new_len <= __pyx_v_self->size); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":263 - * - * if new_len <= self.size: - * return 0 # <<<<<<<<<<<<<< - * - * return self._actually_increase_buffer(new_len) - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":265 - * return 0 - * - * return self._actually_increase_buffer(new_len) # <<<<<<<<<<<<<< - * - * cdef int write(self, char *buf, Py_ssize_t size) except -1: - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->_actually_increase_buffer(__pyx_v_self, __pyx_v_new_len); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_2; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream._increase_buffer"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":267 - * return self._actually_increase_buffer(new_len) - * - * cdef int write(self, char *buf, Py_ssize_t size) except -1: # <<<<<<<<<<<<<< - * """ - * Writes the content of the specified C{buf} into this buffer. - */ - -static int __pyx_f_6cpyamf_4util_19cBufferedByteStream_write(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, char *__pyx_v_buf, Py_ssize_t __pyx_v_size) { - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("write"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":271 - * Writes the content of the specified C{buf} into this buffer. - * """ - * assert buf != NULL, 'buf cannot be NULL' # <<<<<<<<<<<<<< - * - * if size == 0: - */ - #ifndef PYREX_WITHOUT_ASSERTIONS - if (unlikely(!(__pyx_v_buf != NULL))) { - PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_2)); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #endif - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":273 - * assert buf != NULL, 'buf cannot be NULL' - * - * if size == 0: # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_t_1 = (__pyx_v_size == 0); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":274 - * - * if size == 0: - * return 0 # <<<<<<<<<<<<<< - * - * self._increase_buffer(size) - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":276 - * return 0 - * - * self._increase_buffer(size) # <<<<<<<<<<<<<< - * - * memcpy(self.buffer + self.pos, buf, size) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->_increase_buffer(__pyx_v_self, __pyx_v_size); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":278 - * self._increase_buffer(size) - * - * memcpy(self.buffer + self.pos, buf, size) # <<<<<<<<<<<<<< - * - * self.pos += size - */ - memcpy((__pyx_v_self->buffer + __pyx_v_self->pos), __pyx_v_buf, __pyx_v_size); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":280 - * memcpy(self.buffer + self.pos, buf, size) - * - * self.pos += size # <<<<<<<<<<<<<< - * - * if self.pos > self.length: - */ - __pyx_v_self->pos = (__pyx_v_self->pos + __pyx_v_size); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":282 - * self.pos += size - * - * if self.pos > self.length: # <<<<<<<<<<<<<< - * self.length = self.pos - * - */ - __pyx_t_1 = (__pyx_v_self->pos > __pyx_v_self->length); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":283 - * - * if self.pos > self.length: - * self.length = self.pos # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_v_self->length = __pyx_v_self->pos; - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":285 - * self.length = self.pos - * - * return 0 # <<<<<<<<<<<<<< - * - * cdef inline bint has_available(self, Py_ssize_t size): - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":287 - * return 0 - * - * cdef inline bint has_available(self, Py_ssize_t size): # <<<<<<<<<<<<<< - * if size == 0: - * return 1 - */ - -static CYTHON_INLINE int __pyx_f_6cpyamf_4util_19cBufferedByteStream_has_available(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, Py_ssize_t __pyx_v_size) { - int __pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("has_available"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":288 - * - * cdef inline bint has_available(self, Py_ssize_t size): - * if size == 0: # <<<<<<<<<<<<<< - * return 1 - * elif size < 0: - */ - __pyx_t_1 = (__pyx_v_size == 0); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":289 - * cdef inline bint has_available(self, Py_ssize_t size): - * if size == 0: - * return 1 # <<<<<<<<<<<<<< - * elif size < 0: - * return 0 - */ - __pyx_r = 1; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":290 - * if size == 0: - * return 1 - * elif size < 0: # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_t_1 = (__pyx_v_size < 0); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":291 - * return 1 - * elif size < 0: - * return 0 # <<<<<<<<<<<<<< - * - * if self.length == self.pos: - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":293 - * return 0 - * - * if self.length == self.pos: # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_t_1 = (__pyx_v_self->length == __pyx_v_self->pos); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":294 - * - * if self.length == self.pos: - * return 0 # <<<<<<<<<<<<<< - * - * if self.pos + size > self.length: - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":296 - * return 0 - * - * if self.pos + size > self.length: # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_t_1 = ((__pyx_v_self->pos + __pyx_v_size) > __pyx_v_self->length); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":297 - * - * if self.pos + size > self.length: - * return 0 # <<<<<<<<<<<<<< - * - * return 1 - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":299 - * return 0 - * - * return 1 # <<<<<<<<<<<<<< - * - * cdef int read(self, char **buf, Py_ssize_t size) except -1: - */ - __pyx_r = 1; - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":301 - * return 1 - * - * cdef int read(self, char **buf, Py_ssize_t size) except -1: # <<<<<<<<<<<<<< - * """ - * Reads up to the specified number of bytes from the stream into - */ - -static int __pyx_f_6cpyamf_4util_19cBufferedByteStream_read(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, char **__pyx_v_buf, Py_ssize_t __pyx_v_size) { - int __pyx_r; - int __pyx_t_1; - Py_ssize_t __pyx_t_2; - int __pyx_t_3; - __Pyx_RefNannySetupContext("read"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":308 - * Do not free the results or bad things will happen - * """ - * if size == -1: # <<<<<<<<<<<<<< - * size = self.remaining() - * - */ - __pyx_t_1 = (__pyx_v_size == -1); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":309 - * """ - * if size == -1: - * size = self.remaining() # <<<<<<<<<<<<<< - * - * if size == 0: - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->remaining(__pyx_v_self, 0); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_size = __pyx_t_2; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":311 - * size = self.remaining() - * - * if size == 0: # <<<<<<<<<<<<<< - * size = 1 - * - */ - __pyx_t_1 = (__pyx_v_size == 0); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":312 - * - * if size == 0: - * size = 1 # <<<<<<<<<<<<<< - * - * if not self.has_available(size): - */ - __pyx_v_size = 1; - goto __pyx_L4; - } - __pyx_L4:; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":314 - * size = 1 - * - * if not self.has_available(size): # <<<<<<<<<<<<<< - * raise IOError - * - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->has_available(__pyx_v_self, __pyx_v_size); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = (!__pyx_t_1); - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":315 - * - * if not self.has_available(size): - * raise IOError # <<<<<<<<<<<<<< - * - * buf[0] = self.buffer + self.pos - */ - __Pyx_Raise(__pyx_builtin_IOError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":317 - * raise IOError - * - * buf[0] = self.buffer + self.pos # <<<<<<<<<<<<<< - * - * self.pos += size - */ - (__pyx_v_buf[0]) = (__pyx_v_self->buffer + __pyx_v_self->pos); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":319 - * buf[0] = self.buffer + self.pos - * - * self.pos += size # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_v_self->pos = (__pyx_v_self->pos + __pyx_v_size); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":321 - * self.pos += size - * - * return 0 # <<<<<<<<<<<<<< - * - * cpdef inline bint at_eof(self) except -1: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.read"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":323 - * return 0 - * - * cpdef inline bint at_eof(self) except -1: # <<<<<<<<<<<<<< - * """ - * Returns C{True} if the internal pointer is at the end of the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_at_eof(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static CYTHON_INLINE int __pyx_f_6cpyamf_4util_19cBufferedByteStream_at_eof(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, int __pyx_skip_dispatch) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - __Pyx_RefNannySetupContext("at_eof"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__at_eof); 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); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_at_eof)) { - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":329 - * @rtype: C{bool} - * """ - * return self.length == self.pos # <<<<<<<<<<<<<< - * - * cpdef inline Py_ssize_t remaining(self) except -1: - */ - __pyx_r = (__pyx_v_self->length == __pyx_v_self->pos); - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.at_eof"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":323 - * return 0 - * - * cpdef inline bint at_eof(self) except -1: # <<<<<<<<<<<<<< - * """ - * Returns C{True} if the internal pointer is at the end of the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_at_eof(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_at_eof[] = "\n Returns C{True} if the internal pointer is at the end of the stream.\n\n @rtype: C{bool}\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_at_eof(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("at_eof"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->at_eof(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.at_eof"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":331 - * return self.length == self.pos - * - * cpdef inline Py_ssize_t remaining(self) except -1: # <<<<<<<<<<<<<< - * """ - * Returns number of remaining bytes. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_remaining(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static CYTHON_INLINE Py_ssize_t __pyx_f_6cpyamf_4util_19cBufferedByteStream_remaining(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, int __pyx_skip_dispatch) { - Py_ssize_t __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - __Pyx_RefNannySetupContext("remaining"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__remaining); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_remaining)) { - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":335 - * Returns number of remaining bytes. - * """ - * return self.length - self.pos # <<<<<<<<<<<<<< - * - * cpdef int seek(self, Py_ssize_t pos, int mode=0) except -1: - */ - __pyx_r = (__pyx_v_self->length - __pyx_v_self->pos); - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.remaining"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":331 - * return self.length == self.pos - * - * cpdef inline Py_ssize_t remaining(self) except -1: # <<<<<<<<<<<<<< - * """ - * Returns number of remaining bytes. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_remaining(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_remaining[] = "\n Returns number of remaining bytes.\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_remaining(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("remaining"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->remaining(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.remaining"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":337 - * return self.length - self.pos - * - * cpdef int seek(self, Py_ssize_t pos, int mode=0) except -1: # <<<<<<<<<<<<<< - * """ - * Sets the file-pointer offset, measured from the beginning of this stream, - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_seek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_f_6cpyamf_4util_19cBufferedByteStream_seek(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, Py_ssize_t __pyx_v_pos, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_seek *__pyx_optional_args) { - int __pyx_v_mode = ((int)0); - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - 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_t_7; - int __pyx_t_8; - __Pyx_RefNannySetupContext("seek"); - if (__pyx_optional_args) { - if (__pyx_optional_args->__pyx_n > 0) { - __pyx_v_mode = __pyx_optional_args->mode; - } - } - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__seek); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_seek)) { - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromLong(__pyx_v_mode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_5; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":354 - * - * self.pos += pos - * elif mode == 2: # <<<<<<<<<<<<<< - * if pos + self.length < 0 or pos + self.length > self.length: - * raise IOError - */ - switch (__pyx_v_mode) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":344 - * @param mode: mode 0: absolute; 1: relative; 2: relative to EOF - * """ - * if mode == 0: # <<<<<<<<<<<<<< - * if pos < 0 or pos > self.length: - * raise IOError - */ - case 0: - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":345 - * """ - * if mode == 0: - * if pos < 0 or pos > self.length: # <<<<<<<<<<<<<< - * raise IOError - * - */ - __pyx_t_6 = (__pyx_v_pos < 0); - if (!__pyx_t_6) { - __pyx_t_7 = (__pyx_v_pos > __pyx_v_self->length); - __pyx_t_8 = __pyx_t_7; - } else { - __pyx_t_8 = __pyx_t_6; - } - if (__pyx_t_8) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":346 - * if mode == 0: - * if pos < 0 or pos > self.length: - * raise IOError # <<<<<<<<<<<<<< - * - * self.pos = pos - */ - __Pyx_Raise(__pyx_builtin_IOError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":348 - * raise IOError - * - * self.pos = pos # <<<<<<<<<<<<<< - * elif mode == 1: - * if pos + self.pos < 0 or pos + self.pos > self.length: - */ - __pyx_v_self->pos = __pyx_v_pos; - break; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":349 - * - * self.pos = pos - * elif mode == 1: # <<<<<<<<<<<<<< - * if pos + self.pos < 0 or pos + self.pos > self.length: - * raise IOError - */ - case 1: - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":350 - * self.pos = pos - * elif mode == 1: - * if pos + self.pos < 0 or pos + self.pos > self.length: # <<<<<<<<<<<<<< - * raise IOError - * - */ - __pyx_t_8 = ((__pyx_v_pos + __pyx_v_self->pos) < 0); - if (!__pyx_t_8) { - __pyx_t_6 = ((__pyx_v_pos + __pyx_v_self->pos) > __pyx_v_self->length); - __pyx_t_7 = __pyx_t_6; - } else { - __pyx_t_7 = __pyx_t_8; - } - if (__pyx_t_7) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":351 - * elif mode == 1: - * if pos + self.pos < 0 or pos + self.pos > self.length: - * raise IOError # <<<<<<<<<<<<<< - * - * self.pos += pos - */ - __Pyx_Raise(__pyx_builtin_IOError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":353 - * raise IOError - * - * self.pos += pos # <<<<<<<<<<<<<< - * elif mode == 2: - * if pos + self.length < 0 or pos + self.length > self.length: - */ - __pyx_v_self->pos = (__pyx_v_self->pos + __pyx_v_pos); - break; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":354 - * - * self.pos += pos - * elif mode == 2: # <<<<<<<<<<<<<< - * if pos + self.length < 0 or pos + self.length > self.length: - * raise IOError - */ - case 2: - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":355 - * self.pos += pos - * elif mode == 2: - * if pos + self.length < 0 or pos + self.length > self.length: # <<<<<<<<<<<<<< - * raise IOError - * - */ - __pyx_t_7 = ((__pyx_v_pos + __pyx_v_self->length) < 0); - if (!__pyx_t_7) { - __pyx_t_8 = ((__pyx_v_pos + __pyx_v_self->length) > __pyx_v_self->length); - __pyx_t_6 = __pyx_t_8; - } else { - __pyx_t_6 = __pyx_t_7; - } - if (__pyx_t_6) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":356 - * elif mode == 2: - * if pos + self.length < 0 or pos + self.length > self.length: - * raise IOError # <<<<<<<<<<<<<< - * - * self.pos = self.length + pos - */ - __Pyx_Raise(__pyx_builtin_IOError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":358 - * raise IOError - * - * self.pos = self.length + pos # <<<<<<<<<<<<<< - * else: - * raise ValueError('Bad value for mode') - */ - __pyx_v_self->pos = (__pyx_v_self->length + __pyx_v_pos); - break; - default: - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":360 - * self.pos = self.length + pos - * else: - * raise ValueError('Bad value for mode') # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":362 - * raise ValueError('Bad value for mode') - * - * return 0 # <<<<<<<<<<<<<< - * - * cpdef object getvalue(self): - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __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("cpyamf.util.cBufferedByteStream.seek"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":337 - * return self.length - self.pos - * - * cpdef int seek(self, Py_ssize_t pos, int mode=0) except -1: # <<<<<<<<<<<<<< - * """ - * Sets the file-pointer offset, measured from the beginning of this stream, - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_seek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_seek[] = "\n Sets the file-pointer offset, measured from the beginning of this stream,\n at which the next write operation will occur.\n\n @param mode: mode 0: absolute; 1: relative; 2: relative to EOF\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_seek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - Py_ssize_t __pyx_v_pos; - int __pyx_v_mode; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_seek __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__pos,&__pyx_n_s__mode,0}; - __Pyx_RefNannySetupContext("seek"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - 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; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mode); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "seek") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_pos = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_pos == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - if (values[1]) { - __pyx_v_mode = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_mode = ((int)0); - } - } else { - __pyx_v_mode = ((int)0); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: __pyx_v_mode = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 1: __pyx_v_pos = __Pyx_PyIndex_AsSsize_t(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_pos == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("seek", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.seek"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_2.__pyx_n = 1; - __pyx_t_2.mode = __pyx_v_mode; - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->seek(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), __pyx_v_pos, 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.seek"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":364 - * return 0 - * - * cpdef object getvalue(self): # <<<<<<<<<<<<<< - * """ - * Get raw data from buffer. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_getvalue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_f_6cpyamf_4util_19cBufferedByteStream_getvalue(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, int __pyx_skip_dispatch) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("getvalue"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__getvalue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_getvalue)) { - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __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; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":368 - * Get raw data from buffer. - * """ - * return PyString_FromStringAndSize(self.buffer, self.length) # <<<<<<<<<<<<<< - * - * cdef Py_ssize_t peek(self, char **buf, Py_ssize_t size) except -1: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyString_FromStringAndSize(__pyx_v_self->buffer, __pyx_v_self->length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __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("cpyamf.util.cBufferedByteStream.getvalue"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":364 - * return 0 - * - * cpdef object getvalue(self): # <<<<<<<<<<<<<< - * """ - * Get raw data from buffer. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_getvalue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_getvalue[] = "\n Get raw data from buffer.\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_getvalue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("getvalue"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->getvalue(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.getvalue"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":370 - * return PyString_FromStringAndSize(self.buffer, self.length) - * - * cdef Py_ssize_t peek(self, char **buf, Py_ssize_t size) except -1: # <<<<<<<<<<<<<< - * """ - * Makes a pointer reference to the underlying buffer. Do NOT modify the - */ - -static Py_ssize_t __pyx_f_6cpyamf_4util_19cBufferedByteStream_peek(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, char **__pyx_v_buf, Py_ssize_t __pyx_v_size) { - Py_ssize_t __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("peek"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":375 - * returned value or free its contents. That would be seriously bad. - * """ - * if not self.has_available(size): # <<<<<<<<<<<<<< - * size = self.length - self.pos - * - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->has_available(__pyx_v_self, __pyx_v_size); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = (!__pyx_t_1); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":376 - * """ - * if not self.has_available(size): - * size = self.length - self.pos # <<<<<<<<<<<<<< - * - * buf[0] = self.buffer + self.pos - */ - __pyx_v_size = (__pyx_v_self->length - __pyx_v_self->pos); - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":378 - * size = self.length - self.pos - * - * buf[0] = self.buffer + self.pos # <<<<<<<<<<<<<< - * - * return size - */ - (__pyx_v_buf[0]) = (__pyx_v_self->buffer + __pyx_v_self->pos); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":380 - * buf[0] = self.buffer + self.pos - * - * return size # <<<<<<<<<<<<<< - * - * cpdef int truncate(self, Py_ssize_t size=0) except -1: - */ - __pyx_r = __pyx_v_size; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.peek"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":382 - * return size - * - * cpdef int truncate(self, Py_ssize_t size=0) except -1: # <<<<<<<<<<<<<< - * """ - * Truncates the stream to the specified length. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_f_6cpyamf_4util_19cBufferedByteStream_truncate(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_truncate *__pyx_optional_args) { - Py_ssize_t __pyx_v_size = ((Py_ssize_t)0); - char *__pyx_v_buf; - Py_ssize_t __pyx_v_cur_pos; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6; - struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_seek __pyx_t_7; - __Pyx_RefNannySetupContext("truncate"); - if (__pyx_optional_args) { - if (__pyx_optional_args->__pyx_n > 0) { - __pyx_v_size = __pyx_optional_args->size; - } - } - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__truncate); 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); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_truncate)) { - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_size); 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_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__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 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); 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_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__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_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":389 - * @type size: C{int} - * """ - * if size > self.length: # <<<<<<<<<<<<<< - * raise IOError - * - */ - __pyx_t_5 = (__pyx_v_size > __pyx_v_self->length); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":390 - * """ - * if size > self.length: - * raise IOError # <<<<<<<<<<<<<< - * - * if size == 0: - */ - __Pyx_Raise(__pyx_builtin_IOError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":392 - * raise IOError - * - * if size == 0: # <<<<<<<<<<<<<< - * return self._init_buffer() - * - */ - __pyx_t_5 = (__pyx_v_size == 0); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":393 - * - * if size == 0: - * return self._init_buffer() # <<<<<<<<<<<<<< - * - * cdef char *buf = NULL - */ - __pyx_r = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->_init_buffer(__pyx_v_self); - goto __pyx_L0; - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":395 - * return self._init_buffer() - * - * cdef char *buf = NULL # <<<<<<<<<<<<<< - * cdef Py_ssize_t cur_pos = self.pos - * - */ - __pyx_v_buf = NULL; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":396 - * - * cdef char *buf = NULL - * cdef Py_ssize_t cur_pos = self.pos # <<<<<<<<<<<<<< - * - * buf = malloc(self.length) - */ - __pyx_v_cur_pos = __pyx_v_self->pos; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":398 - * cdef Py_ssize_t cur_pos = self.pos - * - * buf = malloc(self.length) # <<<<<<<<<<<<<< - * - * if buf == NULL: - */ - __pyx_v_buf = ((char *)malloc(__pyx_v_self->length)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":400 - * buf = malloc(self.length) - * - * if buf == NULL: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * - */ - __pyx_t_5 = (__pyx_v_buf == NULL); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":401 - * - * if buf == NULL: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * - * memcpy(buf, self.buffer, self.length) - */ - __pyx_t_6 = PyErr_NoMemory(); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":403 - * PyErr_NoMemory() - * - * memcpy(buf, self.buffer, self.length) # <<<<<<<<<<<<<< - * - * try: - */ - memcpy(__pyx_v_buf, __pyx_v_self->buffer, __pyx_v_self->length); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":405 - * memcpy(buf, self.buffer, self.length) - * - * try: # <<<<<<<<<<<<<< - * self._init_buffer() - * - */ - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":406 - * - * try: - * self._init_buffer() # <<<<<<<<<<<<<< - * - * self.write(buf, size) - */ - ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->_init_buffer(__pyx_v_self); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":408 - * self._init_buffer() - * - * self.write(buf, size) # <<<<<<<<<<<<<< - * finally: - * free(buf) - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->write(__pyx_v_self, __pyx_v_buf, __pyx_v_size); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L7;} - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":410 - * self.write(buf, size) - * finally: - * free(buf) # <<<<<<<<<<<<<< - * - * if self.length > cur_pos: - */ - /*finally:*/ { - int __pyx_why; - PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; - int __pyx_exc_lineno; - __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 0; goto __pyx_L8; - __pyx_L7: { - __pyx_why = 4; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); - __pyx_exc_lineno = __pyx_lineno; - goto __pyx_L8; - } - __pyx_L8:; - free(__pyx_v_buf); - switch (__pyx_why) { - case 4: { - __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); - __pyx_lineno = __pyx_exc_lineno; - __pyx_exc_type = 0; - __pyx_exc_value = 0; - __pyx_exc_tb = 0; - goto __pyx_L1_error; - } - } - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":412 - * free(buf) - * - * if self.length > cur_pos: # <<<<<<<<<<<<<< - * self.pos = self.length - * else: - */ - __pyx_t_5 = (__pyx_v_self->length > __pyx_v_cur_pos); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":413 - * - * if self.length > cur_pos: - * self.pos = self.length # <<<<<<<<<<<<<< - * else: - * self.seek(cur_pos, 0) - */ - __pyx_v_self->pos = __pyx_v_self->length; - goto __pyx_L10; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":415 - * self.pos = self.length - * else: - * self.seek(cur_pos, 0) # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_7.__pyx_n = 1; - __pyx_t_7.mode = 0; - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->seek(__pyx_v_self, __pyx_v_cur_pos, 0, &__pyx_t_7); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L10:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":417 - * self.seek(cur_pos, 0) - * - * return 0 # <<<<<<<<<<<<<< - * - * cpdef int consume(self) except -1: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.truncate"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":382 - * return size - * - * cpdef int truncate(self, Py_ssize_t size=0) except -1: # <<<<<<<<<<<<<< - * """ - * Truncates the stream to the specified length. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_truncate[] = "\n Truncates the stream to the specified length.\n\n @param size: The length of the stream, in bytes.\n @type size: C{int}\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - Py_ssize_t __pyx_v_size; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_truncate __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0}; - __Pyx_RefNannySetupContext("truncate"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[1] = {0}; - 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; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); - if (value) { values[0] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "truncate") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - if (values[0]) { - __pyx_v_size = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_size == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_size = ((Py_ssize_t)0); - } - } else { - __pyx_v_size = ((Py_ssize_t)0); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 1: __pyx_v_size = __Pyx_PyIndex_AsSsize_t(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_size == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("truncate", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.truncate"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_2.__pyx_n = 1; - __pyx_t_2.size = __pyx_v_size; - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->truncate(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromLong(__pyx_t_1); 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_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.truncate"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":419 - * return 0 - * - * cpdef int consume(self) except -1: # <<<<<<<<<<<<<< - * """ - * Chops the tail off the stream starting at 0 and ending at C{tell()}. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_consume(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static int __pyx_f_6cpyamf_4util_19cBufferedByteStream_consume(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, int __pyx_skip_dispatch) { - char *__pyx_v_buf; - char *__pyx_v_peek_buf; - Py_ssize_t __pyx_v_size; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - Py_ssize_t __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6; - __Pyx_RefNannySetupContext("consume"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__consume); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_consume)) { - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":424 - * The stream pointer is set to 0 at the end of this function. - * """ - * cdef char *buf = NULL # <<<<<<<<<<<<<< - * cdef char *peek_buf - * cdef Py_ssize_t size = self.remaining() - */ - __pyx_v_buf = NULL; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":426 - * cdef char *buf = NULL - * cdef char *peek_buf - * cdef Py_ssize_t size = self.remaining() # <<<<<<<<<<<<<< - * - * if size > 0: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->remaining(__pyx_v_self, 0); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_size = __pyx_t_4; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":428 - * cdef Py_ssize_t size = self.remaining() - * - * if size > 0: # <<<<<<<<<<<<<< - * size = self.peek(&peek_buf, size) - * buf = malloc(size) - */ - __pyx_t_5 = (__pyx_v_size > 0); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":429 - * - * if size > 0: - * size = self.peek(&peek_buf, size) # <<<<<<<<<<<<<< - * buf = malloc(size) - * - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->peek(__pyx_v_self, (&__pyx_v_peek_buf), __pyx_v_size); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_size = __pyx_t_4; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":430 - * if size > 0: - * size = self.peek(&peek_buf, size) - * buf = malloc(size) # <<<<<<<<<<<<<< - * - * if buf == NULL: - */ - __pyx_v_buf = ((char *)malloc(__pyx_v_size)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":432 - * buf = malloc(size) - * - * if buf == NULL: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * - */ - __pyx_t_5 = (__pyx_v_buf == NULL); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":433 - * - * if buf == NULL: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * - * memcpy(buf, peek_buf, size) - */ - __pyx_t_6 = PyErr_NoMemory(); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":435 - * PyErr_NoMemory() - * - * memcpy(buf, peek_buf, size) # <<<<<<<<<<<<<< - * - * try: - */ - memcpy(__pyx_v_buf, __pyx_v_peek_buf, __pyx_v_size); - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":437 - * memcpy(buf, peek_buf, size) - * - * try: # <<<<<<<<<<<<<< - * self._init_buffer() - * - */ - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":438 - * - * try: - * self._init_buffer() # <<<<<<<<<<<<<< - * - * if size > 0: - */ - ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->_init_buffer(__pyx_v_self); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":440 - * self._init_buffer() - * - * if size > 0: # <<<<<<<<<<<<<< - * self.write(buf, size) - * finally: - */ - __pyx_t_5 = (__pyx_v_size > 0); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":441 - * - * if size > 0: - * self.write(buf, size) # <<<<<<<<<<<<<< - * finally: - * free(buf) - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->write(__pyx_v_self, __pyx_v_buf, __pyx_v_size); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L6;} - goto __pyx_L8; - } - __pyx_L8:; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":443 - * self.write(buf, size) - * finally: - * free(buf) # <<<<<<<<<<<<<< - * - * self.pos = 0 - */ - /*finally:*/ { - int __pyx_why; - PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; - int __pyx_exc_lineno; - __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 0; goto __pyx_L7; - __pyx_L6: { - __pyx_why = 4; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); - __pyx_exc_lineno = __pyx_lineno; - goto __pyx_L7; - } - __pyx_L7:; - free(__pyx_v_buf); - switch (__pyx_why) { - case 4: { - __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); - __pyx_lineno = __pyx_exc_lineno; - __pyx_exc_type = 0; - __pyx_exc_value = 0; - __pyx_exc_tb = 0; - goto __pyx_L1_error; - } - } - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":445 - * free(buf) - * - * self.pos = 0 # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_v_self->pos = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":447 - * self.pos = 0 - * - * return 0 # <<<<<<<<<<<<<< - * - * cdef int unpack_int(self, unsigned int num_bytes, void *ret) except -1: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.consume"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":419 - * return 0 - * - * cpdef int consume(self) except -1: # <<<<<<<<<<<<<< - * """ - * Chops the tail off the stream starting at 0 and ending at C{tell()}. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_consume(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_consume[] = "\n Chops the tail off the stream starting at 0 and ending at C{tell()}.\n The stream pointer is set to 0 at the end of this function.\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_consume(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("consume"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->consume(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.consume"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":449 - * return 0 - * - * cdef int unpack_int(self, unsigned int num_bytes, void *ret) except -1: # <<<<<<<<<<<<<< - * """ - * Unpacks a long from C{buf}. - */ - -static int __pyx_f_6cpyamf_4util_19cBufferedByteStream_unpack_int(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, unsigned int __pyx_v_num_bytes, void *__pyx_v_ret) { - Py_ssize_t __pyx_v_nb; - unsigned long __pyx_v_x; - unsigned char *__pyx_v_bytes; - int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - unsigned int __pyx_t_4; - __Pyx_RefNannySetupContext("unpack_int"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":455 - * cdef Py_ssize_t nb - * - * if num_bytes > 4: # <<<<<<<<<<<<<< - * raise ValueError('Max 4 bytes to unpack') - * - */ - __pyx_t_1 = (__pyx_v_num_bytes > 4); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":456 - * - * if num_bytes > 4: - * raise ValueError('Max 4 bytes to unpack') # <<<<<<<<<<<<<< - * - * if not self.has_available(num_bytes): - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":458 - * raise ValueError('Max 4 bytes to unpack') - * - * if not self.has_available(num_bytes): # <<<<<<<<<<<<<< - * raise IOError - * - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->has_available(__pyx_v_self, __pyx_v_num_bytes); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = (!__pyx_t_1); - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":459 - * - * if not self.has_available(num_bytes): - * raise IOError # <<<<<<<<<<<<<< - * - * cdef unsigned long x = 0 - */ - __Pyx_Raise(__pyx_builtin_IOError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":461 - * raise IOError - * - * cdef unsigned long x = 0 # <<<<<<<<<<<<<< - * cdef unsigned char *bytes = (self.buffer + self.pos) - * - */ - __pyx_v_x = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":462 - * - * cdef unsigned long x = 0 - * cdef unsigned char *bytes = (self.buffer + self.pos) # <<<<<<<<<<<<<< - * - * if is_big_endian(self.endian): - */ - __pyx_v_bytes = ((unsigned char *)(__pyx_v_self->buffer + __pyx_v_self->pos)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":464 - * cdef unsigned char *bytes = (self.buffer + self.pos) - * - * if is_big_endian(self.endian): # <<<<<<<<<<<<<< - * for 0 <= nb < num_bytes: - * x = (x << 8) | bytes[nb] - */ - __pyx_t_3 = __pyx_f_6cpyamf_4util_is_big_endian(__pyx_v_self->endian); - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":465 - * - * if is_big_endian(self.endian): - * for 0 <= nb < num_bytes: # <<<<<<<<<<<<<< - * x = (x << 8) | bytes[nb] - * else: - */ - __pyx_t_4 = __pyx_v_num_bytes; - for (__pyx_v_nb = 0; __pyx_v_nb < __pyx_t_4; __pyx_v_nb++) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":466 - * if is_big_endian(self.endian): - * for 0 <= nb < num_bytes: - * x = (x << 8) | bytes[nb] # <<<<<<<<<<<<<< - * else: - * for 0 <= nb < num_bytes: - */ - __pyx_v_x = ((__pyx_v_x << 8) | (__pyx_v_bytes[__pyx_v_nb])); - } - goto __pyx_L5; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":468 - * x = (x << 8) | bytes[nb] - * else: - * for 0 <= nb < num_bytes: # <<<<<<<<<<<<<< - * x = (x << 8) | bytes[num_bytes - nb - 1] - * - */ - __pyx_t_4 = __pyx_v_num_bytes; - for (__pyx_v_nb = 0; __pyx_v_nb < __pyx_t_4; __pyx_v_nb++) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":469 - * else: - * for 0 <= nb < num_bytes: - * x = (x << 8) | bytes[num_bytes - nb - 1] # <<<<<<<<<<<<<< - * - * self.pos += num_bytes - */ - __pyx_v_x = ((__pyx_v_x << 8) | (__pyx_v_bytes[((__pyx_v_num_bytes - __pyx_v_nb) - 1)])); - } - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":471 - * x = (x << 8) | bytes[num_bytes - nb - 1] - * - * self.pos += num_bytes # <<<<<<<<<<<<<< - * memcpy(ret, &x, num_bytes) - * - */ - __pyx_v_self->pos = (__pyx_v_self->pos + __pyx_v_num_bytes); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":472 - * - * self.pos += num_bytes - * memcpy(ret, &x, num_bytes) # <<<<<<<<<<<<<< - * - * return 0 - */ - memcpy(__pyx_v_ret, (&__pyx_v_x), __pyx_v_num_bytes); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":474 - * memcpy(ret, &x, num_bytes) - * - * return 0 # <<<<<<<<<<<<<< - * - * cdef int pack_int(self, int num_bytes, long x) except -1: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.unpack_int"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":476 - * return 0 - * - * cdef int pack_int(self, int num_bytes, long x) except -1: # <<<<<<<<<<<<<< - * """ - * Packs a long. - */ - -static int __pyx_f_6cpyamf_4util_19cBufferedByteStream_pack_int(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, int __pyx_v_num_bytes, long __pyx_v_x) { - long __pyx_v_maxint; - long __pyx_v_minint; - char *__pyx_v_buf; - long __pyx_v_i; - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5; - int __pyx_t_6; - __Pyx_RefNannySetupContext("pack_int"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":482 - * @raise OverflowError: integer out of range - * """ - * cdef long maxint = 1 # <<<<<<<<<<<<<< - * cdef long minint = -1 - * - */ - __pyx_v_maxint = 1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":483 - * """ - * cdef long maxint = 1 - * cdef long minint = -1 # <<<<<<<<<<<<<< - * - * if num_bytes != SIZEOF_LONG: - */ - __pyx_v_minint = -1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":485 - * cdef long minint = -1 - * - * if num_bytes != SIZEOF_LONG: # <<<<<<<<<<<<<< - * maxint = (maxint << (num_bytes * 8 - 1)) - 1 - * minint = (-maxint) - 1 - */ - __pyx_t_1 = (__pyx_v_num_bytes != SIZEOF_LONG); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":486 - * - * if num_bytes != SIZEOF_LONG: - * maxint = (maxint << (num_bytes * 8 - 1)) - 1 # <<<<<<<<<<<<<< - * minint = (-maxint) - 1 - * - */ - __pyx_v_maxint = ((__pyx_v_maxint << ((__pyx_v_num_bytes * 8) - 1)) - 1); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":487 - * if num_bytes != SIZEOF_LONG: - * maxint = (maxint << (num_bytes * 8 - 1)) - 1 - * minint = (-maxint) - 1 # <<<<<<<<<<<<<< - * - * if x > maxint or x < minint: - */ - __pyx_v_minint = ((-__pyx_v_maxint) - 1); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":489 - * minint = (-maxint) - 1 - * - * if x > maxint or x < minint: # <<<<<<<<<<<<<< - * raise OverflowError('integer out of range') - * - */ - __pyx_t_1 = (__pyx_v_x > __pyx_v_maxint); - if (!__pyx_t_1) { - __pyx_t_2 = (__pyx_v_x < __pyx_v_minint); - __pyx_t_3 = __pyx_t_2; - } else { - __pyx_t_3 = __pyx_t_1; - } - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":490 - * - * if x > maxint or x < minint: - * raise OverflowError('integer out of range') # <<<<<<<<<<<<<< - * - * cdef char *buf = malloc(num_bytes) - */ - __pyx_t_4 = PyObject_Call(__pyx_builtin_OverflowError, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":492 - * raise OverflowError('integer out of range') - * - * cdef char *buf = malloc(num_bytes) # <<<<<<<<<<<<<< - * - * if buf == NULL: - */ - __pyx_v_buf = ((char *)malloc(__pyx_v_num_bytes)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":494 - * cdef char *buf = malloc(num_bytes) - * - * if buf == NULL: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * - */ - __pyx_t_3 = (__pyx_v_buf == NULL); - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":495 - * - * if buf == NULL: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * - * cdef long i = num_bytes - */ - __pyx_t_5 = PyErr_NoMemory(); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":497 - * PyErr_NoMemory() - * - * cdef long i = num_bytes # <<<<<<<<<<<<<< - * - * if is_big_endian(self.endian): - */ - __pyx_v_i = __pyx_v_num_bytes; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":499 - * cdef long i = num_bytes - * - * if is_big_endian(self.endian): # <<<<<<<<<<<<<< - * while i > 0: - * i -= 1 - */ - __pyx_t_3 = __pyx_f_6cpyamf_4util_is_big_endian(__pyx_v_self->endian); - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":500 - * - * if is_big_endian(self.endian): - * while i > 0: # <<<<<<<<<<<<<< - * i -= 1 - * buf[i] = x - */ - while (1) { - __pyx_t_3 = (__pyx_v_i > 0); - if (!__pyx_t_3) break; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":501 - * if is_big_endian(self.endian): - * while i > 0: - * i -= 1 # <<<<<<<<<<<<<< - * buf[i] = x - * x >>= 8 - */ - __pyx_v_i = (__pyx_v_i - 1); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":502 - * while i > 0: - * i -= 1 - * buf[i] = x # <<<<<<<<<<<<<< - * x >>= 8 - * else: - */ - (__pyx_v_buf[__pyx_v_i]) = ((char)__pyx_v_x); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":503 - * i -= 1 - * buf[i] = x - * x >>= 8 # <<<<<<<<<<<<<< - * else: - * while i > 0: - */ - __pyx_v_x = (__pyx_v_x >> 8); - } - goto __pyx_L6; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":505 - * x >>= 8 - * else: - * while i > 0: # <<<<<<<<<<<<<< - * buf[num_bytes - i] = x - * i -= 1 - */ - while (1) { - __pyx_t_3 = (__pyx_v_i > 0); - if (!__pyx_t_3) break; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":506 - * else: - * while i > 0: - * buf[num_bytes - i] = x # <<<<<<<<<<<<<< - * i -= 1 - * x >>= 8 - */ - (__pyx_v_buf[(__pyx_v_num_bytes - __pyx_v_i)]) = ((char)__pyx_v_x); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":507 - * while i > 0: - * buf[num_bytes - i] = x - * i -= 1 # <<<<<<<<<<<<<< - * x >>= 8 - * - */ - __pyx_v_i = (__pyx_v_i - 1); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":508 - * buf[num_bytes - i] = x - * i -= 1 - * x >>= 8 # <<<<<<<<<<<<<< - * - * try: - */ - __pyx_v_x = (__pyx_v_x >> 8); - } - } - __pyx_L6:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":510 - * x >>= 8 - * - * try: # <<<<<<<<<<<<<< - * self.write(buf, num_bytes) - * finally: - */ - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":511 - * - * try: - * self.write(buf, num_bytes) # <<<<<<<<<<<<<< - * finally: - * free(buf) - */ - __pyx_t_6 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->write(__pyx_v_self, __pyx_v_buf, __pyx_v_num_bytes); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L12;} - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":513 - * self.write(buf, num_bytes) - * finally: - * free(buf) # <<<<<<<<<<<<<< - * - * return 0 - */ - /*finally:*/ { - int __pyx_why; - PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; - int __pyx_exc_lineno; - __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 0; goto __pyx_L13; - __pyx_L12: { - __pyx_why = 4; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); - __pyx_exc_lineno = __pyx_lineno; - goto __pyx_L13; - } - __pyx_L13:; - free(__pyx_v_buf); - switch (__pyx_why) { - case 4: { - __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); - __pyx_lineno = __pyx_exc_lineno; - __pyx_exc_type = 0; - __pyx_exc_value = 0; - __pyx_exc_tb = 0; - goto __pyx_L1_error; - } - } - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":515 - * free(buf) - * - * return 0 # <<<<<<<<<<<<<< - * - * cdef int pack_uint(self, int num_bytes, unsigned long x) except -1: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.pack_int"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":517 - * return 0 - * - * cdef int pack_uint(self, int num_bytes, unsigned long x) except -1: # <<<<<<<<<<<<<< - * """ - * Packs an unsigned long into a buffer. - */ - -static int __pyx_f_6cpyamf_4util_19cBufferedByteStream_pack_uint(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, int __pyx_v_num_bytes, unsigned long __pyx_v_x) { - unsigned long __pyx_v_maxint; - char *__pyx_v_buf; - long __pyx_v_i; - int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("pack_uint"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":523 - * @raise OverflowError: integer out of range - * """ - * cdef unsigned long maxint = 1 # <<<<<<<<<<<<<< - * - * if num_bytes != SIZEOF_LONG: - */ - __pyx_v_maxint = 1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":525 - * cdef unsigned long maxint = 1 - * - * if num_bytes != SIZEOF_LONG: # <<<<<<<<<<<<<< - * maxint <<= (num_bytes * 8) - * - */ - __pyx_t_1 = (__pyx_v_num_bytes != SIZEOF_LONG); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":526 - * - * if num_bytes != SIZEOF_LONG: - * maxint <<= (num_bytes * 8) # <<<<<<<<<<<<<< - * - * if x >= maxint: - */ - __pyx_v_maxint = (__pyx_v_maxint << ((unsigned long)(__pyx_v_num_bytes * 8))); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":528 - * maxint <<= (num_bytes * 8) - * - * if x >= maxint: # <<<<<<<<<<<<<< - * raise OverflowError('integer out of range') - * - */ - __pyx_t_1 = (__pyx_v_x >= __pyx_v_maxint); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":529 - * - * if x >= maxint: - * raise OverflowError('integer out of range') # <<<<<<<<<<<<<< - * - * cdef char *buf = malloc(num_bytes) - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_OverflowError, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":531 - * raise OverflowError('integer out of range') - * - * cdef char *buf = malloc(num_bytes) # <<<<<<<<<<<<<< - * - * if buf == NULL: - */ - __pyx_v_buf = ((char *)malloc(__pyx_v_num_bytes)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":533 - * cdef char *buf = malloc(num_bytes) - * - * if buf == NULL: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * - */ - __pyx_t_1 = (__pyx_v_buf == NULL); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":534 - * - * if buf == NULL: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * - * cdef long i = num_bytes - */ - __pyx_t_3 = PyErr_NoMemory(); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":536 - * PyErr_NoMemory() - * - * cdef long i = num_bytes # <<<<<<<<<<<<<< - * - * if is_big_endian(self.endian): - */ - __pyx_v_i = __pyx_v_num_bytes; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":538 - * cdef long i = num_bytes - * - * if is_big_endian(self.endian): # <<<<<<<<<<<<<< - * while i > 0: - * i -= 1 - */ - __pyx_t_1 = __pyx_f_6cpyamf_4util_is_big_endian(__pyx_v_self->endian); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":539 - * - * if is_big_endian(self.endian): - * while i > 0: # <<<<<<<<<<<<<< - * i -= 1 - * buf[i] = x - */ - while (1) { - __pyx_t_1 = (__pyx_v_i > 0); - if (!__pyx_t_1) break; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":540 - * if is_big_endian(self.endian): - * while i > 0: - * i -= 1 # <<<<<<<<<<<<<< - * buf[i] = x - * x >>= 8 - */ - __pyx_v_i = (__pyx_v_i - 1); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":541 - * while i > 0: - * i -= 1 - * buf[i] = x # <<<<<<<<<<<<<< - * x >>= 8 - * else: - */ - (__pyx_v_buf[__pyx_v_i]) = ((char)__pyx_v_x); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":542 - * i -= 1 - * buf[i] = x - * x >>= 8 # <<<<<<<<<<<<<< - * else: - * while i > 0: - */ - __pyx_v_x = (__pyx_v_x >> 8); - } - goto __pyx_L6; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":544 - * x >>= 8 - * else: - * while i > 0: # <<<<<<<<<<<<<< - * buf[num_bytes - i] = x - * i -= 1 - */ - while (1) { - __pyx_t_1 = (__pyx_v_i > 0); - if (!__pyx_t_1) break; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":545 - * else: - * while i > 0: - * buf[num_bytes - i] = x # <<<<<<<<<<<<<< - * i -= 1 - * x >>= 8 - */ - (__pyx_v_buf[(__pyx_v_num_bytes - __pyx_v_i)]) = ((char)__pyx_v_x); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":546 - * while i > 0: - * buf[num_bytes - i] = x - * i -= 1 # <<<<<<<<<<<<<< - * x >>= 8 - * - */ - __pyx_v_i = (__pyx_v_i - 1); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":547 - * buf[num_bytes - i] = x - * i -= 1 - * x >>= 8 # <<<<<<<<<<<<<< - * - * try: - */ - __pyx_v_x = (__pyx_v_x >> 8); - } - } - __pyx_L6:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":549 - * x >>= 8 - * - * try: # <<<<<<<<<<<<<< - * self.write(buf, num_bytes) - * finally: - */ - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":550 - * - * try: - * self.write(buf, num_bytes) # <<<<<<<<<<<<<< - * finally: - * free(buf) - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->write(__pyx_v_self, __pyx_v_buf, __pyx_v_num_bytes); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L12;} - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":552 - * self.write(buf, num_bytes) - * finally: - * free(buf) # <<<<<<<<<<<<<< - * - * return 0 - */ - /*finally:*/ { - int __pyx_why; - PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; - int __pyx_exc_lineno; - __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 0; goto __pyx_L13; - __pyx_L12: { - __pyx_why = 4; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); - __pyx_exc_lineno = __pyx_lineno; - goto __pyx_L13; - } - __pyx_L13:; - free(__pyx_v_buf); - switch (__pyx_why) { - case 4: { - __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); - __pyx_lineno = __pyx_exc_lineno; - __pyx_exc_type = 0; - __pyx_exc_value = 0; - __pyx_exc_tb = 0; - goto __pyx_L1_error; - } - } - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":554 - * free(buf) - * - * return 0 # <<<<<<<<<<<<<< - * - * cpdef unsigned char read_uchar(self) except? 0: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.pack_uint"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":556 - * return 0 - * - * cpdef unsigned char read_uchar(self) except? 0: # <<<<<<<<<<<<<< - * """ - * Reads an C{unsigned char} from the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_uchar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static unsigned char __pyx_f_6cpyamf_4util_19cBufferedByteStream_read_uchar(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, int __pyx_skip_dispatch) { - unsigned char __pyx_v_ch; - unsigned char __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - unsigned char __pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("read_uchar"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_uchar); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_uchar)) { - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_AsUnsignedChar(__pyx_t_2); if (unlikely((__pyx_t_3 == (unsigned char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":560 - * Reads an C{unsigned char} from the stream. - * """ - * cdef unsigned char ch = 0 # <<<<<<<<<<<<<< - * - * self.unpack_int(1, &ch) - */ - __pyx_v_ch = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":562 - * cdef unsigned char ch = 0 - * - * self.unpack_int(1, &ch) # <<<<<<<<<<<<<< - * - * return ch - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->unpack_int(__pyx_v_self, 1, (&__pyx_v_ch)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":564 - * self.unpack_int(1, &ch) - * - * return ch # <<<<<<<<<<<<<< - * - * cpdef char read_char(self) except? 0: - */ - __pyx_r = __pyx_v_ch; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.read_uchar"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":556 - * return 0 - * - * cpdef unsigned char read_uchar(self) except? 0: # <<<<<<<<<<<<<< - * """ - * Reads an C{unsigned char} from the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_uchar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_read_uchar[] = "\n Reads an C{unsigned char} from the stream.\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_uchar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - unsigned char __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("read_uchar"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->read_uchar(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), 1); if (unlikely(__pyx_t_1 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.read_uchar"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":566 - * return ch - * - * cpdef char read_char(self) except? 0: # <<<<<<<<<<<<<< - * """ - * Reads a C{char} from the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_char(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_f_6cpyamf_4util_19cBufferedByteStream_read_char(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, int __pyx_skip_dispatch) { - char __pyx_v_ch; - char __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - char __pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("read_char"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_char); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_char)) { - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_AsChar(__pyx_t_2); if (unlikely((__pyx_t_3 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":570 - * Reads a C{char} from the stream. - * """ - * cdef char ch = 0 # <<<<<<<<<<<<<< - * - * self.unpack_int(1, &ch) - */ - __pyx_v_ch = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":572 - * cdef char ch = 0 - * - * self.unpack_int(1, &ch) # <<<<<<<<<<<<<< - * - * return ch - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->unpack_int(__pyx_v_self, 1, (&__pyx_v_ch)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":574 - * self.unpack_int(1, &ch) - * - * return ch # <<<<<<<<<<<<<< - * - * cpdef unsigned short read_ushort(self) except? 0: - */ - __pyx_r = __pyx_v_ch; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.read_char"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":566 - * return ch - * - * cpdef char read_char(self) except? 0: # <<<<<<<<<<<<<< - * """ - * Reads a C{char} from the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_char(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_read_char[] = "\n Reads a C{char} from the stream.\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_char(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - char __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("read_char"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->read_char(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), 1); if (unlikely(__pyx_t_1 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.read_char"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":576 - * return ch - * - * cpdef unsigned short read_ushort(self) except? 0: # <<<<<<<<<<<<<< - * """ - * Reads a 2 byte unsigned integer from the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_ushort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static unsigned short __pyx_f_6cpyamf_4util_19cBufferedByteStream_read_ushort(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, int __pyx_skip_dispatch) { - unsigned short __pyx_v_x; - unsigned short __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - unsigned short __pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("read_ushort"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_ushort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_ushort)) { - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_AsUnsignedShort(__pyx_t_2); if (unlikely((__pyx_t_3 == (unsigned short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":580 - * Reads a 2 byte unsigned integer from the stream. - * """ - * cdef unsigned short x = 0 # <<<<<<<<<<<<<< - * - * self.unpack_int(2, &x) - */ - __pyx_v_x = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":582 - * cdef unsigned short x = 0 - * - * self.unpack_int(2, &x) # <<<<<<<<<<<<<< - * - * return x - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->unpack_int(__pyx_v_self, 2, (&__pyx_v_x)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":584 - * self.unpack_int(2, &x) - * - * return x # <<<<<<<<<<<<<< - * - * cpdef short read_short(self) except? 0: - */ - __pyx_r = __pyx_v_x; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.read_ushort"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":576 - * return ch - * - * cpdef unsigned short read_ushort(self) except? 0: # <<<<<<<<<<<<<< - * """ - * Reads a 2 byte unsigned integer from the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_ushort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_read_ushort[] = "\n Reads a 2 byte unsigned integer from the stream.\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_ushort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - unsigned short __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("read_ushort"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->read_ushort(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), 1); if (unlikely(__pyx_t_1 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.read_ushort"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":586 - * return x - * - * cpdef short read_short(self) except? 0: # <<<<<<<<<<<<<< - * """ - * Reads a 2 byte integer from the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_short(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static short __pyx_f_6cpyamf_4util_19cBufferedByteStream_read_short(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, int __pyx_skip_dispatch) { - short __pyx_v_x; - short __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - short __pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("read_short"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_short); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_short)) { - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_AsShort(__pyx_t_2); if (unlikely((__pyx_t_3 == (short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":590 - * Reads a 2 byte integer from the stream. - * """ - * cdef short x = 0 # <<<<<<<<<<<<<< - * - * self.unpack_int(2, &x) - */ - __pyx_v_x = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":592 - * cdef short x = 0 - * - * self.unpack_int(2, &x) # <<<<<<<<<<<<<< - * - * return x - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->unpack_int(__pyx_v_self, 2, (&__pyx_v_x)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":594 - * self.unpack_int(2, &x) - * - * return x # <<<<<<<<<<<<<< - * - * cpdef unsigned long read_24bit_uint(self) except? 0: - */ - __pyx_r = __pyx_v_x; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.read_short"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":586 - * return x - * - * cpdef short read_short(self) except? 0: # <<<<<<<<<<<<<< - * """ - * Reads a 2 byte integer from the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_short(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_read_short[] = "\n Reads a 2 byte integer from the stream.\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_short(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - short __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("read_short"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->read_short(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), 1); if (unlikely(__pyx_t_1 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.read_short"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":596 - * return x - * - * cpdef unsigned long read_24bit_uint(self) except? 0: # <<<<<<<<<<<<<< - * """ - * Reads a 24 bit unsigned integer from the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_24bit_uint(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static unsigned long __pyx_f_6cpyamf_4util_19cBufferedByteStream_read_24bit_uint(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, int __pyx_skip_dispatch) { - unsigned long __pyx_v_x; - unsigned long __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - unsigned long __pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("read_24bit_uint"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_24bit_uint); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_24bit_uint)) { - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_AsUnsignedLong(__pyx_t_2); if (unlikely((__pyx_t_3 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":600 - * Reads a 24 bit unsigned integer from the stream. - * """ - * cdef unsigned long x = 0 # <<<<<<<<<<<<<< - * - * self.unpack_int(3, &x) - */ - __pyx_v_x = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":602 - * cdef unsigned long x = 0 - * - * self.unpack_int(3, &x) # <<<<<<<<<<<<<< - * - * return x - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->unpack_int(__pyx_v_self, 3, (&__pyx_v_x)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":604 - * self.unpack_int(3, &x) - * - * return x # <<<<<<<<<<<<<< - * - * cpdef long read_24bit_int(self) except? 0: - */ - __pyx_r = __pyx_v_x; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.read_24bit_uint"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":596 - * return x - * - * cpdef unsigned long read_24bit_uint(self) except? 0: # <<<<<<<<<<<<<< - * """ - * Reads a 24 bit unsigned integer from the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_24bit_uint(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_read_24bit_uint[] = "\n Reads a 24 bit unsigned integer from the stream.\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_24bit_uint(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - unsigned long __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("read_24bit_uint"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->read_24bit_uint(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), 1); if (unlikely(__pyx_t_1 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.read_24bit_uint"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":606 - * return x - * - * cpdef long read_24bit_int(self) except? 0: # <<<<<<<<<<<<<< - * """ - * Reads a 24 bit integer from the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_24bit_int(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static long __pyx_f_6cpyamf_4util_19cBufferedByteStream_read_24bit_int(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, int __pyx_skip_dispatch) { - long __pyx_v_x; - long __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - long __pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("read_24bit_int"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_24bit_int); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_24bit_int)) { - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":610 - * Reads a 24 bit integer from the stream. - * """ - * cdef long x = 0 # <<<<<<<<<<<<<< - * - * self.unpack_int(3, &x) - */ - __pyx_v_x = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":612 - * cdef long x = 0 - * - * self.unpack_int(3, &x) # <<<<<<<<<<<<<< - * - * if x & 0x800000: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->unpack_int(__pyx_v_self, 3, (&__pyx_v_x)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":614 - * self.unpack_int(3, &x) - * - * if x & 0x800000: # <<<<<<<<<<<<<< - * x |= ~0xffffff - * - */ - __pyx_t_3 = (__pyx_v_x & 0x800000); - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":615 - * - * if x & 0x800000: - * x |= ~0xffffff # <<<<<<<<<<<<<< - * - * return x - */ - __pyx_v_x = (__pyx_v_x | (~0xffffff)); - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":617 - * x |= ~0xffffff - * - * return x # <<<<<<<<<<<<<< - * - * cpdef unsigned long read_ulong(self) except? 0: - */ - __pyx_r = __pyx_v_x; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.read_24bit_int"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":606 - * return x - * - * cpdef long read_24bit_int(self) except? 0: # <<<<<<<<<<<<<< - * """ - * Reads a 24 bit integer from the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_24bit_int(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_read_24bit_int[] = "\n Reads a 24 bit integer from the stream.\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_24bit_int(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - long __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("read_24bit_int"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->read_24bit_int(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), 1); if (unlikely(__pyx_t_1 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.read_24bit_int"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":619 - * return x - * - * cpdef unsigned long read_ulong(self) except? 0: # <<<<<<<<<<<<<< - * """ - * Reads a 4 byte unsigned integer from the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_ulong(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static unsigned long __pyx_f_6cpyamf_4util_19cBufferedByteStream_read_ulong(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, int __pyx_skip_dispatch) { - unsigned long __pyx_v_x; - unsigned long __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - unsigned long __pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("read_ulong"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_ulong); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_ulong)) { - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_AsUnsignedLong(__pyx_t_2); if (unlikely((__pyx_t_3 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":623 - * Reads a 4 byte unsigned integer from the stream. - * """ - * cdef unsigned long x = 0 # <<<<<<<<<<<<<< - * - * self.unpack_int(4, &x) - */ - __pyx_v_x = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":625 - * cdef unsigned long x = 0 - * - * self.unpack_int(4, &x) # <<<<<<<<<<<<<< - * - * return x - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->unpack_int(__pyx_v_self, 4, (&__pyx_v_x)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":627 - * self.unpack_int(4, &x) - * - * return x # <<<<<<<<<<<<<< - * - * cpdef long read_long(self) except? 0: - */ - __pyx_r = __pyx_v_x; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.read_ulong"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":619 - * return x - * - * cpdef unsigned long read_ulong(self) except? 0: # <<<<<<<<<<<<<< - * """ - * Reads a 4 byte unsigned integer from the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_ulong(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_read_ulong[] = "\n Reads a 4 byte unsigned integer from the stream.\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_ulong(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - unsigned long __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("read_ulong"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->read_ulong(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), 1); if (unlikely(__pyx_t_1 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.read_ulong"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":629 - * return x - * - * cpdef long read_long(self) except? 0: # <<<<<<<<<<<<<< - * """ - * Reads a 4 byte integer from the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_long(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static long __pyx_f_6cpyamf_4util_19cBufferedByteStream_read_long(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, int __pyx_skip_dispatch) { - long __pyx_v_x; - long __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - long __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("read_long"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_long); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_long)) { - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":633 - * Reads a 4 byte integer from the stream. - * """ - * cdef long x = 0 # <<<<<<<<<<<<<< - * - * self.unpack_int(4, &x) - */ - __pyx_v_x = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":635 - * cdef long x = 0 - * - * self.unpack_int(4, &x) # <<<<<<<<<<<<<< - * - * if x & 0x80000000: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->unpack_int(__pyx_v_self, 4, (&__pyx_v_x)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":637 - * self.unpack_int(4, &x) - * - * if x & 0x80000000: # <<<<<<<<<<<<<< - * x |= ~0x7fffffff - * - */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_int_2147483648); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":638 - * - * if x & 0x80000000: - * x |= ~0x7fffffff # <<<<<<<<<<<<<< - * - * return x - */ - __pyx_v_x = (__pyx_v_x | (~0x7fffffff)); - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":640 - * x |= ~0x7fffffff - * - * return x # <<<<<<<<<<<<<< - * - * cpdef int write_uchar(self, unsigned char ret) except -1: - */ - __pyx_r = __pyx_v_x; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.read_long"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":629 - * return x - * - * cpdef long read_long(self) except? 0: # <<<<<<<<<<<<<< - * """ - * Reads a 4 byte integer from the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_long(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_read_long[] = "\n Reads a 4 byte integer from the stream.\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_long(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - long __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("read_long"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->read_long(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), 1); if (unlikely(__pyx_t_1 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.read_long"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":642 - * return x - * - * cpdef int write_uchar(self, unsigned char ret) except -1: # <<<<<<<<<<<<<< - * """ - * Writes an C{unsigned char} to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_uchar(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret); /*proto*/ -static int __pyx_f_6cpyamf_4util_19cBufferedByteStream_write_uchar(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, unsigned char __pyx_v_ret, int __pyx_skip_dispatch) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("write_uchar"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__write_uchar); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_uchar)) { - __pyx_t_2 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __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[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__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 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":649 - * @type ret: C{int} - * """ - * return self.pack_uint(1, ret) # <<<<<<<<<<<<<< - * - * cpdef int write_char(self, char ret) except -1: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->pack_uint(__pyx_v_self, 1, ((unsigned long)__pyx_v_ret)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_uchar"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":642 - * return x - * - * cpdef int write_uchar(self, unsigned char ret) except -1: # <<<<<<<<<<<<<< - * """ - * Writes an C{unsigned char} to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_uchar(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_write_uchar[] = "\n Writes an C{unsigned char} to the stream.\n\n @param ret: Unsigned char\n @type ret: C{int}\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_uchar(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret) { - unsigned char __pyx_v_ret; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("write_uchar"); - assert(__pyx_arg_ret); { - __pyx_v_ret = __Pyx_PyInt_AsUnsignedChar(__pyx_arg_ret); if (unlikely((__pyx_v_ret == (unsigned char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_uchar"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->write_uchar(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), __pyx_v_ret, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_uchar"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":651 - * return self.pack_uint(1, ret) - * - * cpdef int write_char(self, char ret) except -1: # <<<<<<<<<<<<<< - * """ - * Write a C{char} to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_char(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret); /*proto*/ -static int __pyx_f_6cpyamf_4util_19cBufferedByteStream_write_char(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, char __pyx_v_ret, int __pyx_skip_dispatch) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("write_char"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__write_char); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_char)) { - __pyx_t_2 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __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[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__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 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":658 - * @type ret: C{int} - * """ - * return self.pack_int(1, ret) # <<<<<<<<<<<<<< - * - * cpdef int write_ushort(self, unsigned short ret) except -1: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->pack_int(__pyx_v_self, 1, ((long)__pyx_v_ret)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_char"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":651 - * return self.pack_uint(1, ret) - * - * cpdef int write_char(self, char ret) except -1: # <<<<<<<<<<<<<< - * """ - * Write a C{char} to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_char(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_write_char[] = "\n Write a C{char} to the stream.\n\n @param ret: char\n @type ret: C{int}\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_char(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret) { - char __pyx_v_ret; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("write_char"); - assert(__pyx_arg_ret); { - __pyx_v_ret = __Pyx_PyInt_AsChar(__pyx_arg_ret); if (unlikely((__pyx_v_ret == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_char"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->write_char(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), __pyx_v_ret, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_char"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":660 - * return self.pack_int(1, ret) - * - * cpdef int write_ushort(self, unsigned short ret) except -1: # <<<<<<<<<<<<<< - * """ - * Writes a 2 byte unsigned integer to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_ushort(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret); /*proto*/ -static int __pyx_f_6cpyamf_4util_19cBufferedByteStream_write_ushort(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, unsigned short __pyx_v_ret, int __pyx_skip_dispatch) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("write_ushort"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__write_ushort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_ushort)) { - __pyx_t_2 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __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[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__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 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":667 - * @type ret: C{int} - * """ - * return self.pack_uint(2, ret) # <<<<<<<<<<<<<< - * - * cpdef int write_short(self, short ret) except -1: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->pack_uint(__pyx_v_self, 2, ((unsigned long)__pyx_v_ret)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_ushort"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":660 - * return self.pack_int(1, ret) - * - * cpdef int write_ushort(self, unsigned short ret) except -1: # <<<<<<<<<<<<<< - * """ - * Writes a 2 byte unsigned integer to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_ushort(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_write_ushort[] = "\n Writes a 2 byte unsigned integer to the stream.\n\n @param ret: 2 byte unsigned integer\n @type ret: C{int}\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_ushort(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret) { - unsigned short __pyx_v_ret; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("write_ushort"); - assert(__pyx_arg_ret); { - __pyx_v_ret = __Pyx_PyInt_AsUnsignedShort(__pyx_arg_ret); if (unlikely((__pyx_v_ret == (unsigned short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_ushort"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->write_ushort(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), __pyx_v_ret, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_ushort"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":669 - * return self.pack_uint(2, ret) - * - * cpdef int write_short(self, short ret) except -1: # <<<<<<<<<<<<<< - * """ - * Writes a 2 byte integer to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_short(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret); /*proto*/ -static int __pyx_f_6cpyamf_4util_19cBufferedByteStream_write_short(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, short __pyx_v_ret, int __pyx_skip_dispatch) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("write_short"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__write_short); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_short)) { - __pyx_t_2 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __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[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__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 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":676 - * @type ret: C{int} - * """ - * return self.pack_int(2, ret) # <<<<<<<<<<<<<< - * - * cpdef int write_ulong(self, unsigned long ret) except -1: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->pack_int(__pyx_v_self, 2, ((long)__pyx_v_ret)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_short"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":669 - * return self.pack_uint(2, ret) - * - * cpdef int write_short(self, short ret) except -1: # <<<<<<<<<<<<<< - * """ - * Writes a 2 byte integer to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_short(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_write_short[] = "\n Writes a 2 byte integer to the stream.\n\n @param ret: 2 byte integer\n @type ret: C{int}\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_short(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret) { - short __pyx_v_ret; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("write_short"); - assert(__pyx_arg_ret); { - __pyx_v_ret = __Pyx_PyInt_AsShort(__pyx_arg_ret); if (unlikely((__pyx_v_ret == (short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_short"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->write_short(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), __pyx_v_ret, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_short"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":678 - * return self.pack_int(2, ret) - * - * cpdef int write_ulong(self, unsigned long ret) except -1: # <<<<<<<<<<<<<< - * """ - * Writes a 4 byte unsigned integer to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_ulong(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret); /*proto*/ -static int __pyx_f_6cpyamf_4util_19cBufferedByteStream_write_ulong(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, unsigned long __pyx_v_ret, int __pyx_skip_dispatch) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("write_ulong"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__write_ulong); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_ulong)) { - __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_ret); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __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[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__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 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":685 - * @type ret: C{int} - * """ - * return self.pack_uint(4, ret) # <<<<<<<<<<<<<< - * - * cpdef int write_long(self, long ret) except -1: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->pack_uint(__pyx_v_self, 4, __pyx_v_ret); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_ulong"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":678 - * return self.pack_int(2, ret) - * - * cpdef int write_ulong(self, unsigned long ret) except -1: # <<<<<<<<<<<<<< - * """ - * Writes a 4 byte unsigned integer to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_ulong(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_write_ulong[] = "\n Writes a 4 byte unsigned integer to the stream.\n\n @param ret: 4 byte unsigned integer\n @type ret: C{int}\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_ulong(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret) { - unsigned long __pyx_v_ret; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("write_ulong"); - assert(__pyx_arg_ret); { - __pyx_v_ret = __Pyx_PyInt_AsUnsignedLong(__pyx_arg_ret); if (unlikely((__pyx_v_ret == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_ulong"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->write_ulong(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), __pyx_v_ret, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_ulong"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":687 - * return self.pack_uint(4, ret) - * - * cpdef int write_long(self, long ret) except -1: # <<<<<<<<<<<<<< - * """ - * Writes a 4 byte integer to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_long(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret); /*proto*/ -static int __pyx_f_6cpyamf_4util_19cBufferedByteStream_write_long(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, long __pyx_v_ret, int __pyx_skip_dispatch) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("write_long"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__write_long); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_long)) { - __pyx_t_2 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __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[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__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 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":694 - * @type ret: C{int} - * """ - * return self.pack_int(4, ret) # <<<<<<<<<<<<<< - * - * cpdef int write_24bit_uint(self, unsigned long ret) except -1: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->pack_int(__pyx_v_self, 4, __pyx_v_ret); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_long"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":687 - * return self.pack_uint(4, ret) - * - * cpdef int write_long(self, long ret) except -1: # <<<<<<<<<<<<<< - * """ - * Writes a 4 byte integer to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_long(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_write_long[] = "\n Writes a 4 byte integer to the stream.\n\n @param ret: 4 byte integer\n @type ret: C{int}\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_long(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret) { - long __pyx_v_ret; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("write_long"); - assert(__pyx_arg_ret); { - __pyx_v_ret = __Pyx_PyInt_AsLong(__pyx_arg_ret); if (unlikely((__pyx_v_ret == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_long"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->write_long(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), __pyx_v_ret, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_long"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":696 - * return self.pack_int(4, ret) - * - * cpdef int write_24bit_uint(self, unsigned long ret) except -1: # <<<<<<<<<<<<<< - * """ - * Writes a 24 bit unsigned integer to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_24bit_uint(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret); /*proto*/ -static int __pyx_f_6cpyamf_4util_19cBufferedByteStream_write_24bit_uint(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, unsigned long __pyx_v_ret, int __pyx_skip_dispatch) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("write_24bit_uint"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__write_24bit_uint); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_24bit_uint)) { - __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_ret); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __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[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__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 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":703 - * @type ret: C{int} - * """ - * return self.pack_uint(3, ret) # <<<<<<<<<<<<<< - * - * cpdef int write_24bit_int(self, long ret) except -1: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->pack_uint(__pyx_v_self, 3, __pyx_v_ret); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_24bit_uint"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":696 - * return self.pack_int(4, ret) - * - * cpdef int write_24bit_uint(self, unsigned long ret) except -1: # <<<<<<<<<<<<<< - * """ - * Writes a 24 bit unsigned integer to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_24bit_uint(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_write_24bit_uint[] = "\n Writes a 24 bit unsigned integer to the stream.\n\n @param ret: 24 bit unsigned integer\n @type ret: C{int}\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_24bit_uint(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret) { - unsigned long __pyx_v_ret; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("write_24bit_uint"); - assert(__pyx_arg_ret); { - __pyx_v_ret = __Pyx_PyInt_AsUnsignedLong(__pyx_arg_ret); if (unlikely((__pyx_v_ret == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_24bit_uint"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->write_24bit_uint(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), __pyx_v_ret, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_24bit_uint"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":705 - * return self.pack_uint(3, ret) - * - * cpdef int write_24bit_int(self, long ret) except -1: # <<<<<<<<<<<<<< - * """ - * Writes a 24 bit integer to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_24bit_int(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret); /*proto*/ -static int __pyx_f_6cpyamf_4util_19cBufferedByteStream_write_24bit_int(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, long __pyx_v_ret, int __pyx_skip_dispatch) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("write_24bit_int"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__write_24bit_int); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_24bit_int)) { - __pyx_t_2 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __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[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__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 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":712 - * @type ret: C{int} - * """ - * return self.pack_int(3, ret) # <<<<<<<<<<<<<< - * - * cpdef object read_utf8_string(self, Py_ssize_t l): - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->pack_int(__pyx_v_self, 3, __pyx_v_ret); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_24bit_int"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":705 - * return self.pack_uint(3, ret) - * - * cpdef int write_24bit_int(self, long ret) except -1: # <<<<<<<<<<<<<< - * """ - * Writes a 24 bit integer to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_24bit_int(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_write_24bit_int[] = "\n Writes a 24 bit integer to the stream.\n\n @param ret: 24 bit integer\n @type ret: C{int}\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_24bit_int(PyObject *__pyx_v_self, PyObject *__pyx_arg_ret) { - long __pyx_v_ret; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("write_24bit_int"); - assert(__pyx_arg_ret); { - __pyx_v_ret = __Pyx_PyInt_AsLong(__pyx_arg_ret); if (unlikely((__pyx_v_ret == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_24bit_int"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->write_24bit_int(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), __pyx_v_ret, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_24bit_int"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":714 - * return self.pack_int(3, ret) - * - * cpdef object read_utf8_string(self, Py_ssize_t l): # <<<<<<<<<<<<<< - * """ - * Reads a UTF-8 string from the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_utf8_string(PyObject *__pyx_v_self, PyObject *__pyx_arg_l); /*proto*/ -static PyObject *__pyx_f_6cpyamf_4util_19cBufferedByteStream_read_utf8_string(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, Py_ssize_t __pyx_v_l, int __pyx_skip_dispatch) { - char *__pyx_v_buf; - PyObject *__pyx_v_ret; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("read_utf8_string"); - __pyx_v_ret = Py_None; __Pyx_INCREF(Py_None); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_utf8_string); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_utf8_string)) { - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_l); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __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[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__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 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":720 - * @rtype: C{unicode} - * """ - * cdef char* buf = NULL # <<<<<<<<<<<<<< - * cdef object ret - * - */ - __pyx_v_buf = NULL; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":723 - * cdef object ret - * - * if l == 0: # <<<<<<<<<<<<<< - * return empty_unicode - * - */ - __pyx_t_4 = (__pyx_v_l == 0); - if (__pyx_t_4) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":724 - * - * if l == 0: - * return empty_unicode # <<<<<<<<<<<<<< - * - * self.read(&buf, l) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_6cpyamf_4util_empty_unicode); - __pyx_r = __pyx_v_6cpyamf_4util_empty_unicode; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":726 - * return empty_unicode - * - * self.read(&buf, l) # <<<<<<<<<<<<<< - * ret = PyUnicode_DecodeUTF8(buf, l, 'strict') - * - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->read(__pyx_v_self, (&__pyx_v_buf), __pyx_v_l); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":727 - * - * self.read(&buf, l) - * ret = PyUnicode_DecodeUTF8(buf, l, 'strict') # <<<<<<<<<<<<<< - * - * return ret - */ - __pyx_t_1 = PyUnicode_DecodeUTF8(__pyx_v_buf, __pyx_v_l, __pyx_k__strict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_v_ret); - __pyx_v_ret = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":729 - * ret = PyUnicode_DecodeUTF8(buf, l, 'strict') - * - * return ret # <<<<<<<<<<<<<< - * - * cpdef int write_utf8_string(self, object obj) except -1: - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_ret); - __pyx_r = __pyx_v_ret; - goto __pyx_L0; - - __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_3); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.read_utf8_string"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_ret); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":714 - * return self.pack_int(3, ret) - * - * cpdef object read_utf8_string(self, Py_ssize_t l): # <<<<<<<<<<<<<< - * """ - * Reads a UTF-8 string from the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_utf8_string(PyObject *__pyx_v_self, PyObject *__pyx_arg_l); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_read_utf8_string[] = "\n Reads a UTF-8 string from the stream.\n\n @rtype: C{unicode}\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_utf8_string(PyObject *__pyx_v_self, PyObject *__pyx_arg_l) { - Py_ssize_t __pyx_v_l; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("read_utf8_string"); - assert(__pyx_arg_l); { - __pyx_v_l = __Pyx_PyIndex_AsSsize_t(__pyx_arg_l); if (unlikely((__pyx_v_l == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.read_utf8_string"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->read_utf8_string(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), __pyx_v_l, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.read_utf8_string"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":731 - * return ret - * - * cpdef int write_utf8_string(self, object obj) except -1: # <<<<<<<<<<<<<< - * """ - * Writes a unicode object to the stream in UTF-8. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_utf8_string(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/ -static int __pyx_f_6cpyamf_4util_19cBufferedByteStream_write_utf8_string(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) { - PyObject *__pyx_v_encoded_string; - char *__pyx_v_buf; - Py_ssize_t __pyx_v_l; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("write_utf8_string"); - __pyx_v_encoded_string = Py_None; __Pyx_INCREF(Py_None); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__write_utf8_string); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_utf8_string)) { - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_obj); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj); - __Pyx_GIVEREF(__pyx_v_obj); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":739 - * """ - * cdef object encoded_string - * cdef char *buf = NULL # <<<<<<<<<<<<<< - * cdef Py_ssize_t l = -1 - * - */ - __pyx_v_buf = NULL; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":740 - * cdef object encoded_string - * cdef char *buf = NULL - * cdef Py_ssize_t l = -1 # <<<<<<<<<<<<<< - * - * if PyUnicode_Check(obj) == 1: - */ - __pyx_v_l = -1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":742 - * cdef Py_ssize_t l = -1 - * - * if PyUnicode_Check(obj) == 1: # <<<<<<<<<<<<<< - * encoded_string = PyUnicode_AsUTF8String(obj) - * elif PyString_Check(obj) == 1: - */ - __pyx_t_5 = (PyUnicode_Check(__pyx_v_obj) == 1); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":743 - * - * if PyUnicode_Check(obj) == 1: - * encoded_string = PyUnicode_AsUTF8String(obj) # <<<<<<<<<<<<<< - * elif PyString_Check(obj) == 1: - * encoded_string = obj - */ - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_obj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_v_encoded_string); - __pyx_v_encoded_string = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L3; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":744 - * if PyUnicode_Check(obj) == 1: - * encoded_string = PyUnicode_AsUTF8String(obj) - * elif PyString_Check(obj) == 1: # <<<<<<<<<<<<<< - * encoded_string = obj - * else: - */ - __pyx_t_5 = (PyString_Check(__pyx_v_obj) == 1); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":745 - * encoded_string = PyUnicode_AsUTF8String(obj) - * elif PyString_Check(obj) == 1: - * encoded_string = obj # <<<<<<<<<<<<<< - * else: - * raise TypeError('value must be Unicode or str') - */ - __Pyx_INCREF(__pyx_v_obj); - __Pyx_DECREF(__pyx_v_encoded_string); - __pyx_v_encoded_string = __pyx_v_obj; - goto __pyx_L3; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":747 - * encoded_string = obj - * else: - * raise TypeError('value must be Unicode or str') # <<<<<<<<<<<<<< - * - * PyString_AsStringAndSize(encoded_string, &buf, &l) - */ - __pyx_t_1 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":749 - * raise TypeError('value must be Unicode or str') - * - * PyString_AsStringAndSize(encoded_string, &buf, &l) # <<<<<<<<<<<<<< - * self.write(buf, l) - * - */ - __pyx_t_4 = PyString_AsStringAndSize(__pyx_v_encoded_string, (&__pyx_v_buf), (&__pyx_v_l)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":750 - * - * PyString_AsStringAndSize(encoded_string, &buf, &l) - * self.write(buf, l) # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->write(__pyx_v_self, __pyx_v_buf, __pyx_v_l); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":752 - * self.write(buf, l) - * - * return 0 # <<<<<<<<<<<<<< - * - * cdef int read_double(self, double *obj) except -1: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_utf8_string"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_encoded_string); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":731 - * return ret - * - * cpdef int write_utf8_string(self, object obj) except -1: # <<<<<<<<<<<<<< - * """ - * Writes a unicode object to the stream in UTF-8. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_utf8_string(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_write_utf8_string[] = "\n Writes a unicode object to the stream in UTF-8.\n\n @param obj: unicode object\n @raise TypeError: Unexpected type for str C{u}.\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_utf8_string(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("write_utf8_string"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->write_utf8_string(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), __pyx_v_obj, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_utf8_string"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":754 - * return 0 - * - * cdef int read_double(self, double *obj) except -1: # <<<<<<<<<<<<<< - * """ - * Reads an 8 byte float from the stream. - */ - -static int __pyx_f_6cpyamf_4util_19cBufferedByteStream_read_double(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, double *__pyx_v_obj) { - unsigned char *__pyx_v_buf; - int __pyx_v_done; - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3; - double __pyx_t_4; - __Pyx_RefNannySetupContext("read_double"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":758 - * Reads an 8 byte float from the stream. - * """ - * cdef unsigned char *buf = NULL # <<<<<<<<<<<<<< - * cdef int done = 0 - * - */ - __pyx_v_buf = NULL; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":759 - * """ - * cdef unsigned char *buf = NULL - * cdef int done = 0 # <<<<<<<<<<<<<< - * - * self.read(&buf, 8) - */ - __pyx_v_done = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":761 - * cdef int done = 0 - * - * self.read(&buf, 8) # <<<<<<<<<<<<<< - * - * if float_broken == 1: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->read(__pyx_v_self, ((char **)(&__pyx_v_buf)), 8); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":763 - * self.read(&buf, 8) - * - * if float_broken == 1: # <<<<<<<<<<<<<< - * if is_big_endian(SYSTEM_ENDIAN): - * if not is_big_endian(self.endian): - */ - __pyx_t_2 = (__pyx_v_6cpyamf_4util_float_broken == 1); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":764 - * - * if float_broken == 1: - * if is_big_endian(SYSTEM_ENDIAN): # <<<<<<<<<<<<<< - * if not is_big_endian(self.endian): - * if swap_bytes(buf, 8) == -1: - */ - __pyx_t_2 = __pyx_f_6cpyamf_4util_is_big_endian(__pyx_v_6cpyamf_4util_SYSTEM_ENDIAN); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":765 - * if float_broken == 1: - * if is_big_endian(SYSTEM_ENDIAN): - * if not is_big_endian(self.endian): # <<<<<<<<<<<<<< - * if swap_bytes(buf, 8) == -1: - * PyErr_NoMemory() - */ - __pyx_t_2 = (!__pyx_f_6cpyamf_4util_is_big_endian(__pyx_v_self->endian)); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":766 - * if is_big_endian(SYSTEM_ENDIAN): - * if not is_big_endian(self.endian): - * if swap_bytes(buf, 8) == -1: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * else: - */ - __pyx_t_2 = (__pyx_f_6cpyamf_4util_swap_bytes(__pyx_v_buf, 8) == -1); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":767 - * if not is_big_endian(self.endian): - * if swap_bytes(buf, 8) == -1: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * else: - * if is_big_endian(self.endian): - */ - __pyx_t_3 = PyErr_NoMemory(); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - goto __pyx_L5; - } - __pyx_L5:; - goto __pyx_L4; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":769 - * PyErr_NoMemory() - * else: - * if is_big_endian(self.endian): # <<<<<<<<<<<<<< - * if swap_bytes(buf, 8) == -1: - * PyErr_NoMemory() - */ - __pyx_t_2 = __pyx_f_6cpyamf_4util_is_big_endian(__pyx_v_self->endian); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":770 - * else: - * if is_big_endian(self.endian): - * if swap_bytes(buf, 8) == -1: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * - */ - __pyx_t_2 = (__pyx_f_6cpyamf_4util_swap_bytes(__pyx_v_buf, 8) == -1); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":771 - * if is_big_endian(self.endian): - * if swap_bytes(buf, 8) == -1: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * - * if memcmp(buf, &system_nan, 8) == 0: - */ - __pyx_t_3 = PyErr_NoMemory(); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; - } - __pyx_L8:; - goto __pyx_L7; - } - __pyx_L7:; - } - __pyx_L4:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":773 - * PyErr_NoMemory() - * - * if memcmp(buf, &system_nan, 8) == 0: # <<<<<<<<<<<<<< - * memcpy(obj, &system_nan, 8) - * - */ - __pyx_t_2 = (memcmp(__pyx_v_buf, (&__pyx_v_6cpyamf_4util_system_nan), 8) == 0); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":774 - * - * if memcmp(buf, &system_nan, 8) == 0: - * memcpy(obj, &system_nan, 8) # <<<<<<<<<<<<<< - * - * done = 1 - */ - memcpy(__pyx_v_obj, (&__pyx_v_6cpyamf_4util_system_nan), 8); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":776 - * memcpy(obj, &system_nan, 8) - * - * done = 1 # <<<<<<<<<<<<<< - * elif memcmp(buf, &system_posinf, 8) == 0: - * memcpy(obj, &system_posinf, 8) - */ - __pyx_v_done = 1; - goto __pyx_L9; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":777 - * - * done = 1 - * elif memcmp(buf, &system_posinf, 8) == 0: # <<<<<<<<<<<<<< - * memcpy(obj, &system_posinf, 8) - * - */ - __pyx_t_2 = (memcmp(__pyx_v_buf, (&__pyx_v_6cpyamf_4util_system_posinf), 8) == 0); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":778 - * done = 1 - * elif memcmp(buf, &system_posinf, 8) == 0: - * memcpy(obj, &system_posinf, 8) # <<<<<<<<<<<<<< - * - * done = 1 - */ - memcpy(__pyx_v_obj, (&__pyx_v_6cpyamf_4util_system_posinf), 8); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":780 - * memcpy(obj, &system_posinf, 8) - * - * done = 1 # <<<<<<<<<<<<<< - * elif memcmp(buf, &system_neginf, 8) == 0: - * memcpy(obj, &system_neginf, 8) - */ - __pyx_v_done = 1; - goto __pyx_L9; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":781 - * - * done = 1 - * elif memcmp(buf, &system_neginf, 8) == 0: # <<<<<<<<<<<<<< - * memcpy(obj, &system_neginf, 8) - * - */ - __pyx_t_2 = (memcmp(__pyx_v_buf, (&__pyx_v_6cpyamf_4util_system_neginf), 8) == 0); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":782 - * done = 1 - * elif memcmp(buf, &system_neginf, 8) == 0: - * memcpy(obj, &system_neginf, 8) # <<<<<<<<<<<<<< - * - * done = 1 - */ - memcpy(__pyx_v_obj, (&__pyx_v_6cpyamf_4util_system_neginf), 8); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":784 - * memcpy(obj, &system_neginf, 8) - * - * done = 1 # <<<<<<<<<<<<<< - * - * if done == 1: - */ - __pyx_v_done = 1; - goto __pyx_L9; - } - __pyx_L9:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":786 - * done = 1 - * - * if done == 1: # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_t_2 = (__pyx_v_done == 1); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":787 - * - * if done == 1: - * return 0 # <<<<<<<<<<<<<< - * - * if is_big_endian(SYSTEM_ENDIAN): - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L10; - } - __pyx_L10:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":789 - * return 0 - * - * if is_big_endian(SYSTEM_ENDIAN): # <<<<<<<<<<<<<< - * if not is_big_endian(self.endian): - * if swap_bytes(buf, 8) == -1: - */ - __pyx_t_2 = __pyx_f_6cpyamf_4util_is_big_endian(__pyx_v_6cpyamf_4util_SYSTEM_ENDIAN); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":790 - * - * if is_big_endian(SYSTEM_ENDIAN): - * if not is_big_endian(self.endian): # <<<<<<<<<<<<<< - * if swap_bytes(buf, 8) == -1: - * PyErr_NoMemory() - */ - __pyx_t_2 = (!__pyx_f_6cpyamf_4util_is_big_endian(__pyx_v_self->endian)); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":791 - * if is_big_endian(SYSTEM_ENDIAN): - * if not is_big_endian(self.endian): - * if swap_bytes(buf, 8) == -1: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * else: - */ - __pyx_t_2 = (__pyx_f_6cpyamf_4util_swap_bytes(__pyx_v_buf, 8) == -1); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":792 - * if not is_big_endian(self.endian): - * if swap_bytes(buf, 8) == -1: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * else: - * if is_big_endian(self.endian): - */ - __pyx_t_3 = PyErr_NoMemory(); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L13; - } - __pyx_L13:; - goto __pyx_L12; - } - __pyx_L12:; - goto __pyx_L11; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":794 - * PyErr_NoMemory() - * else: - * if is_big_endian(self.endian): # <<<<<<<<<<<<<< - * if swap_bytes(buf, 8) == -1: - * PyErr_NoMemory() - */ - __pyx_t_2 = __pyx_f_6cpyamf_4util_is_big_endian(__pyx_v_self->endian); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":795 - * else: - * if is_big_endian(self.endian): - * if swap_bytes(buf, 8) == -1: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * - */ - __pyx_t_2 = (__pyx_f_6cpyamf_4util_swap_bytes(__pyx_v_buf, 8) == -1); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":796 - * if is_big_endian(self.endian): - * if swap_bytes(buf, 8) == -1: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * - * obj[0] = _PyFloat_Unpack8(buf, not is_big_endian(self.endian)) - */ - __pyx_t_3 = PyErr_NoMemory(); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L15; - } - __pyx_L15:; - goto __pyx_L14; - } - __pyx_L14:; - } - __pyx_L11:; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":798 - * PyErr_NoMemory() - * - * obj[0] = _PyFloat_Unpack8(buf, not is_big_endian(self.endian)) # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_4 = _PyFloat_Unpack8(__pyx_v_buf, (!__pyx_f_6cpyamf_4util_is_big_endian(__pyx_v_self->endian))); if (unlikely(__pyx_t_4 == (-1.0) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - (__pyx_v_obj[0]) = __pyx_t_4; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":800 - * obj[0] = _PyFloat_Unpack8(buf, not is_big_endian(self.endian)) - * - * return 0 # <<<<<<<<<<<<<< - * - * cpdef int write_double(self, double val) except -1: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.read_double"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":802 - * return 0 - * - * cpdef int write_double(self, double val) except -1: # <<<<<<<<<<<<<< - * """ - * Writes an 8 byte float to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_double(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/ -static int __pyx_f_6cpyamf_4util_19cBufferedByteStream_write_double(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, double __pyx_v_val, int __pyx_skip_dispatch) { - unsigned char *__pyx_v_buf; - int __pyx_v_done; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6; - __Pyx_RefNannySetupContext("write_double"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__write_double); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_double)) { - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __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[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__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 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":811 - * cdef unsigned char *buf - * cdef unsigned char *foo - * cdef int done = 0 # <<<<<<<<<<<<<< - * - * buf = malloc(sizeof(double)) - */ - __pyx_v_done = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":813 - * cdef int done = 0 - * - * buf = malloc(sizeof(double)) # <<<<<<<<<<<<<< - * - * if buf == NULL: - */ - __pyx_v_buf = ((unsigned char *)malloc((sizeof(double)))); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":815 - * buf = malloc(sizeof(double)) - * - * if buf == NULL: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * - */ - __pyx_t_5 = (__pyx_v_buf == NULL); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":816 - * - * if buf == NULL: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * - * try: - */ - __pyx_t_6 = PyErr_NoMemory(); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":818 - * PyErr_NoMemory() - * - * try: # <<<<<<<<<<<<<< - * if float_broken == 1: - * if memcmp(&val, &system_nan, 8) == 0: - */ - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":819 - * - * try: - * if float_broken == 1: # <<<<<<<<<<<<<< - * if memcmp(&val, &system_nan, 8) == 0: - * memcpy(buf, &val, 8) - */ - __pyx_t_5 = (__pyx_v_6cpyamf_4util_float_broken == 1); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":820 - * try: - * if float_broken == 1: - * if memcmp(&val, &system_nan, 8) == 0: # <<<<<<<<<<<<<< - * memcpy(buf, &val, 8) - * - */ - __pyx_t_5 = (memcmp((&__pyx_v_val), (&__pyx_v_6cpyamf_4util_system_nan), 8) == 0); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":821 - * if float_broken == 1: - * if memcmp(&val, &system_nan, 8) == 0: - * memcpy(buf, &val, 8) # <<<<<<<<<<<<<< - * - * done = 1 - */ - memcpy(__pyx_v_buf, (&__pyx_v_val), 8); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":823 - * memcpy(buf, &val, 8) - * - * done = 1 # <<<<<<<<<<<<<< - * elif memcmp(&val, &system_posinf, 8) == 0: - * memcpy(buf, &val, 8) - */ - __pyx_v_done = 1; - goto __pyx_L8; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":824 - * - * done = 1 - * elif memcmp(&val, &system_posinf, 8) == 0: # <<<<<<<<<<<<<< - * memcpy(buf, &val, 8) - * - */ - __pyx_t_5 = (memcmp((&__pyx_v_val), (&__pyx_v_6cpyamf_4util_system_posinf), 8) == 0); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":825 - * done = 1 - * elif memcmp(&val, &system_posinf, 8) == 0: - * memcpy(buf, &val, 8) # <<<<<<<<<<<<<< - * - * done = 1 - */ - memcpy(__pyx_v_buf, (&__pyx_v_val), 8); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":827 - * memcpy(buf, &val, 8) - * - * done = 1 # <<<<<<<<<<<<<< - * elif memcmp(&val, &system_neginf, 8) == 0: - * memcpy(buf, &val, 8) - */ - __pyx_v_done = 1; - goto __pyx_L8; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":828 - * - * done = 1 - * elif memcmp(&val, &system_neginf, 8) == 0: # <<<<<<<<<<<<<< - * memcpy(buf, &val, 8) - * - */ - __pyx_t_5 = (memcmp((&__pyx_v_val), (&__pyx_v_6cpyamf_4util_system_neginf), 8) == 0); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":829 - * done = 1 - * elif memcmp(&val, &system_neginf, 8) == 0: - * memcpy(buf, &val, 8) # <<<<<<<<<<<<<< - * - * done = 1 - */ - memcpy(__pyx_v_buf, (&__pyx_v_val), 8); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":831 - * memcpy(buf, &val, 8) - * - * done = 1 # <<<<<<<<<<<<<< - * - * if done == 1: - */ - __pyx_v_done = 1; - goto __pyx_L8; - } - __pyx_L8:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":833 - * done = 1 - * - * if done == 1: # <<<<<<<<<<<<<< - * if is_big_endian(SYSTEM_ENDIAN): - * if not is_big_endian(self.endian): - */ - __pyx_t_5 = (__pyx_v_done == 1); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":834 - * - * if done == 1: - * if is_big_endian(SYSTEM_ENDIAN): # <<<<<<<<<<<<<< - * if not is_big_endian(self.endian): - * if swap_bytes(buf, 8) == -1: - */ - __pyx_t_5 = __pyx_f_6cpyamf_4util_is_big_endian(__pyx_v_6cpyamf_4util_SYSTEM_ENDIAN); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":835 - * if done == 1: - * if is_big_endian(SYSTEM_ENDIAN): - * if not is_big_endian(self.endian): # <<<<<<<<<<<<<< - * if swap_bytes(buf, 8) == -1: - * PyErr_NoMemory() - */ - __pyx_t_5 = (!__pyx_f_6cpyamf_4util_is_big_endian(__pyx_v_self->endian)); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":836 - * if is_big_endian(SYSTEM_ENDIAN): - * if not is_big_endian(self.endian): - * if swap_bytes(buf, 8) == -1: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * else: - */ - __pyx_t_5 = (__pyx_f_6cpyamf_4util_swap_bytes(__pyx_v_buf, 8) == -1); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":837 - * if not is_big_endian(self.endian): - * if swap_bytes(buf, 8) == -1: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * else: - * if is_big_endian(self.endian): - */ - __pyx_t_6 = PyErr_NoMemory(); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L5;} - goto __pyx_L12; - } - __pyx_L12:; - goto __pyx_L11; - } - __pyx_L11:; - goto __pyx_L10; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":839 - * PyErr_NoMemory() - * else: - * if is_big_endian(self.endian): # <<<<<<<<<<<<<< - * if swap_bytes(buf, 8) == -1: - * PyErr_NoMemory() - */ - __pyx_t_5 = __pyx_f_6cpyamf_4util_is_big_endian(__pyx_v_self->endian); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":840 - * else: - * if is_big_endian(self.endian): - * if swap_bytes(buf, 8) == -1: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * - */ - __pyx_t_5 = (__pyx_f_6cpyamf_4util_swap_bytes(__pyx_v_buf, 8) == -1); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":841 - * if is_big_endian(self.endian): - * if swap_bytes(buf, 8) == -1: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * - * if done == 0: - */ - __pyx_t_6 = PyErr_NoMemory(); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L5;} - goto __pyx_L14; - } - __pyx_L14:; - goto __pyx_L13; - } - __pyx_L13:; - } - __pyx_L10:; - goto __pyx_L9; - } - __pyx_L9:; - goto __pyx_L7; - } - __pyx_L7:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":843 - * PyErr_NoMemory() - * - * if done == 0: # <<<<<<<<<<<<<< - * _PyFloat_Pack8(val, buf, not is_big_endian(self.endian)) - * - */ - __pyx_t_5 = (__pyx_v_done == 0); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":844 - * - * if done == 0: - * _PyFloat_Pack8(val, buf, not is_big_endian(self.endian)) # <<<<<<<<<<<<<< - * - * self.write(buf, 8) - */ - __pyx_t_4 = _PyFloat_Pack8(__pyx_v_val, __pyx_v_buf, (!__pyx_f_6cpyamf_4util_is_big_endian(__pyx_v_self->endian))); if (unlikely(__pyx_t_4 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L5;} - goto __pyx_L15; - } - __pyx_L15:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":846 - * _PyFloat_Pack8(val, buf, not is_big_endian(self.endian)) - * - * self.write(buf, 8) # <<<<<<<<<<<<<< - * finally: - * free(buf) - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->write(__pyx_v_self, ((char *)__pyx_v_buf), 8); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L5;} - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":848 - * self.write(buf, 8) - * finally: - * free(buf) # <<<<<<<<<<<<<< - * - * return 0 - */ - /*finally:*/ { - int __pyx_why; - PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; - int __pyx_exc_lineno; - __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 0; goto __pyx_L6; - __pyx_L5: { - __pyx_why = 4; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); - __pyx_exc_lineno = __pyx_lineno; - goto __pyx_L6; - } - __pyx_L6:; - free(__pyx_v_buf); - switch (__pyx_why) { - case 4: { - __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); - __pyx_lineno = __pyx_exc_lineno; - __pyx_exc_type = 0; - __pyx_exc_value = 0; - __pyx_exc_tb = 0; - goto __pyx_L1_error; - } - } - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":850 - * free(buf) - * - * return 0 # <<<<<<<<<<<<<< - * - * cdef int read_float(self, float *x) except -1: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_double"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":802 - * return 0 - * - * cpdef int write_double(self, double val) except -1: # <<<<<<<<<<<<<< - * """ - * Writes an 8 byte float to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_double(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_write_double[] = "\n Writes an 8 byte float to the stream.\n\n @param val: 8 byte float\n @type val: C{float}\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_double(PyObject *__pyx_v_self, PyObject *__pyx_arg_val) { - double __pyx_v_val; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("write_double"); - assert(__pyx_arg_val); { - __pyx_v_val = __pyx_PyFloat_AsDouble(__pyx_arg_val); if (unlikely((__pyx_v_val == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_double"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->write_double(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), __pyx_v_val, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_double"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":852 - * return 0 - * - * cdef int read_float(self, float *x) except -1: # <<<<<<<<<<<<<< - * """ - * Reads a 4 byte float from the stream. - */ - -static int __pyx_f_6cpyamf_4util_19cBufferedByteStream_read_float(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, float *__pyx_v_x) { - char *__pyx_v_buf; - unsigned char __pyx_v_le; - int __pyx_r; - int __pyx_t_1; - double __pyx_t_2; - __Pyx_RefNannySetupContext("read_float"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":856 - * Reads a 4 byte float from the stream. - * """ - * cdef char *buf = NULL # <<<<<<<<<<<<<< - * cdef unsigned char le = not is_big_endian(self.endian) - * - */ - __pyx_v_buf = NULL; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":857 - * """ - * cdef char *buf = NULL - * cdef unsigned char le = not is_big_endian(self.endian) # <<<<<<<<<<<<<< - * - * self.read(&buf, 4) - */ - __pyx_v_le = (!__pyx_f_6cpyamf_4util_is_big_endian(__pyx_v_self->endian)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":859 - * cdef unsigned char le = not is_big_endian(self.endian) - * - * self.read(&buf, 4) # <<<<<<<<<<<<<< - * - * x[0] = _PyFloat_Unpack4(buf, le) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->read(__pyx_v_self, (&__pyx_v_buf), 4); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":861 - * self.read(&buf, 4) - * - * x[0] = _PyFloat_Unpack4(buf, le) # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_t_2 = _PyFloat_Unpack4(((unsigned char *)__pyx_v_buf), __pyx_v_le); if (unlikely(__pyx_t_2 == (-1.0) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - (__pyx_v_x[0]) = __pyx_t_2; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":863 - * x[0] = _PyFloat_Unpack4(buf, le) - * - * return 0 # <<<<<<<<<<<<<< - * - * cpdef int write_float(self, float c) except -1: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.read_float"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":865 - * return 0 - * - * cpdef int write_float(self, float c) except -1: # <<<<<<<<<<<<<< - * """ - * Writes a 4 byte float to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_float(PyObject *__pyx_v_self, PyObject *__pyx_arg_c); /*proto*/ -static int __pyx_f_6cpyamf_4util_19cBufferedByteStream_write_float(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, float __pyx_v_c, int __pyx_skip_dispatch) { - unsigned char *__pyx_v_buf; - unsigned char __pyx_v_le; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6; - __Pyx_RefNannySetupContext("write_float"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__write_float); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_float)) { - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_c); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __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[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__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 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":873 - * """ - * cdef unsigned char *buf - * cdef unsigned char le = not is_big_endian(self.endian) # <<<<<<<<<<<<<< - * - * buf = malloc(4) - */ - __pyx_v_le = (!__pyx_f_6cpyamf_4util_is_big_endian(__pyx_v_self->endian)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":875 - * cdef unsigned char le = not is_big_endian(self.endian) - * - * buf = malloc(4) # <<<<<<<<<<<<<< - * - * if buf == NULL: - */ - __pyx_v_buf = ((unsigned char *)malloc(4)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":877 - * buf = malloc(4) - * - * if buf == NULL: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * - */ - __pyx_t_5 = (__pyx_v_buf == NULL); - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":878 - * - * if buf == NULL: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * - * try: - */ - __pyx_t_6 = PyErr_NoMemory(); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":880 - * PyErr_NoMemory() - * - * try: # <<<<<<<<<<<<<< - * _PyFloat_Pack4(c, buf, le) - * - */ - /*try:*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":881 - * - * try: - * _PyFloat_Pack4(c, buf, le) # <<<<<<<<<<<<<< - * - * self.write(buf, 4) - */ - __pyx_t_4 = _PyFloat_Pack4(__pyx_v_c, __pyx_v_buf, __pyx_v_le); if (unlikely(__pyx_t_4 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L5;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":883 - * _PyFloat_Pack4(c, buf, le) - * - * self.write(buf, 4) # <<<<<<<<<<<<<< - * finally: - * free(buf) - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->write(__pyx_v_self, ((char *)__pyx_v_buf), 4); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L5;} - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":885 - * self.write(buf, 4) - * finally: - * free(buf) # <<<<<<<<<<<<<< - * - * return 0 - */ - /*finally:*/ { - int __pyx_why; - PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; - int __pyx_exc_lineno; - __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 0; goto __pyx_L6; - __pyx_L5: { - __pyx_why = 4; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); - __pyx_exc_lineno = __pyx_lineno; - goto __pyx_L6; - } - __pyx_L6:; - free(__pyx_v_buf); - switch (__pyx_why) { - case 4: { - __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); - __pyx_lineno = __pyx_exc_lineno; - __pyx_exc_type = 0; - __pyx_exc_value = 0; - __pyx_exc_tb = 0; - goto __pyx_L1_error; - } - } - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":887 - * free(buf) - * - * return 0 # <<<<<<<<<<<<<< - * - * cpdef int append(self, object obj) except -1: - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_float"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":865 - * return 0 - * - * cpdef int write_float(self, float c) except -1: # <<<<<<<<<<<<<< - * """ - * Writes a 4 byte float to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_float(PyObject *__pyx_v_self, PyObject *__pyx_arg_c); /*proto*/ -static char __pyx_doc_6cpyamf_4util_19cBufferedByteStream_write_float[] = "\n Writes a 4 byte float to the stream.\n\n @param c: 4 byte float\n @type c: C{float}\n "; -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_float(PyObject *__pyx_v_self, PyObject *__pyx_arg_c) { - float __pyx_v_c; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("write_float"); - assert(__pyx_arg_c); { - __pyx_v_c = __pyx_PyFloat_AsDouble(__pyx_arg_c); if (unlikely((__pyx_v_c == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_float"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->write_float(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), __pyx_v_c, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.write_float"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":889 - * return 0 - * - * cpdef int append(self, object obj) except -1: # <<<<<<<<<<<<<< - * cdef int i = self.pos - * - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_append(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/ -static int __pyx_f_6cpyamf_4util_19cBufferedByteStream_append(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) { - int __pyx_v_i; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("append"); - /* Check if called by wrapper */ - if (unlikely(__pyx_skip_dispatch)) ; - /* Check if overriden in Python */ - else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__append); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6cpyamf_4util_19cBufferedByteStream_append)) { - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_obj); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj); - __Pyx_GIVEREF(__pyx_v_obj); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":890 - * - * cpdef int append(self, object obj) except -1: - * cdef int i = self.pos # <<<<<<<<<<<<<< - * - * self.pos = self.length - */ - __pyx_v_i = __pyx_v_self->pos; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":892 - * cdef int i = self.pos - * - * self.pos = self.length # <<<<<<<<<<<<<< - * - * if hasattr(obj, 'getvalue'): - */ - __pyx_v_self->pos = __pyx_v_self->length; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":894 - * self.pos = self.length - * - * if hasattr(obj, 'getvalue'): # <<<<<<<<<<<<<< - * self.write_utf8_string(obj.getvalue()) - * else: - */ - __pyx_t_5 = PyObject_HasAttr(__pyx_v_obj, ((PyObject *)__pyx_n_s__getvalue)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_5) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":895 - * - * if hasattr(obj, 'getvalue'): - * self.write_utf8_string(obj.getvalue()) # <<<<<<<<<<<<<< - * else: - * self.write_utf8_string(obj) - */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__getvalue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->write_utf8_string(__pyx_v_self, __pyx_t_3, 0); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L3; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":897 - * self.write_utf8_string(obj.getvalue()) - * else: - * self.write_utf8_string(obj) # <<<<<<<<<<<<<< - * - * self.pos = i - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self->__pyx_vtab)->write_utf8_string(__pyx_v_self, __pyx_v_obj, 0); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":899 - * self.write_utf8_string(obj) - * - * self.pos = i # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_v_self->pos = __pyx_v_i; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":901 - * self.pos = i - * - * return 0 # <<<<<<<<<<<<<< - * - * def __nonzero__(self): - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.append"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":889 - * return 0 - * - * cpdef int append(self, object obj) except -1: # <<<<<<<<<<<<<< - * cdef int i = self.pos - * - */ - -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_append(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4util_19cBufferedByteStream_append(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("append"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->__pyx_vtab)->append(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), __pyx_v_obj, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.cBufferedByteStream.append"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":903 - * return 0 - * - * def __nonzero__(self): # <<<<<<<<<<<<<< - * return self.length > 0 - * - */ - -static int __pyx_pf_6cpyamf_4util_19cBufferedByteStream___nonzero__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pf_6cpyamf_4util_19cBufferedByteStream___nonzero__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannySetupContext("__nonzero__"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":904 - * - * def __nonzero__(self): - * return self.length > 0 # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = (((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self)->length > 0); - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":913 - * """ - * - * def __init__(self, buf=None, min_buf_size=512): # <<<<<<<<<<<<<< - * cdef Py_ssize_t i - * cdef cBufferedByteStream x - */ - -static int __pyx_pf_6cpyamf_4util_18BufferedByteStream___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6cpyamf_4util_18BufferedByteStream___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_buf = 0; - PyObject *__pyx_v_min_buf_size = 0; - struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *__pyx_v_x; - PyObject *__pyx_v_old_pos; - int __pyx_r; - Py_ssize_t __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_t_8; - int __pyx_t_9; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__buf,&__pyx_n_s__min_buf_size,0}; - __Pyx_RefNannySetupContext("__init__"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - values[0] = ((PyObject *)Py_None); - values[1] = ((PyObject *)__pyx_int_512); - 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; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__buf); - if (value) { values[0] = value; kw_args--; } - } - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__min_buf_size); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_buf = values[0]; - __pyx_v_min_buf_size = values[1]; - } else { - __pyx_v_buf = ((PyObject *)Py_None); - __pyx_v_min_buf_size = ((PyObject *)__pyx_int_512); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: __pyx_v_min_buf_size = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: __pyx_v_buf = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - } - 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 = 913; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.util.BufferedByteStream.__init__"); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_v_x = ((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_old_pos = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":917 - * cdef cBufferedByteStream x - * - * self.min_buf_size = min_buf_size # <<<<<<<<<<<<<< - * - * if buf is None: - */ - __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_min_buf_size); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_6cpyamf_4util_BufferedByteStream *)__pyx_v_self)->__pyx_base.min_buf_size = __pyx_t_1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":919 - * self.min_buf_size = min_buf_size - * - * if buf is None: # <<<<<<<<<<<<<< - * pass - * elif isinstance(buf, cBufferedByteStream): - */ - __pyx_t_2 = (__pyx_v_buf == Py_None); - if (__pyx_t_2) { - goto __pyx_L6; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":921 - * if buf is None: - * pass - * elif isinstance(buf, cBufferedByteStream): # <<<<<<<<<<<<<< - * x = buf - * self.write(x.getvalue()) - */ - __pyx_t_2 = PyObject_TypeCheck(__pyx_v_buf, ((PyTypeObject *)((PyObject*)__pyx_ptype_6cpyamf_4util_cBufferedByteStream))); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":922 - * pass - * elif isinstance(buf, cBufferedByteStream): - * x = buf # <<<<<<<<<<<<<< - * self.write(x.getvalue()) - * elif isinstance(buf, (str, unicode)): - */ - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_buf))); - __Pyx_DECREF(((PyObject *)__pyx_v_x)); - __pyx_v_x = ((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_buf); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":923 - * elif isinstance(buf, cBufferedByteStream): - * x = buf - * self.write(x.getvalue()) # <<<<<<<<<<<<<< - * elif isinstance(buf, (str, unicode)): - * self.write(buf) - */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__write); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream *)__pyx_v_x->__pyx_vtab)->getvalue(__pyx_v_x, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __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 = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__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 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L6; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":924 - * x = buf - * self.write(x.getvalue()) - * elif isinstance(buf, (str, unicode)): # <<<<<<<<<<<<<< - * self.write(buf) - * elif hasattr(buf, 'getvalue'): - */ - __Pyx_INCREF(__pyx_v_buf); - __pyx_t_4 = __pyx_v_buf; - __pyx_t_2 = PyString_Check(__pyx_t_4); - if (!__pyx_t_2) { - __pyx_t_6 = PyUnicode_Check(__pyx_t_4); - __pyx_t_7 = __pyx_t_6; - } else { - __pyx_t_7 = __pyx_t_2; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_7) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":925 - * self.write(x.getvalue()) - * elif isinstance(buf, (str, unicode)): - * self.write(buf) # <<<<<<<<<<<<<< - * elif hasattr(buf, 'getvalue'): - * self.write(buf.getvalue()) - */ - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __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 = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_v_buf); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_buf); - __Pyx_GIVEREF(__pyx_v_buf); - __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L6; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":926 - * elif isinstance(buf, (str, unicode)): - * self.write(buf) - * elif hasattr(buf, 'getvalue'): # <<<<<<<<<<<<<< - * self.write(buf.getvalue()) - * elif hasattr(buf, 'read') and hasattr(buf, 'seek') and hasattr(buf, 'tell'): - */ - __pyx_t_7 = PyObject_HasAttr(__pyx_v_buf, ((PyObject *)__pyx_n_s__getvalue)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_7) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":927 - * self.write(buf) - * elif hasattr(buf, 'getvalue'): - * self.write(buf.getvalue()) # <<<<<<<<<<<<<< - * elif hasattr(buf, 'read') and hasattr(buf, 'seek') and hasattr(buf, 'tell'): - * old_pos = buf.tell() - */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__write); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_GetAttr(__pyx_v_buf, __pyx_n_s__getvalue); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__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 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L6; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":928 - * elif hasattr(buf, 'getvalue'): - * self.write(buf.getvalue()) - * elif hasattr(buf, 'read') and hasattr(buf, 'seek') and hasattr(buf, 'tell'): # <<<<<<<<<<<<<< - * old_pos = buf.tell() - * buf.seek(0) - */ - __pyx_t_7 = PyObject_HasAttr(__pyx_v_buf, ((PyObject *)__pyx_n_s__read)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_7) { - __pyx_t_2 = PyObject_HasAttr(__pyx_v_buf, ((PyObject *)__pyx_n_s__seek)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_2) { - __pyx_t_6 = PyObject_HasAttr(__pyx_v_buf, ((PyObject *)__pyx_n_s__tell)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = __pyx_t_6; - } else { - __pyx_t_8 = __pyx_t_2; - } - __pyx_t_2 = __pyx_t_8; - } else { - __pyx_t_2 = __pyx_t_7; - } - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":929 - * self.write(buf.getvalue()) - * elif hasattr(buf, 'read') and hasattr(buf, 'seek') and hasattr(buf, 'tell'): - * old_pos = buf.tell() # <<<<<<<<<<<<<< - * buf.seek(0) - * self.write(buf.read()) - */ - __pyx_t_4 = PyObject_GetAttr(__pyx_v_buf, __pyx_n_s__tell); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_v_old_pos); - __pyx_v_old_pos = __pyx_t_5; - __pyx_t_5 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":930 - * elif hasattr(buf, 'read') and hasattr(buf, 'seek') and hasattr(buf, 'tell'): - * old_pos = buf.tell() - * buf.seek(0) # <<<<<<<<<<<<<< - * self.write(buf.read()) - * buf.seek(old_pos) - */ - __pyx_t_5 = PyObject_GetAttr(__pyx_v_buf, __pyx_n_s__seek); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __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; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":931 - * old_pos = buf.tell() - * buf.seek(0) - * self.write(buf.read()) # <<<<<<<<<<<<<< - * buf.seek(old_pos) - * else: - */ - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_GetAttr(__pyx_v_buf, __pyx_n_s__read); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":932 - * buf.seek(0) - * self.write(buf.read()) - * buf.seek(old_pos) # <<<<<<<<<<<<<< - * else: - * raise TypeError("Unable to coerce buf->StringIO") - */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_buf, __pyx_n_s__seek); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_v_old_pos); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_old_pos); - __Pyx_GIVEREF(__pyx_v_old_pos); - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L6; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":934 - * buf.seek(old_pos) - * else: - * raise TypeError("Unable to coerce buf->StringIO") # <<<<<<<<<<<<<< - * - * self.seek(0) - */ - __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L6:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":936 - * raise TypeError("Unable to coerce buf->StringIO") - * - * self.seek(0) # <<<<<<<<<<<<<< - * - * property endian: - */ - __pyx_t_9 = ((struct __pyx_vtabstruct_6cpyamf_4util_BufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_BufferedByteStream *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.seek(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), 0, 0, NULL); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __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("cpyamf.util.BufferedByteStream.__init__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_x); - __Pyx_DECREF(__pyx_v_old_pos); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":939 - * - * property endian: - * def __set__(self, value): # <<<<<<<<<<<<<< - * if PyString_Check(value) == 0: - * raise TypeError('String value expected') - */ - -static int __pyx_pf_6cpyamf_4util_18BufferedByteStream_6endian___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pf_6cpyamf_4util_18BufferedByteStream_6endian___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - char *__pyx_t_6; - __Pyx_RefNannySetupContext("__set__"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":940 - * property endian: - * def __set__(self, value): - * if PyString_Check(value) == 0: # <<<<<<<<<<<<<< - * raise TypeError('String value expected') - * - */ - __pyx_t_1 = (PyString_Check(__pyx_v_value) == 0); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":941 - * def __set__(self, value): - * if PyString_Check(value) == 0: - * raise TypeError('String value expected') # <<<<<<<<<<<<<< - * - * if value not in [ENDIAN_NETWORK, ENDIAN_NATIVE, ENDIAN_LITTLE, ENDIAN_BIG]: - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_16), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":943 - * raise TypeError('String value expected') - * - * if value not in [ENDIAN_NETWORK, ENDIAN_NATIVE, ENDIAN_LITTLE, ENDIAN_BIG]: # <<<<<<<<<<<<<< - * raise ValueError('Not a valid endian type') - * - */ - __Pyx_INCREF(__pyx_v_value); - __pyx_t_2 = __pyx_v_value; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_kp_b_17), Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __pyx_t_1; - if (__pyx_t_4) { - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_kp_b_18), Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __pyx_t_1; - __pyx_t_1 = __pyx_t_5; - } else { - __pyx_t_1 = __pyx_t_4; - } - if (__pyx_t_1) { - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_kp_b_19), Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __pyx_t_4; - __pyx_t_4 = __pyx_t_5; - } else { - __pyx_t_4 = __pyx_t_1; - } - if (__pyx_t_4) { - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_kp_b_20), Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __pyx_t_1; - __pyx_t_1 = __pyx_t_5; - } else { - __pyx_t_1 = __pyx_t_4; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_t_1; - if (__pyx_t_4) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":944 - * - * if value not in [ENDIAN_NETWORK, ENDIAN_NATIVE, ENDIAN_LITTLE, ENDIAN_BIG]: - * raise ValueError('Not a valid endian type') # <<<<<<<<<<<<<< - * - * self.endian = PyString_AsString(value)[0] - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_22), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":946 - * raise ValueError('Not a valid endian type') - * - * self.endian = PyString_AsString(value)[0] # <<<<<<<<<<<<<< - * - * def __get__(self): - */ - __pyx_t_6 = PyString_AsString(__pyx_v_value); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_6cpyamf_4util_BufferedByteStream *)__pyx_v_self)->__pyx_base.endian = (__pyx_t_6[0]); - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.util.BufferedByteStream.endian.__set__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":948 - * self.endian = PyString_AsString(value)[0] - * - * def __get__(self): # <<<<<<<<<<<<<< - * return PyString_FromStringAndSize(&self.endian, 1) - * - */ - -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_6endian___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_6endian___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":949 - * - * def __get__(self): - * return PyString_FromStringAndSize(&self.endian, 1) # <<<<<<<<<<<<<< - * - * def read(self, size=-1): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyString_FromStringAndSize((&((struct __pyx_obj_6cpyamf_4util_BufferedByteStream *)__pyx_v_self)->__pyx_base.endian), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.util.BufferedByteStream.endian.__get__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":951 - * return PyString_FromStringAndSize(&self.endian, 1) - * - * def read(self, size=-1): # <<<<<<<<<<<<<< - * """ - * Reads C{size} bytes from the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6cpyamf_4util_18BufferedByteStream_read[] = "\n Reads C{size} bytes from the stream.\n "; -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_size = 0; - Py_ssize_t __pyx_v_s; - char *__pyx_v_buf; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - Py_ssize_t __pyx_t_3; - int __pyx_t_4; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0}; - __Pyx_RefNannySetupContext("read"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[1] = {0}; - values[0] = ((PyObject *)__pyx_int_neg_1); - 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; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); - if (value) { values[0] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "read") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_size = values[0]; - } else { - __pyx_v_size = ((PyObject *)__pyx_int_neg_1); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 1: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("read", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.util.BufferedByteStream.read"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":958 - * cdef object cls - * - * if size != -1: # <<<<<<<<<<<<<< - * s = size - * else: - */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_size, __pyx_int_neg_1, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":959 - * - * if size != -1: - * s = size # <<<<<<<<<<<<<< - * else: - * s = self.remaining() - */ - __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_size); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_s = __pyx_t_3; - goto __pyx_L6; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":961 - * s = size - * else: - * s = self.remaining() # <<<<<<<<<<<<<< - * - * if s == 0: - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6cpyamf_4util_BufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_BufferedByteStream *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.remaining(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), 0); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_s = __pyx_t_3; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":963 - * s = self.remaining() - * - * if s == 0: # <<<<<<<<<<<<<< - * s = 1 - * - */ - __pyx_t_2 = (__pyx_v_s == 0); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":964 - * - * if s == 0: - * s = 1 # <<<<<<<<<<<<<< - * - * cdef char *buf = NULL - */ - __pyx_v_s = 1; - goto __pyx_L7; - } - __pyx_L7:; - } - __pyx_L6:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":966 - * s = 1 - * - * cdef char *buf = NULL # <<<<<<<<<<<<<< - * - * cBufferedByteStream.read(self, &buf, s) - */ - __pyx_v_buf = NULL; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":968 - * cdef char *buf = NULL - * - * cBufferedByteStream.read(self, &buf, s) # <<<<<<<<<<<<<< - * - * return PyString_FromStringAndSize(buf, s) - */ - __pyx_t_4 = __pyx_vtabptr_6cpyamf_4util_cBufferedByteStream->read(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), (&__pyx_v_buf), __pyx_v_s); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":970 - * cBufferedByteStream.read(self, &buf, s) - * - * return PyString_FromStringAndSize(buf, s) # <<<<<<<<<<<<<< - * - * def write(self, x, size=-1): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyString_FromStringAndSize(__pyx_v_buf, __pyx_v_s); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.util.BufferedByteStream.read"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":972 - * return PyString_FromStringAndSize(buf, s) - * - * def write(self, x, size=-1): # <<<<<<<<<<<<<< - * """ - * Writes the content of the specified C{x} into this buffer. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_write(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6cpyamf_4util_18BufferedByteStream_write[] = "\n Writes the content of the specified C{x} into this buffer.\n\n @param x:\n @type x:\n "; -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_write(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_x = 0; - PyObject *__pyx_v_size = 0; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - char *__pyx_t_4; - Py_ssize_t __pyx_t_5; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__x,&__pyx_n_s__size,0}; - __Pyx_RefNannySetupContext("write"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - values[1] = ((PyObject *)__pyx_int_neg_1); - 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; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__x); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "write") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_x = values[0]; - __pyx_v_size = values[1]; - } else { - __pyx_v_size = ((PyObject *)__pyx_int_neg_1); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: __pyx_v_x = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("write", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.util.BufferedByteStream.write"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":979 - * @type x: - * """ - * if size == -1: # <<<<<<<<<<<<<< - * cBufferedByteStream.write_utf8_string(self, x) - * else: - */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_size, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":980 - * """ - * if size == -1: - * cBufferedByteStream.write_utf8_string(self, x) # <<<<<<<<<<<<<< - * else: - * cBufferedByteStream.write(self, x, size) - */ - __pyx_t_3 = __pyx_vtabptr_6cpyamf_4util_cBufferedByteStream->write_utf8_string(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), __pyx_v_x, 1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":982 - * cBufferedByteStream.write_utf8_string(self, x) - * else: - * cBufferedByteStream.write(self, x, size) # <<<<<<<<<<<<<< - * - * def flush(self): - */ - __pyx_t_4 = PyBytes_AsString(__pyx_v_x); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_size); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = __pyx_vtabptr_6cpyamf_4util_cBufferedByteStream->write(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), __pyx_t_4, __pyx_t_5); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L6:; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.util.BufferedByteStream.write"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":984 - * cBufferedByteStream.write(self, x, size) - * - * def flush(self): # <<<<<<<<<<<<<< - * # no-op - * pass - */ - -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("flush"); - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":988 - * pass - * - * def __len__(self): # <<<<<<<<<<<<<< - * return self.length - * - */ - -static Py_ssize_t __pyx_pf_6cpyamf_4util_18BufferedByteStream___len__(PyObject *__pyx_v_self); /*proto*/ -static Py_ssize_t __pyx_pf_6cpyamf_4util_18BufferedByteStream___len__(PyObject *__pyx_v_self) { - Py_ssize_t __pyx_r; - __Pyx_RefNannySetupContext("__len__"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":989 - * - * def __len__(self): - * return self.length # <<<<<<<<<<<<<< - * - * def peek(self, Py_ssize_t size=1): - */ - __pyx_r = ((struct __pyx_obj_6cpyamf_4util_BufferedByteStream *)__pyx_v_self)->__pyx_base.length; - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":991 - * return self.length - * - * def peek(self, Py_ssize_t size=1): # <<<<<<<<<<<<<< - * """ - * Looks C{size} bytes ahead in the stream, returning what it finds, - */ - -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_peek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6cpyamf_4util_18BufferedByteStream_peek[] = "\n Looks C{size} bytes ahead in the stream, returning what it finds,\n returning the stream pointer to its initial position.\n\n @param size: Default is 1.\n @type size: C{int}\n\n @rtype:\n @return: Bytes.\n "; -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_peek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - Py_ssize_t __pyx_v_size; - char *__pyx_v_buf; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0}; - __Pyx_RefNannySetupContext("peek"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[1] = {0}; - 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; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); - if (value) { values[0] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "peek") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - if (values[0]) { - __pyx_v_size = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_size == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_size = ((Py_ssize_t)1); - } - } else { - __pyx_v_size = ((Py_ssize_t)1); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 1: __pyx_v_size = __Pyx_PyIndex_AsSsize_t(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_size == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("peek", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("cpyamf.util.BufferedByteStream.peek"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1002 - * @return: Bytes. - * """ - * cdef char *buf = NULL # <<<<<<<<<<<<<< - * - * if size == -1: - */ - __pyx_v_buf = NULL; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1004 - * cdef char *buf = NULL - * - * if size == -1: # <<<<<<<<<<<<<< - * size = cBufferedByteStream.remaining(self) - * - */ - __pyx_t_1 = (__pyx_v_size == -1); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1005 - * - * if size == -1: - * size = cBufferedByteStream.remaining(self) # <<<<<<<<<<<<<< - * - * size = cBufferedByteStream.peek(self, &buf, size) - */ - __pyx_t_2 = __pyx_vtabptr_6cpyamf_4util_cBufferedByteStream->remaining(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), 1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_size = __pyx_t_2; - goto __pyx_L6; - } - __pyx_L6:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1007 - * size = cBufferedByteStream.remaining(self) - * - * size = cBufferedByteStream.peek(self, &buf, size) # <<<<<<<<<<<<<< - * - * return PyString_FromStringAndSize(buf, size) - */ - __pyx_t_2 = __pyx_vtabptr_6cpyamf_4util_cBufferedByteStream->peek(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), (&__pyx_v_buf), __pyx_v_size); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_size = __pyx_t_2; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1009 - * size = cBufferedByteStream.peek(self, &buf, size) - * - * return PyString_FromStringAndSize(buf, size) # <<<<<<<<<<<<<< - * - * def write_char(self, x): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyString_FromStringAndSize(__pyx_v_buf, __pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.util.BufferedByteStream.peek"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1011 - * return PyString_FromStringAndSize(buf, size) - * - * def write_char(self, x): # <<<<<<<<<<<<<< - * """ - * Write a C{char} to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_write_char(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/ -static char __pyx_doc_6cpyamf_4util_18BufferedByteStream_write_char[] = "\n Write a C{char} to the stream.\n\n @param x: char\n @type x: C{int}\n @raise TypeError: Unexpected type for int C{x}.\n "; -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_write_char(PyObject *__pyx_v_self, PyObject *__pyx_v_x) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - char __pyx_t_5; - int __pyx_t_6; - __Pyx_RefNannySetupContext("write_char"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1019 - * @raise TypeError: Unexpected type for int C{x}. - * """ - * if PyInt_Check(x) == 0 and PyLong_Check(x) == 0: # <<<<<<<<<<<<<< - * raise TypeError('expected int for x') - * - */ - __pyx_t_1 = (PyInt_Check(__pyx_v_x) == 0); - if (__pyx_t_1) { - __pyx_t_2 = (PyLong_Check(__pyx_v_x) == 0); - __pyx_t_3 = __pyx_t_2; - } else { - __pyx_t_3 = __pyx_t_1; - } - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1020 - * """ - * if PyInt_Check(x) == 0 and PyLong_Check(x) == 0: - * raise TypeError('expected int for x') # <<<<<<<<<<<<<< - * - * cBufferedByteStream.write_char(self, x) - */ - __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_24), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1022 - * raise TypeError('expected int for x') - * - * cBufferedByteStream.write_char(self, x) # <<<<<<<<<<<<<< - * - * def write_ushort(self, x): - */ - __pyx_t_5 = __Pyx_PyInt_AsChar(__pyx_v_x); if (unlikely((__pyx_t_5 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __pyx_vtabptr_6cpyamf_4util_cBufferedByteStream->write_char(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), __pyx_t_5, 1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("cpyamf.util.BufferedByteStream.write_char"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1024 - * cBufferedByteStream.write_char(self, x) - * - * def write_ushort(self, x): # <<<<<<<<<<<<<< - * """ - * Writes a 2 byte unsigned integer to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_write_ushort(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/ -static char __pyx_doc_6cpyamf_4util_18BufferedByteStream_write_ushort[] = "\n Writes a 2 byte unsigned integer to the stream.\n\n @param x: 2 byte unsigned integer\n @type x: C{int}\n @raise TypeError: Unexpected type for int C{x}.\n "; -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_write_ushort(PyObject *__pyx_v_self, PyObject *__pyx_v_x) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - unsigned short __pyx_t_5; - int __pyx_t_6; - __Pyx_RefNannySetupContext("write_ushort"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1032 - * @raise TypeError: Unexpected type for int C{x}. - * """ - * if PyInt_Check(x) == 0 and PyLong_Check(x) == 0: # <<<<<<<<<<<<<< - * raise TypeError('expected int for x') - * - */ - __pyx_t_1 = (PyInt_Check(__pyx_v_x) == 0); - if (__pyx_t_1) { - __pyx_t_2 = (PyLong_Check(__pyx_v_x) == 0); - __pyx_t_3 = __pyx_t_2; - } else { - __pyx_t_3 = __pyx_t_1; - } - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1033 - * """ - * if PyInt_Check(x) == 0 and PyLong_Check(x) == 0: - * raise TypeError('expected int for x') # <<<<<<<<<<<<<< - * - * cBufferedByteStream.write_ushort(self, x) - */ - __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_25), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1035 - * raise TypeError('expected int for x') - * - * cBufferedByteStream.write_ushort(self, x) # <<<<<<<<<<<<<< - * - * def write_short(self, x): - */ - __pyx_t_5 = __Pyx_PyInt_AsUnsignedShort(__pyx_v_x); if (unlikely((__pyx_t_5 == (unsigned short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __pyx_vtabptr_6cpyamf_4util_cBufferedByteStream->write_ushort(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), __pyx_t_5, 1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("cpyamf.util.BufferedByteStream.write_ushort"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1037 - * cBufferedByteStream.write_ushort(self, x) - * - * def write_short(self, x): # <<<<<<<<<<<<<< - * """ - * Writes a 2 byte integer to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_write_short(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/ -static char __pyx_doc_6cpyamf_4util_18BufferedByteStream_write_short[] = "\n Writes a 2 byte integer to the stream.\n\n @param x: 2 byte integer\n @type x: C{int}\n @raise TypeError: Unexpected type for int C{x}.\n "; -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_write_short(PyObject *__pyx_v_self, PyObject *__pyx_v_x) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - short __pyx_t_5; - int __pyx_t_6; - __Pyx_RefNannySetupContext("write_short"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1045 - * @raise TypeError: Unexpected type for int C{x}. - * """ - * if PyInt_Check(x) == 0 and PyLong_Check(x) == 0: # <<<<<<<<<<<<<< - * raise TypeError('expected int for x') - * - */ - __pyx_t_1 = (PyInt_Check(__pyx_v_x) == 0); - if (__pyx_t_1) { - __pyx_t_2 = (PyLong_Check(__pyx_v_x) == 0); - __pyx_t_3 = __pyx_t_2; - } else { - __pyx_t_3 = __pyx_t_1; - } - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1046 - * """ - * if PyInt_Check(x) == 0 and PyLong_Check(x) == 0: - * raise TypeError('expected int for x') # <<<<<<<<<<<<<< - * - * cBufferedByteStream.write_short(self, x) - */ - __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_26), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1048 - * raise TypeError('expected int for x') - * - * cBufferedByteStream.write_short(self, x) # <<<<<<<<<<<<<< - * - * def write_ulong(self, x): - */ - __pyx_t_5 = __Pyx_PyInt_AsShort(__pyx_v_x); if (unlikely((__pyx_t_5 == (short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __pyx_vtabptr_6cpyamf_4util_cBufferedByteStream->write_short(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), __pyx_t_5, 1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("cpyamf.util.BufferedByteStream.write_short"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1050 - * cBufferedByteStream.write_short(self, x) - * - * def write_ulong(self, x): # <<<<<<<<<<<<<< - * """ - * Writes a 4 byte unsigned integer to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_write_ulong(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/ -static char __pyx_doc_6cpyamf_4util_18BufferedByteStream_write_ulong[] = "\n Writes a 4 byte unsigned integer to the stream.\n\n @param x: 4 byte unsigned integer\n @type x: C{int}\n @raise TypeError: Unexpected type for int C{x}.\n "; -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_write_ulong(PyObject *__pyx_v_self, PyObject *__pyx_v_x) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - unsigned long __pyx_t_5; - int __pyx_t_6; - __Pyx_RefNannySetupContext("write_ulong"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1058 - * @raise TypeError: Unexpected type for int C{x}. - * """ - * if PyInt_Check(x) == 0 and PyLong_Check(x) == 0: # <<<<<<<<<<<<<< - * raise TypeError('expected int for x') - * - */ - __pyx_t_1 = (PyInt_Check(__pyx_v_x) == 0); - if (__pyx_t_1) { - __pyx_t_2 = (PyLong_Check(__pyx_v_x) == 0); - __pyx_t_3 = __pyx_t_2; - } else { - __pyx_t_3 = __pyx_t_1; - } - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1059 - * """ - * if PyInt_Check(x) == 0 and PyLong_Check(x) == 0: - * raise TypeError('expected int for x') # <<<<<<<<<<<<<< - * - * if x > 4294967295L or x < 0: - */ - __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_27), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1061 - * raise TypeError('expected int for x') - * - * if x > 4294967295L or x < 0: # <<<<<<<<<<<<<< - * raise OverflowError - * - */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_x, __pyx_int_4294967295L, Py_GT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __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 = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_3) { - __pyx_t_4 = PyObject_RichCompare(__pyx_v_x, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __pyx_t_1; - } else { - __pyx_t_2 = __pyx_t_3; - } - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1062 - * - * if x > 4294967295L or x < 0: - * raise OverflowError # <<<<<<<<<<<<<< - * - * cBufferedByteStream.write_ulong(self, x) - */ - __Pyx_Raise(__pyx_builtin_OverflowError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1064 - * raise OverflowError - * - * cBufferedByteStream.write_ulong(self, x) # <<<<<<<<<<<<<< - * - * def read_double(self): - */ - __pyx_t_5 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_x); if (unlikely((__pyx_t_5 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __pyx_vtabptr_6cpyamf_4util_cBufferedByteStream->write_ulong(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), __pyx_t_5, 1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("cpyamf.util.BufferedByteStream.write_ulong"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1066 - * cBufferedByteStream.write_ulong(self, x) - * - * def read_double(self): # <<<<<<<<<<<<<< - * """ - * Reads an 8 byte float from the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_read_double(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6cpyamf_4util_18BufferedByteStream_read_double[] = "\n Reads an 8 byte float from the stream.\n "; -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_read_double(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - double __pyx_v_x; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("read_double"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1072 - * cdef double x - * - * cBufferedByteStream.read_double(self, &x) # <<<<<<<<<<<<<< - * - * if float_broken == 1: - */ - __pyx_t_1 = __pyx_vtabptr_6cpyamf_4util_cBufferedByteStream->read_double(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), (&__pyx_v_x)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1074 - * cBufferedByteStream.read_double(self, &x) - * - * if float_broken == 1: # <<<<<<<<<<<<<< - * if memcmp(&x, &system_nan, 8) == 0: - * return pyamf_NaN - */ - __pyx_t_2 = (__pyx_v_6cpyamf_4util_float_broken == 1); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1075 - * - * if float_broken == 1: - * if memcmp(&x, &system_nan, 8) == 0: # <<<<<<<<<<<<<< - * return pyamf_NaN - * elif memcmp(&x, &system_neginf, 8) == 0: - */ - __pyx_t_2 = (memcmp((&__pyx_v_x), (&__pyx_v_6cpyamf_4util_system_nan), 8) == 0); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1076 - * if float_broken == 1: - * if memcmp(&x, &system_nan, 8) == 0: - * return pyamf_NaN # <<<<<<<<<<<<<< - * elif memcmp(&x, &system_neginf, 8) == 0: - * return pyamf_NegInf - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_6cpyamf_4util_pyamf_NaN); - __pyx_r = __pyx_v_6cpyamf_4util_pyamf_NaN; - goto __pyx_L0; - goto __pyx_L6; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1077 - * if memcmp(&x, &system_nan, 8) == 0: - * return pyamf_NaN - * elif memcmp(&x, &system_neginf, 8) == 0: # <<<<<<<<<<<<<< - * return pyamf_NegInf - * elif memcmp(&x, &system_posinf, 8) == 0: - */ - __pyx_t_2 = (memcmp((&__pyx_v_x), (&__pyx_v_6cpyamf_4util_system_neginf), 8) == 0); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1078 - * return pyamf_NaN - * elif memcmp(&x, &system_neginf, 8) == 0: - * return pyamf_NegInf # <<<<<<<<<<<<<< - * elif memcmp(&x, &system_posinf, 8) == 0: - * return pyamf_PosInf - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_6cpyamf_4util_pyamf_NegInf); - __pyx_r = __pyx_v_6cpyamf_4util_pyamf_NegInf; - goto __pyx_L0; - goto __pyx_L6; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1079 - * elif memcmp(&x, &system_neginf, 8) == 0: - * return pyamf_NegInf - * elif memcmp(&x, &system_posinf, 8) == 0: # <<<<<<<<<<<<<< - * return pyamf_PosInf - * - */ - __pyx_t_2 = (memcmp((&__pyx_v_x), (&__pyx_v_6cpyamf_4util_system_posinf), 8) == 0); - if (__pyx_t_2) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1080 - * return pyamf_NegInf - * elif memcmp(&x, &system_posinf, 8) == 0: - * return pyamf_PosInf # <<<<<<<<<<<<<< - * - * return PyFloat_FromDouble(x) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_6cpyamf_4util_pyamf_PosInf); - __pyx_r = __pyx_v_6cpyamf_4util_pyamf_PosInf; - goto __pyx_L0; - goto __pyx_L6; - } - __pyx_L6:; - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1082 - * return pyamf_PosInf - * - * return PyFloat_FromDouble(x) # <<<<<<<<<<<<<< - * - * def write_double(self, val): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cpyamf.util.BufferedByteStream.read_double"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1084 - * return PyFloat_FromDouble(x) - * - * def write_double(self, val): # <<<<<<<<<<<<<< - * """ - * Writes an 8 byte float to the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_write_double(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ -static char __pyx_doc_6cpyamf_4util_18BufferedByteStream_write_double[] = "\n Writes an 8 byte float to the stream.\n\n @param val: 8 byte float\n @type val: C{float}\n @raise TypeError: Unexpected type for float C{val}.\n "; -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_write_double(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { - double __pyx_v_d; - long __pyx_v_done; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - double __pyx_t_3; - PyObject *__pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("write_double"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1092 - * @raise TypeError: Unexpected type for float C{val}. - * """ - * if PyFloat_Check(val) == 0: # <<<<<<<<<<<<<< - * raise TypeError('Expecting float for val') - * - */ - __pyx_t_1 = (PyFloat_Check(__pyx_v_val) == 0); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1093 - * """ - * if PyFloat_Check(val) == 0: - * raise TypeError('Expecting float for val') # <<<<<<<<<<<<<< - * - * cdef double d = val - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_29), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1095 - * raise TypeError('Expecting float for val') - * - * cdef double d = val # <<<<<<<<<<<<<< - * - * if float_broken == 1: - */ - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_val); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_d = __pyx_t_3; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1097 - * cdef double d = val - * - * if float_broken == 1: # <<<<<<<<<<<<<< - * if memcmp(&d, &platform_nan, 8) == 0: - * done = 1 - */ - __pyx_t_1 = (__pyx_v_6cpyamf_4util_float_broken == 1); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1098 - * - * if float_broken == 1: - * if memcmp(&d, &platform_nan, 8) == 0: # <<<<<<<<<<<<<< - * done = 1 - * elif memcmp(&d, &platform_neginf, 8) == 0: - */ - __pyx_t_1 = (memcmp((&__pyx_v_d), (&__pyx_v_6cpyamf_4util_platform_nan), 8) == 0); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1099 - * if float_broken == 1: - * if memcmp(&d, &platform_nan, 8) == 0: - * done = 1 # <<<<<<<<<<<<<< - * elif memcmp(&d, &platform_neginf, 8) == 0: - * done = 1 - */ - __pyx_v_done = 1; - goto __pyx_L7; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1100 - * if memcmp(&d, &platform_nan, 8) == 0: - * done = 1 - * elif memcmp(&d, &platform_neginf, 8) == 0: # <<<<<<<<<<<<<< - * done = 1 - * elif memcmp(&d, &platform_posinf, 8) == 0: - */ - __pyx_t_1 = (memcmp((&__pyx_v_d), (&__pyx_v_6cpyamf_4util_platform_neginf), 8) == 0); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1101 - * done = 1 - * elif memcmp(&d, &platform_neginf, 8) == 0: - * done = 1 # <<<<<<<<<<<<<< - * elif memcmp(&d, &platform_posinf, 8) == 0: - * done = 1 - */ - __pyx_v_done = 1; - goto __pyx_L7; - } - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1102 - * elif memcmp(&d, &platform_neginf, 8) == 0: - * done = 1 - * elif memcmp(&d, &platform_posinf, 8) == 0: # <<<<<<<<<<<<<< - * done = 1 - * - */ - __pyx_t_1 = (memcmp((&__pyx_v_d), (&__pyx_v_6cpyamf_4util_platform_posinf), 8) == 0); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1103 - * done = 1 - * elif memcmp(&d, &platform_posinf, 8) == 0: - * done = 1 # <<<<<<<<<<<<<< - * - * if done == 1: - */ - __pyx_v_done = 1; - goto __pyx_L7; - } - __pyx_L7:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1105 - * done = 1 - * - * if done == 1: # <<<<<<<<<<<<<< - * if is_big_endian(SYSTEM_ENDIAN): - * if not is_big_endian(self.endian): - */ - __pyx_t_1 = (__pyx_v_done == 1); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1106 - * - * if done == 1: - * if is_big_endian(SYSTEM_ENDIAN): # <<<<<<<<<<<<<< - * if not is_big_endian(self.endian): - * if swap_bytes(&d, 8) == -1: - */ - __pyx_t_1 = __pyx_f_6cpyamf_4util_is_big_endian(__pyx_v_6cpyamf_4util_SYSTEM_ENDIAN); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1107 - * if done == 1: - * if is_big_endian(SYSTEM_ENDIAN): - * if not is_big_endian(self.endian): # <<<<<<<<<<<<<< - * if swap_bytes(&d, 8) == -1: - * PyErr_NoMemory() - */ - __pyx_t_1 = (!__pyx_f_6cpyamf_4util_is_big_endian(((struct __pyx_obj_6cpyamf_4util_BufferedByteStream *)__pyx_v_self)->__pyx_base.endian)); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1108 - * if is_big_endian(SYSTEM_ENDIAN): - * if not is_big_endian(self.endian): - * if swap_bytes(&d, 8) == -1: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * else: - */ - __pyx_t_1 = (__pyx_f_6cpyamf_4util_swap_bytes(((unsigned char *)(&__pyx_v_d)), 8) == -1); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1109 - * if not is_big_endian(self.endian): - * if swap_bytes(&d, 8) == -1: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * else: - * if is_big_endian(self.endian): - */ - __pyx_t_4 = PyErr_NoMemory(); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L11; - } - __pyx_L11:; - goto __pyx_L10; - } - __pyx_L10:; - goto __pyx_L9; - } - /*else*/ { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1111 - * PyErr_NoMemory() - * else: - * if is_big_endian(self.endian): # <<<<<<<<<<<<<< - * if swap_bytes(&d, 8) == -1: - * PyErr_NoMemory() - */ - __pyx_t_1 = __pyx_f_6cpyamf_4util_is_big_endian(((struct __pyx_obj_6cpyamf_4util_BufferedByteStream *)__pyx_v_self)->__pyx_base.endian); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1112 - * else: - * if is_big_endian(self.endian): - * if swap_bytes(&d, 8) == -1: # <<<<<<<<<<<<<< - * PyErr_NoMemory() - * - */ - __pyx_t_1 = (__pyx_f_6cpyamf_4util_swap_bytes(((unsigned char *)(&__pyx_v_d)), 8) == -1); - if (__pyx_t_1) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1113 - * if is_big_endian(self.endian): - * if swap_bytes(&d, 8) == -1: - * PyErr_NoMemory() # <<<<<<<<<<<<<< - * - * cBufferedByteStream.write(self, &d, 8) - */ - __pyx_t_4 = PyErr_NoMemory(); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L13; - } - __pyx_L13:; - goto __pyx_L12; - } - __pyx_L12:; - } - __pyx_L9:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1115 - * PyErr_NoMemory() - * - * cBufferedByteStream.write(self, &d, 8) # <<<<<<<<<<<<<< - * - * return - */ - __pyx_t_5 = __pyx_vtabptr_6cpyamf_4util_cBufferedByteStream->write(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), ((char *)(&__pyx_v_d)), 8); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1117 - * cBufferedByteStream.write(self, &d, 8) - * - * return # <<<<<<<<<<<<<< - * - * cBufferedByteStream.write_double(self, d) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - goto __pyx_L8; - } - __pyx_L8:; - goto __pyx_L6; - } - __pyx_L6:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1119 - * return - * - * cBufferedByteStream.write_double(self, d) # <<<<<<<<<<<<<< - * - * def read_float(self): - */ - __pyx_t_5 = __pyx_vtabptr_6cpyamf_4util_cBufferedByteStream->write_double(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), __pyx_v_d, 1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.BufferedByteStream.write_double"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1121 - * cBufferedByteStream.write_double(self, d) - * - * def read_float(self): # <<<<<<<<<<<<<< - * """ - * Reads a 4 byte float from the stream. - */ - -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_read_float(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6cpyamf_4util_18BufferedByteStream_read_float[] = "\n Reads a 4 byte float from the stream.\n "; -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream_read_float(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - float __pyx_v_x; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("read_float"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1127 - * cdef float x - * - * cBufferedByteStream.read_float(self, &x) # <<<<<<<<<<<<<< - * - * return PyFloat_FromDouble(x) - */ - __pyx_t_1 = __pyx_vtabptr_6cpyamf_4util_cBufferedByteStream->read_float(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), (&__pyx_v_x)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1129 - * cBufferedByteStream.read_float(self, &x) - * - * return PyFloat_FromDouble(x) # <<<<<<<<<<<<<< - * - * def __add__(self, other): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("cpyamf.util.BufferedByteStream.read_float"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1131 - * return PyFloat_FromDouble(x) - * - * def __add__(self, other): # <<<<<<<<<<<<<< - * cdef Py_ssize_t old_pos = self.tell() - * cdef Py_ssize_t old_other_pos = other.tell() - */ - -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream___add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream___add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { - Py_ssize_t __pyx_v_old_pos; - Py_ssize_t __pyx_v_old_other_pos; - struct __pyx_obj_6cpyamf_4util_BufferedByteStream *__pyx_v_new; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - int __pyx_t_4; - struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_seek __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - __Pyx_RefNannySetupContext("__add__"); - __pyx_v_new = ((struct __pyx_obj_6cpyamf_4util_BufferedByteStream *)Py_None); __Pyx_INCREF(Py_None); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1132 - * - * def __add__(self, other): - * cdef Py_ssize_t old_pos = self.tell() # <<<<<<<<<<<<<< - * cdef Py_ssize_t old_other_pos = other.tell() - * - */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tell); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_old_pos = __pyx_t_3; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1133 - * def __add__(self, other): - * cdef Py_ssize_t old_pos = self.tell() - * cdef Py_ssize_t old_other_pos = other.tell() # <<<<<<<<<<<<<< - * - * new = BufferedByteStream(self) - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__tell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_old_other_pos = __pyx_t_3; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1135 - * cdef Py_ssize_t old_other_pos = other.tell() - * - * new = BufferedByteStream(self) # <<<<<<<<<<<<<< - * - * other.seek(0) - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_self); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6cpyamf_4util_BufferedByteStream)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_new)); - __pyx_v_new = ((struct __pyx_obj_6cpyamf_4util_BufferedByteStream *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1137 - * new = BufferedByteStream(self) - * - * other.seek(0) # <<<<<<<<<<<<<< - * new.seek(0, 2) - * new.write(other.read()) - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__seek); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_30), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1138 - * - * other.seek(0) - * new.seek(0, 2) # <<<<<<<<<<<<<< - * new.write(other.read()) - * - */ - __pyx_t_5.__pyx_n = 1; - __pyx_t_5.mode = 2; - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_BufferedByteStream *)__pyx_v_new->__pyx_base.__pyx_vtab)->__pyx_base.seek(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_new), 0, 0, &__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1139 - * other.seek(0) - * new.seek(0, 2) - * new.write(other.read()) # <<<<<<<<<<<<<< - * - * self.seek(old_pos) - */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_new), __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__read); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1141 - * new.write(other.read()) - * - * self.seek(old_pos) # <<<<<<<<<<<<<< - * other.seek(old_other_pos) - * new.seek(0) - */ - __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__seek); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_old_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__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 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1142 - * - * self.seek(old_pos) - * other.seek(old_other_pos) # <<<<<<<<<<<<<< - * new.seek(0) - * - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__seek); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_old_other_pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1143 - * self.seek(old_pos) - * other.seek(old_other_pos) - * new.seek(0) # <<<<<<<<<<<<<< - * - * return new - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6cpyamf_4util_BufferedByteStream *)__pyx_v_new->__pyx_base.__pyx_vtab)->__pyx_base.seek(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_new), 0, 0, NULL); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1145 - * new.seek(0) - * - * return new # <<<<<<<<<<<<<< - * - * def __str__(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_new)); - __pyx_r = ((PyObject *)__pyx_v_new); - goto __pyx_L0; - - __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("cpyamf.util.BufferedByteStream.__add__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_new); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1147 - * return new - * - * def __str__(self): # <<<<<<<<<<<<<< - * return self.getvalue() - * - */ - -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream___str__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6cpyamf_4util_18BufferedByteStream___str__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__str__"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1148 - * - * def __str__(self): - * return self.getvalue() # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6cpyamf_4util_BufferedByteStream *)((struct __pyx_obj_6cpyamf_4util_BufferedByteStream *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.getvalue(((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpyamf.util.BufferedByteStream.__str__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream __pyx_vtable_6cpyamf_4util_cBufferedByteStream; - -static PyObject *__pyx_tp_new_6cpyamf_4util_cBufferedByteStream(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *p; - PyObject *o = (*t->tp_alloc)(t, 0); - if (!o) return 0; - p = ((struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *)o); - p->__pyx_vtab = __pyx_vtabptr_6cpyamf_4util_cBufferedByteStream; - if (__pyx_pf_6cpyamf_4util_19cBufferedByteStream___cinit__(o, __pyx_empty_tuple, NULL) < 0) { - Py_DECREF(o); o = 0; - } - return o; -} - -static void __pyx_tp_dealloc_6cpyamf_4util_cBufferedByteStream(PyObject *o) { - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pf_6cpyamf_4util_19cBufferedByteStream___dealloc__(o); - if (PyErr_Occurred()) PyErr_WriteUnraisable(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); - } - (*Py_TYPE(o)->tp_free)(o); -} - -static PyMethodDef __pyx_methods_6cpyamf_4util_cBufferedByteStream[] = { - {__Pyx_NAMESTR("tell"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_tell, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_tell)}, - {__Pyx_NAMESTR("at_eof"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_at_eof, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_at_eof)}, - {__Pyx_NAMESTR("remaining"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_remaining, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_remaining)}, - {__Pyx_NAMESTR("seek"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_seek, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_seek)}, - {__Pyx_NAMESTR("getvalue"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_getvalue, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_getvalue)}, - {__Pyx_NAMESTR("truncate"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_truncate, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_truncate)}, - {__Pyx_NAMESTR("consume"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_consume, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_consume)}, - {__Pyx_NAMESTR("read_uchar"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_uchar, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_read_uchar)}, - {__Pyx_NAMESTR("read_char"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_char, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_read_char)}, - {__Pyx_NAMESTR("read_ushort"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_ushort, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_read_ushort)}, - {__Pyx_NAMESTR("read_short"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_short, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_read_short)}, - {__Pyx_NAMESTR("read_24bit_uint"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_24bit_uint, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_read_24bit_uint)}, - {__Pyx_NAMESTR("read_24bit_int"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_24bit_int, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_read_24bit_int)}, - {__Pyx_NAMESTR("read_ulong"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_ulong, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_read_ulong)}, - {__Pyx_NAMESTR("read_long"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_long, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_read_long)}, - {__Pyx_NAMESTR("write_uchar"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_uchar, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_write_uchar)}, - {__Pyx_NAMESTR("write_char"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_char, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_write_char)}, - {__Pyx_NAMESTR("write_ushort"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_ushort, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_write_ushort)}, - {__Pyx_NAMESTR("write_short"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_short, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_write_short)}, - {__Pyx_NAMESTR("write_ulong"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_ulong, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_write_ulong)}, - {__Pyx_NAMESTR("write_long"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_long, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_write_long)}, - {__Pyx_NAMESTR("write_24bit_uint"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_24bit_uint, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_write_24bit_uint)}, - {__Pyx_NAMESTR("write_24bit_int"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_24bit_int, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_write_24bit_int)}, - {__Pyx_NAMESTR("read_utf8_string"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_read_utf8_string, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_read_utf8_string)}, - {__Pyx_NAMESTR("write_utf8_string"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_utf8_string, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_write_utf8_string)}, - {__Pyx_NAMESTR("write_double"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_double, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_write_double)}, - {__Pyx_NAMESTR("write_float"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_write_float, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_19cBufferedByteStream_write_float)}, - {__Pyx_NAMESTR("append"), (PyCFunction)__pyx_pf_6cpyamf_4util_19cBufferedByteStream_append, METH_O, __Pyx_DOCSTR(0)}, - {0, 0, 0, 0} -}; - -static PyNumberMethods __pyx_tp_as_number_cBufferedByteStream = { - 0, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_divide*/ - #endif - 0, /*nb_remainder*/ - 0, /*nb_divmod*/ - 0, /*nb_power*/ - 0, /*nb_negative*/ - 0, /*nb_positive*/ - 0, /*nb_absolute*/ - __pyx_pf_6cpyamf_4util_19cBufferedByteStream___nonzero__, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_coerce*/ - #endif - 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif - 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*nb_hex*/ - #endif - 0, /*nb_inplace_add*/ - 0, /*nb_inplace_subtract*/ - 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_inplace_divide*/ - #endif - 0, /*nb_inplace_remainder*/ - 0, /*nb_inplace_power*/ - 0, /*nb_inplace_lshift*/ - 0, /*nb_inplace_rshift*/ - 0, /*nb_inplace_and*/ - 0, /*nb_inplace_xor*/ - 0, /*nb_inplace_or*/ - 0, /*nb_floor_divide*/ - 0, /*nb_true_divide*/ - 0, /*nb_inplace_floor_divide*/ - 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 - 0, /*nb_index*/ - #endif -}; - -static PySequenceMethods __pyx_tp_as_sequence_cBufferedByteStream = { - 0, /*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_cBufferedByteStream = { - 0, /*mp_length*/ - 0, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; - -static PyBufferProcs __pyx_tp_as_buffer_cBufferedByteStream = { - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif -}; - -PyTypeObject __pyx_type_6cpyamf_4util_cBufferedByteStream = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cpyamf.util.cBufferedByteStream"), /*tp_name*/ - sizeof(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6cpyamf_4util_cBufferedByteStream, /*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*/ - &__pyx_tp_as_number_cBufferedByteStream, /*tp_as_number*/ - &__pyx_tp_as_sequence_cBufferedByteStream, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_cBufferedByteStream, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_cBufferedByteStream, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - __Pyx_DOCSTR("\n A file like object that can be read/written to. Supports data type\n specific reads/writes (e.g. ints, longs, floats etc.)\n\n Endian aware.\n "), /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6cpyamf_4util_cBufferedByteStream, /*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_6cpyamf_4util_cBufferedByteStream, /*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*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif -}; -static struct __pyx_vtabstruct_6cpyamf_4util_BufferedByteStream __pyx_vtable_6cpyamf_4util_BufferedByteStream; - -static PyObject *__pyx_tp_new_6cpyamf_4util_BufferedByteStream(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6cpyamf_4util_BufferedByteStream *p; - PyObject *o = __pyx_tp_new_6cpyamf_4util_cBufferedByteStream(t, a, k); - if (!o) return 0; - p = ((struct __pyx_obj_6cpyamf_4util_BufferedByteStream *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6cpyamf_4util_cBufferedByteStream*)__pyx_vtabptr_6cpyamf_4util_BufferedByteStream; - return o; -} - -static PyObject *__pyx_getprop_6cpyamf_4util_18BufferedByteStream_endian(PyObject *o, void *x) { - return __pyx_pf_6cpyamf_4util_18BufferedByteStream_6endian___get__(o); -} - -static int __pyx_setprop_6cpyamf_4util_18BufferedByteStream_endian(PyObject *o, PyObject *v, void *x) { - if (v) { - return __pyx_pf_6cpyamf_4util_18BufferedByteStream_6endian___set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyMethodDef __pyx_methods_6cpyamf_4util_BufferedByteStream[] = { - {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pf_6cpyamf_4util_18BufferedByteStream_read, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_18BufferedByteStream_read)}, - {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pf_6cpyamf_4util_18BufferedByteStream_write, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_18BufferedByteStream_write)}, - {__Pyx_NAMESTR("flush"), (PyCFunction)__pyx_pf_6cpyamf_4util_18BufferedByteStream_flush, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("peek"), (PyCFunction)__pyx_pf_6cpyamf_4util_18BufferedByteStream_peek, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_18BufferedByteStream_peek)}, - {__Pyx_NAMESTR("write_char"), (PyCFunction)__pyx_pf_6cpyamf_4util_18BufferedByteStream_write_char, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_18BufferedByteStream_write_char)}, - {__Pyx_NAMESTR("write_ushort"), (PyCFunction)__pyx_pf_6cpyamf_4util_18BufferedByteStream_write_ushort, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_18BufferedByteStream_write_ushort)}, - {__Pyx_NAMESTR("write_short"), (PyCFunction)__pyx_pf_6cpyamf_4util_18BufferedByteStream_write_short, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_18BufferedByteStream_write_short)}, - {__Pyx_NAMESTR("write_ulong"), (PyCFunction)__pyx_pf_6cpyamf_4util_18BufferedByteStream_write_ulong, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_18BufferedByteStream_write_ulong)}, - {__Pyx_NAMESTR("read_double"), (PyCFunction)__pyx_pf_6cpyamf_4util_18BufferedByteStream_read_double, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_18BufferedByteStream_read_double)}, - {__Pyx_NAMESTR("write_double"), (PyCFunction)__pyx_pf_6cpyamf_4util_18BufferedByteStream_write_double, METH_O, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_18BufferedByteStream_write_double)}, - {__Pyx_NAMESTR("read_float"), (PyCFunction)__pyx_pf_6cpyamf_4util_18BufferedByteStream_read_float, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6cpyamf_4util_18BufferedByteStream_read_float)}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_6cpyamf_4util_BufferedByteStream[] = { - {(char *)"endian", __pyx_getprop_6cpyamf_4util_18BufferedByteStream_endian, __pyx_setprop_6cpyamf_4util_18BufferedByteStream_endian, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyNumberMethods __pyx_tp_as_number_BufferedByteStream = { - __pyx_pf_6cpyamf_4util_18BufferedByteStream___add__, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_divide*/ - #endif - 0, /*nb_remainder*/ - 0, /*nb_divmod*/ - 0, /*nb_power*/ - 0, /*nb_negative*/ - 0, /*nb_positive*/ - 0, /*nb_absolute*/ - 0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_coerce*/ - #endif - 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif - 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*nb_hex*/ - #endif - 0, /*nb_inplace_add*/ - 0, /*nb_inplace_subtract*/ - 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_inplace_divide*/ - #endif - 0, /*nb_inplace_remainder*/ - 0, /*nb_inplace_power*/ - 0, /*nb_inplace_lshift*/ - 0, /*nb_inplace_rshift*/ - 0, /*nb_inplace_and*/ - 0, /*nb_inplace_xor*/ - 0, /*nb_inplace_or*/ - 0, /*nb_floor_divide*/ - 0, /*nb_true_divide*/ - 0, /*nb_inplace_floor_divide*/ - 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 - 0, /*nb_index*/ - #endif -}; - -static PySequenceMethods __pyx_tp_as_sequence_BufferedByteStream = { - __pyx_pf_6cpyamf_4util_18BufferedByteStream___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_BufferedByteStream = { - __pyx_pf_6cpyamf_4util_18BufferedByteStream___len__, /*mp_length*/ - 0, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; - -static PyBufferProcs __pyx_tp_as_buffer_BufferedByteStream = { - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif -}; - -PyTypeObject __pyx_type_6cpyamf_4util_BufferedByteStream = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cpyamf.util.BufferedByteStream"), /*tp_name*/ - sizeof(struct __pyx_obj_6cpyamf_4util_BufferedByteStream), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6cpyamf_4util_cBufferedByteStream, /*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*/ - &__pyx_tp_as_number_BufferedByteStream, /*tp_as_number*/ - &__pyx_tp_as_sequence_BufferedByteStream, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_BufferedByteStream, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - __pyx_pf_6cpyamf_4util_18BufferedByteStream___str__, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_BufferedByteStream, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - __Pyx_DOCSTR("\n A Python exposed version of cBufferedByteStream. This exists because of\n various intricacies of Cythons cpdef (probably just user stupidity tho)\n "), /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6cpyamf_4util_BufferedByteStream, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_6cpyamf_4util_BufferedByteStream, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pf_6cpyamf_4util_18BufferedByteStream___init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6cpyamf_4util_BufferedByteStream, /*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*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif -}; - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - PyModuleDef_HEAD_INIT, - __Pyx_NAMESTR("util"), - __Pyx_DOCSTR(__pyx_k_31), /* 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_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 1}, - {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0}, - {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0}, - {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0}, - {&__pyx_kp_b_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 0, 0}, - {&__pyx_kp_b_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 0, 0}, - {&__pyx_kp_b_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 0, 0}, - {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, - {&__pyx_kp_b_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 0, 0}, - {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0}, - {&__pyx_kp_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 0}, - {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0}, - {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, - {&__pyx_kp_s_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 0, 1, 0}, - {&__pyx_kp_s_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 0, 1, 0}, - {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0}, - {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0}, - {&__pyx_n_s__IOError, __pyx_k__IOError, sizeof(__pyx_k__IOError), 0, 0, 1, 1}, - {&__pyx_n_s__NaN, __pyx_k__NaN, sizeof(__pyx_k__NaN), 0, 0, 1, 1}, - {&__pyx_n_s__NegInf, __pyx_k__NegInf, sizeof(__pyx_k__NegInf), 0, 0, 1, 1}, - {&__pyx_n_s__OverflowError, __pyx_k__OverflowError, sizeof(__pyx_k__OverflowError), 0, 0, 1, 1}, - {&__pyx_n_s__PosInf, __pyx_k__PosInf, sizeof(__pyx_k__PosInf), 0, 0, 1, 1}, - {&__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_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 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}, - {&__pyx_n_s___increase_buffer, __pyx_k___increase_buffer, sizeof(__pyx_k___increase_buffer), 0, 0, 1, 1}, - {&__pyx_n_s___init_buffer, __pyx_k___init_buffer, sizeof(__pyx_k___init_buffer), 0, 0, 1, 1}, - {&__pyx_n_s__append, __pyx_k__append, sizeof(__pyx_k__append), 0, 0, 1, 1}, - {&__pyx_n_s__at_eof, __pyx_k__at_eof, sizeof(__pyx_k__at_eof), 0, 0, 1, 1}, - {&__pyx_n_s__buf, __pyx_k__buf, sizeof(__pyx_k__buf), 0, 0, 1, 1}, - {&__pyx_n_s__buffer, __pyx_k__buffer, sizeof(__pyx_k__buffer), 0, 0, 1, 1}, - {&__pyx_n_s__consume, __pyx_k__consume, sizeof(__pyx_k__consume), 0, 0, 1, 1}, - {&__pyx_n_s__endian, __pyx_k__endian, sizeof(__pyx_k__endian), 0, 0, 1, 1}, - {&__pyx_n_s__getvalue, __pyx_k__getvalue, sizeof(__pyx_k__getvalue), 0, 0, 1, 1}, - {&__pyx_n_s__has_available, __pyx_k__has_available, sizeof(__pyx_k__has_available), 0, 0, 1, 1}, - {&__pyx_n_s__length, __pyx_k__length, sizeof(__pyx_k__length), 0, 0, 1, 1}, - {&__pyx_n_s__min_buf_size, __pyx_k__min_buf_size, sizeof(__pyx_k__min_buf_size), 0, 0, 1, 1}, - {&__pyx_n_s__mode, __pyx_k__mode, sizeof(__pyx_k__mode), 0, 0, 1, 1}, - {&__pyx_n_s__pack_int, __pyx_k__pack_int, sizeof(__pyx_k__pack_int), 0, 0, 1, 1}, - {&__pyx_n_s__pack_uint, __pyx_k__pack_uint, sizeof(__pyx_k__pack_uint), 0, 0, 1, 1}, - {&__pyx_n_s__peek, __pyx_k__peek, sizeof(__pyx_k__peek), 0, 0, 1, 1}, - {&__pyx_n_s__pos, __pyx_k__pos, sizeof(__pyx_k__pos), 0, 0, 1, 1}, - {&__pyx_n_s__pyamf, __pyx_k__pyamf, sizeof(__pyx_k__pyamf), 0, 0, 1, 1}, - {&__pyx_n_s__python, __pyx_k__python, sizeof(__pyx_k__python), 0, 0, 1, 1}, - {&__pyx_n_s__read, __pyx_k__read, sizeof(__pyx_k__read), 0, 0, 1, 1}, - {&__pyx_n_s__read_24bit_int, __pyx_k__read_24bit_int, sizeof(__pyx_k__read_24bit_int), 0, 0, 1, 1}, - {&__pyx_n_s__read_24bit_uint, __pyx_k__read_24bit_uint, sizeof(__pyx_k__read_24bit_uint), 0, 0, 1, 1}, - {&__pyx_n_s__read_char, __pyx_k__read_char, sizeof(__pyx_k__read_char), 0, 0, 1, 1}, - {&__pyx_n_s__read_long, __pyx_k__read_long, sizeof(__pyx_k__read_long), 0, 0, 1, 1}, - {&__pyx_n_s__read_short, __pyx_k__read_short, sizeof(__pyx_k__read_short), 0, 0, 1, 1}, - {&__pyx_n_s__read_uchar, __pyx_k__read_uchar, sizeof(__pyx_k__read_uchar), 0, 0, 1, 1}, - {&__pyx_n_s__read_ulong, __pyx_k__read_ulong, sizeof(__pyx_k__read_ulong), 0, 0, 1, 1}, - {&__pyx_n_s__read_ushort, __pyx_k__read_ushort, sizeof(__pyx_k__read_ushort), 0, 0, 1, 1}, - {&__pyx_n_s__read_utf8_string, __pyx_k__read_utf8_string, sizeof(__pyx_k__read_utf8_string), 0, 0, 1, 1}, - {&__pyx_n_s__remaining, __pyx_k__remaining, sizeof(__pyx_k__remaining), 0, 0, 1, 1}, - {&__pyx_n_s__seek, __pyx_k__seek, sizeof(__pyx_k__seek), 0, 0, 1, 1}, - {&__pyx_n_s__size, __pyx_k__size, sizeof(__pyx_k__size), 0, 0, 1, 1}, - {&__pyx_n_s__tell, __pyx_k__tell, sizeof(__pyx_k__tell), 0, 0, 1, 1}, - {&__pyx_n_s__truncate, __pyx_k__truncate, sizeof(__pyx_k__truncate), 0, 0, 1, 1}, - {&__pyx_n_s__unpack_int, __pyx_k__unpack_int, sizeof(__pyx_k__unpack_int), 0, 0, 1, 1}, - {&__pyx_n_s__write, __pyx_k__write, sizeof(__pyx_k__write), 0, 0, 1, 1}, - {&__pyx_n_s__write_24bit_int, __pyx_k__write_24bit_int, sizeof(__pyx_k__write_24bit_int), 0, 0, 1, 1}, - {&__pyx_n_s__write_24bit_uint, __pyx_k__write_24bit_uint, sizeof(__pyx_k__write_24bit_uint), 0, 0, 1, 1}, - {&__pyx_n_s__write_char, __pyx_k__write_char, sizeof(__pyx_k__write_char), 0, 0, 1, 1}, - {&__pyx_n_s__write_double, __pyx_k__write_double, sizeof(__pyx_k__write_double), 0, 0, 1, 1}, - {&__pyx_n_s__write_float, __pyx_k__write_float, sizeof(__pyx_k__write_float), 0, 0, 1, 1}, - {&__pyx_n_s__write_long, __pyx_k__write_long, sizeof(__pyx_k__write_long), 0, 0, 1, 1}, - {&__pyx_n_s__write_short, __pyx_k__write_short, sizeof(__pyx_k__write_short), 0, 0, 1, 1}, - {&__pyx_n_s__write_uchar, __pyx_k__write_uchar, sizeof(__pyx_k__write_uchar), 0, 0, 1, 1}, - {&__pyx_n_s__write_ulong, __pyx_k__write_ulong, sizeof(__pyx_k__write_ulong), 0, 0, 1, 1}, - {&__pyx_n_s__write_ushort, __pyx_k__write_ushort, sizeof(__pyx_k__write_ushort), 0, 0, 1, 1}, - {&__pyx_n_s__write_utf8_string, __pyx_k__write_utf8_string, sizeof(__pyx_k__write_utf8_string), 0, 0, 1, 1}, - {&__pyx_n_s__x, __pyx_k__x, sizeof(__pyx_k__x), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_SystemError = __Pyx_GetName(__pyx_b, __pyx_n_s__SystemError); if (!__pyx_builtin_SystemError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_IOError = __Pyx_GetName(__pyx_b, __pyx_n_s__IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_OverflowError = __Pyx_GetName(__pyx_b, __pyx_n_s__OverflowError); if (!__pyx_builtin_OverflowError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":360 - * self.pos = self.length + pos - * else: - * raise ValueError('Bad value for mode') # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_k_tuple_4 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_4)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_3)); - PyTuple_SET_ITEM(__pyx_k_tuple_4, 0, ((PyObject *)__pyx_kp_s_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":456 - * - * if num_bytes > 4: - * raise ValueError('Max 4 bytes to unpack') # <<<<<<<<<<<<<< - * - * if not self.has_available(num_bytes): - */ - __pyx_k_tuple_6 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_6)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_5)); - PyTuple_SET_ITEM(__pyx_k_tuple_6, 0, ((PyObject *)__pyx_kp_s_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":490 - * - * if x > maxint or x < minint: - * raise OverflowError('integer out of range') # <<<<<<<<<<<<<< - * - * cdef char *buf = malloc(num_bytes) - */ - __pyx_k_tuple_8 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_8)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_7)); - PyTuple_SET_ITEM(__pyx_k_tuple_8, 0, ((PyObject *)__pyx_kp_s_7)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":529 - * - * if x >= maxint: - * raise OverflowError('integer out of range') # <<<<<<<<<<<<<< - * - * cdef char *buf = malloc(num_bytes) - */ - __pyx_k_tuple_9 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_9)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_7)); - PyTuple_SET_ITEM(__pyx_k_tuple_9, 0, ((PyObject *)__pyx_kp_s_7)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":747 - * encoded_string = obj - * else: - * raise TypeError('value must be Unicode or str') # <<<<<<<<<<<<<< - * - * PyString_AsStringAndSize(encoded_string, &buf, &l) - */ - __pyx_k_tuple_11 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_11)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_10)); - PyTuple_SET_ITEM(__pyx_k_tuple_11, 0, ((PyObject *)__pyx_kp_s_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":930 - * elif hasattr(buf, 'read') and hasattr(buf, 'seek') and hasattr(buf, 'tell'): - * old_pos = buf.tell() - * buf.seek(0) # <<<<<<<<<<<<<< - * self.write(buf.read()) - * buf.seek(old_pos) - */ - __pyx_k_tuple_12 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_12)); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_k_tuple_12, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":934 - * buf.seek(old_pos) - * else: - * raise TypeError("Unable to coerce buf->StringIO") # <<<<<<<<<<<<<< - * - * self.seek(0) - */ - __pyx_k_tuple_14 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_14)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_13)); - PyTuple_SET_ITEM(__pyx_k_tuple_14, 0, ((PyObject *)__pyx_kp_s_13)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":941 - * def __set__(self, value): - * if PyString_Check(value) == 0: - * raise TypeError('String value expected') # <<<<<<<<<<<<<< - * - * if value not in [ENDIAN_NETWORK, ENDIAN_NATIVE, ENDIAN_LITTLE, ENDIAN_BIG]: - */ - __pyx_k_tuple_16 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_16)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_15)); - PyTuple_SET_ITEM(__pyx_k_tuple_16, 0, ((PyObject *)__pyx_kp_s_15)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_15)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":944 - * - * if value not in [ENDIAN_NETWORK, ENDIAN_NATIVE, ENDIAN_LITTLE, ENDIAN_BIG]: - * raise ValueError('Not a valid endian type') # <<<<<<<<<<<<<< - * - * self.endian = PyString_AsString(value)[0] - */ - __pyx_k_tuple_22 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_22)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_21)); - PyTuple_SET_ITEM(__pyx_k_tuple_22, 0, ((PyObject *)__pyx_kp_s_21)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_21)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1020 - * """ - * if PyInt_Check(x) == 0 and PyLong_Check(x) == 0: - * raise TypeError('expected int for x') # <<<<<<<<<<<<<< - * - * cBufferedByteStream.write_char(self, x) - */ - __pyx_k_tuple_24 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_24)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_23)); - PyTuple_SET_ITEM(__pyx_k_tuple_24, 0, ((PyObject *)__pyx_kp_s_23)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_23)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1033 - * """ - * if PyInt_Check(x) == 0 and PyLong_Check(x) == 0: - * raise TypeError('expected int for x') # <<<<<<<<<<<<<< - * - * cBufferedByteStream.write_ushort(self, x) - */ - __pyx_k_tuple_25 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_25)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_23)); - PyTuple_SET_ITEM(__pyx_k_tuple_25, 0, ((PyObject *)__pyx_kp_s_23)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_23)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_25)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1046 - * """ - * if PyInt_Check(x) == 0 and PyLong_Check(x) == 0: - * raise TypeError('expected int for x') # <<<<<<<<<<<<<< - * - * cBufferedByteStream.write_short(self, x) - */ - __pyx_k_tuple_26 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_26)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_23)); - PyTuple_SET_ITEM(__pyx_k_tuple_26, 0, ((PyObject *)__pyx_kp_s_23)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_23)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1059 - * """ - * if PyInt_Check(x) == 0 and PyLong_Check(x) == 0: - * raise TypeError('expected int for x') # <<<<<<<<<<<<<< - * - * if x > 4294967295L or x < 0: - */ - __pyx_k_tuple_27 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_27)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_23)); - PyTuple_SET_ITEM(__pyx_k_tuple_27, 0, ((PyObject *)__pyx_kp_s_23)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_23)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_27)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1093 - * """ - * if PyFloat_Check(val) == 0: - * raise TypeError('Expecting float for val') # <<<<<<<<<<<<<< - * - * cdef double d = val - */ - __pyx_k_tuple_29 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_29)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_28)); - PyTuple_SET_ITEM(__pyx_k_tuple_29, 0, ((PyObject *)__pyx_kp_s_28)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_28)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_29)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1137 - * new = BufferedByteStream(self) - * - * other.seek(0) # <<<<<<<<<<<<<< - * new.seek(0, 2) - * new.write(other.read()) - */ - __pyx_k_tuple_30 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_30)); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_k_tuple_30, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_30)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":55 - * cdef object pyamf_NegInf = python.NegInf - * cdef object pyamf_PosInf = python.PosInf - * cdef object empty_unicode = unicode('') # <<<<<<<<<<<<<< - * - * - */ - __pyx_k_tuple_36 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_36)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_35)); - PyTuple_SET_ITEM(__pyx_k_tuple_36, 0, ((PyObject *)__pyx_kp_s_35)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_35)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_36)); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1159 - * - * if build_platform_exceptional_floats() == -1: - * raise SystemError('Unable to initialise cpyamf.util') # <<<<<<<<<<<<<< - */ - __pyx_k_tuple_38 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_38)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_37)); - PyTuple_SET_ITEM(__pyx_k_tuple_38, 0, ((PyObject *)__pyx_kp_s_37)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_37)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_38)); - __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_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;}; - __pyx_int_512 = PyInt_FromLong(512); if (unlikely(!__pyx_int_512)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_2147483648 = PyInt_FromString((char *)"2147483648", 0, 0); if (unlikely(!__pyx_int_2147483648)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_4294967295L = PyLong_FromString((char *)"4294967295", 0, 0); if (unlikely(!__pyx_int_4294967295L)) {__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 initutil(void); /*proto*/ -PyMODINIT_FUNC initutil(void) -#else -PyMODINIT_FUNC PyInit_util(void); /*proto*/ -PyMODINIT_FUNC PyInit_util(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - #if CYTHON_REFNANNY - void* __pyx_refnanny = NULL; - __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"); - } - __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_util(void)", __LINE__, __FILE__); - #endif - __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_binding_PyCFunctionType_USED - if (__pyx_binding_PyCFunctionType_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(__Pyx_NAMESTR("util"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_31), 0, PYTHON_API_VERSION); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - #if PY_MAJOR_VERSION < 3 - Py_INCREF(__pyx_m); - #endif - __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); - if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__Pyx_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 (__pyx_module_is_main_cpyamf__util) { - if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - } - /*--- 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 ---*/ - __pyx_v_6cpyamf_4util_pyamf_NaN = Py_None; Py_INCREF(Py_None); - __pyx_v_6cpyamf_4util_pyamf_NegInf = Py_None; Py_INCREF(Py_None); - __pyx_v_6cpyamf_4util_pyamf_PosInf = Py_None; Py_INCREF(Py_None); - __pyx_v_6cpyamf_4util_empty_unicode = Py_None; Py_INCREF(Py_None); - /*--- Function export code ---*/ - /*--- Type init code ---*/ - __pyx_vtabptr_6cpyamf_4util_cBufferedByteStream = &__pyx_vtable_6cpyamf_4util_cBufferedByteStream; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.tell = (Py_ssize_t (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_tell; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.write = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, char *, Py_ssize_t))__pyx_f_6cpyamf_4util_19cBufferedByteStream_write; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream._init_buffer = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *))__pyx_f_6cpyamf_4util_19cBufferedByteStream__init_buffer; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream._actually_increase_buffer = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t))__pyx_f_6cpyamf_4util_19cBufferedByteStream__actually_increase_buffer; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream._increase_buffer = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t))__pyx_f_6cpyamf_4util_19cBufferedByteStream__increase_buffer; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.has_available = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t))__pyx_f_6cpyamf_4util_19cBufferedByteStream_has_available; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.read = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, char **, Py_ssize_t))__pyx_f_6cpyamf_4util_19cBufferedByteStream_read; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.at_eof = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_at_eof; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.remaining = (Py_ssize_t (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_remaining; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.seek = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_seek *__pyx_optional_args))__pyx_f_6cpyamf_4util_19cBufferedByteStream_seek; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.getvalue = (PyObject *(*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_getvalue; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.peek = (Py_ssize_t (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, char **, Py_ssize_t))__pyx_f_6cpyamf_4util_19cBufferedByteStream_peek; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.truncate = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch, struct __pyx_opt_args_6cpyamf_4util_19cBufferedByteStream_truncate *__pyx_optional_args))__pyx_f_6cpyamf_4util_19cBufferedByteStream_truncate; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.consume = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_consume; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.unpack_int = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned int, void *))__pyx_f_6cpyamf_4util_19cBufferedByteStream_unpack_int; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.pack_int = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int, long))__pyx_f_6cpyamf_4util_19cBufferedByteStream_pack_int; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.pack_uint = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int, unsigned long))__pyx_f_6cpyamf_4util_19cBufferedByteStream_pack_uint; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.read_uchar = (unsigned char (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_read_uchar; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.read_char = (char (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_read_char; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.read_ushort = (unsigned short (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_read_ushort; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.read_short = (short (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_read_short; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.read_24bit_uint = (unsigned long (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_read_24bit_uint; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.read_24bit_int = (long (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_read_24bit_int; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.read_ulong = (unsigned long (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_read_ulong; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.read_long = (long (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_read_long; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.write_uchar = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned char, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_write_uchar; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.write_char = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, char, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_write_char; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.write_ushort = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned short, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_write_ushort; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.write_short = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, short, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_write_short; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.write_24bit_uint = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned long, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_write_24bit_uint; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.write_24bit_int = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, long, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_write_24bit_int; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.write_ulong = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, unsigned long, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_write_ulong; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.write_long = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, long, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_write_long; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.read_utf8_string = (PyObject *(*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_read_utf8_string; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.write_utf8_string = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_write_utf8_string; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.read_double = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, double *))__pyx_f_6cpyamf_4util_19cBufferedByteStream_read_double; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.write_double = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, double, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_write_double; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.read_float = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, float *))__pyx_f_6cpyamf_4util_19cBufferedByteStream_read_float; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.write_float = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, float, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_write_float; - __pyx_vtable_6cpyamf_4util_cBufferedByteStream.append = (int (*)(struct __pyx_obj_6cpyamf_4util_cBufferedByteStream *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6cpyamf_4util_19cBufferedByteStream_append; - if (PyType_Ready(&__pyx_type_6cpyamf_4util_cBufferedByteStream) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6cpyamf_4util_cBufferedByteStream.tp_dict, __pyx_vtabptr_6cpyamf_4util_cBufferedByteStream) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "cBufferedByteStream", (PyObject *)&__pyx_type_6cpyamf_4util_cBufferedByteStream) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_4util_cBufferedByteStream = &__pyx_type_6cpyamf_4util_cBufferedByteStream; - __pyx_vtabptr_6cpyamf_4util_BufferedByteStream = &__pyx_vtable_6cpyamf_4util_BufferedByteStream; - __pyx_vtable_6cpyamf_4util_BufferedByteStream.__pyx_base = *__pyx_vtabptr_6cpyamf_4util_cBufferedByteStream; - __pyx_type_6cpyamf_4util_BufferedByteStream.tp_base = __pyx_ptype_6cpyamf_4util_cBufferedByteStream; - if (PyType_Ready(&__pyx_type_6cpyamf_4util_BufferedByteStream) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6cpyamf_4util_BufferedByteStream.tp_dict, __pyx_vtabptr_6cpyamf_4util_BufferedByteStream) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "BufferedByteStream", (PyObject *)&__pyx_type_6cpyamf_4util_BufferedByteStream) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6cpyamf_4util_BufferedByteStream = &__pyx_type_6cpyamf_4util_BufferedByteStream; - /*--- Type import code ---*/ - __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[1]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":26 - * - * - * from pyamf import python # <<<<<<<<<<<<<< - * - * # module constant declarations - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__python)); - PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__python)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__python)); - __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__pyamf), ((PyObject *)__pyx_t_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(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__python); 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 (PyObject_SetAttr(__pyx_m, __pyx_n_s__python, __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; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":38 - * cdef char SYSTEM_ENDIAN - * - * cdef int float_broken = -1 # <<<<<<<<<<<<<< - * - * cdef unsigned char *NaN = '\xff\xf8\x00\x00\x00\x00\x00\x00' - */ - __pyx_v_6cpyamf_4util_float_broken = -1; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":40 - * cdef int float_broken = -1 - * - * cdef unsigned char *NaN = '\xff\xf8\x00\x00\x00\x00\x00\x00' # <<<<<<<<<<<<<< - * cdef unsigned char *NegInf = '\xff\xf0\x00\x00\x00\x00\x00\x00' - * cdef unsigned char *PosInf = '\x7f\xf0\x00\x00\x00\x00\x00\x00' - */ - __pyx_v_6cpyamf_4util_NaN = ((unsigned char *)__pyx_k_32); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":41 - * - * cdef unsigned char *NaN = '\xff\xf8\x00\x00\x00\x00\x00\x00' - * cdef unsigned char *NegInf = '\xff\xf0\x00\x00\x00\x00\x00\x00' # <<<<<<<<<<<<<< - * cdef unsigned char *PosInf = '\x7f\xf0\x00\x00\x00\x00\x00\x00' - * - */ - __pyx_v_6cpyamf_4util_NegInf = ((unsigned char *)__pyx_k_33); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":42 - * cdef unsigned char *NaN = '\xff\xf8\x00\x00\x00\x00\x00\x00' - * cdef unsigned char *NegInf = '\xff\xf0\x00\x00\x00\x00\x00\x00' - * cdef unsigned char *PosInf = '\x7f\xf0\x00\x00\x00\x00\x00\x00' # <<<<<<<<<<<<<< - * - * cdef double platform_nan - */ - __pyx_v_6cpyamf_4util_PosInf = ((unsigned char *)__pyx_k_34); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":52 - * cdef double system_neginf - * - * cdef object pyamf_NaN = python.NaN # <<<<<<<<<<<<<< - * cdef object pyamf_NegInf = python.NegInf - * cdef object pyamf_PosInf = python.PosInf - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__python); 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_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_v_6cpyamf_4util_pyamf_NaN); - __Pyx_DECREF(__pyx_v_6cpyamf_4util_pyamf_NaN); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_v_6cpyamf_4util_pyamf_NaN = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":53 - * - * cdef object pyamf_NaN = python.NaN - * cdef object pyamf_NegInf = python.NegInf # <<<<<<<<<<<<<< - * cdef object pyamf_PosInf = python.PosInf - * cdef object empty_unicode = unicode('') - */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__python); 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_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__NegInf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_v_6cpyamf_4util_pyamf_NegInf); - __Pyx_DECREF(__pyx_v_6cpyamf_4util_pyamf_NegInf); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_v_6cpyamf_4util_pyamf_NegInf = __pyx_t_2; - __pyx_t_2 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":54 - * cdef object pyamf_NaN = python.NaN - * cdef object pyamf_NegInf = python.NegInf - * cdef object pyamf_PosInf = python.PosInf # <<<<<<<<<<<<<< - * cdef object empty_unicode = unicode('') - * - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__python); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__PosInf); 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_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_v_6cpyamf_4util_pyamf_PosInf); - __Pyx_DECREF(__pyx_v_6cpyamf_4util_pyamf_PosInf); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_v_6cpyamf_4util_pyamf_PosInf = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":55 - * cdef object pyamf_NegInf = python.NegInf - * cdef object pyamf_PosInf = python.PosInf - * cdef object empty_unicode = unicode('') # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyUnicode_Type)), ((PyObject *)__pyx_k_tuple_36), NULL); 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_GOTREF(__pyx_v_6cpyamf_4util_empty_unicode); - __Pyx_DECREF(__pyx_v_6cpyamf_4util_empty_unicode); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_v_6cpyamf_4util_empty_unicode = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1153 - * # init the module from here - * - * SYSTEM_ENDIAN = get_native_endian() # <<<<<<<<<<<<<< - * - * if is_broken_float(): - */ - __pyx_v_6cpyamf_4util_SYSTEM_ENDIAN = __pyx_f_6cpyamf_4util_get_native_endian(); - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1155 - * SYSTEM_ENDIAN = get_native_endian() - * - * if is_broken_float(): # <<<<<<<<<<<<<< - * float_broken = 1 - * - */ - __pyx_t_3 = __pyx_f_6cpyamf_4util_is_broken_float(); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1156 - * - * if is_broken_float(): - * float_broken = 1 # <<<<<<<<<<<<<< - * - * if build_platform_exceptional_floats() == -1: - */ - __pyx_v_6cpyamf_4util_float_broken = 1; - goto __pyx_L2; - } - __pyx_L2:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1158 - * float_broken = 1 - * - * if build_platform_exceptional_floats() == -1: # <<<<<<<<<<<<<< - * raise SystemError('Unable to initialise cpyamf.util') - */ - __pyx_t_4 = __pyx_f_6cpyamf_4util_build_platform_exceptional_floats(); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = (__pyx_t_4 == -1); - if (__pyx_t_3) { - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1159 - * - * if build_platform_exceptional_floats() == -1: - * raise SystemError('Unable to initialise cpyamf.util') # <<<<<<<<<<<<<< - */ - __pyx_t_1 = PyObject_Call(__pyx_builtin_SystemError, ((PyObject *)__pyx_k_tuple_38), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/nick/projects/opensource/pyamf/pyamf/cpyamf/util.pyx":1 - * # Copyright (c) The PyAMF Project. # <<<<<<<<<<<<<< - * # See LICENSE.txt for details. - * - */ - __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(((PyObject *)__pyx_t_1)); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/Library/Python/2.6/site-packages/Cython/Includes/cpython/type.pxd":2 - * - * cdef extern from "Python.h": # <<<<<<<<<<<<<< - * # The C structure of the objects used to describe built-in types. - * - */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - if (__pyx_m) { - __Pyx_AddTraceback("init cpyamf.util"); - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init cpyamf.util"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -/* Runtime support code */ - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} - -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { - PyObject *local_type, *local_value, *local_tb; - 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; - PyErr_NormalizeException(&local_type, &local_value, &local_tb); - if (unlikely(tstate->curexc_type)) - goto bad; - #if PY_MAJOR_VERSION >= 3 - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) - goto bad; - #endif - *type = local_type; - *value = local_value; - *tb = local_tb; - Py_INCREF(local_type); - Py_INCREF(local_value); - Py_INCREF(local_tb); - 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; - /* Make sure tstate is in a consistent state when we XDECREF - these objects (XDECREF may run arbitrary code). */ - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); - 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_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 *number, *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"; - } - number = (num_expected == 1) ? "" : "s"; - PyErr_Format(PyExc_TypeError, - #if PY_VERSION_HEX < 0x02050000 - "%s() takes %s %d positional argument%s (%d given)", - #else - "%s() takes %s %zd positional argument%s (%zd given)", - #endif - func_name, more_or_less, num_expected, number, 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; - while (PyDict_Next(kwdict, &pos, &key, 0)) { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) - #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) - #endif - goto invalid_keyword_type; - } - if ((!kw_allowed) && unlikely(key)) - goto invalid_keyword; - return 1; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - return 0; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif - 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_AS_STRING(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; - } else { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { - #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { - #endif - goto invalid_keyword_type; - } else { - for (name = first_kw_arg; *name; name++) { - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) break; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) break; - #endif - } - if (*name) { - values[name-argnames] = value; - } else { - /* unexpected keyword found */ - for (name=argnames; name != first_kw_arg; name++) { - if (**name == key) goto arg_passed_twice; - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) goto arg_passed_twice; - #endif - } - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - } - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, **name); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - 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); -} - -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - 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; -} - - -static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { - 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); -} - -static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { - 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); -} - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *py_import = 0; - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - py_import = __Pyx_GetAttrString(__pyx_b, "__import__"); - if (!py_import) - goto bad; - 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; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, NULL); -bad: - Py_XDECREF(empty_list); - Py_XDECREF(py_import); - Py_XDECREF(empty_dict); - return module; -} - -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - Py_XINCREF(type); - Py_XINCREF(value); - Py_XINCREF(tb); - /* First, check the traceback argument, replacing None with NULL. */ - if (tb == Py_None) { - Py_DECREF(tb); - tb = 0; - } - else if (tb != NULL && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - /* Next, replace a missing value with None */ - if (value == NULL) { - value = Py_None; - Py_INCREF(value); - } - #if PY_VERSION_HEX < 0x02050000 - if (!PyClass_Check(type)) - #else - if (!PyType_Check(type)) - #endif - { - /* Raising an instance. The value should be a dummy. */ - if (value != Py_None) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - /* Normalize to raise , */ - Py_DECREF(value); - value = type; - #if PY_VERSION_HEX < 0x02050000 - if (PyInstance_Check(type)) { - type = (PyObject*) ((PyInstanceObject*)type)->in_class; - Py_INCREF(type); - } - else { - type = 0; - PyErr_SetString(PyExc_TypeError, - "raise: exception must be an old-style class or instance"); - goto raise_error; - } - #else - 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; - } - #endif - } - - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} - -#else /* Python 3+ */ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - 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)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } - - PyErr_SetObject(type, value); - - if (tb) { - 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); - } - } - -bad: - return; -} -#endif - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { - const unsigned char neg_one = (unsigned char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned char" : - "value too large to convert to unsigned char"); - } - return (unsigned char)-1; - } - return (unsigned char)val; - } - return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { - const unsigned short neg_one = (unsigned short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned short" : - "value too large to convert to unsigned short"); - } - return (unsigned short)-1; - } - return (unsigned short)val; - } - return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { - const unsigned int neg_one = (unsigned int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned int" : - "value too large to convert to unsigned int"); - } - return (unsigned int)-1; - } - return (unsigned int)val; - } - return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { - const char neg_one = (char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to char" : - "value too large to convert to char"); - } - return (char)-1; - } - return (char)val; - } - return (char)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { - const short neg_one = (short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to short" : - "value too large to convert to short"); - } - return (short)-1; - } - return (short)val; - } - return (short)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { - const signed char neg_one = (signed char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed char" : - "value too large to convert to signed char"); - } - return (signed char)-1; - } - return (signed char)val; - } - return (signed char)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { - const signed short neg_one = (signed short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed short" : - "value too large to convert to signed short"); - } - return (signed short)-1; - } - return (signed short)val; - } - return (signed short)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { - const signed int neg_one = (signed int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed int" : - "value too large to convert to signed int"); - } - return (signed int)-1; - } - return (signed int)val; - } - return (signed int)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { - const unsigned long neg_one = (unsigned long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - unsigned long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned long)-1; - val = __Pyx_PyInt_AsUnsignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { - const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - unsigned PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { - const long neg_one = (long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long)-1; - val = __Pyx_PyInt_AsLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { - const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { - const signed long neg_one = (signed long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - signed long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed long)-1; - val = __Pyx_PyInt_AsSignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { - const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - signed PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsSignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static void __Pyx_WriteUnraisable(const char *name) { - PyObject *old_exc, *old_val, *old_tb; - PyObject *ctx; - __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); - #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 int __Pyx_SetVtable(PyObject *dict, void *vtable) { -#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) - PyObject *ob = PyCapsule_New(vtable, 0, 0); -#else - PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); -#endif - if (!ob) - goto bad; - if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0) - goto bad; - Py_DECREF(ob); - return 0; -bad: - Py_XDECREF(ob); - return -1; -} - -#ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - long size, int strict) -{ - PyObject *py_module = 0; - PyObject *result = 0; - PyObject *py_name = 0; - char warning[200]; - - py_module = __Pyx_ImportModule(module_name); - if (!py_module) - goto bad; - #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(class_name); - #else - py_name = PyUnicode_FromString(class_name); - #endif - 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, - "%s.%s is not a type object", - module_name, class_name); - goto bad; - } - if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), - "%s.%s size changed, may indicate binary incompatibility", - module_name, class_name); - #if PY_VERSION_HEX < 0x02050000 - PyErr_Warn(NULL, warning); - #else - PyErr_WarnEx(NULL, warning, 0); - #endif - } - else if (((PyTypeObject *)result)->tp_basicsize != size) { - PyErr_Format(PyExc_ValueError, - "%s.%s has the wrong size, try recompiling", - module_name, class_name); - goto bad; - } - return (PyTypeObject *)result; -bad: - Py_XDECREF(py_module); - Py_XDECREF(result); - return 0; -} -#endif - -#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; - - #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(name); - #else - py_name = PyUnicode_FromString(name); - #endif - 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 - -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" - -static void __Pyx_AddTraceback(const char *funcname) { - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - PyObject *py_globals = 0; - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(__pyx_filename); - #else - py_srcfile = PyUnicode_FromString(__pyx_filename); - #endif - if (!py_srcfile) goto bad; - if (__pyx_clineno) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #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_globals = PyModule_GetDict(__pyx_m); - if (!py_globals) goto bad; - py_code = PyCode_New( - 0, /*int argcount,*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*int kwonlyargcount,*/ - #endif - 0, /*int nlocals,*/ - 0, /*int stacksize,*/ - 0, /*int flags,*/ - __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,*/ - __pyx_lineno, /*int firstlineno,*/ - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - if (!py_code) goto bad; - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - py_globals, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = __pyx_lineno; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -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 /* Python 3+ has unicode identifiers */ - 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; -} - -/* Type Conversion Functions */ - -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_VERSION_HEX < 0x03000000 - 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_VERSION_HEX < 0x03000000 - 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_VERSION_HEX < 0x03000000 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%s__ returned non-%s (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 = 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) { -#if PY_VERSION_HEX < 0x02050000 - if (ival <= LONG_MAX) - return PyInt_FromLong((long)ival); - else { - unsigned char *bytes = (unsigned char *) &ival; - int one = 1; int little = (int)*(unsigned char*)&one; - return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); - } -#else - return PyInt_FromSize_t(ival); -#endif -} - -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { - unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); - if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { - return (size_t)-1; - } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t)-1; - } - return (size_t)val; -} - - -#endif /* Py_PYTHON_H */ diff --git a/distribute_setup.py b/distribute_setup.py new file mode 100644 index 00000000..3ea2e667 --- /dev/null +++ b/distribute_setup.py @@ -0,0 +1,485 @@ +#!python +"""Bootstrap distribute installation + +If you want to use setuptools in your package's setup.py, just include this +file in the same directory with it, and add this to the top of your setup.py:: + + from distribute_setup import use_setuptools + use_setuptools() + +If you want to require a specific version of setuptools, set a download +mirror, or use an alternate download directory, you can do so by supplying +the appropriate options to ``use_setuptools()``. + +This file can also be run as a script to install or upgrade setuptools. +""" +import os +import sys +import time +import fnmatch +import tempfile +import tarfile +from distutils import log + +try: + from site import USER_SITE +except ImportError: + USER_SITE = None + +try: + import subprocess + + def _python_cmd(*args): + args = (sys.executable,) + args + return subprocess.call(args) == 0 + +except ImportError: + # will be used for python 2.3 + def _python_cmd(*args): + args = (sys.executable,) + args + # quoting arguments if windows + if sys.platform == 'win32': + def quote(arg): + if ' ' in arg: + return '"%s"' % arg + return arg + args = [quote(arg) for arg in args] + return os.spawnl(os.P_WAIT, sys.executable, *args) == 0 + +DEFAULT_VERSION = "0.6.14" +DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/" +SETUPTOOLS_FAKED_VERSION = "0.6c11" + +SETUPTOOLS_PKG_INFO = """\ +Metadata-Version: 1.0 +Name: setuptools +Version: %s +Summary: xxxx +Home-page: xxx +Author: xxx +Author-email: xxx +License: xxx +Description: xxx +""" % SETUPTOOLS_FAKED_VERSION + + +def _install(tarball): + # extracting the tarball + tmpdir = tempfile.mkdtemp() + log.warn('Extracting in %s', tmpdir) + old_wd = os.getcwd() + try: + os.chdir(tmpdir) + tar = tarfile.open(tarball) + _extractall(tar) + tar.close() + + # going in the directory + subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0]) + os.chdir(subdir) + log.warn('Now working in %s', subdir) + + # installing + log.warn('Installing Distribute') + if not _python_cmd('setup.py', 'install'): + log.warn('Something went wrong during the installation.') + log.warn('See the error message above.') + finally: + os.chdir(old_wd) + + +def _build_egg(egg, tarball, to_dir): + # extracting the tarball + tmpdir = tempfile.mkdtemp() + log.warn('Extracting in %s', tmpdir) + old_wd = os.getcwd() + try: + os.chdir(tmpdir) + tar = tarfile.open(tarball) + _extractall(tar) + tar.close() + + # going in the directory + subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0]) + os.chdir(subdir) + log.warn('Now working in %s', subdir) + + # building an egg + log.warn('Building a Distribute egg in %s', to_dir) + _python_cmd('setup.py', '-q', 'bdist_egg', '--dist-dir', to_dir) + + finally: + os.chdir(old_wd) + # returning the result + log.warn(egg) + if not os.path.exists(egg): + raise IOError('Could not build the egg.') + + +def _do_download(version, download_base, to_dir, download_delay): + egg = os.path.join(to_dir, 'distribute-%s-py%d.%d.egg' + % (version, sys.version_info[0], sys.version_info[1])) + if not os.path.exists(egg): + tarball = download_setuptools(version, download_base, + to_dir, download_delay) + _build_egg(egg, tarball, to_dir) + sys.path.insert(0, egg) + import setuptools + setuptools.bootstrap_install_from = egg + + +def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, + to_dir=os.curdir, download_delay=15, no_fake=True): + # making sure we use the absolute path + to_dir = os.path.abspath(to_dir) + was_imported = 'pkg_resources' in sys.modules or \ + 'setuptools' in sys.modules + try: + try: + import pkg_resources + if not hasattr(pkg_resources, '_distribute'): + if not no_fake: + _fake_setuptools() + raise ImportError + except ImportError: + return _do_download(version, download_base, to_dir, download_delay) + try: + pkg_resources.require("distribute>="+version) + return + except pkg_resources.VersionConflict: + e = sys.exc_info()[1] + if was_imported: + sys.stderr.write( + "The required version of distribute (>=%s) is not available,\n" + "and can't be installed while this script is running. Please\n" + "install a more recent version first, using\n" + "'easy_install -U distribute'." + "\n\n(Currently using %r)\n" % (version, e.args[0])) + sys.exit(2) + else: + del pkg_resources, sys.modules['pkg_resources'] # reload ok + return _do_download(version, download_base, to_dir, + download_delay) + except pkg_resources.DistributionNotFound: + return _do_download(version, download_base, to_dir, + download_delay) + finally: + if not no_fake: + _create_fake_setuptools_pkg_info(to_dir) + +def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, + to_dir=os.curdir, delay=15): + """Download distribute from a specified location and return its filename + + `version` should be a valid distribute version number that is available + as an egg for download under the `download_base` URL (which should end + with a '/'). `to_dir` is the directory where the egg will be downloaded. + `delay` is the number of seconds to pause before an actual download + attempt. + """ + # making sure we use the absolute path + to_dir = os.path.abspath(to_dir) + try: + from urllib.request import urlopen + except ImportError: + from urllib2 import urlopen + tgz_name = "distribute-%s.tar.gz" % version + url = download_base + tgz_name + saveto = os.path.join(to_dir, tgz_name) + src = dst = None + if not os.path.exists(saveto): # Avoid repeated downloads + try: + log.warn("Downloading %s", url) + src = urlopen(url) + # Read/write all in one block, so we don't create a corrupt file + # if the download is interrupted. + data = src.read() + dst = open(saveto, "wb") + dst.write(data) + finally: + if src: + src.close() + if dst: + dst.close() + return os.path.realpath(saveto) + +def _no_sandbox(function): + def __no_sandbox(*args, **kw): + try: + from setuptools.sandbox import DirectorySandbox + if not hasattr(DirectorySandbox, '_old'): + def violation(*args): + pass + DirectorySandbox._old = DirectorySandbox._violation + DirectorySandbox._violation = violation + patched = True + else: + patched = False + except ImportError: + patched = False + + try: + return function(*args, **kw) + finally: + if patched: + DirectorySandbox._violation = DirectorySandbox._old + del DirectorySandbox._old + + return __no_sandbox + +def _patch_file(path, content): + """Will backup the file then patch it""" + existing_content = open(path).read() + if existing_content == content: + # already patched + log.warn('Already patched.') + return False + log.warn('Patching...') + _rename_path(path) + f = open(path, 'w') + try: + f.write(content) + finally: + f.close() + return True + +_patch_file = _no_sandbox(_patch_file) + +def _same_content(path, content): + return open(path).read() == content + +def _rename_path(path): + new_name = path + '.OLD.%s' % time.time() + log.warn('Renaming %s into %s', path, new_name) + os.rename(path, new_name) + return new_name + +def _remove_flat_installation(placeholder): + if not os.path.isdir(placeholder): + log.warn('Unkown installation at %s', placeholder) + return False + found = False + for file in os.listdir(placeholder): + if fnmatch.fnmatch(file, 'setuptools*.egg-info'): + found = True + break + if not found: + log.warn('Could not locate setuptools*.egg-info') + return + + log.warn('Removing elements out of the way...') + pkg_info = os.path.join(placeholder, file) + if os.path.isdir(pkg_info): + patched = _patch_egg_dir(pkg_info) + else: + patched = _patch_file(pkg_info, SETUPTOOLS_PKG_INFO) + + if not patched: + log.warn('%s already patched.', pkg_info) + return False + # now let's move the files out of the way + for element in ('setuptools', 'pkg_resources.py', 'site.py'): + element = os.path.join(placeholder, element) + if os.path.exists(element): + _rename_path(element) + else: + log.warn('Could not find the %s element of the ' + 'Setuptools distribution', element) + return True + +_remove_flat_installation = _no_sandbox(_remove_flat_installation) + +def _after_install(dist): + log.warn('After install bootstrap.') + placeholder = dist.get_command_obj('install').install_purelib + _create_fake_setuptools_pkg_info(placeholder) + +def _create_fake_setuptools_pkg_info(placeholder): + if not placeholder or not os.path.exists(placeholder): + log.warn('Could not find the install location') + return + pyver = '%s.%s' % (sys.version_info[0], sys.version_info[1]) + setuptools_file = 'setuptools-%s-py%s.egg-info' % \ + (SETUPTOOLS_FAKED_VERSION, pyver) + pkg_info = os.path.join(placeholder, setuptools_file) + if os.path.exists(pkg_info): + log.warn('%s already exists', pkg_info) + return + + log.warn('Creating %s', pkg_info) + f = open(pkg_info, 'w') + try: + f.write(SETUPTOOLS_PKG_INFO) + finally: + f.close() + + pth_file = os.path.join(placeholder, 'setuptools.pth') + log.warn('Creating %s', pth_file) + f = open(pth_file, 'w') + try: + f.write(os.path.join(os.curdir, setuptools_file)) + finally: + f.close() + +_create_fake_setuptools_pkg_info = _no_sandbox(_create_fake_setuptools_pkg_info) + +def _patch_egg_dir(path): + # let's check if it's already patched + pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO') + if os.path.exists(pkg_info): + if _same_content(pkg_info, SETUPTOOLS_PKG_INFO): + log.warn('%s already patched.', pkg_info) + return False + _rename_path(path) + os.mkdir(path) + os.mkdir(os.path.join(path, 'EGG-INFO')) + pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO') + f = open(pkg_info, 'w') + try: + f.write(SETUPTOOLS_PKG_INFO) + finally: + f.close() + return True + +_patch_egg_dir = _no_sandbox(_patch_egg_dir) + +def _before_install(): + log.warn('Before install bootstrap.') + _fake_setuptools() + + +def _under_prefix(location): + if 'install' not in sys.argv: + return True + args = sys.argv[sys.argv.index('install')+1:] + for index, arg in enumerate(args): + for option in ('--root', '--prefix'): + if arg.startswith('%s=' % option): + top_dir = arg.split('root=')[-1] + return location.startswith(top_dir) + elif arg == option: + if len(args) > index: + top_dir = args[index+1] + return location.startswith(top_dir) + if arg == '--user' and USER_SITE is not None: + return location.startswith(USER_SITE) + return True + + +def _fake_setuptools(): + log.warn('Scanning installed packages') + try: + import pkg_resources + except ImportError: + # we're cool + log.warn('Setuptools or Distribute does not seem to be installed.') + return + ws = pkg_resources.working_set + try: + setuptools_dist = ws.find(pkg_resources.Requirement.parse('setuptools', + replacement=False)) + except TypeError: + # old distribute API + setuptools_dist = ws.find(pkg_resources.Requirement.parse('setuptools')) + + if setuptools_dist is None: + log.warn('No setuptools distribution found') + return + # detecting if it was already faked + setuptools_location = setuptools_dist.location + log.warn('Setuptools installation detected at %s', setuptools_location) + + # if --root or --preix was provided, and if + # setuptools is not located in them, we don't patch it + if not _under_prefix(setuptools_location): + log.warn('Not patching, --root or --prefix is installing Distribute' + ' in another location') + return + + # let's see if its an egg + if not setuptools_location.endswith('.egg'): + log.warn('Non-egg installation') + res = _remove_flat_installation(setuptools_location) + if not res: + return + else: + log.warn('Egg installation') + pkg_info = os.path.join(setuptools_location, 'EGG-INFO', 'PKG-INFO') + if (os.path.exists(pkg_info) and + _same_content(pkg_info, SETUPTOOLS_PKG_INFO)): + log.warn('Already patched.') + return + log.warn('Patching...') + # let's create a fake egg replacing setuptools one + res = _patch_egg_dir(setuptools_location) + if not res: + return + log.warn('Patched done.') + _relaunch() + + +def _relaunch(): + log.warn('Relaunching...') + # we have to relaunch the process + # pip marker to avoid a relaunch bug + if sys.argv[:3] == ['-c', 'install', '--single-version-externally-managed']: + sys.argv[0] = 'setup.py' + args = [sys.executable] + sys.argv + sys.exit(subprocess.call(args)) + + +def _extractall(self, path=".", members=None): + """Extract all members from the archive to the current working + directory and set owner, modification time and permissions on + directories afterwards. `path' specifies a different directory + to extract to. `members' is optional and must be a subset of the + list returned by getmembers(). + """ + import copy + import operator + from tarfile import ExtractError + directories = [] + + if members is None: + members = self + + for tarinfo in members: + if tarinfo.isdir(): + # Extract directories with a safe mode. + directories.append(tarinfo) + tarinfo = copy.copy(tarinfo) + tarinfo.mode = 448 # decimal for oct 0700 + self.extract(tarinfo, path) + + # Reverse sort directories. + if sys.version_info < (2, 4): + def sorter(dir1, dir2): + return cmp(dir1.name, dir2.name) + directories.sort(sorter) + directories.reverse() + else: + directories.sort(key=operator.attrgetter('name'), reverse=True) + + # Set correct owner, mtime and filemode on directories. + for tarinfo in directories: + dirpath = os.path.join(path, tarinfo.name) + try: + self.chown(tarinfo, dirpath) + self.utime(tarinfo, dirpath) + self.chmod(tarinfo, dirpath) + except ExtractError: + e = sys.exc_info()[1] + if self.errorlevel > 1: + raise + else: + self._dbg(1, "tarfile: %s" % e) + + +def main(argv, version=DEFAULT_VERSION): + """Install or upgrade setuptools and EasyInstall""" + tarball = download_setuptools() + _install(tarball) + + +if __name__ == '__main__': + main(sys.argv[1:]) diff --git a/ez_setup.py b/ez_setup.py deleted file mode 100644 index cb72037e..00000000 --- a/ez_setup.py +++ /dev/null @@ -1,276 +0,0 @@ -#!python -"""Bootstrap setuptools installation - -If you want to use setuptools in your package's setup.py, just include this -file in the same directory with it, and add this to the top of your setup.py:: - - from ez_setup import use_setuptools - use_setuptools() - -If you want to require a specific version of setuptools, set a download -mirror, or use an alternate download directory, you can do so by supplying -the appropriate options to C{use_setuptools()}. - -This file can also be run as a script to install or upgrade setuptools. -""" -import sys -DEFAULT_VERSION = "0.6c9" -DEFAULT_URL = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3] - -md5_data = { - 'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca', - 'setuptools-0.6b1-py2.4.egg': 'b79a8a403e4502fbb85ee3f1941735cb', - 'setuptools-0.6b2-py2.3.egg': '5657759d8a6d8fc44070a9d07272d99b', - 'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a', - 'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618', - 'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac', - 'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5', - 'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4', - 'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c', - 'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b', - 'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27', - 'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277', - 'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa', - 'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e', - 'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e', - 'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f', - 'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2', - 'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc', - 'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167', - 'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64', - 'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d', - 'setuptools-0.6c6-py2.3.egg': '35686b78116a668847237b69d549ec20', - 'setuptools-0.6c6-py2.4.egg': '3c56af57be3225019260a644430065ab', - 'setuptools-0.6c6-py2.5.egg': 'b2f8a7520709a5b34f80946de5f02f53', - 'setuptools-0.6c7-py2.3.egg': '209fdf9adc3a615e5115b725658e13e2', - 'setuptools-0.6c7-py2.4.egg': '5a8f954807d46a0fb67cf1f26c55a82e', - 'setuptools-0.6c7-py2.5.egg': '45d2ad28f9750e7434111fde831e8372', - 'setuptools-0.6c8-py2.3.egg': '50759d29b349db8cfd807ba8303f1902', - 'setuptools-0.6c8-py2.4.egg': 'cba38d74f7d483c06e9daa6070cce6de', - 'setuptools-0.6c8-py2.5.egg': '1721747ee329dc150590a58b3e1ac95b', - 'setuptools-0.6c9-py2.3.egg': 'a83c4020414807b496e4cfbe08507c03', - 'setuptools-0.6c9-py2.4.egg': '260a2be2e5388d66bdaee06abec6342a', - 'setuptools-0.6c9-py2.5.egg': 'fe67c3e5a17b12c0e7c541b7ea43a8e6', - 'setuptools-0.6c9-py2.6.egg': 'ca37b1ff16fa2ede6e19383e7b59245a', -} - -import sys, os -try: from hashlib import md5 -except ImportError: from md5 import md5 - -def _validate_md5(egg_name, data): - if egg_name in md5_data: - digest = md5(data).hexdigest() - if digest != md5_data[egg_name]: - print >>sys.stderr, ( - "md5 validation of %s failed! (Possible download problem?)" - % egg_name - ) - sys.exit(2) - return data - -def use_setuptools( - version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, - download_delay=15 -): - """Automatically find/download setuptools and make it available on sys.path - - `version` should be a valid setuptools version number that is available - as an egg for download under the `download_base` URL (which should end with - a '/'). `to_dir` is the directory where setuptools will be downloaded, if - it is not already available. If `download_delay` is specified, it should - be the number of seconds that will be paused before initiating a download, - should one be required. If an older version of setuptools is installed, - this routine will print a message to ``sys.stderr`` and raise SystemExit in - an attempt to abort the calling script. - """ - was_imported = 'pkg_resources' in sys.modules or 'setuptools' in sys.modules - def do_download(): - egg = download_setuptools(version, download_base, to_dir, download_delay) - sys.path.insert(0, egg) - import setuptools; setuptools.bootstrap_install_from = egg - try: - import pkg_resources - except ImportError: - return do_download() - try: - pkg_resources.require("setuptools>="+version); return - except pkg_resources.VersionConflict, e: - if was_imported: - print >>sys.stderr, ( - "The required version of setuptools (>=%s) is not available, and\n" - "can't be installed while this script is running. Please install\n" - " a more recent version first, using 'easy_install -U setuptools'." - "\n\n(Currently using %r)" - ) % (version, e.args[0]) - sys.exit(2) - else: - del pkg_resources, sys.modules['pkg_resources'] # reload ok - return do_download() - except pkg_resources.DistributionNotFound: - return do_download() - -def download_setuptools( - version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, - delay = 15 -): - """Download setuptools from a specified location and return its filename - - `version` should be a valid setuptools version number that is available - as an egg for download under the `download_base` URL (which should end - with a '/'). `to_dir` is the directory where the egg will be downloaded. - `delay` is the number of seconds to pause before an actual download attempt. - """ - import urllib2, shutil - egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3]) - url = download_base + egg_name - saveto = os.path.join(to_dir, egg_name) - src = dst = None - if not os.path.exists(saveto): # Avoid repeated downloads - try: - from distutils import log - if delay: - log.warn(""" ---------------------------------------------------------------------------- -This script requires setuptools version %s to run (even to display -help). I will attempt to download it for you (from -%s), but -you may need to enable firewall access for this script first. -I will start the download in %d seconds. - -(Note: if this machine does not have network access, please obtain the file - - %s - -and place it in this directory before rerunning this script.) ----------------------------------------------------------------------------""", - version, download_base, delay, url - ); from time import sleep; sleep(delay) - log.warn("Downloading %s", url) - src = urllib2.urlopen(url) - # Read/write all in one block, so we don't create a corrupt file - # if the download is interrupted. - data = _validate_md5(egg_name, src.read()) - dst = open(saveto,"wb"); dst.write(data) - finally: - if src: src.close() - if dst: dst.close() - return os.path.realpath(saveto) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -def main(argv, version=DEFAULT_VERSION): - """Install or upgrade setuptools and EasyInstall""" - try: - import setuptools - except ImportError: - egg = None - try: - egg = download_setuptools(version, delay=0) - sys.path.insert(0,egg) - from setuptools.command.easy_install import main - return main(list(argv)+[egg]) # we're done here - finally: - if egg and os.path.exists(egg): - os.unlink(egg) - else: - if setuptools.__version__ == '0.0.1': - print >>sys.stderr, ( - "You have an obsolete version of setuptools installed. Please\n" - "remove it from your system entirely before rerunning this script." - ) - sys.exit(2) - - req = "setuptools>="+version - import pkg_resources - try: - pkg_resources.require(req) - except pkg_resources.VersionConflict: - try: - from setuptools.command.easy_install import main - except ImportError: - from easy_install import main - main(list(argv)+[download_setuptools(delay=0)]) - sys.exit(0) # try to force an exit - else: - if argv: - from setuptools.command.easy_install import main - main(argv) - else: - print "Setuptools version",version,"or greater has been installed." - print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)' - -def update_md5(filenames): - """Update our built-in md5 registry""" - - import re - - for name in filenames: - base = os.path.basename(name) - f = open(name,'rb') - md5_data[base] = md5(f.read()).hexdigest() - f.close() - - data = [" %r: %r,\n" % it for it in md5_data.items()] - data.sort() - repl = "".join(data) - - import inspect - srcfile = inspect.getsourcefile(sys.modules[__name__]) - f = open(srcfile, 'rb'); src = f.read(); f.close() - - match = re.search("\nmd5_data = {\n([^}]+)}", src) - if not match: - print >>sys.stderr, "Internal error!" - sys.exit(2) - - src = src[:match.start(1)] + repl + src[match.end(1):] - f = open(srcfile,'w') - f.write(src) - f.close() - - -if __name__=='__main__': - if len(sys.argv)>2 and sys.argv[1]=='--md5update': - update_md5(sys.argv[2:]) - else: - main(sys.argv[1:]) - - - - - - diff --git a/fake_pyrex/Pyrex/Distutils/__init__.py b/fake_pyrex/Pyrex/Distutils/__init__.py new file mode 100644 index 00000000..51c8e16b --- /dev/null +++ b/fake_pyrex/Pyrex/Distutils/__init__.py @@ -0,0 +1 @@ +# work around broken setuptools monkey patching diff --git a/fake_pyrex/Pyrex/Distutils/build_ext.py b/fake_pyrex/Pyrex/Distutils/build_ext.py new file mode 100644 index 00000000..3fa8d9b8 --- /dev/null +++ b/fake_pyrex/Pyrex/Distutils/build_ext.py @@ -0,0 +1,2 @@ +build_ext = "this setuptools bug has been around for a *very* long time ..." + diff --git a/fake_pyrex/Pyrex/__init__.py b/fake_pyrex/Pyrex/__init__.py new file mode 100644 index 00000000..51c8e16b --- /dev/null +++ b/fake_pyrex/Pyrex/__init__.py @@ -0,0 +1 @@ +# work around broken setuptools monkey patching diff --git a/pyamf/__init__.py b/pyamf/__init__.py index 8f769cb2..1c42108d 100644 --- a/pyamf/__init__.py +++ b/pyamf/__init__.py @@ -14,7 +14,7 @@ import types import inspect -from pyamf import util, versions as v +from pyamf import util, _version from pyamf.adapters import register_adapters from pyamf import python from pyamf.alias import ClassAlias, UnknownClassAlias @@ -30,7 +30,7 @@ ] #: PyAMF version number. -__version__ = version = v.Version(0, 6) +__version__ = version = _version.version #: Class alias mapping support. Contains two types of keys: The string alias #: related to the class and the class object itself. Both point to the linked diff --git a/setup.cfg b/setup.cfg index 43ea3e48..655ff56d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,3 @@ -[egg_info] -tag_build = dev -tag_svn_revision = true - [epydoc] # The documented project's name. name: PyAMF API Documentation diff --git a/setup.py b/setup.py index 3c2becd0..f87064cd 100644 --- a/setup.py +++ b/setup.py @@ -1,201 +1,82 @@ +#!/usr/bin/env python + # Copyright (c) The PyAMF Project. # See LICENSE.txt for details. -from ez_setup import use_setuptools +from distribute_setup import use_setuptools # 15 seconds is far too long .... use_setuptools(download_delay=3) -import sys, os.path - -from setuptools import setup, find_packages, Extension -from setuptools.command import test - -try: - from Cython.Distutils import build_ext -except ImportError: - from setuptools.command.build_ext import build_ext - - -# add the path of the folder this file lives in -base_path = os.path.dirname(os.path.normpath(os.path.abspath(__file__))) - -# since the basedir is set as the first option in sys.path, this works -sys.path.insert(0, base_path) - -readme = os.path.join(base_path, 'README.txt') - - -class TestCommand(test.test): - """ - Ensures that unittest2 is imported if required and replaces the old - unittest module. - """ - - def run_tests(self): - try: - import unittest2 - import sys - - sys.modules['unittest'] = unittest2 - except ImportError: - pass - - return test.test.run_tests(self) - - -def get_cpyamf_extensions(): - """ - Returns a list of all extensions for the cpyamf module. If for some reason - cpyamf can't be built an empty list is returned. - - :since: 0.4 - """ - try: - import Cython - - extension = '.pyx' - except ImportError: - extension = '.c' - - import glob - - ext_modules = [] - - for file in glob.glob(os.path.join('cpyamf', '*' + extension)): - mod = file.replace(os.path.sep, '.')[:-len(extension)] - - ext_modules.append(Extension(mod, [file])) - - return ext_modules - - -def get_extensions(): - """ - Returns a list of extensions to be built for PyAMF. - - @since: 0.4 - """ - if '--disable-ext' in sys.argv: - sys.argv.remove('--disable-ext') - - return [] - - if sys.platform.startswith('java'): - print(80 * '*') - print('WARNING:') - print('\tAn optional code optimization (C extension) could not be compiled.\n\n') - print('\tOptimizations for this package will not be available!\n\n') - print('Compiling extensions is not supported on Jython') - print(80 * '*') - - return [] - - ext_modules = [] - - ext_modules.extend(get_cpyamf_extensions()) - - return ext_modules - - -def get_install_requirements(): - """ - Returns a list of dependancies for PyAMF to function correctly on the - target platform. - """ - install_requires = [] - - if sys.version_info < (2, 5): - install_requires.extend(["elementtree >= 1.2.6", "uuid>=1.30"]) - - return install_requires - - -def get_test_requirements(): - tests_require = ['pysqlite'] - - if sys.version_info < (2, 7): - tests_require.append('unittest2') - - return tests_require - - -def get_version(): - mp = sys.meta_path[:] - - from pyamf import version - - # need to remove all references to imported pyamf modules, as building - # the c extensions change pyamf.util.BufferedByteStream, which blow up - # the tests (at least the first time its built which in case of the - # buildbots is always true) - for k, v in sys.modules.copy().iteritems(): - if k and k.startswith('pyamf'): - del sys.modules[k] - - sys.meta_path = mp - - return version - - -keyw = """\ -amf amf0 amf3 flex flash remoting rpc http flashplayer air bytearray -objectproxy arraycollection recordset actionscript decoder encoder -gateway remoteobject twisted pylons django sharedobject lso sol""" - - -def main(): - setup(name = "PyAMF", - version = str(get_version()), - description = "AMF support for Python", - long_description = open(readme, 'rt').read(), - url = "http://pyamf.org", - author = "The PyAMF Project", - author_email = "users@pyamf.org", - keywords = keyw, - packages = find_packages(exclude=["*.tests"]), - ext_modules = get_extensions(), - install_requires = get_install_requirements(), - tests_require = get_test_requirements(), +# import ordering is important +import setupinfo +from setuptools import setup, find_packages + + +version = (0, 6, 1, 'dev') + +name = "PyAMF" +description = "AMF support for Python" +long_description = setupinfo.read('README.txt') +url = "http://pyamf.org" +author = "The PyAMF Project" +author_email = "users@pyamf.org" +license = "MIT License" + +classifiers = """\ +Framework :: Django +Framework :: Pylons +Framework :: Turbogears +Framework :: Twisted +Intended Audience :: Developers +Intended Audience :: Information Technology +License :: OSI Approved :: MIT License +Natural Language :: English +Operating System :: OS Independent +Programming Language :: C +Programming Language :: Python +Programming Language :: Cython +Programming Language :: Python :: 2.4 +Programming Language :: Python :: 2.5 +Programming Language :: Python :: 2.6 +Programming Language :: Python :: 2.7 +Topic :: Internet :: WWW/HTTP :: WSGI :: Application +Topic :: Software Development :: Libraries :: Python Modules +""" + +keywords = """\ +amf amf0 amf3 flex flash remoting rpc http flashplayer air bytearray objectproxy +arraycollection recordset actionscript decoder encoder gateway remoteobject +twisted pylons django sharedobject lso sol +""" + + +def setup_package(): + setupinfo.set_version(version) + + setupinfo.write_version_py() + + setup( + name=name, + version=setupinfo.get_version(), + description=description, + long_description=long_description, + url=url, + author=author, + author_email=author_email, + keywords = keywords.strip(), + license = license, + packages = find_packages(exclude=['*.tests*']), + ext_modules = setupinfo.get_extensions(), + install_requires = setupinfo.get_install_requirements(), + tests_require = setupinfo.get_test_requirements(), test_suite = "pyamf.tests.get_suite", zip_safe = True, - license = "MIT License", - platforms = ["any"], - cmdclass = { - 'build_ext': build_ext, - 'test': TestCommand - }, - extras_require = { - 'wsgi': ['wsgiref'], - 'twisted': ['Twisted>=2.5.0'], - 'django': ['Django>=0.96'], - 'sqlalchemy': ['SQLAlchemy>=0.4'], - 'elixir': ['Elixir>=0.7.1'], - 'cython': ['Cython>=0.13'], - 'lxml': ['lxml>=2.2'], - }, - classifiers = [ - "Development Status :: 5 - Production/Stable", - "Framework :: Django", - "Framework :: Pylons", - "Framework :: Turbogears", - "Framework :: Twisted", - "Intended Audience :: Developers", - "Intended Audience :: Information Technology", - "License :: OSI Approved :: MIT License", - "Natural Language :: English", - "Operating System :: OS Independent", - "Programming Language :: C", - "Programming Language :: Python", - "Programming Language :: Cython", - "Programming Language :: Python :: 2.4", - "Programming Language :: Python :: 2.5", - "Programming Language :: Python :: 2.6", - "Programming Language :: Python :: 2.7", - "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", - "Topic :: Software Development :: Libraries :: Python Modules", - ]) + extras_require = setupinfo.get_extras_require(), + classifiers = filter(None, classifiers.split('\n')) + \ + setupinfo.get_trove_classifiers(), + **setupinfo.extra_setup_args()) if __name__ == '__main__': - main() + setup_package() diff --git a/setupinfo.py b/setupinfo.py new file mode 100644 index 00000000..44001f2c --- /dev/null +++ b/setupinfo.py @@ -0,0 +1,305 @@ +# Copyright (c) The PyAMF Project. +# See LICENSE.txt for details. + +""" +Meta data and helper functions for setup +""" + +import sys +import os.path +import fnmatch + +try: + from Cython.Distutils import build_ext + + have_cython = True +except ImportError: + from setuptools.command.build_ext import build_ext + + have_cython = False + + +if have_cython: + # may need to work around setuptools bug by providing a fake Pyrex + sys.path.insert(0, os.path.join(os.path.dirname(__file__), "fake_pyrex")) + + +from setuptools.command import test, sdist +from setuptools import Extension +from distutils.core import Distribution + + +_version = None + + + +class MyDistribution(Distribution): + """ + This seems to be is the only obvious way to add a global option to + distutils. + + Provide the ability to disable building the extensions for any called + command. + """ + + global_options = Distribution.global_options + [ + ('disable-ext', None, 'Disable building extensions.') + ] + + def finalize_options(self): + Distribution.finalize_options(self) + + try: + i = self.script_args.index('--disable-ext') + except ValueError: + self.disable_ext = False + else: + self.disable_ext = True + self.script_args.pop(i) + + +class MyBuildExt(build_ext): + """ + The companion to L{MyDistribution} that checks to see if building the + extensions are disabled. + """ + + def build_extension(self, ext): + if self.distribution.disable_ext: + return + + return build_ext.build_extension(self, ext) + + def build_extensions(self): + if self.distribution.disable_ext: + return + + # First, sanity-check the 'extensions' list + self.check_extensions_list(self.extensions) + + for ext in self.extensions: + ext.sources = self.cython_sources(ext.sources, ext) + + +class MySDist(sdist.sdist): + """ + We generate the Cython code for a source distribution + """ + + def cythonise(self): + ext = MyBuildExt(self.distribution) + ext.initialize_options() + ext.finalize_options() + + ext.build_extensions() + + def run(self): + if not have_cython: + print('ERROR - Cython is required to build source distributions') + + raise SystemExit(1) + + self.cythonise() + + return sdist.sdist.run(self) + + +class TestCommand(test.test): + """ + Ensures that unittest2 is imported if required and replaces the old + unittest module. + """ + + def run_tests(self): + try: + import unittest2 + + sys.modules['unittest'] = unittest2 + except ImportError: + pass + + return test.test.run_tests(self) + + +def set_version(version): + global _version + + _version = version + + +def get_version(): + v = '' + prev = None + + for x in _version: + if prev is not None: + if isinstance(x, int): + v += '.' + + prev = x + v += str(x) + + return v.strip('.') + + +def get_extras_require(): + return { + 'wsgi': ['wsgiref'], + 'twisted': ['Twisted>=2.5.0'], + 'django': ['Django>=0.96'], + 'sqlalchemy': ['SQLAlchemy>=0.4'], + 'elixir': ['Elixir>=0.7.1'], + 'cython': ['Cython>=0.14'], + 'lxml': ['lxml>=2.2'], + } + + +def extra_setup_args(): + """ + Extra kwargs to supply in the call to C{setup}. + + This is used to supply custom commands, not metadata - that should live in + setup.py itself. + """ + return { + 'distclass': MyDistribution, + 'cmdclass': { + 'test': TestCommand, + 'build_ext': MyBuildExt, + 'sdist': MySDist + } + } + + +def get_install_requirements(): + """ + Returns a list of dependencies for PyAMF to function correctly on the + target platform. + """ + install_requires = [] + + if sys.version_info < (2, 5): + install_requires.extend(["elementtree>=1.2.6", "uuid>=1.30"]) + + if 'dev' in get_version(): + install_requires.extend(['Cython>=0.14']) + + return install_requires + + +def get_test_requirements(): + """ + Returns a list of required packages to run the test suite. + """ + tests_require = ['pysqlite'] + + if sys.version_info < (2, 7): + tests_require.append('unittest2') + + return tests_require + + +def write_version_py(filename='pyamf/_version.py'): + """ + """ + if os.path.exists(filename): + os.remove(filename) + + content = """\ +# THIS FILE IS GENERATED BY PYAMF SETUP.PY +from pyamf.versions import Version + +version = Version(*%(version)r) +""" + a = open(filename, 'wt') + + try: + a.write(content % {'version': _version}) + finally: + a.close() + + +def make_extension(mod_name, **extra_options): + """ + Tries is best to return an Extension instance based on the mod_name + """ + base_name = os.path.join(mod_name.replace('.', os.path.sep)) + + if have_cython: + for ext in ['.pyx', '.py']: + source = base_name + ext + + if os.path.exists(source): + return Extension(mod_name, [source], **extra_options) + + print('WARNING: Could not find Cython source for %r' % (mod_name,)) + else: + source = base_name + '.c' + + if os.path.exists(source): + return Extension(mod_name, [source], **extra_options) + + print('WARNING: Could not build extension for %r, no source found' % ( + mod_name,)) + + +def read(fname): + return open(os.path.join(os.path.dirname(__file__), fname)).read() + + +def get_extensions(): + """ + Return a list of Extension instances that can be compiled. + """ + if sys.platform.startswith('java'): + print(80 * '*') + print('WARNING:') + print('\tAn optional code optimization (C extension) could not be compiled.\n\n') + print('\tOptimizations for this package will not be available!\n\n') + print('Compiling extensions is not supported on Jython') + print(80 * '*') + + return [] + + extensions = [] + + for p in recursive_glob('.', '*.pyx'): + mod_name = os.path.splitext(p)[0].replace(os.path.sep, '.') + + e = make_extension(mod_name) + + if e: + extensions.append(e) + + return extensions + + +def get_trove_classifiers(): + """ + Return a list of trove classifiers that are setup dependent. + """ + classifiers = [] + + def dev_status(): + version = get_version() + + if 'dev' in version: + return 'Development Status :: 2 - Pre-Alpha' + elif 'alpha' in version: + return 'Development Status :: 3 - Alpha' + elif 'beta' in version: + return 'Development Status :: 4 - Beta' + else: + return 'Development Status :: 5 - Production/Stable' + + return classifiers + [dev_status()] + + +def recursive_glob(path, pattern): + matches = [] + + for root, dirnames, filenames in os.walk(path): + for filename in fnmatch.filter(filenames, pattern): + matches.append(os.path.normpath(os.path.join(root, filename))) + + return matches