File: pyutils.h

package info (click to toggle)
swftools 0.9.2%2Bds1-3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 9,488 kB
  • sloc: ansic: 122,576; sh: 8,494; cpp: 8,020; yacc: 2,260; lisp: 904; makefile: 581; python: 304
file content (22 lines) | stat: -rw-r--r-- 714 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef __pyutil_h__
#define __pyutil_h__
#include <Python.h>

#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