summaryrefslogtreecommitdiffstats
path: root/gio
diff options
context:
space:
mode:
authorGian Mario Tagliaretti <gianmt@gnome.org>2009-12-30 23:44:25 +0100
committerGian Mario Tagliaretti <gianmt@gnome.org>2009-12-30 23:44:25 +0100
commitdff024256295c15e49888ad9d5fef74a7746edd7 (patch)
treea4ebb5cdb0a3e60915abef46d3ee99ef7844e67e /gio
parente2330bd0d6cbc49b0ecb27b30e3b0593935ce229 (diff)
downloadpygobject-dff024256295c15e49888ad9d5fef74a7746edd7.tar.gz
pygobject-dff024256295c15e49888ad9d5fef74a7746edd7.tar.xz
pygobject-dff024256295c15e49888ad9d5fef74a7746edd7.zip
Wrap gio.SocketAddressEnumerator.next_async() and add a test
Diffstat (limited to 'gio')
-rw-r--r--gio/gsocket.override42
1 files changed, 42 insertions, 0 deletions
diff --git a/gio/gsocket.override b/gio/gsocket.override
index 4bf3a6b..95e6527 100644
--- a/gio/gsocket.override
+++ b/gio/gsocket.override
@@ -66,6 +66,48 @@ _wrap_g_socket_condition_wait(PyGObject *self,
return PyBool_FromLong(ret);
}
+%%
+override g_socket_address_enumerator_next_async kwargs
+static PyObject *
+_wrap_g_socket_address_enumerator_next_async(PyGObject *self,
+ PyObject *args,
+ PyObject *kwargs)
+{
+ static char *kwlist[] = { "callback", "cancellable", "user_data", NULL };
+ PyGIONotify *notify;
+ PyGObject *py_cancellable = NULL;
+ GCancellable *cancellable;
+
+ notify = pygio_notify_new();
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+ "O|OO:gio.SocketAddressEnumerator.next_async",
+ kwlist,
+ &notify->callback,
+ &py_cancellable,
+ &notify->data))
+ goto error;
+
+ if (!pygio_notify_callback_is_valid(notify))
+ goto error;
+
+ if (!pygio_check_cancellable(py_cancellable, &cancellable))
+ goto error;
+
+ pygio_notify_reference_callback(notify);
+
+ g_socket_address_enumerator_next_async(G_SOCKET_ADDRESS_ENUMERATOR(self->obj),
+ cancellable,
+ (GAsyncReadyCallback) async_result_callback_marshal,
+ notify);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+
+ error:
+ pygio_notify_free(notify);
+ return NULL;
+}
/* Could not write method GSocket.receive_from: No ArgType for GSocketAddress** */
/* Could not write method GSocket.receive_message: No ArgType for GSocketAddress** */