diff options
author | Stefan Metzmacher <metze@samba.org> | 2022-08-23 08:27:37 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2023-01-18 16:26:36 +0000 |
commit | 620ad8af4661e32eb0fb27aff632305a3def04dc (patch) | |
tree | a306143f89653647298f50aeb7bb1fa038dd80b8 | |
parent | eb05fe87bf77839fa0e83e6ba5ec4ab9a3fdcef1 (diff) | |
download | samba-620ad8af4661e32eb0fb27aff632305a3def04dc.tar.gz |
tevent: remove unused register_backend() from python bindings
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
-rw-r--r-- | lib/tevent/pytevent.c | 130 |
1 files changed, 0 insertions, 130 deletions
diff --git a/lib/tevent/pytevent.c b/lib/tevent/pytevent.c index 62dfe2419ff..6e8c8b72e1c 100644 --- a/lib/tevent/pytevent.c +++ b/lib/tevent/pytevent.c @@ -73,134 +73,6 @@ static PyTypeObject TeventSignal_Type; static PyTypeObject TeventTimer_Type; static PyTypeObject TeventFd_Type; -static int py_context_init(struct tevent_context *ev) -{ - /* FIXME */ - return 0; -} - -static struct tevent_fd *py_add_fd(struct tevent_context *ev, - TALLOC_CTX *mem_ctx, - int fd, uint16_t flags, - tevent_fd_handler_t handler, - void *private_data, - const char *handler_name, - const char *location) -{ - /* FIXME */ - return NULL; -} - -static void py_set_fd_close_fn(struct tevent_fd *fde, - tevent_fd_close_fn_t close_fn) -{ - /* FIXME */ -} - -static uint16_t py_get_fd_flags(struct tevent_fd *fde) -{ - /* FIXME */ - return 0; -} - -static void py_set_fd_flags(struct tevent_fd *fde, uint16_t flags) -{ - /* FIXME */ -} - -/* timed_event functions */ -static struct tevent_timer *py_add_timer(struct tevent_context *ev, - TALLOC_CTX *mem_ctx, - struct timeval next_event, - tevent_timer_handler_t handler, - void *private_data, - const char *handler_name, - const char *location) -{ - /* FIXME */ - return NULL; -} - -/* immediate event functions */ -static void py_schedule_immediate(struct tevent_immediate *im, - struct tevent_context *ev, - tevent_immediate_handler_t handler, - void *private_data, - const char *handler_name, - const char *location) -{ - /* FIXME */ -} - -/* signal functions */ -static struct tevent_signal *py_add_signal(struct tevent_context *ev, - TALLOC_CTX *mem_ctx, - int signum, int sa_flags, - tevent_signal_handler_t handler, - void *private_data, - const char *handler_name, - const char *location) -{ - /* FIXME */ - return NULL; -} - -/* loop functions */ -static int py_loop_once(struct tevent_context *ev, const char *location) -{ - /* FIXME */ - return 0; -} - -static int py_loop_wait(struct tevent_context *ev, const char *location) -{ - /* FIXME */ - return 0; -} - -const static struct tevent_ops py_tevent_ops = { - .context_init = py_context_init, - .add_fd = py_add_fd, - .set_fd_close_fn = py_set_fd_close_fn, - .get_fd_flags = py_get_fd_flags, - .set_fd_flags = py_set_fd_flags, - .add_timer = py_add_timer, - .schedule_immediate = py_schedule_immediate, - .add_signal = py_add_signal, - .loop_wait = py_loop_wait, - .loop_once = py_loop_once, -}; - -static PyObject *py_register_backend(PyObject *self, PyObject *args) -{ - PyObject *name, *py_backend; - - if (!PyArg_ParseTuple(args, "O", &py_backend)) - return NULL; - - name = PyObject_GetAttrString(py_backend, "name"); - if (name == NULL) { - PyErr_SetNone(PyExc_AttributeError); - return NULL; - } - - if (!PyUnicode_Check(name)) { - PyErr_SetNone(PyExc_TypeError); - Py_DECREF(name); - return NULL; - } - - if (!tevent_register_backend(PyUnicode_AsUTF8(name), &py_tevent_ops)) { /* FIXME: What to do with backend */ - PyErr_SetNone(PyExc_RuntimeError); - Py_DECREF(name); - return NULL; - } - - Py_DECREF(name); - - Py_RETURN_NONE; -} - static PyObject *py_tevent_context_reinitialise(TeventContext_Object *self, PyObject *Py_UNUSED(ignored)) { @@ -855,8 +727,6 @@ err: } static PyMethodDef tevent_methods[] = { - { "register_backend", (PyCFunction)py_register_backend, METH_VARARGS, - "register_backend(backend)" }, { "set_default_backend", (PyCFunction)py_set_default_backend, METH_VARARGS, "set_default_backend(backend)" }, { "backend_list", (PyCFunction)py_backend_list, |