diff options
Diffstat (limited to 'src/hwdmodule.cpp')
-rw-r--r-- | src/hwdmodule.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/hwdmodule.cpp b/src/hwdmodule.cpp new file mode 100644 index 0000000..d0565df --- /dev/null +++ b/src/hwdmodule.cpp @@ -0,0 +1,32 @@ +#define PY_SSIZE_T_CLEAN +#include <Python.h> + +#include <hwd.h> + + +static PyObject * hwd_stop_server(PyObject * self, PyObject * args) +{ + hwd::stop_server(); + Py_RETURN_NONE; +} + + +static PyMethodDef HwdMethods[] = { + {"stop_server", hwd_stop_server, METH_VARARGS, "Shutdown daemon instance"}, + {NULL, NULL, 0, NULL} +}; + + +static struct PyModuleDef hwdmodule = { + PyModuleDef_HEAD_INIT, + "hwd", + NULL, + -1, + HwdMethods +}; + + +PyMODINIT_FUNC PyInit_hwd(void) +{ + return PyModule_Create(&hwdmodule); +} |