/* Generated by Pyrex 0.9.6.3 on Sat Dec 15 22:02:43 2007 */

#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 <math.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 PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/

static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/

static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/

static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size);  /*proto*/

static PyObject *__Pyx_ImportModule(char *name); /*proto*/

static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/

static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/

static void __Pyx_AddTraceback(char *funcname); /*proto*/

/* Declarations from rabbyt._anims */

struct __pyx_obj_6rabbyt_6_anims_Anim {
  PyObject_HEAD
  struct __pyx_vtabstruct_6rabbyt_6_anims_Anim *__pyx_vtab;
};

struct __pyx_obj_6rabbyt_6_anims_AnimConst {
  struct __pyx_obj_6rabbyt_6_anims_Anim __pyx_base;
  float v;
};


struct __pyx_vtabstruct_6rabbyt_6_anims_Anim {
  float (*g)(struct __pyx_obj_6rabbyt_6_anims_Anim *);
};
static struct __pyx_vtabstruct_6rabbyt_6_anims_Anim *__pyx_vtabptr_6rabbyt_6_anims_Anim;


struct __pyx_vtabstruct_6rabbyt_6_anims_AnimConst {
  struct __pyx_vtabstruct_6rabbyt_6_anims_Anim __pyx_base;
};
static struct __pyx_vtabstruct_6rabbyt_6_anims_AnimConst *__pyx_vtabptr_6rabbyt_6_anims_AnimConst;

static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_Anim = 0;
static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_AnimConst = 0;

/* Declarations from rabbyt.chipmunkglue */

typedef struct {
  float x;
  float y;
} __pyx_t_6rabbyt_12chipmunkglue_cpVect;

typedef struct {
  float m;
  float m_inv;
  float i;
  float i_inv;
  __pyx_t_6rabbyt_12chipmunkglue_cpVect p;
  __pyx_t_6rabbyt_12chipmunkglue_cpVect v;
  __pyx_t_6rabbyt_12chipmunkglue_cpVect f;
  __pyx_t_6rabbyt_12chipmunkglue_cpVect v_bias;
  float a;
  float w;
  float t;
  float w_bias;
  __pyx_t_6rabbyt_12chipmunkglue_cpVect rot;
} __pyx_t_6rabbyt_12chipmunkglue_cpBody;

struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyX {
  struct __pyx_obj_6rabbyt_6_anims_Anim __pyx_base;
  __pyx_t_6rabbyt_12chipmunkglue_cpBody *body;
};

struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyY {
  struct __pyx_obj_6rabbyt_6_anims_Anim __pyx_base;
  __pyx_t_6rabbyt_12chipmunkglue_cpBody *body;
};

struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyA {
  struct __pyx_obj_6rabbyt_6_anims_Anim __pyx_base;
  __pyx_t_6rabbyt_12chipmunkglue_cpBody *body;
};


struct __pyx_vtabstruct_6rabbyt_12chipmunkglue__ChipmunkBodyX {
  struct __pyx_vtabstruct_6rabbyt_6_anims_Anim __pyx_base;
};
static struct __pyx_vtabstruct_6rabbyt_12chipmunkglue__ChipmunkBodyX *__pyx_vtabptr_6rabbyt_12chipmunkglue__ChipmunkBodyX;


struct __pyx_vtabstruct_6rabbyt_12chipmunkglue__ChipmunkBodyY {
  struct __pyx_vtabstruct_6rabbyt_6_anims_Anim __pyx_base;
};
static struct __pyx_vtabstruct_6rabbyt_12chipmunkglue__ChipmunkBodyY *__pyx_vtabptr_6rabbyt_12chipmunkglue__ChipmunkBodyY;


struct __pyx_vtabstruct_6rabbyt_12chipmunkglue__ChipmunkBodyA {
  struct __pyx_vtabstruct_6rabbyt_6_anims_Anim __pyx_base;
};
static struct __pyx_vtabstruct_6rabbyt_12chipmunkglue__ChipmunkBodyA *__pyx_vtabptr_6rabbyt_12chipmunkglue__ChipmunkBodyA;

static PyTypeObject *__pyx_ptype_6rabbyt_12chipmunkglue__ChipmunkBodyX = 0;
static PyTypeObject *__pyx_ptype_6rabbyt_12chipmunkglue__ChipmunkBodyY = 0;
static PyTypeObject *__pyx_ptype_6rabbyt_12chipmunkglue__ChipmunkBodyA = 0;
static float __pyx_v_6rabbyt_12chipmunkglue_pi;
static float __pyx_v_6rabbyt_12chipmunkglue_pi_over_180;
static float __pyx_v_6rabbyt_12chipmunkglue_oneeighty_over_pi;


/* Implementation of rabbyt.chipmunkglue */

static char __pyx_k1[] = "rabbyt.anims";

static PyObject *__pyx_n_to_Anim;
static PyObject *__pyx_n_chipmunk_body_anims;
static PyObject *__pyx_n___docs_all__;

static PyObject *__pyx_k1p;

static float __pyx_f_6rabbyt_12chipmunkglue_14_ChipmunkBodyX_g(struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyX *__pyx_v_self) {
  float __pyx_r;
  Py_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = (__pyx_v_self->body[0]).p.x;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static float __pyx_f_6rabbyt_12chipmunkglue_14_ChipmunkBodyY_g(struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyY *__pyx_v_self) {
  float __pyx_r;
  Py_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = (__pyx_v_self->body[0]).p.y;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static float __pyx_f_6rabbyt_12chipmunkglue_14_ChipmunkBodyA_g(struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyA *__pyx_v_self) {
  float __pyx_r;
  Py_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((__pyx_v_self->body[0]).a * __pyx_v_6rabbyt_12chipmunkglue_oneeighty_over_pi);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_6rabbyt_12chipmunkglue_chipmunk_body_anims(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6rabbyt_12chipmunkglue_chipmunk_body_anims[] = "\n    ``chipmunk_body_anims(body_addr)``\n\n    Provides fast integration with the chipmunk physics library.  Returns\n    three anims for x, y, and rotation.\n\n    ``body_addr`` Should be the address of a cpBody structure.  For example,\n    if you are using the pymonk wrapper, you can do this:\n\n        .. sourcecode:: python\n\n            anims = chipmunk_body_anims(ctypes.addressof(body.contents))\n            sprite.x, sprite.y, sprite.rot = anims\n\n    Note that the anims store an internal pointer to the cpBody structure,\n    but not a python reference.  This means that if you read the anims value\n    after calling cpBodyDestroy on the body, you will get a segfault.\n    ";
static PyObject *__pyx_f_6rabbyt_12chipmunkglue_chipmunk_body_anims(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  long __pyx_v_body_addr;
  struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyX *__pyx_v_x;
  struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyY *__pyx_v_y;
  struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyA *__pyx_v_a;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {"body_addr",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "l", __pyx_argnames, &__pyx_v_body_addr)) return 0;
  __pyx_v_x = ((struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyX *)Py_None); Py_INCREF(Py_None);
  __pyx_v_y = ((struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyY *)Py_None); Py_INCREF(Py_None);
  __pyx_v_a = ((struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyA *)Py_None); Py_INCREF(Py_None);

  /* "/home/mmarshall/projects/rabbyt_7.6/rabbyt/rabbyt.chipmunkglue.pyx":61 */
  __pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_6rabbyt_12chipmunkglue__ChipmunkBodyX), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6rabbyt_12chipmunkglue__ChipmunkBodyX)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_x));
  __pyx_v_x = ((struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyX *)__pyx_1);
  __pyx_1 = 0;

  /* "/home/mmarshall/projects/rabbyt_7.6/rabbyt/rabbyt.chipmunkglue.pyx":62 */
  __pyx_v_x->body = ((__pyx_t_6rabbyt_12chipmunkglue_cpBody *)__pyx_v_body_addr);

  /* "/home/mmarshall/projects/rabbyt_7.6/rabbyt/rabbyt.chipmunkglue.pyx":64 */
  __pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_6rabbyt_12chipmunkglue__ChipmunkBodyY), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6rabbyt_12chipmunkglue__ChipmunkBodyY)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_y));
  __pyx_v_y = ((struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyY *)__pyx_1);
  __pyx_1 = 0;

  /* "/home/mmarshall/projects/rabbyt_7.6/rabbyt/rabbyt.chipmunkglue.pyx":65 */
  __pyx_v_y->body = ((__pyx_t_6rabbyt_12chipmunkglue_cpBody *)__pyx_v_body_addr);

  /* "/home/mmarshall/projects/rabbyt_7.6/rabbyt/rabbyt.chipmunkglue.pyx":67 */
  __pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_6rabbyt_12chipmunkglue__ChipmunkBodyA), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6rabbyt_12chipmunkglue__ChipmunkBodyA)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_a));
  __pyx_v_a = ((struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyA *)__pyx_1);
  __pyx_1 = 0;

  /* "/home/mmarshall/projects/rabbyt_7.6/rabbyt/rabbyt.chipmunkglue.pyx":68 */
  __pyx_v_a->body = ((__pyx_t_6rabbyt_12chipmunkglue_cpBody *)__pyx_v_body_addr);

  /* "/home/mmarshall/projects/rabbyt_7.6/rabbyt/rabbyt.chipmunkglue.pyx":70 */
  __pyx_1 = PyTuple_New(3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; goto __pyx_L1;}
  Py_INCREF(((PyObject *)__pyx_v_x));
  PyTuple_SET_ITEM(__pyx_1, 0, ((PyObject *)__pyx_v_x));
  Py_INCREF(((PyObject *)__pyx_v_y));
  PyTuple_SET_ITEM(__pyx_1, 1, ((PyObject *)__pyx_v_y));
  Py_INCREF(((PyObject *)__pyx_v_a));
  PyTuple_SET_ITEM(__pyx_1, 2, ((PyObject *)__pyx_v_a));
  __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("rabbyt.chipmunkglue.chipmunk_body_anims");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_x);
  Py_DECREF((PyObject *)__pyx_v_y);
  Py_DECREF((PyObject *)__pyx_v_a);
  return __pyx_r;
}

static __Pyx_InternTabEntry __pyx_intern_tab[] = {
  {&__pyx_n___docs_all__, "__docs_all__"},
  {&__pyx_n_chipmunk_body_anims, "chipmunk_body_anims"},
  {&__pyx_n_to_Anim, "to_Anim"},
  {0, 0}
};

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_k1p, __pyx_k1, sizeof(__pyx_k1)},
  {0, 0, 0}
};
static struct __pyx_vtabstruct_6rabbyt_12chipmunkglue__ChipmunkBodyX __pyx_vtable_6rabbyt_12chipmunkglue__ChipmunkBodyX;

static PyObject *__pyx_tp_new_6rabbyt_12chipmunkglue__ChipmunkBodyX(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyX *p;
  PyObject *o = __pyx_ptype_6rabbyt_6_anims_Anim->tp_new(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyX *)o);
  *(struct __pyx_vtabstruct_6rabbyt_12chipmunkglue__ChipmunkBodyX **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_6rabbyt_12chipmunkglue__ChipmunkBodyX;
  return o;
}

static void __pyx_tp_dealloc_6rabbyt_12chipmunkglue__ChipmunkBodyX(PyObject *o) {
  __pyx_ptype_6rabbyt_6_anims_Anim->tp_dealloc(o);
}

static int __pyx_tp_traverse_6rabbyt_12chipmunkglue__ChipmunkBodyX(PyObject *o, visitproc v, void *a) {
  int e;
  e = __pyx_ptype_6rabbyt_6_anims_Anim->tp_traverse(o, v, a); if (e) return e;
  return 0;
}

static int __pyx_tp_clear_6rabbyt_12chipmunkglue__ChipmunkBodyX(PyObject *o) {
  __pyx_ptype_6rabbyt_6_anims_Anim->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_6rabbyt_12chipmunkglue__ChipmunkBodyX[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__ChipmunkBodyX = {
  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__ChipmunkBodyX = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__ChipmunkBodyX = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__ChipmunkBodyX = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_6rabbyt_12chipmunkglue__ChipmunkBodyX = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "rabbyt.chipmunkglue._ChipmunkBodyX", /*tp_name*/
  sizeof(struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyX), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6rabbyt_12chipmunkglue__ChipmunkBodyX, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number__ChipmunkBodyX, /*tp_as_number*/
  &__pyx_tp_as_sequence__ChipmunkBodyX, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__ChipmunkBodyX, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__ChipmunkBodyX, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6rabbyt_12chipmunkglue__ChipmunkBodyX, /*tp_traverse*/
  __pyx_tp_clear_6rabbyt_12chipmunkglue__ChipmunkBodyX, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6rabbyt_12chipmunkglue__ChipmunkBodyX, /*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_6rabbyt_12chipmunkglue__ChipmunkBodyX, /*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_6rabbyt_12chipmunkglue__ChipmunkBodyY __pyx_vtable_6rabbyt_12chipmunkglue__ChipmunkBodyY;

static PyObject *__pyx_tp_new_6rabbyt_12chipmunkglue__ChipmunkBodyY(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyY *p;
  PyObject *o = __pyx_ptype_6rabbyt_6_anims_Anim->tp_new(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyY *)o);
  *(struct __pyx_vtabstruct_6rabbyt_12chipmunkglue__ChipmunkBodyY **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_6rabbyt_12chipmunkglue__ChipmunkBodyY;
  return o;
}

static void __pyx_tp_dealloc_6rabbyt_12chipmunkglue__ChipmunkBodyY(PyObject *o) {
  __pyx_ptype_6rabbyt_6_anims_Anim->tp_dealloc(o);
}

static int __pyx_tp_traverse_6rabbyt_12chipmunkglue__ChipmunkBodyY(PyObject *o, visitproc v, void *a) {
  int e;
  e = __pyx_ptype_6rabbyt_6_anims_Anim->tp_traverse(o, v, a); if (e) return e;
  return 0;
}

static int __pyx_tp_clear_6rabbyt_12chipmunkglue__ChipmunkBodyY(PyObject *o) {
  __pyx_ptype_6rabbyt_6_anims_Anim->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_6rabbyt_12chipmunkglue__ChipmunkBodyY[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__ChipmunkBodyY = {
  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__ChipmunkBodyY = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__ChipmunkBodyY = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__ChipmunkBodyY = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_6rabbyt_12chipmunkglue__ChipmunkBodyY = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "rabbyt.chipmunkglue._ChipmunkBodyY", /*tp_name*/
  sizeof(struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyY), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6rabbyt_12chipmunkglue__ChipmunkBodyY, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number__ChipmunkBodyY, /*tp_as_number*/
  &__pyx_tp_as_sequence__ChipmunkBodyY, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__ChipmunkBodyY, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__ChipmunkBodyY, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6rabbyt_12chipmunkglue__ChipmunkBodyY, /*tp_traverse*/
  __pyx_tp_clear_6rabbyt_12chipmunkglue__ChipmunkBodyY, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6rabbyt_12chipmunkglue__ChipmunkBodyY, /*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_6rabbyt_12chipmunkglue__ChipmunkBodyY, /*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_6rabbyt_12chipmunkglue__ChipmunkBodyA __pyx_vtable_6rabbyt_12chipmunkglue__ChipmunkBodyA;

static PyObject *__pyx_tp_new_6rabbyt_12chipmunkglue__ChipmunkBodyA(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyA *p;
  PyObject *o = __pyx_ptype_6rabbyt_6_anims_Anim->tp_new(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyA *)o);
  *(struct __pyx_vtabstruct_6rabbyt_12chipmunkglue__ChipmunkBodyA **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_6rabbyt_12chipmunkglue__ChipmunkBodyA;
  return o;
}

static void __pyx_tp_dealloc_6rabbyt_12chipmunkglue__ChipmunkBodyA(PyObject *o) {
  __pyx_ptype_6rabbyt_6_anims_Anim->tp_dealloc(o);
}

static int __pyx_tp_traverse_6rabbyt_12chipmunkglue__ChipmunkBodyA(PyObject *o, visitproc v, void *a) {
  int e;
  e = __pyx_ptype_6rabbyt_6_anims_Anim->tp_traverse(o, v, a); if (e) return e;
  return 0;
}

static int __pyx_tp_clear_6rabbyt_12chipmunkglue__ChipmunkBodyA(PyObject *o) {
  __pyx_ptype_6rabbyt_6_anims_Anim->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_6rabbyt_12chipmunkglue__ChipmunkBodyA[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__ChipmunkBodyA = {
  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__ChipmunkBodyA = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__ChipmunkBodyA = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__ChipmunkBodyA = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_6rabbyt_12chipmunkglue__ChipmunkBodyA = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "rabbyt.chipmunkglue._ChipmunkBodyA", /*tp_name*/
  sizeof(struct __pyx_obj_6rabbyt_12chipmunkglue__ChipmunkBodyA), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6rabbyt_12chipmunkglue__ChipmunkBodyA, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number__ChipmunkBodyA, /*tp_as_number*/
  &__pyx_tp_as_sequence__ChipmunkBodyA, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__ChipmunkBodyA, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__ChipmunkBodyA, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6rabbyt_12chipmunkglue__ChipmunkBodyA, /*tp_traverse*/
  __pyx_tp_clear_6rabbyt_12chipmunkglue__ChipmunkBodyA, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6rabbyt_12chipmunkglue__ChipmunkBodyA, /*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_6rabbyt_12chipmunkglue__ChipmunkBodyA, /*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[] = {
  {"chipmunk_body_anims", (PyCFunction)__pyx_f_6rabbyt_12chipmunkglue_chipmunk_body_anims, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6rabbyt_12chipmunkglue_chipmunk_body_anims},
  {0, 0, 0, 0}
};

static void __pyx_init_filenames(void); /*proto*/

PyMODINIT_FUNC initchipmunkglue(void); /*proto*/
PyMODINIT_FUNC initchipmunkglue(void) {
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  __pyx_init_filenames();
  __pyx_m = Py_InitModule4("chipmunkglue", __pyx_methods, 0, 0, PYTHON_API_VERSION);
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; goto __pyx_L1;};
  __pyx_b = PyImport_AddModule("__builtin__");
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; goto __pyx_L1;};
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; goto __pyx_L1;};
  if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; goto __pyx_L1;};
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; goto __pyx_L1;};
  __pyx_ptype_6rabbyt_6_anims_Anim = __Pyx_ImportType("rabbyt._anims", "Anim", sizeof(struct __pyx_obj_6rabbyt_6_anims_Anim)); if (!__pyx_ptype_6rabbyt_6_anims_Anim) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_6rabbyt_6_anims_Anim->tp_dict, &__pyx_vtabptr_6rabbyt_6_anims_Anim) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; goto __pyx_L1;}
  __pyx_vtabptr_6rabbyt_12chipmunkglue__ChipmunkBodyX = &__pyx_vtable_6rabbyt_12chipmunkglue__ChipmunkBodyX;
  __pyx_vtable_6rabbyt_12chipmunkglue__ChipmunkBodyX.__pyx_base = *__pyx_vtabptr_6rabbyt_6_anims_Anim;
  *(void(**)(void))&__pyx_vtable_6rabbyt_12chipmunkglue__ChipmunkBodyX.__pyx_base.g = (void(*)(void))__pyx_f_6rabbyt_12chipmunkglue_14_ChipmunkBodyX_g;
  __pyx_type_6rabbyt_12chipmunkglue__ChipmunkBodyX.tp_base = __pyx_ptype_6rabbyt_6_anims_Anim;
  if (PyType_Ready(&__pyx_type_6rabbyt_12chipmunkglue__ChipmunkBodyX) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_6rabbyt_12chipmunkglue__ChipmunkBodyX.tp_dict, __pyx_vtabptr_6rabbyt_12chipmunkglue__ChipmunkBodyX) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "_ChipmunkBodyX", (PyObject *)&__pyx_type_6rabbyt_12chipmunkglue__ChipmunkBodyX) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
  __pyx_ptype_6rabbyt_12chipmunkglue__ChipmunkBodyX = &__pyx_type_6rabbyt_12chipmunkglue__ChipmunkBodyX;
  __pyx_vtabptr_6rabbyt_12chipmunkglue__ChipmunkBodyY = &__pyx_vtable_6rabbyt_12chipmunkglue__ChipmunkBodyY;
  __pyx_vtable_6rabbyt_12chipmunkglue__ChipmunkBodyY.__pyx_base = *__pyx_vtabptr_6rabbyt_6_anims_Anim;
  *(void(**)(void))&__pyx_vtable_6rabbyt_12chipmunkglue__ChipmunkBodyY.__pyx_base.g = (void(*)(void))__pyx_f_6rabbyt_12chipmunkglue_14_ChipmunkBodyY_g;
  __pyx_type_6rabbyt_12chipmunkglue__ChipmunkBodyY.tp_base = __pyx_ptype_6rabbyt_6_anims_Anim;
  if (PyType_Ready(&__pyx_type_6rabbyt_12chipmunkglue__ChipmunkBodyY) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_6rabbyt_12chipmunkglue__ChipmunkBodyY.tp_dict, __pyx_vtabptr_6rabbyt_12chipmunkglue__ChipmunkBodyY) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "_ChipmunkBodyY", (PyObject *)&__pyx_type_6rabbyt_12chipmunkglue__ChipmunkBodyY) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; goto __pyx_L1;}
  __pyx_ptype_6rabbyt_12chipmunkglue__ChipmunkBodyY = &__pyx_type_6rabbyt_12chipmunkglue__ChipmunkBodyY;
  __pyx_vtabptr_6rabbyt_12chipmunkglue__ChipmunkBodyA = &__pyx_vtable_6rabbyt_12chipmunkglue__ChipmunkBodyA;
  __pyx_vtable_6rabbyt_12chipmunkglue__ChipmunkBodyA.__pyx_base = *__pyx_vtabptr_6rabbyt_6_anims_Anim;
  *(void(**)(void))&__pyx_vtable_6rabbyt_12chipmunkglue__ChipmunkBodyA.__pyx_base.g = (void(*)(void))__pyx_f_6rabbyt_12chipmunkglue_14_ChipmunkBodyA_g;
  __pyx_type_6rabbyt_12chipmunkglue__ChipmunkBodyA.tp_base = __pyx_ptype_6rabbyt_6_anims_Anim;
  if (PyType_Ready(&__pyx_type_6rabbyt_12chipmunkglue__ChipmunkBodyA) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_6rabbyt_12chipmunkglue__ChipmunkBodyA.tp_dict, __pyx_vtabptr_6rabbyt_12chipmunkglue__ChipmunkBodyA) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "_ChipmunkBodyA", (PyObject *)&__pyx_type_6rabbyt_12chipmunkglue__ChipmunkBodyA) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
  __pyx_ptype_6rabbyt_12chipmunkglue__ChipmunkBodyA = &__pyx_type_6rabbyt_12chipmunkglue__ChipmunkBodyA;
  __pyx_ptype_6rabbyt_6_anims_AnimConst = __Pyx_ImportType("rabbyt._anims", "AnimConst", sizeof(struct __pyx_obj_6rabbyt_6_anims_AnimConst)); if (!__pyx_ptype_6rabbyt_6_anims_AnimConst) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_6rabbyt_6_anims_AnimConst->tp_dict, &__pyx_vtabptr_6rabbyt_6_anims_AnimConst) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; goto __pyx_L1;}

  /* "/home/mmarshall/projects/rabbyt_7.6/rabbyt/rabbyt.chipmunkglue.pyx":4 */
  __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;}
  Py_INCREF(__pyx_n_to_Anim);
  PyList_SET_ITEM(__pyx_1, 0, __pyx_n_to_Anim);
  __pyx_2 = __Pyx_Import(__pyx_k1p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_to_Anim); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_to_Anim, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/mmarshall/projects/rabbyt_7.6/rabbyt/rabbyt.chipmunkglue.pyx":7 */
  __pyx_v_6rabbyt_12chipmunkglue_pi = 3.1415926535897931;

  /* "/home/mmarshall/projects/rabbyt_7.6/rabbyt/rabbyt.chipmunkglue.pyx":8 */
  __pyx_v_6rabbyt_12chipmunkglue_pi_over_180 = (__pyx_v_6rabbyt_12chipmunkglue_pi / 180.0);

  /* "/home/mmarshall/projects/rabbyt_7.6/rabbyt/rabbyt.chipmunkglue.pyx":9 */
  __pyx_v_6rabbyt_12chipmunkglue_oneeighty_over_pi = (180.0 / __pyx_v_6rabbyt_12chipmunkglue_pi);

  /* "/home/mmarshall/projects/rabbyt_7.6/rabbyt/rabbyt.chipmunkglue.pyx":72 */
  __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;}
  Py_INCREF(__pyx_n_chipmunk_body_anims);
  PyList_SET_ITEM(__pyx_2, 0, __pyx_n_chipmunk_body_anims);
  if (PyObject_SetAttr(__pyx_m, __pyx_n___docs_all__, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  return;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("rabbyt.chipmunkglue");
}

static char *__pyx_filenames[] = {
  "rabbyt.chipmunkglue.pyx",
  "rabbyt._anims.pxd",
};

/* Runtime support code */

static void __pyx_init_filenames(void) {
  __pyx_f = __pyx_filenames;
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
    PyObject *__import__ = 0;
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    __import__ = PyObject_GetAttrString(__pyx_b, "__import__");
    if (!__import__)
        goto bad;
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    module = PyObject_CallFunction(__import__, "OOOO",
        name, global_dict, empty_dict, list);
bad:
    Py_XDECREF(empty_list);
    Py_XDECREF(__import__);
    Py_XDECREF(empty_dict);
    return module;
}

static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (obj == Py_None || PyObject_TypeCheck(obj, type))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s",
        obj->ob_type->tp_name, type->tp_name);
    return 0;
}

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;
}

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, 
    long size) 
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    result = PyObject_GetAttrString(py_module, class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError, 
            "%s.%s is not a type object",
            module_name, class_name);
        goto bad;
    }
    if (((PyTypeObject *)result)->tp_basicsize != size) {
        PyErr_Format(PyExc_ValueError, 
            "%s.%s does not appear to be the correct type object",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return 0;
}
#endif

static PyObject *__Pyx_ImportModule(char *name) {
    PyObject *py_name = 0;
    
    py_name = PyString_FromString(name);
    if (!py_name)
        goto bad;
    return PyImport_Import(py_name);
bad:
    Py_XDECREF(py_name);
    return 0;
}

static int __Pyx_GetVtable(PyObject *dict, void *vtabptr) {
    int result;
    PyObject *pycobj;
    
    pycobj = PyMapping_GetItemString(dict, "__pyx_vtable__");
    if (!pycobj)
        goto bad;
    *(void **)vtabptr = PyCObject_AsVoidPtr(pycobj);
    if (!*(void **)vtabptr)
        goto bad;
    result = 0;
    goto done;

bad:
    result = -1;
done:
    Py_XDECREF(pycobj);
    return result;
}

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);
}
