static int py_context_init(struct tevent_context *ev)
{
/* FIXME */
+ return 0;
}
static struct tevent_fd *py_add_fd(struct tevent_context *ev,
const char *location)
{
/* FIXME */
+ return NULL;
}
static void py_set_fd_close_fn(struct tevent_fd *fde,
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)
const char *location)
{
/* FIXME */
+ return NULL;
}
/* immediate event functions */
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 = {
static void py_queue_trigger(struct tevent_req *req, void *private_data)
{
- PyObject *callback, *ret;
+ PyObject *callback = private_data, *ret;
- ret = PyObject_CallFunction(private_data, "");
+ ret = PyObject_CallFunction(callback, "");
Py_XDECREF(ret);
}
return (PyObject *)ret;
}
+#ifdef TEVENT_DEPRECATED
static PyObject *py_tevent_context_set_allow_nesting(TeventContext_Object *self)
{
tevent_loop_allow_nesting(self->ev);
Py_RETURN_NONE;
}
-
-
+#endif
static PyMethodDef py_tevent_context_methods[] = {
{ "reinitialise", (PyCFunction)py_tevent_context_reinitialise, METH_NOARGS,
METH_VARARGS, "S.add_timer(next_event, handler) -> timer" },
{ "add_fd", (PyCFunction)py_tevent_context_add_fd,
METH_VARARGS, "S.add_fd(fd, flags, handler) -> fd" },
+#ifdef TEVENT_DEPRECATED
{ "allow_nesting", (PyCFunction)py_tevent_context_set_allow_nesting,
METH_NOARGS, "Whether to allow nested tevent loops." },
+#endif
{ NULL },
};
.tp_basicsize = sizeof(TeventReq_Object),
.tp_methods = py_tevent_req_methods,
.tp_dealloc = (destructor)py_tevent_req_dealloc,
+ .tp_getset = py_tevent_req_getsetters,
/* FIXME: .tp_new = py_tevent_req_new, */
};
static PyObject *py_tevent_context_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
- char *kwnames[] = { "name", NULL };
+ const char *kwnames[] = { "name", NULL };
char *name = NULL;
struct tevent_context *ev;
TeventContext_Object *ret;
{ NULL },
};
-int init_tevent(void)
+void init_tevent(void)
{
PyObject *m;