[libgsystem] local-alloc: Add support for GVariantIters



commit a2c2d22f80af18878ea16671f1bdc01b1475343c
Author: Marius Vollmer <mvollmer redhat com>
Date:   Mon Oct 22 15:41:08 2012 +0300

    local-alloc: Add support for GVariantIters
    
    Signed-off-by: Colin Walters <walters verbum org>

 gsystem-local-alloc.c |    8 +++++++-
 gsystem-local-alloc.h |    9 +++++++++
 2 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/gsystem-local-alloc.c b/gsystem-local-alloc.c
index b19a329..0059896 100644
--- a/gsystem-local-alloc.c
+++ b/gsystem-local-alloc.c
@@ -67,7 +67,7 @@
  * }
  * </programlisting>
  * </example>
- *   
+ *
  */
 
 void
@@ -101,6 +101,12 @@ gs_local_variant_unref (void *loc)
 }
 
 void
+gs_local_variant_iter_free (void *loc)
+{
+  _gs_local_free(GVariantIter, g_variant_iter_free);
+}
+
+void
 gs_local_ptrarray_unref (void *loc)
 {
   _gs_local_free(GPtrArray, g_ptr_array_unref);
diff --git a/gsystem-local-alloc.h b/gsystem-local-alloc.h
index 28d857f..9471293 100644
--- a/gsystem-local-alloc.h
+++ b/gsystem-local-alloc.h
@@ -33,6 +33,7 @@ G_BEGIN_DECLS
 void gs_local_free (void *loc);
 void gs_local_obj_unref (void *loc);
 void gs_local_variant_unref (void *loc);
+void gs_local_variant_iter_free (void *loc);
 void gs_local_ptrarray_unref (void *loc);
 void gs_local_hashtable_unref (void *loc);
 
@@ -62,6 +63,14 @@ void gs_local_hashtable_unref (void *loc);
 #define gs_lvariant __attribute__ ((cleanup(gs_local_variant_unref)))
 
 /**
+ * gs_lvariant_iter:
+ *
+ * Call g_variant_iter_free() on a variable location when it goes out of
+ * scope.
+ */
+#define gs_lvariant_iter __attribute__ ((cleanup(gs_local_variant_iter_free)))
+
+/**
  * gs_lptrarray:
  *
  * Call g_ptr_array_unref() on a variable location when it goes out of



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