Annotate GVariant and GSettings _strv() functions
authorMilan Bouchet-Valat <nalimilan@club.fr>
Wed, 2 Jun 2010 14:05:13 +0000 (16:05 +0200)
committerRyan Lortie <desrt@desrt.ca>
Wed, 2 Jun 2010 17:37:30 +0000 (19:37 +0200)
Add GObject introspection annotations so that the length parameter is
correctly detected for g_variant_new_strv(), g_variant_get_strv() and
g_variant_dup_strv(). Also specify that it can be a NULL pointer in
g_variant_get_strv() and g_variant_dup_strv().

For g_settings_set_strv(), detect that a NULL value is allowed, meaning
empty array.

Closes bug #620384.

Signed-off-by: Ryan Lortie <desrt@desrt.ca>
gio/gsettings.c
glib/gvariant.c

index 373b703..6ad842a 100644 (file)
@@ -1833,7 +1833,7 @@ g_settings_get_strv (GSettings   *settings,
  * g_settings_set_strv:
  * @settings: a #GSettings object
  * @key: the name of the key to set
- * @value: the value to set it to, or %NULL
+ * @value: (allow-none): the value to set it to, or %NULL
  * @returns: %TRUE if setting the key succeeded,
  *     %FALSE if the key was not writable
  *
index 0863f37..9dca0d0 100644 (file)
@@ -1244,7 +1244,7 @@ g_variant_get_byte_array (GVariant *value,
  * g_variant_new_strv:
  * @strv: an array of strings
  * @length: the length of @strv, or -1
- * @returns: a new floating #GVariant instance
+ * @returns: (array length=length): a new floating #GVariant instance
  *
  * Constructs an array of strings #GVariant from the given array of
  * strings.
@@ -1277,8 +1277,8 @@ g_variant_new_strv (const gchar * const *strv,
 /**
  * g_variant_get_strv:
  * @value: an array of strings #GVariant
- * @length: the length of the result, or %NULL
- * @returns: an array of constant strings
+ * @length: (allow-none): the length of the result, or %NULL
+ * @returns: (array length=length): an array of constant strings
  *
  * Gets the contents of an array of strings #GVariant.  This call
  * makes a shallow copy; the return result should be released with
@@ -1329,8 +1329,8 @@ g_variant_get_strv (GVariant *value,
 /**
  * g_variant_dup_strv:
  * @value: an array of strings #GVariant
- * @length: the length of the result, or %NULL
- * @returns: an array of constant strings
+ * @length: (allow-none): the length of the result, or %NULL
+ * @returns: (array length=length): an array of constant strings
  *
  * Gets the contents of an array of strings #GVariant.  This call
  * makes a deep copy; the return result should be released with