tevent: remove unused register_backend() from python bindings
authorStefan Metzmacher <metze@samba.org>
Tue, 23 Aug 2022 06:27:37 +0000 (08:27 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 18 Jan 2023 16:26:36 +0000 (16:26 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
lib/tevent/pytevent.c

index 62dfe2419ff5571cb213f72b20e8ecca743a9813..6e8c8b72e1c2dac2a0e6c7cdb673fb54e66d841c 100644 (file)
@@ -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,