#define PyStr_AsUTF8 PyString_AsString
#endif
+/* discard signature of 'func' in favour of 'target_sig' */
+#define PY_DISCARD_FUNC_SIG(target_sig, func) (target_sig)(void(*)(void))func
+
void init_tevent(void);
typedef struct {
Py_RETURN_NONE;
}
-static PyObject *py_tevent_context_reinitialise(TeventContext_Object *self)
+static PyObject *py_tevent_context_reinitialise(TeventContext_Object *self,
+ PyObject *Py_UNUSED(ignored))
{
int ret = tevent_re_initialise(self->ev);
if (ret != 0) {
Py_RETURN_NONE;
}
-static PyObject *py_tevent_queue_stop(TeventQueue_Object *self)
+static PyObject *py_tevent_queue_stop(TeventQueue_Object *self,
+ PyObject *Py_UNUSED(ignored))
{
tevent_queue_stop(self->queue);
Py_RETURN_NONE;
}
-static PyObject *py_tevent_queue_start(TeventQueue_Object *self)
+static PyObject *py_tevent_queue_start(TeventQueue_Object *self,
+ PyObject *Py_UNUSED(ignored))
{
tevent_queue_start(self->queue);
Py_RETURN_NONE;
}
static PyMethodDef py_tevent_queue_methods[] = {
- { "stop", (PyCFunction)py_tevent_queue_stop, METH_NOARGS,
+ { "stop", (PyCFunction)py_tevent_queue_stop,
+ METH_NOARGS,
"S.stop()" },
- { "start", (PyCFunction)py_tevent_queue_start, METH_NOARGS,
+ { "start", (PyCFunction)py_tevent_queue_start,
+ METH_NOARGS,
"S.start()" },
{ "add", (PyCFunction)py_tevent_queue_add, METH_VARARGS,
"S.add(ctx, req, trigger, baton)" },
Py_RETURN_NONE;
}
-static PyObject *py_tevent_context_loop_wait(TeventContext_Object *self)
+static PyObject *py_tevent_context_loop_wait(TeventContext_Object *self,
+ PyObject *Py_UNUSED(ignored))
{
if (tevent_loop_wait(self->ev) != 0) {
PyErr_SetNone(PyExc_RuntimeError);
Py_RETURN_NONE;
}
-static PyObject *py_tevent_context_loop_once(TeventContext_Object *self)
+static PyObject *py_tevent_context_loop_once(TeventContext_Object *self,
+ PyObject *Py_UNUSED(ignored))
{
if (tevent_loop_once(self->ev) != 0) {
PyErr_SetNone(PyExc_RuntimeError);
return 0;
}
-static PyObject* py_tevent_timer_get_active(TeventTimer_Object *self) {
+static PyObject* py_tevent_timer_get_active(TeventTimer_Object *self,
+ PyObject *Py_UNUSED(ignored))
+{
return PyBool_FromLong(self->timer != NULL);
}
}
static PyMethodDef py_tevent_context_methods[] = {
- { "reinitialise", (PyCFunction)py_tevent_context_reinitialise, METH_NOARGS,
+ { "reinitialise", (PyCFunction)py_tevent_context_reinitialise,
+ METH_NOARGS,
"S.reinitialise()" },
{ "wakeup_send", (PyCFunction)py_tevent_context_wakeup_send,
METH_VARARGS, "S.wakeup_send(wakeup_time) -> req" },
{ NULL },
};
-static PyObject *py_tevent_req_wakeup_recv(PyObject *self)
+static PyObject *py_tevent_req_wakeup_recv(PyObject *self,
+ PyObject *Py_UNUSED(ignored))
{
/* FIXME */
Py_RETURN_NONE;
}
-static PyObject *py_tevent_req_received(PyObject *self)
+static PyObject *py_tevent_req_received(PyObject *self,
+ PyObject *Py_UNUSED(ignored))
{
/* FIXME */
Py_RETURN_NONE;
}
-static PyObject *py_tevent_req_is_error(PyObject *self)
+static PyObject *py_tevent_req_is_error(PyObject *self,
+ PyObject *Py_UNUSED(ignored))
{
/* FIXME */
Py_RETURN_NONE;
}
-static PyObject *py_tevent_req_poll(PyObject *self)
+static PyObject *py_tevent_req_poll(PyObject *self,
+ PyObject *Py_UNUSED(ignored))
{
/* FIXME */
Py_RETURN_NONE;
}
-static PyObject *py_tevent_req_is_in_progress(PyObject *self)
+static PyObject *py_tevent_req_is_in_progress(PyObject *self,
+ PyObject *Py_UNUSED(ignored))
{
/* FIXME */
Py_RETURN_NONE;
Py_RETURN_NONE;
}
-static PyObject *py_tevent_req_done(PyObject *self)
+static PyObject *py_tevent_req_done(PyObject *self,
+ PyObject *Py_UNUSED(ignored))
{
/* FIXME */
Py_RETURN_NONE;
}
-static PyObject *py_tevent_req_notify_callback(PyObject *self)
+static PyObject *py_tevent_req_notify_callback(PyObject *self,
+ PyObject *Py_UNUSED(ignored))
{
/* FIXME */
Py_RETURN_NONE;
Py_RETURN_NONE;
}
-static PyObject *py_tevent_req_cancel(TeventReq_Object *self)
+static PyObject *py_tevent_req_cancel(TeventReq_Object *self,
+ PyObject *Py_UNUSED(ignored))
{
if (!tevent_req_cancel(self->req)) {
PyErr_SetNone(PyExc_RuntimeError);
}
static PyMethodDef py_tevent_req_methods[] = {
- { "wakeup_recv", (PyCFunction)py_tevent_req_wakeup_recv, METH_NOARGS,
+ { "wakeup_recv", (PyCFunction)py_tevent_req_wakeup_recv,
+ METH_NOARGS,
"Wakeup received" },
- { "received", (PyCFunction)py_tevent_req_received, METH_NOARGS,
+ { "received", (PyCFunction)py_tevent_req_received,
+ METH_NOARGS,
"Receive finished" },
{ "is_error", (PyCFunction)py_tevent_req_is_error, METH_NOARGS,
"is_error() -> (error, state)" },
/* FIXME: .tp_new = py_tevent_req_new, */
};
-static PyObject *py_tevent_queue_get_length(TeventQueue_Object *self)
+static PyObject *py_tevent_queue_get_length(TeventQueue_Object *self,
+ PyObject *Py_UNUSED(ignored))
{
return PyInt_FromLong(tevent_queue_length(self->queue));
}
.tp_methods = py_tevent_queue_methods,
};
-static PyObject *py_tevent_context_signal_support(PyObject *_self)
+static PyObject *py_tevent_context_signal_support(PyObject *_self,
+ PyObject *Py_UNUSED(ignored))
{
TeventContext_Object *self = (TeventContext_Object *)_self;
return PyBool_FromLong(tevent_signal_support(self->ev));
static PyGetSetDef py_tevent_context_getsetters[] = {
{
.name = discard_const_p(char, "signal_support"),
- .get = (getter)py_tevent_context_signal_support,
+ .get = PY_DISCARD_FUNC_SIG(getter,
+ py_tevent_context_signal_support),
.doc = discard_const_p(char, "if this platform and tevent context support signal handling"),
},
{ NULL }
Py_RETURN_NONE;
}
-static PyObject *py_backend_list(PyObject *self)
+static PyObject *py_backend_list(PyObject *self,
+ PyObject *Py_UNUSED(ignored))
{
PyObject *ret = NULL;
PyObject *string = NULL;