[gobject-introspection] Add a simple callback type which has no arguments or return values



commit 2c99e2c77dbf0937c0c4e8cba21e53727bcef718
Author: Zach Goldberg <zach zachgoldberg com>
Date:   Thu Apr 15 17:01:11 2010 -0400

    Add a simple callback type which has no arguments or return values
    
    https://bugzilla.gnome.org/show_bug.cgi?id=615887

 gir/everything.c |   14 ++++++++++++++
 gir/everything.h |    4 +++-
 2 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/gir/everything.c b/gir/everything.c
index 748b11a..006798a 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 7096017..5521c4a 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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]