diff options
author | Zach Goldberg <zach@zachgoldberg.com> | 2010-04-15 17:01:11 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2010-04-16 10:58:24 -0400 |
commit | 2c99e2c77dbf0937c0c4e8cba21e53727bcef718 (patch) | |
tree | df10ad0e564a74b57b39564c59fb27f4b369a808 | |
parent | d5e9f88c1ac94b126c5ee2eb54483be839255f0d (diff) | |
download | gobject-introspection-2c99e2c77dbf0937c0c4e8cba21e53727bcef718.tar.gz |
Add a simple callback type which has no arguments or return values
https://bugzilla.gnome.org/show_bug.cgi?id=615887
-rw-r--r-- | gir/everything.c | 14 | ||||
-rw-r--r-- | gir/everything.h | 4 |
2 files changed, 17 insertions, 1 deletions
diff --git a/gir/everything.c b/gir/everything.c index 748b11a7..006798a6 100644 --- a/gir/everything.c +++ b/gir/everything.c @@ -1748,6 +1748,20 @@ test_callback (TestCallback callback) } /** + * test_simple_callback: + * @callback: (scope call) (allow-none): + * + **/ +void +test_simple_callback (TestSimpleCallback callback) +{ + if (callback != NULL) + callback(); + + return; +} + +/** * test_callback_user_data: * @callback: (scope call): * diff --git a/gir/everything.h b/gir/everything.h index 7096017a..5521c4a5 100644 --- a/gir/everything.h +++ b/gir/everything.h @@ -320,9 +320,11 @@ void test_sub_obj_unset_bare (TestSubObj *obj); int test_sub_obj_instance_method (TestSubObj *obj); /* callback */ -typedef int (*TestCallback) (); +typedef void (*TestSimpleCallback) (void); +typedef int (*TestCallback) (void); typedef int (*TestCallbackUserData) (gpointer user_data); +void test_simple_callback (TestSimpleCallback callback); int test_callback (TestCallback callback); int test_callback_user_data (TestCallbackUserData callback, gpointer user_data); |