diff options
| author | Jiri Moskovcak <jmoskovc@redhat.com> | 2010-12-14 13:56:07 +0100 |
|---|---|---|
| committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2010-12-14 13:56:07 +0100 |
| commit | 8598b22e101201de4d06ea48f2b500f81f2b30d5 (patch) | |
| tree | 16a7ff27a1f52cf91f6ea0a1f1d36e87d4e0d021 /src/report-python/reportmodule.c | |
| parent | 529935edd6733438531232b28174541ca6f92692 (diff) | |
| download | abrt-8598b22e101201de4d06ea48f2b500f81f2b30d5.tar.gz abrt-8598b22e101201de4d06ea48f2b500f81f2b30d5.tar.xz abrt-8598b22e101201de4d06ea48f2b500f81f2b30d5.zip | |
a stub for report-python
Diffstat (limited to 'src/report-python/reportmodule.c')
| -rw-r--r-- | src/report-python/reportmodule.c | 34 |
1 files changed, 34 insertions, 0 deletions
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 <Python.h> +#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); +} |
