#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); }