/* Generated by Pyrex 0.9.6.2 on Wed Jan 9 06:05:17 2008 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #include "structmember.h" #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #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 PyInt_FromSsize_t(z) PyInt_FromLong(z) #define PyInt_AsSsize_t(o) PyInt_AsLong(o) #endif #ifndef WIN32 #define __stdcall #define __cdecl #endif #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #include #include "stdio.h" #include "rbtree.h" typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/ typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/ static PyObject *__pyx_m; static PyObject *__pyx_b; static int __pyx_lineno; static char *__pyx_filename; static char **__pyx_f; static char __pyx_mdoc[] = "\nrbtree\n~~~~~~~~~~~~~~~~~~~~\na fast rbtree impl for python using pyrex\n\n"; static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/ static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], Py_ssize_t nargs, PyObject **args2, PyObject **kwds2, char rqd_kwds[]); /*proto*/ static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ static PyObject *__Pyx_UnpackItem(PyObject *); /*proto*/ static int __Pyx_EndUnpack(PyObject *); /*proto*/ static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ static void __Pyx_AddTraceback(char *funcname); /*proto*/ /* Declarations from rbtree */ typedef enum { __pyx_e_6rbtree_KEYS = 1, __pyx_e_6rbtree_VALUES = 2, __pyx_e_6rbtree_ITEMS = 4, __pyx_e_6rbtree_NODES = 8 } __pyx_t_6rbtree_ITER_TYPE; struct __pyx_obj_6rbtree_RBTreeIterator { PyObject_HEAD struct __pyx_vtabstruct_6rbtree_RBTreeIterator *__pyx_vtab; struct __pyx_obj_6rbtree_RBTree *_T; rbtree_node_t *_iter; __pyx_t_6rbtree_ITER_TYPE _type; int _done; iter_direction _direction; }; struct __pyx_obj_6rbtree_RBTree { PyObject_HEAD rbtree_t *_tree; }; struct __pyx_vtabstruct_6rbtree_RBTreeIterator { PyObject *(*_position)(struct __pyx_obj_6rbtree_RBTreeIterator *,iter_direction); rbtree_node_t *(*walk)(struct __pyx_obj_6rbtree_RBTreeIterator *,iter_direction); PyObject *(*step)(struct __pyx_obj_6rbtree_RBTreeIterator *,iter_direction); }; static struct __pyx_vtabstruct_6rbtree_RBTreeIterator *__pyx_vtabptr_6rbtree_RBTreeIterator; static PyTypeObject *__pyx_ptype_6rbtree_RBTree = 0; static PyTypeObject *__pyx_ptype_6rbtree_RBTreeIterator = 0; static PyObject *__pyx_k4; static PyObject *__pyx_k5; static PyObject *__pyx_k6; static int __pyx_k7; /* Implementation of rbtree */ static char __pyx_k1[] = "Benjamin Saller "; static char __pyx_k2[] = "Copyright ObjectRealms, LLC 2007."; static char __pyx_k3[] = "The GNU Public License V2+"; static PyObject *__pyx_n___author__; static PyObject *__pyx_n___copyright__; static PyObject *__pyx_n___license__; static PyObject *__pyx_k1p; static PyObject *__pyx_k2p; static PyObject *__pyx_k3p; static PyObject *__pyx_n_False; static PyObject *__pyx_n_direction; static int __pyx_f_6rbtree_14RBTreeIterator___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_6rbtree_14RBTreeIterator___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_6rbtree_RBTree *__pyx_v_tree = 0; PyObject *__pyx_v_itype = 0; int __pyx_r; __pyx_t_6rbtree_ITER_TYPE __pyx_1; PyObject *__pyx_2 = 0; int __pyx_3; static char *__pyx_argnames[] = {"tree","itype",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_tree, &__pyx_v_itype)) return -1; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_tree); Py_INCREF(__pyx_v_itype); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tree), __pyx_ptype_6rbtree_RBTree, 1, "tree")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; goto __pyx_L1;} /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":87 */ Py_INCREF(((PyObject *)__pyx_v_tree)); Py_DECREF(((PyObject *)((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_T)); ((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_T = __pyx_v_tree; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":88 */ ((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_iter = NULL; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":89 */ __pyx_1 = ((__pyx_t_6rbtree_ITER_TYPE)PyInt_AsLong(__pyx_v_itype)); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;} ((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_type = __pyx_1; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":90 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;} __pyx_3 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; ((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_done = __pyx_3; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":91 */ __pyx_2 = PyInt_FromLong(FORWARD); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_v_self, __pyx_n_direction, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("rbtree.RBTreeIterator.__cinit__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_tree); Py_DECREF(__pyx_v_itype); return __pyx_r; } static PyObject *__pyx_f_6rbtree_14RBTreeIterator_9direction___get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_6rbtree_14RBTreeIterator_9direction___get__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; Py_INCREF(__pyx_v_self); __pyx_1 = PyInt_FromLong(((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_direction); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("rbtree.RBTreeIterator.direction.__get__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static int __pyx_f_6rbtree_14RBTreeIterator_9direction___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_f_6rbtree_14RBTreeIterator_9direction___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; iter_direction __pyx_1; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_value); __pyx_1 = ((iter_direction)PyInt_AsLong(__pyx_v_value)); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;} ((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_direction = __pyx_1; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("rbtree.RBTreeIterator.direction.__set__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_value); return __pyx_r; } static PyObject *__pyx_n_StopIteration; static PyObject *__pyx_f_6rbtree_14RBTreeIterator__position(struct __pyx_obj_6rbtree_RBTreeIterator *__pyx_v_self,iter_direction __pyx_v_direction) { PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; Py_INCREF(__pyx_v_self); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":100 */ __pyx_1 = __pyx_v_self->_done; if (__pyx_1) { __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_StopIteration); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; goto __pyx_L1;} __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":103 */ __pyx_1 = (__pyx_v_direction == FORWARD); if (__pyx_1) { __pyx_v_self->_iter = tree_min(__pyx_v_self->_T->_tree,NULL); goto __pyx_L3; } /*else*/ { __pyx_v_self->_iter = tree_max(__pyx_v_self->_T->_tree,NULL); } __pyx_L3:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("rbtree.RBTreeIterator._position"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static rbtree_node_t *__pyx_f_6rbtree_14RBTreeIterator_walk(struct __pyx_obj_6rbtree_RBTreeIterator *__pyx_v_self,iter_direction __pyx_v_direction) { rbtree_node_t *__pyx_v_n; rbtree_node_t *__pyx_r; int __pyx_1; Py_INCREF(__pyx_v_self); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":110 */ __pyx_1 = (__pyx_v_direction == FORWARD); if (__pyx_1) { __pyx_v_n = tree_successor(__pyx_v_self->_T->_tree,__pyx_v_self->_iter); goto __pyx_L2; } /*else*/ { __pyx_v_n = tree_predecessor(__pyx_v_self->_T->_tree,__pyx_v_self->_iter); } __pyx_L2:; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":114 */ __pyx_r = __pyx_v_n; goto __pyx_L0; __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_6rbtree_14RBTreeIterator___iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_6rbtree_14RBTreeIterator___iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_self); __pyx_r = __pyx_v_self; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_n_True; static PyObject *__pyx_n_key; static PyObject *__pyx_n_value; static PyObject *__pyx_n_item; static PyObject *__pyx_f_6rbtree_14RBTreeIterator_step(struct __pyx_obj_6rbtree_RBTreeIterator *__pyx_v_self,iter_direction __pyx_v_direction) { PyObject *__pyx_v_r; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; Py_INCREF(__pyx_v_self); __pyx_v_r = Py_None; Py_INCREF(Py_None); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":122 */ __pyx_1 = (__pyx_v_self->_iter == NULL); if (__pyx_1) { __pyx_2 = ((struct __pyx_vtabstruct_6rbtree_RBTreeIterator *)__pyx_v_self->__pyx_vtab)->_position(__pyx_v_self,__pyx_v_direction); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; goto __pyx_L2; } /*else*/ { __pyx_v_self->_iter = ((struct __pyx_vtabstruct_6rbtree_RBTreeIterator *)__pyx_v_self->__pyx_vtab)->walk(__pyx_v_self,__pyx_v_direction); } __pyx_L2:; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":125 */ __pyx_1 = (__pyx_v_self->_iter == NULL); if (__pyx_1) { /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":126 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;} __pyx_1 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_v_self->_done = __pyx_1; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":127 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_StopIteration); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;} __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":129 */ __pyx_1 = (__pyx_v_self->_type == __pyx_e_6rbtree_KEYS); if (__pyx_1) { __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_key); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;} Py_DECREF(__pyx_v_r); __pyx_v_r = __pyx_2; __pyx_2 = 0; goto __pyx_L4; } __pyx_1 = (__pyx_v_self->_type == __pyx_e_6rbtree_VALUES); if (__pyx_1) { __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_value); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; goto __pyx_L1;} Py_DECREF(__pyx_v_r); __pyx_v_r = __pyx_2; __pyx_2 = 0; goto __pyx_L4; } __pyx_1 = (__pyx_v_self->_type == __pyx_e_6rbtree_NODES); if (__pyx_1) { Py_INCREF(((PyObject *)__pyx_v_self)); Py_DECREF(__pyx_v_r); __pyx_v_r = ((PyObject *)__pyx_v_self); goto __pyx_L4; } /*else*/ { __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_item); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;} Py_DECREF(__pyx_v_r); __pyx_v_r = __pyx_2; __pyx_2 = 0; } __pyx_L4:; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":133 */ Py_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("rbtree.RBTreeIterator.step"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_r); Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_6rbtree_14RBTreeIterator___next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_6rbtree_14RBTreeIterator___next__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; iter_direction __pyx_2; Py_INCREF(__pyx_v_self); __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_direction); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; goto __pyx_L1;} __pyx_2 = ((iter_direction)PyInt_AsLong(__pyx_1)); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_1 = ((struct __pyx_vtabstruct_6rbtree_RBTreeIterator *)((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->__pyx_vtab)->step(((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self),__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("rbtree.RBTreeIterator.__next__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_6rbtree_14RBTreeIterator_prev(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_14RBTreeIterator_prev(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; iter_direction __pyx_4; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_direction); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L1;} __pyx_2 = PyInt_FromLong((-1)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L1;} __pyx_3 = PyNumber_Multiply(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_4 = ((iter_direction)PyInt_AsLong(__pyx_3)); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_1 = ((struct __pyx_vtabstruct_6rbtree_RBTreeIterator *)((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->__pyx_vtab)->step(((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self),__pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("rbtree.RBTreeIterator.prev"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_n_KeyError; static PyObject *__pyx_f_6rbtree_14RBTreeIterator_goto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_14RBTreeIterator_goto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; rbtree_node_t *__pyx_v_n; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {"key",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_key)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_key); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":141 */ __pyx_v_n = rbtree_get_node(((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_T->_tree,__pyx_v_key); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":142 */ __pyx_1 = (__pyx_v_n == NULL); if (__pyx_1) { /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":143 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;} __pyx_1 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; ((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_done = __pyx_1; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":144 */ ((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_iter = NULL; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":145 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_KeyError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_v_key, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;} goto __pyx_L2; } /*else*/ { ((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_iter = __pyx_v_n; } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("rbtree.RBTreeIterator.goto"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_key); return __pyx_r; } static PyObject *__pyx_k8p; static char __pyx_k8[] = "Iterator has no current value"; static PyObject *__pyx_f_6rbtree_14RBTreeIterator_3key___get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_6rbtree_14RBTreeIterator_3key___get__(PyObject *__pyx_v_self) { PyObject *__pyx_v_result; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; Py_INCREF(__pyx_v_self); __pyx_v_result = Py_None; Py_INCREF(Py_None); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":151 */ __pyx_1 = (((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_iter != NULL); if (__pyx_1) { /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":152 */ __pyx_2 = (PyObject *)((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_iter->key; Py_INCREF(__pyx_2); Py_DECREF(__pyx_v_result); __pyx_v_result = __pyx_2; __pyx_2 = 0; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":153 */ Py_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":154 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_KeyError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; goto __pyx_L1;} Py_INCREF(__pyx_k8p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k8p); __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __Pyx_Raise(__pyx_4, 0, 0); Py_DECREF(__pyx_4); __pyx_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; goto __pyx_L1;} __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("rbtree.RBTreeIterator.key.__get__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_result); Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_k9p; static char __pyx_k9[] = "Iterator has no current value"; static PyObject *__pyx_f_6rbtree_14RBTreeIterator_5value___get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_6rbtree_14RBTreeIterator_5value___get__(PyObject *__pyx_v_self) { PyObject *__pyx_v_result; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; Py_INCREF(__pyx_v_self); __pyx_v_result = Py_None; Py_INCREF(Py_None); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":158 */ __pyx_1 = (((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_iter != NULL); if (__pyx_1) { /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":159 */ __pyx_2 = (PyObject *)((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_iter->value; Py_INCREF(__pyx_2); Py_DECREF(__pyx_v_result); __pyx_v_result = __pyx_2; __pyx_2 = 0; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":160 */ Py_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":161 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_KeyError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_k9p, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; goto __pyx_L1;} __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("rbtree.RBTreeIterator.value.__get__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_result); Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_k10p; static char __pyx_k10[] = "Iterator has no current value"; static PyObject *__pyx_f_6rbtree_14RBTreeIterator_4item___get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_6rbtree_14RBTreeIterator_4item___get__(PyObject *__pyx_v_self) { PyObject *__pyx_v_result; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; Py_INCREF(__pyx_v_self); __pyx_v_result = Py_None; Py_INCREF(Py_None); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":165 */ __pyx_1 = (((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_iter != NULL); if (__pyx_1) { /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":166 */ __pyx_2 = (PyObject *)((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_iter->key; Py_INCREF(__pyx_2); __pyx_3 = (PyObject *)((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_iter->value; Py_INCREF(__pyx_3); __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3); __pyx_2 = 0; __pyx_3 = 0; Py_DECREF(__pyx_v_result); __pyx_v_result = __pyx_4; __pyx_4 = 0; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":168 */ Py_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":169 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_KeyError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_k10p, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;} __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("rbtree.RBTreeIterator.item.__get__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_result); Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_6rbtree_14RBTreeIterator_delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_14RBTreeIterator_delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { rbtree_node_t *__pyx_v_n; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":177 */ __pyx_v_n = rbtree_node_del(((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_T->_tree,((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_iter); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":179 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_direction); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;} __pyx_2 = PyInt_FromLong(BACKWARD); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;} __pyx_3 = __pyx_1 == __pyx_2; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { __pyx_v_n = tree_predecessor(((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_T->_tree,__pyx_v_n); goto __pyx_L2; } __pyx_L2:; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":181 */ ((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_iter = __pyx_v_n; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("rbtree.RBTreeIterator.delete"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_6rbtree_14RBTreeIterator_dump(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_14RBTreeIterator_dump(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); rbtree_dump_node(((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_T->_tree,((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_iter); __pyx_r = Py_None; Py_INCREF(Py_None); Py_DECREF(__pyx_v_self); return __pyx_r; } static Py_ssize_t __pyx_f_6rbtree_14RBTreeIterator___len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_f_6rbtree_14RBTreeIterator___len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; Py_INCREF(__pyx_v_self); __pyx_r = PyObject_Length(((PyObject *)((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_T)); goto __pyx_L0; __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static int __pyx_f_6rbtree_14RBTreeIterator___nonzero__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_f_6rbtree_14RBTreeIterator___nonzero__(PyObject *__pyx_v_self) { int __pyx_r; Py_INCREF(__pyx_v_self); __pyx_r = (!((struct __pyx_obj_6rbtree_RBTreeIterator *)__pyx_v_self)->_done); goto __pyx_L0; __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_n_update; static int __pyx_f_6rbtree_6RBTree___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_6rbtree_6RBTree___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_mapping = 0; PyObject *__pyx_v_cmp = 0; int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; static char *__pyx_argnames[] = {"mapping","cmp",0}; __pyx_v_mapping = __pyx_k4; __pyx_v_cmp = __pyx_k5; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_mapping, &__pyx_v_cmp)) return -1; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_mapping); Py_INCREF(__pyx_v_cmp); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":197 */ ((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree = rbtree_alloc(); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":198 */ rbtree_init(((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":200 */ __pyx_1 = __pyx_v_cmp != Py_None; if (__pyx_1) { rbtree_set_compare(((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree,__pyx_v_cmp); goto __pyx_L2; } __pyx_L2:; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":203 */ __pyx_1 = PyObject_IsTrue(__pyx_v_mapping); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;} if (__pyx_1) { __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_update); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} Py_INCREF(__pyx_v_mapping); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_mapping); __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; goto __pyx_L3; } __pyx_L3:; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("rbtree.RBTree.__cinit__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_mapping); Py_DECREF(__pyx_v_cmp); return __pyx_r; } static void __pyx_f_6rbtree_6RBTree___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_f_6rbtree_6RBTree___dealloc__(PyObject *__pyx_v_self) { Py_INCREF(__pyx_v_self); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":208 */ rbtree_dealloc(((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":209 */ rbtree_free(((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree); Py_DECREF(__pyx_v_self); } static PyObject *__pyx_f_6rbtree_6RBTree___getnewargs__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree___getnewargs__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {0}; if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_args, 0, 0) < 0) return 0; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) { Py_XDECREF(__pyx_args); Py_XDECREF(__pyx_kwds); Py_XDECREF(__pyx_v_args); return 0; } Py_INCREF(__pyx_v_self); __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("rbtree.RBTree.__getnewargs__"); __pyx_r = 0; __pyx_L0:; Py_XDECREF(__pyx_v_args); Py_DECREF(__pyx_v_self); Py_XDECREF(__pyx_args); Py_XDECREF(__pyx_kwds); return __pyx_r; } static PyObject *__pyx_n_dict; static PyObject *__pyx_n_data; static PyObject *__pyx_n_compare; static PyObject *__pyx_f_6rbtree_6RBTree___getstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree___getstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_d; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); __pyx_v_d = Py_None; Py_INCREF(Py_None); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":216 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_dict); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L1;} Py_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self); __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_d); __pyx_v_d = __pyx_3; __pyx_3 = 0; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":217 */ __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;} if (PyDict_SetItem(__pyx_1, __pyx_n_data, __pyx_v_d) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;} __pyx_2 = (PyObject *)((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree->compare; Py_INCREF(__pyx_2); if (PyDict_SetItem(__pyx_1, __pyx_n_compare, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("rbtree.RBTree.__getstate__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_d); Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_6rbtree_6RBTree___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_state = 0; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; static char *__pyx_argnames[] = {"state",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_state)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_state); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":224 */ __pyx_1 = PyObject_GetItem(__pyx_v_state, __pyx_n_compare); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;} __pyx_2 = __pyx_1 != Py_None; Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_2) { __pyx_1 = PyObject_GetItem(__pyx_v_state, __pyx_n_compare); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} rbtree_set_compare(((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree,__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; goto __pyx_L2; } __pyx_L2:; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":227 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_update); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;} __pyx_3 = PyObject_GetItem(__pyx_v_state, __pyx_n_data); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;} __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); __pyx_3 = 0; __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("rbtree.RBTree.__setstate__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_state); return __pyx_r; } static PyObject *__pyx_n_ValueError; static PyObject *__pyx_n_iternodes; static PyObject *__pyx_n_next; static PyObject *__pyx_k16p; static char __pyx_k16[] = "Can only test equality of two RBTrees"; static PyObject *__pyx_f_6rbtree_6RBTree___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_arg_mode); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_arg_mode) { PyObject *__pyx_v_mode = 0; PyObject *__pyx_v_s; PyObject *__pyx_v_o; PyObject *__pyx_v_i; PyObject *__pyx_r; int __pyx_1; int __pyx_2; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; PyObject *__pyx_5 = 0; PyObject *__pyx_6 = 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_other); __pyx_v_s = Py_None; Py_INCREF(Py_None); __pyx_v_o = Py_None; Py_INCREF(Py_None); __pyx_v_i = Py_None; Py_INCREF(Py_None); __pyx_v_mode = PyInt_FromLong(__pyx_arg_mode); if (!__pyx_v_mode) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":231 */ __pyx_1 = PyObject_IsInstance(__pyx_v_other,((PyObject*)__pyx_ptype_6rbtree_RBTree)); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;} __pyx_2 = (!__pyx_1); if (__pyx_2) { __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; goto __pyx_L1;} __Pyx_Raise(__pyx_3, __pyx_k16p, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":234 */ __pyx_3 = PyInt_FromLong(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; goto __pyx_L1;} if (PyObject_Cmp(__pyx_v_mode, __pyx_3, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; goto __pyx_L1;} __pyx_1 = __pyx_1 != 0; Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; goto __pyx_L3; } __pyx_L3:; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":235 */ __pyx_2 = (PyObject_Length(__pyx_v_other) != PyObject_Length(__pyx_v_self)); if (__pyx_2) { __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; goto __pyx_L4; } __pyx_L4:; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":236 */ __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_iternodes); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; goto __pyx_L1;} __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_v_s); __pyx_v_s = __pyx_4; __pyx_4 = 0; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":237 */ __pyx_3 = PyObject_GetAttr(__pyx_v_other, __pyx_n_iternodes); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L1;} __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_v_o); __pyx_v_o = __pyx_4; __pyx_4 = 0; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":238 */ __pyx_3 = PyObject_GetIter(__pyx_v_self); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; goto __pyx_L1;} for (;;) { __pyx_4 = PyIter_Next(__pyx_3); if (!__pyx_4) { if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; goto __pyx_L1;} break; } Py_DECREF(__pyx_v_i); __pyx_v_i = __pyx_4; __pyx_4 = 0; __pyx_4 = PyObject_GetAttr(__pyx_v_s, __pyx_n_next); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; goto __pyx_L1;} __pyx_5 = PyObject_CallObject(__pyx_4, 0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_item); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; __pyx_5 = PyObject_GetAttr(__pyx_v_o, __pyx_n_next); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; goto __pyx_L1;} __pyx_6 = PyObject_CallObject(__pyx_5, 0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; __pyx_5 = PyObject_GetAttr(__pyx_6, __pyx_n_item); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; if (PyObject_Cmp(__pyx_4, __pyx_5, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; goto __pyx_L1;} __pyx_1 = __pyx_1 != 0; Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; goto __pyx_L1;} __pyx_r = __pyx_6; __pyx_6 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; goto __pyx_L0; goto __pyx_L7; } __pyx_L7:; } Py_DECREF(__pyx_3); __pyx_3 = 0; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":240 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); Py_XDECREF(__pyx_5); Py_XDECREF(__pyx_6); __Pyx_AddTraceback("rbtree.RBTree.__richcmp__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_mode); Py_DECREF(__pyx_v_s); Py_DECREF(__pyx_v_o); Py_DECREF(__pyx_v_i); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_other); return __pyx_r; } static Py_ssize_t __pyx_f_6rbtree_6RBTree___len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_f_6rbtree_6RBTree___len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; Py_INCREF(__pyx_v_self); __pyx_r = ((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree->ct; goto __pyx_L0; __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_n_slice; static PyObject *__pyx_k17p; static char __pyx_k17[] = "setslice is unsupported"; static int __pyx_f_6rbtree_6RBTree___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /*proto*/ static int __pyx_f_6rbtree_6RBTree___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { int __pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_key); Py_INCREF(__pyx_v_value); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":248 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_slice); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L1;} __pyx_2 = PyObject_IsInstance(__pyx_v_key,__pyx_1); if (__pyx_2 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_2) { __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;} __Pyx_Raise(__pyx_1, __pyx_k17p, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":251 */ __pyx_2 = PyObject_Hash(__pyx_v_key); if (__pyx_2 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; goto __pyx_L1;} /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":252 */ rbtree_add(((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree,__pyx_v_key,__pyx_v_value); __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("rbtree.RBTree.__setitem__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_key); Py_DECREF(__pyx_v_value); return __pyx_r; } static PyObject *__pyx_n___doslice__; static PyObject *__pyx_f_6rbtree_6RBTree___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { void *__pyx_v_v; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_key); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":257 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_slice); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; goto __pyx_L1;} __pyx_2 = PyObject_IsInstance(__pyx_v_key,__pyx_1); if (__pyx_2 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_2) { __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___doslice__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; goto __pyx_L1;} Py_INCREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_key); __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":260 */ __pyx_v_v = rbtree_get(((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree,__pyx_v_key); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":261 */ __pyx_2 = (__pyx_v_v == NULL); if (__pyx_2) { __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_KeyError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; goto __pyx_L1;} __Pyx_Raise(__pyx_1, __pyx_v_key, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":262 */ __pyx_3 = (PyObject *)__pyx_v_v; Py_INCREF(__pyx_3); __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("rbtree.RBTree.__getitem__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_key); return __pyx_r; } static PyObject *__pyx_n___dodeleteslice__; static int __pyx_f_6rbtree_6RBTree___delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static int __pyx_f_6rbtree_6RBTree___delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { int __pyx_v_rc; int __pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_key); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":267 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_slice); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; goto __pyx_L1;} __pyx_2 = PyObject_IsInstance(__pyx_v_key,__pyx_1); if (__pyx_2 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_2) { /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":268 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___dodeleteslice__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; goto __pyx_L1;} Py_INCREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_key); __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":269 */ __pyx_r = 0; goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":271 */ __pyx_v_rc = rbtree_del(((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree,__pyx_v_key); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":272 */ __pyx_2 = (__pyx_v_rc != 0); if (__pyx_2) { __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_KeyError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; goto __pyx_L1;} __Pyx_Raise(__pyx_1, __pyx_v_key, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("rbtree.RBTree.__delitem__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_key); return __pyx_r; } static PyObject *__pyx_n___class__; static PyObject *__pyx_n_start; static PyObject *__pyx_n_stop; static PyObject *__pyx_n_step; static PyObject *__pyx_f_6rbtree_6RBTree___doslice__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree___doslice__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_slice = 0; PyObject *__pyx_v_instance; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"slice",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_slice)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_slice); __pyx_v_instance = Py_None; Py_INCREF(Py_None); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":281 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___class__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; goto __pyx_L1;} __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_instance); __pyx_v_instance = __pyx_2; __pyx_2 = 0; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":282 */ __pyx_1 = PyObject_GetAttr(__pyx_v_slice, __pyx_n_start); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_v_slice, __pyx_n_stop); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_v_slice, __pyx_n_step); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;} rbtree_do_slice(((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree,__pyx_1,__pyx_2,__pyx_3,((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_instance)->_tree); Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":287 */ Py_INCREF(__pyx_v_instance); __pyx_r = __pyx_v_instance; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("rbtree.RBTree.__doslice__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_instance); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_slice); return __pyx_r; } static PyObject *__pyx_f_6rbtree_6RBTree___dodeleteslice__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree___dodeleteslice__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_slice = 0; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"slice",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_slice)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_slice); __pyx_1 = PyObject_GetAttr(__pyx_v_slice, __pyx_n_start); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_v_slice, __pyx_n_stop); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_v_slice, __pyx_n_step); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; goto __pyx_L1;} rbtree_do_del_slice(((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree,__pyx_1,__pyx_2,__pyx_3); Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("rbtree.RBTree.__dodeleteslice__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_slice); return __pyx_r; } static PyObject *__pyx_f_6rbtree_6RBTree_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; PyObject *__pyx_v_default = 0; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; static char *__pyx_argnames[] = {"key","default",0}; __pyx_v_default = __pyx_k6; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_key, &__pyx_v_default)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_key); Py_INCREF(__pyx_v_default); /*try:*/ { __pyx_1 = PyObject_GetItem(__pyx_v_self, __pyx_v_key); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; goto __pyx_L2;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; } goto __pyx_L3; __pyx_L2:; Py_XDECREF(__pyx_1); __pyx_1 = 0; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":295 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_KeyError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;} __pyx_2 = PyErr_ExceptionMatches(__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_2) { __Pyx_AddTraceback("rbtree.get"); if (__Pyx_GetException(&__pyx_1, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;} Py_INCREF(__pyx_v_default); __pyx_r = __pyx_v_default; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; goto __pyx_L0; Py_DECREF(__pyx_1); Py_DECREF(__pyx_3); Py_DECREF(__pyx_4); goto __pyx_L3; } goto __pyx_L1; __pyx_L3:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("rbtree.RBTree.get"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_key); Py_DECREF(__pyx_v_default); return __pyx_r; } static int __pyx_f_6rbtree_6RBTree___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static int __pyx_f_6rbtree_6RBTree___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { void *__pyx_v_v; int __pyx_r; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_key); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":300 */ __pyx_v_v = rbtree_get(((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree,__pyx_v_key); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":301 */ __pyx_r = (__pyx_v_v != NULL); goto __pyx_L0; __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_key); return __pyx_r; } static PyObject *__pyx_f_6rbtree_6RBTree_has_key(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree_has_key(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; void *__pyx_v_v; PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {"key",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_key)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_key); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":305 */ __pyx_v_v = rbtree_get(((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree,__pyx_v_key); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":306 */ __pyx_1 = PyInt_FromLong((__pyx_v_v != NULL)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("rbtree.RBTree.has_key"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_key); return __pyx_r; } static PyObject *__pyx_f_6rbtree_6RBTree___iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree___iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; Py_INCREF(__pyx_v_self); __pyx_1 = PyInt_FromLong(__pyx_e_6rbtree_KEYS); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; goto __pyx_L1;} __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; goto __pyx_L1;} Py_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self); PyTuple_SET_ITEM(__pyx_2, 1, __pyx_1); __pyx_1 = 0; __pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_6rbtree_RBTreeIterator), __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("rbtree.RBTree.__iter__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_6rbtree_6RBTree_iterkeys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree_iterkeys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); __pyx_1 = PyInt_FromLong(__pyx_e_6rbtree_KEYS); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;} __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;} Py_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self); PyTuple_SET_ITEM(__pyx_2, 1, __pyx_1); __pyx_1 = 0; __pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_6rbtree_RBTreeIterator), __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("rbtree.RBTree.iterkeys"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_6rbtree_6RBTree_itervalues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree_itervalues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); __pyx_1 = PyInt_FromLong(__pyx_e_6rbtree_VALUES); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;} __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;} Py_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self); PyTuple_SET_ITEM(__pyx_2, 1, __pyx_1); __pyx_1 = 0; __pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_6rbtree_RBTreeIterator), __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("rbtree.RBTree.itervalues"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_6rbtree_6RBTree_iteritems(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree_iteritems(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); __pyx_1 = PyInt_FromLong(__pyx_e_6rbtree_ITEMS); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; goto __pyx_L1;} __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; goto __pyx_L1;} Py_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self); PyTuple_SET_ITEM(__pyx_2, 1, __pyx_1); __pyx_1 = 0; __pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_6rbtree_RBTreeIterator), __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("rbtree.RBTree.iteritems"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_6rbtree_6RBTree_iternodes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree_iternodes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); __pyx_1 = PyInt_FromLong(__pyx_e_6rbtree_NODES); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; goto __pyx_L1;} __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; goto __pyx_L1;} Py_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self); PyTuple_SET_ITEM(__pyx_2, 1, __pyx_1); __pyx_1 = 0; __pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_6rbtree_RBTreeIterator), __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("rbtree.RBTree.iternodes"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_n_list; static PyObject *__pyx_n___iter__; static PyObject *__pyx_f_6rbtree_6RBTree_keys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree_keys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n___iter__); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; goto __pyx_L1;} __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3); __pyx_3 = 0; __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("rbtree.RBTree.keys"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_n_itervalues; static PyObject *__pyx_f_6rbtree_6RBTree_values(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree_values(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_itervalues); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; goto __pyx_L1;} __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3); __pyx_3 = 0; __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("rbtree.RBTree.values"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_n_iteritems; static PyObject *__pyx_f_6rbtree_6RBTree_items(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree_items(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_iteritems); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; goto __pyx_L1;} __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3); __pyx_3 = 0; __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("rbtree.RBTree.items"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_n_tuple; static PyObject *__pyx_n_TypeError; static PyObject *__pyx_k18p; static char __pyx_k18[] = "Unsupported type in ctor (need dict/sequence)"; static PyObject *__pyx_f_6rbtree_6RBTree_update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree_update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_mapping = 0; PyObject *__pyx_v_k; PyObject *__pyx_v_v; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; PyObject *__pyx_4 = 0; static char *__pyx_argnames[] = {"mapping",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_mapping)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_mapping); __pyx_v_k = Py_None; Py_INCREF(Py_None); __pyx_v_v = Py_None; Py_INCREF(Py_None); __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_dict); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; goto __pyx_L1;} __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1); Py_INCREF(((PyObject*)__pyx_ptype_6rbtree_RBTree)); PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject*)__pyx_ptype_6rbtree_RBTree)); __pyx_1 = 0; __pyx_3 = PyObject_IsInstance(__pyx_v_mapping,__pyx_2); if (__pyx_3 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { __pyx_1 = PyObject_GetAttr(__pyx_v_mapping, __pyx_n_iteritems); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_1 = PyObject_GetIter(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; for (;;) { __pyx_2 = PyIter_Next(__pyx_1); if (!__pyx_2) { if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} break; } __pyx_4 = PyObject_GetIter(__pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_2 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} Py_DECREF(__pyx_v_k); __pyx_v_k = __pyx_2; __pyx_2 = 0; __pyx_2 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} Py_DECREF(__pyx_v_v); __pyx_v_v = __pyx_2; __pyx_2 = 0; if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; if (PyObject_SetItem(__pyx_v_self, __pyx_v_k, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; goto __pyx_L1;} } Py_DECREF(__pyx_1); __pyx_1 = 0; goto __pyx_L2; } __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;} __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;} __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2); PyTuple_SET_ITEM(__pyx_1, 1, __pyx_4); __pyx_2 = 0; __pyx_4 = 0; __pyx_3 = PyObject_IsInstance(__pyx_v_mapping,__pyx_1); if (__pyx_3 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_3) { __pyx_2 = PyObject_GetIter(__pyx_v_mapping); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;} for (;;) { __pyx_4 = PyIter_Next(__pyx_2); if (!__pyx_4) { if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;} break; } __pyx_1 = PyObject_GetIter(__pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_4 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;} Py_DECREF(__pyx_v_k); __pyx_v_k = __pyx_4; __pyx_4 = 0; __pyx_4 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;} Py_DECREF(__pyx_v_v); __pyx_v_v = __pyx_4; __pyx_4 = 0; if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; if (PyObject_SetItem(__pyx_v_self, __pyx_v_k, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; goto __pyx_L1;} } Py_DECREF(__pyx_2); __pyx_2 = 0; goto __pyx_L2; } /*else*/ { __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; goto __pyx_L1;} __Pyx_Raise(__pyx_4, __pyx_k18p, 0); Py_DECREF(__pyx_4); __pyx_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; goto __pyx_L1;} } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("rbtree.RBTree.update"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_k); Py_DECREF(__pyx_v_v); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_mapping); return __pyx_r; } static PyObject *__pyx_f_6rbtree_6RBTree_pop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree_pop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key; PyObject *__pyx_v_v; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); __pyx_v_key = Py_None; Py_INCREF(Py_None); __pyx_v_v = Py_None; Py_INCREF(Py_None); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":330 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___iter__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; goto __pyx_L1;} __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_next); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_key); __pyx_v_key = __pyx_2; __pyx_2 = 0; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":331 */ __pyx_1 = PyObject_GetItem(__pyx_v_self, __pyx_v_key); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; goto __pyx_L1;} Py_DECREF(__pyx_v_v); __pyx_v_v = __pyx_1; __pyx_1 = 0; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":332 */ if (PyObject_DelItem(__pyx_v_self, __pyx_v_key) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; goto __pyx_L1;} /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":333 */ Py_INCREF(__pyx_v_v); __pyx_r = __pyx_v_v; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("rbtree.RBTree.pop"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_key); Py_DECREF(__pyx_v_v); Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_6rbtree_6RBTree_dumpDot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree_dumpDot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { char *__pyx_v_filename; PyObject *__pyx_r; static char *__pyx_argnames[] = {"filename",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "s", __pyx_argnames, &__pyx_v_filename)) return 0; Py_INCREF(__pyx_v_self); rbtree_dump_dot(((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree,__pyx_v_filename); __pyx_r = Py_None; Py_INCREF(Py_None); Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_6rbtree_6RBTree_validate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree_validate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_verbose; PyObject *__pyx_r; static char *__pyx_argnames[] = {"verbose",0}; __pyx_v_verbose = __pyx_k7; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|i", __pyx_argnames, &__pyx_v_verbose)) return 0; Py_INCREF(__pyx_v_self); rbtree_validate(((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree,__pyx_v_verbose); __pyx_r = Py_None; Py_INCREF(Py_None); Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_6rbtree_6RBTree_copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree_copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___class__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; goto __pyx_L1;} Py_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self); __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("rbtree.RBTree.copy"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_6rbtree_6RBTree_clear(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree_clear(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":345 */ rbtree_dealloc(((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":346 */ rbtree_free(((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":347 */ ((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree = rbtree_alloc(); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":348 */ rbtree_init(((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree); __pyx_r = Py_None; Py_INCREF(Py_None); Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_6rbtree_6RBTree_setdefault(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree_setdefault(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; PyObject *__pyx_v_default = 0; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {"key","default",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_key, &__pyx_v_default)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_key); Py_INCREF(__pyx_v_default); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":351 */ __pyx_1 = PySequence_Contains(__pyx_v_self, __pyx_v_key); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; goto __pyx_L1;} __pyx_1 = !__pyx_1; if (__pyx_1) { /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":352 */ if (PyObject_SetItem(__pyx_v_self, __pyx_v_key, __pyx_v_default) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; goto __pyx_L1;} /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":353 */ Py_INCREF(__pyx_v_default); __pyx_r = __pyx_v_default; goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":354 */ __pyx_2 = PyObject_GetItem(__pyx_v_self, __pyx_v_key); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("rbtree.RBTree.setdefault"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_key); Py_DECREF(__pyx_v_default); return __pyx_r; } static PyObject *__pyx_n_xrange; static PyObject *__pyx_f_6rbtree_6RBTree_byOffset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree_byOffset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_offset = 0; rbtree_node_t *__pyx_v_n; PyObject *__pyx_v_forward; PyObject *__pyx_v_i; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; static char *__pyx_argnames[] = {"offset",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_offset)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_offset); __pyx_v_forward = Py_None; Py_INCREF(Py_None); __pyx_v_i = Py_None; Py_INCREF(Py_None); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":359 */ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; goto __pyx_L1;} if (PyObject_Cmp(__pyx_v_offset, __pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; goto __pyx_L1;} __pyx_2 = __pyx_2 >= 0; Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_2) { /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":360 */ __pyx_v_n = tree_min(((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree,NULL); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":361 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; goto __pyx_L1;} Py_DECREF(__pyx_v_forward); __pyx_v_forward = __pyx_1; __pyx_1 = 0; goto __pyx_L2; } /*else*/ { /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":363 */ __pyx_v_n = tree_max(((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree,NULL); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":364 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; goto __pyx_L1;} Py_DECREF(__pyx_v_forward); __pyx_v_forward = __pyx_1; __pyx_1 = 0; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":365 */ __pyx_1 = PyNumber_Absolute(__pyx_v_offset); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; goto __pyx_L1;} __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; goto __pyx_L1;} __pyx_4 = PyNumber_Subtract(__pyx_1, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_v_offset); __pyx_v_offset = __pyx_4; __pyx_4 = 0; } __pyx_L2:; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":367 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_xrange); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; goto __pyx_L1;} Py_INCREF(__pyx_v_offset); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_offset); __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_1 = PyObject_GetIter(__pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; for (;;) { __pyx_3 = PyIter_Next(__pyx_1); if (!__pyx_3) { if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; goto __pyx_L1;} break; } Py_DECREF(__pyx_v_i); __pyx_v_i = __pyx_3; __pyx_3 = 0; __pyx_2 = PyObject_IsTrue(__pyx_v_forward); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;} if (__pyx_2) { __pyx_v_n = tree_successor(((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree,__pyx_v_n); goto __pyx_L5; } /*else*/ { __pyx_v_n = tree_predecessor(((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree,__pyx_v_n); } __pyx_L5:; } Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":373 */ __pyx_4 = (PyObject *)__pyx_v_n->key; Py_INCREF(__pyx_4); __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("rbtree.RBTree.byOffset"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_forward); Py_DECREF(__pyx_v_i); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_offset); return __pyx_r; } static PyObject *__pyx_f_6rbtree_6RBTree_min(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree_min(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":377 */ __pyx_1 = (PyObject_Length(__pyx_v_self) == 0); if (__pyx_1) { Py_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":379 */ __pyx_2 = (PyObject *)tree_min(((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree,NULL)->key; Py_INCREF(__pyx_2); __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_6rbtree_6RBTree_max(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree_max(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":383 */ __pyx_1 = (PyObject_Length(__pyx_v_self) == 0); if (__pyx_1) { Py_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":385 */ __pyx_2 = (PyObject *)tree_max(((struct __pyx_obj_6rbtree_RBTree *)__pyx_v_self)->_tree,NULL)->key; Py_INCREF(__pyx_2); __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_n_append; static PyObject *__pyx_n_join; static PyObject *__pyx_n___name__; static PyObject *__pyx_k19p; static PyObject *__pyx_k21p; static PyObject *__pyx_k20p; static PyObject *__pyx_k22p; static PyObject *__pyx_k23p; static char __pyx_k19[] = "%r : %r"; static char __pyx_k20[] = " "; static char __pyx_k21[] = ", "; static char __pyx_k22[] = ""; static char __pyx_k23[] = "<%s%s>"; static PyObject *__pyx_f_6rbtree_6RBTree___repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_6rbtree_6RBTree___repr__(PyObject *__pyx_v_self) { PyObject *__pyx_v_res; PyObject *__pyx_v_k; PyObject *__pyx_v_v; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; Py_ssize_t __pyx_5; Py_INCREF(__pyx_v_self); __pyx_v_res = Py_None; Py_INCREF(Py_None); __pyx_v_k = Py_None; Py_INCREF(Py_None); __pyx_v_v = Py_None; Py_INCREF(Py_None); /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":388 */ __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;} Py_DECREF(__pyx_v_res); __pyx_v_res = __pyx_1; __pyx_1 = 0; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":389 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_iteritems); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; goto __pyx_L1;} __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_1 = PyObject_GetIter(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; for (;;) { __pyx_2 = PyIter_Next(__pyx_1); if (!__pyx_2) { if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; goto __pyx_L1;} break; } __pyx_3 = PyObject_GetIter(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_2 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; goto __pyx_L1;} Py_DECREF(__pyx_v_k); __pyx_v_k = __pyx_2; __pyx_2 = 0; __pyx_2 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; goto __pyx_L1;} Py_DECREF(__pyx_v_v); __pyx_v_v = __pyx_2; __pyx_2 = 0; if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_2 = PyObject_GetAttr(__pyx_v_res, __pyx_n_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; goto __pyx_L1;} __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; goto __pyx_L1;} Py_INCREF(__pyx_v_k); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_k); Py_INCREF(__pyx_v_v); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_v); __pyx_4 = PyNumber_Remainder(__pyx_k19p, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4); __pyx_4 = 0; __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; } Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":391 */ __pyx_5 = PyObject_Length(__pyx_v_res); if (__pyx_5) { __pyx_2 = PyObject_GetAttr(__pyx_k21p, __pyx_n_join); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;} Py_INCREF(__pyx_v_res); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_res); __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_1 = PyNumber_Add(__pyx_k20p, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_v_res); __pyx_v_res = __pyx_1; __pyx_1 = 0; goto __pyx_L4; } /*else*/ { Py_INCREF(__pyx_k22p); Py_DECREF(__pyx_v_res); __pyx_v_res = __pyx_k22p; } __pyx_L4:; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":395 */ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n___class__); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n___name__); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); Py_INCREF(__pyx_v_res); PyTuple_SET_ITEM(__pyx_4, 1, __pyx_v_res); __pyx_3 = 0; __pyx_1 = PyNumber_Remainder(__pyx_k23p, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("rbtree.RBTree.__repr__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_res); Py_DECREF(__pyx_v_k); Py_DECREF(__pyx_v_v); Py_DECREF(__pyx_v_self); return __pyx_r; } static __Pyx_InternTabEntry __pyx_intern_tab[] = { {&__pyx_n_False, "False"}, {&__pyx_n_KeyError, "KeyError"}, {&__pyx_n_StopIteration, "StopIteration"}, {&__pyx_n_True, "True"}, {&__pyx_n_TypeError, "TypeError"}, {&__pyx_n_ValueError, "ValueError"}, {&__pyx_n___author__, "__author__"}, {&__pyx_n___class__, "__class__"}, {&__pyx_n___copyright__, "__copyright__"}, {&__pyx_n___dodeleteslice__, "__dodeleteslice__"}, {&__pyx_n___doslice__, "__doslice__"}, {&__pyx_n___iter__, "__iter__"}, {&__pyx_n___license__, "__license__"}, {&__pyx_n___name__, "__name__"}, {&__pyx_n_append, "append"}, {&__pyx_n_compare, "compare"}, {&__pyx_n_data, "data"}, {&__pyx_n_dict, "dict"}, {&__pyx_n_direction, "direction"}, {&__pyx_n_item, "item"}, {&__pyx_n_iteritems, "iteritems"}, {&__pyx_n_iternodes, "iternodes"}, {&__pyx_n_itervalues, "itervalues"}, {&__pyx_n_join, "join"}, {&__pyx_n_key, "key"}, {&__pyx_n_list, "list"}, {&__pyx_n_next, "next"}, {&__pyx_n_slice, "slice"}, {&__pyx_n_start, "start"}, {&__pyx_n_step, "step"}, {&__pyx_n_stop, "stop"}, {&__pyx_n_tuple, "tuple"}, {&__pyx_n_update, "update"}, {&__pyx_n_value, "value"}, {&__pyx_n_xrange, "xrange"}, {0, 0} }; static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_k1p, __pyx_k1, sizeof(__pyx_k1)}, {&__pyx_k2p, __pyx_k2, sizeof(__pyx_k2)}, {&__pyx_k3p, __pyx_k3, sizeof(__pyx_k3)}, {&__pyx_k8p, __pyx_k8, sizeof(__pyx_k8)}, {&__pyx_k9p, __pyx_k9, sizeof(__pyx_k9)}, {&__pyx_k10p, __pyx_k10, sizeof(__pyx_k10)}, {&__pyx_k16p, __pyx_k16, sizeof(__pyx_k16)}, {&__pyx_k17p, __pyx_k17, sizeof(__pyx_k17)}, {&__pyx_k18p, __pyx_k18, sizeof(__pyx_k18)}, {&__pyx_k19p, __pyx_k19, sizeof(__pyx_k19)}, {&__pyx_k21p, __pyx_k21, sizeof(__pyx_k21)}, {&__pyx_k20p, __pyx_k20, sizeof(__pyx_k20)}, {&__pyx_k22p, __pyx_k22, sizeof(__pyx_k22)}, {&__pyx_k23p, __pyx_k23, sizeof(__pyx_k23)}, {0, 0, 0} }; static PyObject *__pyx_tp_new_6rbtree_RBTree(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; if (__pyx_f_6rbtree_6RBTree___new__(o, a, k) < 0) { Py_DECREF(o); o = 0; } return o; } static void __pyx_tp_dealloc_6rbtree_RBTree(PyObject *o) { { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++o->ob_refcnt; __pyx_f_6rbtree_6RBTree___dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --o->ob_refcnt; PyErr_Restore(etype, eval, etb); } (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_6rbtree_RBTree(PyObject *o, visitproc v, void *a) { return 0; } static int __pyx_tp_clear_6rbtree_RBTree(PyObject *o) { return 0; } static PyObject *__pyx_sq_item_6rbtree_RBTree(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = o->ob_type->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_6rbtree_RBTree(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_f_6rbtree_6RBTree___setitem__(o, i, v); } else { return __pyx_f_6rbtree_6RBTree___delitem__(o, i); } } static struct PyMethodDef __pyx_methods_6rbtree_RBTree[] = { {"__getnewargs__", (PyCFunction)__pyx_f_6rbtree_6RBTree___getnewargs__, METH_VARARGS|METH_KEYWORDS, 0}, {"__getstate__", (PyCFunction)__pyx_f_6rbtree_6RBTree___getstate__, METH_VARARGS|METH_KEYWORDS, 0}, {"__setstate__", (PyCFunction)__pyx_f_6rbtree_6RBTree___setstate__, METH_VARARGS|METH_KEYWORDS, 0}, {"__doslice__", (PyCFunction)__pyx_f_6rbtree_6RBTree___doslice__, METH_VARARGS|METH_KEYWORDS, 0}, {"__dodeleteslice__", (PyCFunction)__pyx_f_6rbtree_6RBTree___dodeleteslice__, METH_VARARGS|METH_KEYWORDS, 0}, {"get", (PyCFunction)__pyx_f_6rbtree_6RBTree_get, METH_VARARGS|METH_KEYWORDS, 0}, {"has_key", (PyCFunction)__pyx_f_6rbtree_6RBTree_has_key, METH_VARARGS|METH_KEYWORDS, 0}, {"iterkeys", (PyCFunction)__pyx_f_6rbtree_6RBTree_iterkeys, METH_VARARGS|METH_KEYWORDS, 0}, {"itervalues", (PyCFunction)__pyx_f_6rbtree_6RBTree_itervalues, METH_VARARGS|METH_KEYWORDS, 0}, {"iteritems", (PyCFunction)__pyx_f_6rbtree_6RBTree_iteritems, METH_VARARGS|METH_KEYWORDS, 0}, {"iternodes", (PyCFunction)__pyx_f_6rbtree_6RBTree_iternodes, METH_VARARGS|METH_KEYWORDS, 0}, {"keys", (PyCFunction)__pyx_f_6rbtree_6RBTree_keys, METH_VARARGS|METH_KEYWORDS, 0}, {"values", (PyCFunction)__pyx_f_6rbtree_6RBTree_values, METH_VARARGS|METH_KEYWORDS, 0}, {"items", (PyCFunction)__pyx_f_6rbtree_6RBTree_items, METH_VARARGS|METH_KEYWORDS, 0}, {"update", (PyCFunction)__pyx_f_6rbtree_6RBTree_update, METH_VARARGS|METH_KEYWORDS, 0}, {"pop", (PyCFunction)__pyx_f_6rbtree_6RBTree_pop, METH_VARARGS|METH_KEYWORDS, 0}, {"dumpDot", (PyCFunction)__pyx_f_6rbtree_6RBTree_dumpDot, METH_VARARGS|METH_KEYWORDS, 0}, {"validate", (PyCFunction)__pyx_f_6rbtree_6RBTree_validate, METH_VARARGS|METH_KEYWORDS, 0}, {"copy", (PyCFunction)__pyx_f_6rbtree_6RBTree_copy, METH_VARARGS|METH_KEYWORDS, 0}, {"clear", (PyCFunction)__pyx_f_6rbtree_6RBTree_clear, METH_VARARGS|METH_KEYWORDS, 0}, {"setdefault", (PyCFunction)__pyx_f_6rbtree_6RBTree_setdefault, METH_VARARGS|METH_KEYWORDS, 0}, {"byOffset", (PyCFunction)__pyx_f_6rbtree_6RBTree_byOffset, METH_VARARGS|METH_KEYWORDS, 0}, {"min", (PyCFunction)__pyx_f_6rbtree_6RBTree_min, METH_VARARGS|METH_KEYWORDS, 0}, {"max", (PyCFunction)__pyx_f_6rbtree_6RBTree_max, METH_VARARGS|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_RBTree = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 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*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 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_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX 0, /*nb_index*/ #endif }; static PySequenceMethods __pyx_tp_as_sequence_RBTree = { __pyx_f_6rbtree_6RBTree___len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_6rbtree_RBTree, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ __pyx_f_6rbtree_6RBTree___contains__, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_RBTree = { __pyx_f_6rbtree_6RBTree___len__, /*mp_length*/ __pyx_f_6rbtree_6RBTree___getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_6rbtree_RBTree, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_RBTree = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_6rbtree_RBTree = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "rbtree.RBTree", /*tp_name*/ sizeof(struct __pyx_obj_6rbtree_RBTree), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6rbtree_RBTree, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ __pyx_f_6rbtree_6RBTree___repr__, /*tp_repr*/ &__pyx_tp_as_number_RBTree, /*tp_as_number*/ &__pyx_tp_as_sequence_RBTree, /*tp_as_sequence*/ &__pyx_tp_as_mapping_RBTree, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_RBTree, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_6rbtree_RBTree, /*tp_traverse*/ __pyx_tp_clear_6rbtree_RBTree, /*tp_clear*/ __pyx_f_6rbtree_6RBTree___richcmp__, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_f_6rbtree_6RBTree___iter__, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6rbtree_RBTree, /*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_6rbtree_RBTree, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static struct __pyx_vtabstruct_6rbtree_RBTreeIterator __pyx_vtable_6rbtree_RBTreeIterator; static PyObject *__pyx_tp_new_6rbtree_RBTreeIterator(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_6rbtree_RBTreeIterator *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; p = ((struct __pyx_obj_6rbtree_RBTreeIterator *)o); *(struct __pyx_vtabstruct_6rbtree_RBTreeIterator **)&p->__pyx_vtab = __pyx_vtabptr_6rbtree_RBTreeIterator; p->_T = ((struct __pyx_obj_6rbtree_RBTree *)Py_None); Py_INCREF(Py_None); if (__pyx_f_6rbtree_14RBTreeIterator___new__(o, a, k) < 0) { Py_DECREF(o); o = 0; } return o; } static void __pyx_tp_dealloc_6rbtree_RBTreeIterator(PyObject *o) { struct __pyx_obj_6rbtree_RBTreeIterator *p = (struct __pyx_obj_6rbtree_RBTreeIterator *)o; Py_XDECREF(((PyObject *)p->_T)); (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_6rbtree_RBTreeIterator(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_6rbtree_RBTreeIterator *p = (struct __pyx_obj_6rbtree_RBTreeIterator *)o; if (p->_T) { e = (*v)(((PyObject*)p->_T), a); if (e) return e; } return 0; } static int __pyx_tp_clear_6rbtree_RBTreeIterator(PyObject *o) { struct __pyx_obj_6rbtree_RBTreeIterator *p = (struct __pyx_obj_6rbtree_RBTreeIterator *)o; Py_XDECREF(((PyObject *)p->_T)); p->_T = ((struct __pyx_obj_6rbtree_RBTree *)Py_None); Py_INCREF(Py_None); return 0; } static PyObject *__pyx_getprop_6rbtree_14RBTreeIterator_direction(PyObject *o, void *x) { return __pyx_f_6rbtree_14RBTreeIterator_9direction___get__(o); } static int __pyx_setprop_6rbtree_14RBTreeIterator_direction(PyObject *o, PyObject *v, void *x) { if (v) { return __pyx_f_6rbtree_14RBTreeIterator_9direction___set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_6rbtree_14RBTreeIterator_key(PyObject *o, void *x) { return __pyx_f_6rbtree_14RBTreeIterator_3key___get__(o); } static PyObject *__pyx_getprop_6rbtree_14RBTreeIterator_value(PyObject *o, void *x) { return __pyx_f_6rbtree_14RBTreeIterator_5value___get__(o); } static PyObject *__pyx_getprop_6rbtree_14RBTreeIterator_item(PyObject *o, void *x) { return __pyx_f_6rbtree_14RBTreeIterator_4item___get__(o); } static struct PyMethodDef __pyx_methods_6rbtree_RBTreeIterator[] = { {"prev", (PyCFunction)__pyx_f_6rbtree_14RBTreeIterator_prev, METH_VARARGS|METH_KEYWORDS, 0}, {"goto", (PyCFunction)__pyx_f_6rbtree_14RBTreeIterator_goto, METH_VARARGS|METH_KEYWORDS, 0}, {"delete", (PyCFunction)__pyx_f_6rbtree_14RBTreeIterator_delete, METH_VARARGS|METH_KEYWORDS, 0}, {"dump", (PyCFunction)__pyx_f_6rbtree_14RBTreeIterator_dump, METH_VARARGS|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_6rbtree_RBTreeIterator[] = { {"direction", __pyx_getprop_6rbtree_14RBTreeIterator_direction, __pyx_setprop_6rbtree_14RBTreeIterator_direction, 0, 0}, {"key", __pyx_getprop_6rbtree_14RBTreeIterator_key, 0, 0, 0}, {"value", __pyx_getprop_6rbtree_14RBTreeIterator_value, 0, 0, 0}, {"item", __pyx_getprop_6rbtree_14RBTreeIterator_item, 0, 0, 0}, {0, 0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_RBTreeIterator = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ __pyx_f_6rbtree_14RBTreeIterator___nonzero__, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 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_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX 0, /*nb_index*/ #endif }; static PySequenceMethods __pyx_tp_as_sequence_RBTreeIterator = { __pyx_f_6rbtree_14RBTreeIterator___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_RBTreeIterator = { __pyx_f_6rbtree_14RBTreeIterator___len__, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_RBTreeIterator = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_6rbtree_RBTreeIterator = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "rbtree.RBTreeIterator", /*tp_name*/ sizeof(struct __pyx_obj_6rbtree_RBTreeIterator), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6rbtree_RBTreeIterator, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ &__pyx_tp_as_number_RBTreeIterator, /*tp_as_number*/ &__pyx_tp_as_sequence_RBTreeIterator, /*tp_as_sequence*/ &__pyx_tp_as_mapping_RBTreeIterator, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_RBTreeIterator, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_6rbtree_RBTreeIterator, /*tp_traverse*/ __pyx_tp_clear_6rbtree_RBTreeIterator, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_f_6rbtree_14RBTreeIterator___iter__, /*tp_iter*/ __pyx_f_6rbtree_14RBTreeIterator___next__, /*tp_iternext*/ __pyx_methods_6rbtree_RBTreeIterator, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_6rbtree_RBTreeIterator, /*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_6rbtree_RBTreeIterator, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static struct PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; static void __pyx_init_filenames(void); /*proto*/ PyMODINIT_FUNC initrbtree(void); /*proto*/ PyMODINIT_FUNC initrbtree(void) { __pyx_init_filenames(); __pyx_m = Py_InitModule4("rbtree", __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION); if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}; __pyx_b = PyImport_AddModule("__builtin__"); if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}; if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}; if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}; if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}; if (PyType_Ready(&__pyx_type_6rbtree_RBTree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "RBTree", (PyObject *)&__pyx_type_6rbtree_RBTree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;} __pyx_ptype_6rbtree_RBTree = &__pyx_type_6rbtree_RBTree; __pyx_vtabptr_6rbtree_RBTreeIterator = &__pyx_vtable_6rbtree_RBTreeIterator; *(void(**)(void))&__pyx_vtable_6rbtree_RBTreeIterator._position = (void(*)(void))__pyx_f_6rbtree_14RBTreeIterator__position; *(void(**)(void))&__pyx_vtable_6rbtree_RBTreeIterator.walk = (void(*)(void))__pyx_f_6rbtree_14RBTreeIterator_walk; *(void(**)(void))&__pyx_vtable_6rbtree_RBTreeIterator.step = (void(*)(void))__pyx_f_6rbtree_14RBTreeIterator_step; __pyx_type_6rbtree_RBTreeIterator.tp_free = _PyObject_GC_Del; if (PyType_Ready(&__pyx_type_6rbtree_RBTreeIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;} if (__Pyx_SetVtable(__pyx_type_6rbtree_RBTreeIterator.tp_dict, __pyx_vtabptr_6rbtree_RBTreeIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "RBTreeIterator", (PyObject *)&__pyx_type_6rbtree_RBTreeIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;} __pyx_ptype_6rbtree_RBTreeIterator = &__pyx_type_6rbtree_RBTreeIterator; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":8 */ if (PyObject_SetAttr(__pyx_m, __pyx_n___author__, __pyx_k1p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;} /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":9 */ if (PyObject_SetAttr(__pyx_m, __pyx_n___copyright__, __pyx_k2p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; goto __pyx_L1;} /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":10 */ if (PyObject_SetAttr(__pyx_m, __pyx_n___license__, __pyx_k3p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; goto __pyx_L1;} /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":196 */ Py_INCREF(Py_None); __pyx_k4 = Py_None; Py_INCREF(Py_None); __pyx_k5 = Py_None; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":292 */ Py_INCREF(Py_None); __pyx_k6 = Py_None; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":338 */ __pyx_k7 = 0; /* "/mnt/gmirror/ports/devel/py-rbtree/work/rbtree-0.8.0/src/rbtree.pyx":387 */ return; __pyx_L1:; __Pyx_AddTraceback("rbtree"); } static char *__pyx_filenames[] = { "rbtree.pyx", }; /* Runtime support code */ static void __pyx_init_filenames(void) { __pyx_f = __pyx_filenames; } static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name) { if (!type) { PyErr_Format(PyExc_SystemError, "Missing type object"); return 0; } if ((none_allowed && obj == Py_None) || PyObject_TypeCheck(obj, type)) return 1; PyErr_Format(PyExc_TypeError, "Argument '%s' has incorrect type (expected %s, got %s)", name, type->tp_name, obj->ob_type->tp_name); return 0; } static int __Pyx_GetStarArgs( PyObject **args, PyObject **kwds, char *kwd_list[], Py_ssize_t nargs, PyObject **args2, PyObject **kwds2, char rqd_kwds[]) { PyObject *x = 0, *args1 = 0, *kwds1 = 0; int i; char **p; if (args2) *args2 = 0; if (kwds2) *kwds2 = 0; if (args2) { args1 = PyTuple_GetSlice(*args, 0, nargs); if (!args1) goto bad; *args2 = PyTuple_GetSlice(*args, nargs, PyTuple_GET_SIZE(*args)); if (!*args2) goto bad; } else if (PyTuple_GET_SIZE(*args) > nargs) { int m = nargs; int n = PyTuple_GET_SIZE(*args); PyErr_Format(PyExc_TypeError, "function takes at most %d positional arguments (%d given)", m, n); goto bad; } else { args1 = *args; Py_INCREF(args1); } if (rqd_kwds && !*kwds) for (i = 0, p = kwd_list; *p; i++, p++) if (rqd_kwds[i]) goto missing_kwarg; if (kwds2) { if (*kwds) { kwds1 = PyDict_New(); if (!kwds1) goto bad; *kwds2 = PyDict_Copy(*kwds); if (!*kwds2) goto bad; for (i = 0, p = kwd_list; *p; i++, p++) { x = PyDict_GetItemString(*kwds, *p); if (x) { if (PyDict_SetItemString(kwds1, *p, x) < 0) goto bad; if (PyDict_DelItemString(*kwds2, *p) < 0) goto bad; } else if (rqd_kwds && rqd_kwds[i]) goto missing_kwarg; } } else { *kwds2 = PyDict_New(); if (!*kwds2) goto bad; } } else { kwds1 = *kwds; Py_XINCREF(kwds1); if (rqd_kwds && *kwds) for (i = 0, p = kwd_list; *p; i++, p++) if (rqd_kwds[i] && !PyDict_GetItemString(*kwds, *p)) goto missing_kwarg; } *args = args1; *kwds = kwds1; return 0; missing_kwarg: PyErr_Format(PyExc_TypeError, "required keyword argument '%s' is missing", *p); bad: Py_XDECREF(args1); Py_XDECREF(kwds1); if (args2) { Py_XDECREF(*args2); } if (kwds2) { Py_XDECREF(*kwds2); } return -1; } 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_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 { PyErr_SetString(PyExc_TypeError, "raise: exception must be an old-style class or instance"); goto raise_error; } #else type = (PyObject*) type->ob_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 } PyErr_Restore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { PyThreadState *tstate = PyThreadState_Get(); PyErr_Fetch(type, value, tb); PyErr_NormalizeException(type, value, tb); if (PyErr_Occurred()) goto bad; Py_INCREF(*type); Py_INCREF(*value); Py_INCREF(*tb); Py_XDECREF(tstate->exc_type); Py_XDECREF(tstate->exc_value); Py_XDECREF(tstate->exc_traceback); tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; return 0; bad: Py_XDECREF(*type); Py_XDECREF(*value); Py_XDECREF(*tb); return -1; } static void __Pyx_UnpackError(void) { PyErr_SetString(PyExc_ValueError, "unpack sequence of wrong size"); } static PyObject *__Pyx_UnpackItem(PyObject *iter) { PyObject *item; if (!(item = PyIter_Next(iter))) { if (!PyErr_Occurred()) __Pyx_UnpackError(); } return item; } static int __Pyx_EndUnpack(PyObject *iter) { PyObject *item; if ((item = PyIter_Next(iter))) { Py_DECREF(item); __Pyx_UnpackError(); return -1; } else if (!PyErr_Occurred()) return 0; else return -1; } static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) { while (t->p) { *t->p = PyString_InternFromString(t->s); if (!*t->p) return -1; ++t; } return 0; } static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); if (!*t->p) return -1; ++t; } return 0; } static int __Pyx_SetVtable(PyObject *dict, void *vtable) { PyObject *pycobj = 0; int result; pycobj = PyCObject_FromVoidPtr(vtable, 0); if (!pycobj) goto bad; if (PyDict_SetItemString(dict, "__pyx_vtable__", pycobj) < 0) goto bad; result = 0; goto done; bad: result = -1; done: Py_XDECREF(pycobj); return result; } #include "compile.h" #include "frameobject.h" #include "traceback.h" static void __Pyx_AddTraceback(char *funcname) { PyObject *py_srcfile = 0; PyObject *py_funcname = 0; PyObject *py_globals = 0; PyObject *empty_tuple = 0; PyObject *empty_string = 0; PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_srcfile = PyString_FromString(__pyx_filename); if (!py_srcfile) goto bad; py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; py_globals = PyModule_GetDict(__pyx_m); if (!py_globals) goto bad; empty_tuple = PyTuple_New(0); if (!empty_tuple) goto bad; empty_string = PyString_FromString(""); if (!empty_string) goto bad; py_code = PyCode_New( 0, /*int argcount,*/ 0, /*int nlocals,*/ 0, /*int stacksize,*/ 0, /*int flags,*/ empty_string, /*PyObject *code,*/ empty_tuple, /*PyObject *consts,*/ empty_tuple, /*PyObject *names,*/ empty_tuple, /*PyObject *varnames,*/ empty_tuple, /*PyObject *freevars,*/ empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ __pyx_lineno, /*int firstlineno,*/ empty_string /*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(empty_tuple); Py_XDECREF(empty_string); Py_XDECREF(py_code); Py_XDECREF(py_frame); }