From 71165bdec129a2f52b9fc20e5a18338dfc413f11 Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 16 Oct 2021 00:45:25 +0200 Subject: Created stub python module for hwd communication library --- src/hwdmodule.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/hwdmodule.cpp (limited to 'src') 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 + +#include + + +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); +} -- cgit v1.1