From 8598b22e101201de4d06ea48f2b500f81f2b30d5 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Tue, 14 Dec 2010 13:56:07 +0100 Subject: a stub for report-python --- src/report-python/reportmodule.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/report-python/reportmodule.c (limited to 'src/report-python/reportmodule.c') diff --git a/src/report-python/reportmodule.c b/src/report-python/reportmodule.c new file mode 100644 index 00000000..b73f88f5 --- /dev/null +++ b/src/report-python/reportmodule.c @@ -0,0 +1,34 @@ +#include +#include "py_crash_dump.h" + +PyObject *ReportError; + +#ifndef PyMODINIT_FUNC /* declarations for DLL import/export */ +#define PyMODINIT_FUNC void +#endif +PyMODINIT_FUNC +init_pyreport(void) +{ + PyObject* m; + + if (PyType_Ready(&p_crash_data_type) < 0) + { + printf("PyType_Ready(&p_crash_data_type) < 0"); + return; + } + + m = Py_InitModule3("_pyreport", module_methods, "Python wrapper around crash_data_t"); + if (m == NULL) + { + printf("m == NULL"); + return; + } + + /* init the exception object */ + ReportError = PyErr_NewException("_pyreport.error", NULL, NULL); + Py_INCREF(ReportError); + PyModule_AddObject(m, "error", ReportError); + + Py_INCREF(&p_crash_data_type); + PyModule_AddObject(m, "crash_data", (PyObject *)&p_crash_data_type); +} -- cgit