File: python_module_init.c

package info (click to toggle)
distorm3 3.5.2b-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,964 kB
  • sloc: ansic: 11,882; python: 5,245; cs: 1,751; java: 1,484; cpp: 147; makefile: 116
file content (28 lines) | stat: -rw-r--r-- 450 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#define PY_SSIZE_T_CLEAN
#include <Python.h>

#if PY_MAJOR_VERSION == 2
PyMODINIT_FUNC init_distorm3(void)
{
    (void)Py_InitModule("_distorm3", NULL);
}
#else
static struct PyModuleDef _distorm3_module = {
    PyModuleDef_HEAD_INIT,
    "_distorm3",
    NULL,
    -1,
    NULL,
};

PyMODINIT_FUNC PyInit__distorm3(void)
{
    PyObject *m;

    m = PyModule_Create(&_distorm3_module);
    if (m == NULL)
        return NULL;

    return m;
}
#endif