Add a generic libffi based marshaller to libgobject
[platform/upstream/glib.git] / gobject / gobject.h
index 751e5f2..971f365 100644 (file)
@@ -390,6 +390,9 @@ GParamSpec**g_object_class_list_properties    (GObjectClass   *oclass,
 void        g_object_class_override_property  (GObjectClass   *oclass,
                                               guint           property_id,
                                               const gchar    *name);
+void        g_object_class_install_properties (GObjectClass   *oclass,
+                                               guint           n_pspecs,
+                                               GParamSpec    **pspecs);
 
 void        g_object_interface_install_property (gpointer     g_iface,
                                                 GParamSpec  *pspec);
@@ -435,6 +438,8 @@ void        g_object_get_property             (GObject        *object,
 void        g_object_freeze_notify            (GObject        *object);
 void        g_object_notify                   (GObject        *object,
                                               const gchar    *property_name);
+void        g_object_notify_by_pspec          (GObject        *object,
+                                              GParamSpec     *pspec);
 void        g_object_thaw_notify              (GObject        *object);
 gboolean    g_object_is_floating             (gpointer        object);
 gpointer    g_object_ref_sink                (gpointer        object);
@@ -557,6 +562,21 @@ G_STMT_START { \
 #define G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec) \
     G_OBJECT_WARN_INVALID_PSPEC ((object), "property", (property_id), (pspec))
 
+void    g_clear_object (volatile GObject **object_ptr);
+#define g_clear_object(object_ptr) \
+  G_STMT_START {                                                             \
+    /* Only one access, please */                                            \
+    gpointer *_p = (gpointer) (object_ptr);                                  \
+    gpointer _o;                                                             \
+                                                                             \
+    do                                                                       \
+      _o = g_atomic_pointer_get (_p);                                        \
+    while G_UNLIKELY (!g_atomic_pointer_compare_and_exchange (_p, _o, NULL));\
+                                                                             \
+    if (_o)                                                                  \
+      g_object_unref (_o);                                                   \
+  } G_STMT_END
+
 G_END_DECLS
 
 #endif /* __G_OBJECT_H__ */