| 1 |
#define PY_SSIZE_T_CLEAN |
| 2 |
#include <Python.h> |
| 3 |
#include "extensions/testcrypt.h" |
| 4 |
|
| 5 |
// Module method definitions |
| 6 |
static PyObject* crypt_something(PyObject *self, PyObject *args) { |
| 7 |
return PyUnicode_FromString(crypt_something().c_str()); |
| 8 |
} |
| 9 |
|
| 10 |
/* Module initialization */ |
| 11 |
PyMODINIT_FUNC PyInit__nonpy_rpath(void) |
| 12 |
{ |
| 13 |
static PyMethodDef module_methods[] = { |
| 14 |
{"crypt_something", (PyCFunction)crypt_something, METH_NOARGS, "crypt_something."}, |
| 15 |
{NULL} /* Sentinel */ |
| 16 |
}; |
| 17 |
static struct PyModuleDef moduledef = { |
| 18 |
PyModuleDef_HEAD_INIT, |
| 19 |
"_nonpy_rpath", |
| 20 |
"_nonpy_rpath module", |
| 21 |
-1, |
| 22 |
module_methods, |
| 23 |
}; |
| 24 |
return PyModule_Create(&moduledef); |
| 25 |
} |