X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fpython%2Fpyutils.h;h=d5d196df4d350bdd228b14e8c804a5e8ff059fb5;hb=bdad407fb79c2f7be9f3603694ebdeadc645b52d;hp=3c749bd5ef7c7550ff0607b3be645b8c52cc155b;hpb=49062bcde61a1622b6e5605097beff11916cd07e;p=swftools.git diff --git a/lib/python/pyutils.h b/lib/python/pyutils.h index 3c749bd..d5d196d 100644 --- a/lib/python/pyutils.h +++ b/lib/python/pyutils.h @@ -4,8 +4,19 @@ #define PY_NONE Py_BuildValue("s", 0) +extern int verbose; + +void setVerbosity(int verbose); + char* setError(char*format, ...); void mylog(char*format, ...); PyObject* FindMethodMore(PyObject*ret, PyMethodDef f[], PyObject*self, char* a); void dummy_dealloc(PyObject* self); +PyMethodDef* addMethods(PyMethodDef*obj1, PyMethodDef*obj2); + +#define PY_CHECK_TYPE(o,c) ((o)->ob_type == (c)) +#define PY_ASSERT_TYPE(o,c) {if((o)->ob_type != (c)) {printf("Invalid type: %08x(%d)", (int)(o), (o)->ob_refcnt);exit(1);}} + +#define PY_ERROR(s,args...) (PyErr_SetString(PyExc_Exception, setError(s, ## args)),NULL) +#define PY_TYPE(o) ((o)->ob_type->tp_name) #endif