[glib/gvariant: 111/116] g_variant_load fixes



commit 8e52adf4dfaed85dc287674b8d099a27575a7d01
Author: Ryan Lortie <desrt desrt ca>
Date:   Wed Jan 13 12:49:24 2010 -0500

    g_variant_load fixes

 glib/gvariant-core.c |    9 ++++++++-
 glib/gvariant.h      |    2 ++
 2 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/glib/gvariant-core.c b/glib/gvariant-core.c
index 2e6c82e..d8a9384 100644
--- a/glib/gvariant-core.c
+++ b/glib/gvariant-core.c
@@ -1426,7 +1426,7 @@ g_variant_from_data (const GVariantType *type,
 
 /**
  * g_variant_load:
- * @type: the #GVariantType of the new variant
+ * @type: the #GVariantType of the new variant, or %NULL
  * @data: the serialised #GVariant data to load
  * @size: the size of @data
  * @flags: zero or more #GVariantFlags
@@ -1436,6 +1436,13 @@ g_variant_from_data (const GVariantType *type,
  * efficient way to create #GVariant instances, see
  * g_variant_from_slice() or g_variant_from_data().
  *
+ * If @type is non-%NULL then it specifies the type of the
+ * #GVariant contained in the serialise data.  If @type is
+ * %NULL then the serialised data is assumed to have type
+ * "v" and instead of returning the variant itself, the
+ * contents of the variant is returned.  This provides a
+ * simple way to store data along with its type.
+ *
  * This function is O(n) in the size of @data.
  *
  * This function never fails.
diff --git a/glib/gvariant.h b/glib/gvariant.h
index 478be9a..92bce56 100644
--- a/glib/gvariant.h
+++ b/glib/gvariant.h
@@ -228,6 +228,8 @@ GVariant *                      g_variant_markup_parse                  (const g
 /* load/store serialised format */
 typedef enum
 {
+  G_VARIANT_LITTLE_ENDIAN       = G_LITTLE_ENDIAN,
+  G_VARIANT_BIG_ENDIAN          = G_BIG_ENDIAN,
   G_VARIANT_TRUSTED             = 0x00010000,
   G_VARIANT_LAZY_BYTESWAP       = 0x00020000,
 } GVariantFlags;



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