GVariant: drop use of @returns

This commit is contained in:
Ryan Lortie 2011-11-21 11:33:05 -05:00
parent 4527e7cbf7
commit 0e0554bd62
5 changed files with 249 additions and 129 deletions

View File

@ -459,11 +459,12 @@ g_variant_ensure_serialised (GVariant *value)
* @type: the type of the new instance
* @serialised: if the instance will be in serialised form
* @trusted: if the instance will be trusted
* @returns: a new #GVariant with a floating reference
*
* Allocates a #GVariant instance and does some common work (such as
* looking up and filling in the type info), setting the state field,
* and setting the ref_count to 1.
*
* Returns: a new #GVariant with a floating reference
*/
static GVariant *
g_variant_alloc (const GVariantType *type,
@ -489,13 +490,14 @@ g_variant_alloc (const GVariantType *type,
* @type: a #GVariantType
* @buffer: a #GBuffer
* @trusted: if the contents of @buffer are trusted
* @returns: a new #GVariant with a floating reference
*
* Constructs a new serialised-mode #GVariant instance. This is the
* inner interface for creation of new serialised values that gets
* called from various functions in gvariant.c.
*
* A reference is taken on @buffer.
*
* Returns: a new #GVariant with a floating reference
*/
GVariant *
g_variant_new_from_buffer (const GVariantType *type,
@ -540,7 +542,6 @@ g_variant_new_from_buffer (const GVariantType *type,
* @children: an array of #GVariant pointers. Consumed.
* @n_children: the length of @children
* @trusted: %TRUE if every child in @children in trusted
* @returns: a new #GVariant with a floating reference
*
* Constructs a new tree-mode #GVariant instance. This is the inner
* interface for creation of new serialised values that gets called from
@ -548,6 +549,8 @@ g_variant_new_from_buffer (const GVariantType *type,
*
* @children is consumed by this function. g_free() will be called on
* it some time later.
*
* Returns: a new #GVariant with a floating reference
*/
GVariant *
g_variant_new_from_children (const GVariantType *type,
@ -567,11 +570,12 @@ g_variant_new_from_children (const GVariantType *type,
/* < internal >
* g_variant_get_type_info:
* @value: a #GVariant
* @returns: the #GVariantTypeInfo for @value
*
* Returns the #GVariantTypeInfo corresponding to the type of @value. A
* reference is not added, so the return value is only good for the
* duration of the life of @value.
*
* Returns: the #GVariantTypeInfo for @value
*/
GVariantTypeInfo *
g_variant_get_type_info (GVariant *value)
@ -582,7 +586,6 @@ g_variant_get_type_info (GVariant *value)
/* < internal >
* g_variant_is_trusted:
* @value: a #GVariant
* @returns: if @value is trusted
*
* Determines if @value is trusted by #GVariant to contain only
* fully-valid data. All values constructed solely via #GVariant APIs
@ -593,6 +596,8 @@ g_variant_get_type_info (GVariant *value)
* skipped. For example, we don't need to check that a string is
* properly nul-terminated or that an object path is actually a
* properly-formatted object path.
*
* Returns: if @value is trusted
*/
gboolean
g_variant_is_trusted (GVariant *value)
@ -637,10 +642,11 @@ g_variant_unref (GVariant *value)
/**
* g_variant_ref:
* @value: a #GVariant
* @returns: the same @value
*
* Increases the reference count of @value.
*
* Returns: the same @value
*
* Since: 2.24
**/
GVariant *
@ -654,7 +660,6 @@ g_variant_ref (GVariant *value)
/**
* g_variant_ref_sink:
* @value: a #GVariant
* @returns: the same @value
*
* #GVariant uses a floating reference count system. All functions with
* names starting with <literal>g_variant_new_</literal> return floating
@ -679,6 +684,8 @@ g_variant_ref (GVariant *value)
* maintaining normal refcounting semantics in situations where values
* are not floating.
*
* Returns: the same @value
*
* Since: 2.24
**/
GVariant *
@ -699,7 +706,6 @@ g_variant_ref_sink (GVariant *value)
/**
* g_variant_take_ref:
* @value: a #GVariant
* @returns: the same @value
*
* If @value is floating, sink it. Otherwise, do nothing.
*
@ -733,6 +739,8 @@ g_variant_ref_sink (GVariant *value)
* be that the floating reference is converted to a hard reference and
* an additional reference on top of that one is added. It is best to
* avoid this situation.
*
* Returns: the same @value
**/
GVariant *
g_variant_take_ref (GVariant *value)
@ -747,7 +755,6 @@ g_variant_take_ref (GVariant *value)
/**
* g_variant_is_floating:
* @value: a #GVariant
* @returns: whether @value is floating
*
* Checks whether @value has a floating reference count.
*
@ -759,6 +766,8 @@ g_variant_take_ref (GVariant *value)
* See g_variant_ref_sink() for more information about floating reference
* counts.
*
* Returns: whether @value is floating
*
* Since: 2.26
**/
gboolean
@ -772,7 +781,6 @@ g_variant_is_floating (GVariant *value)
/**
* g_variant_get_size:
* @value: a #GVariant instance
* @returns: the serialised size of @value
*
* Determines the number of bytes that would be required to store @value
* with g_variant_store().
@ -786,6 +794,8 @@ g_variant_is_floating (GVariant *value)
* operation which is approximately O(n) in the number of values
* involved.
*
* Returns: the serialised size of @value
*
* Since: 2.24
**/
gsize
@ -801,7 +811,6 @@ g_variant_get_size (GVariant *value)
/**
* g_variant_get_data:
* @value: a #GVariant instance
* @returns: (transfer none): the serialised form of @value, or %NULL
*
* Returns a pointer to the serialised form of a #GVariant instance.
* The returned data may not be in fully-normalised form if read from an
@ -829,6 +838,8 @@ g_variant_get_size (GVariant *value)
* explicitly (by storing the type and/or endianness in addition to the
* serialised data).
*
* Returns: (transfer none): the serialised form of @value, or %NULL
*
* Since: 2.24
**/
gconstpointer
@ -844,7 +855,6 @@ g_variant_get_data (GVariant *value)
/**
* g_variant_n_children:
* @value: a container #GVariant
* @returns: the number of children in the container
*
* Determines the number of children in a container #GVariant instance.
* This includes variants, maybes, arrays, tuples and dictionary
@ -858,6 +868,8 @@ g_variant_get_data (GVariant *value)
*
* This function is O(1).
*
* Returns: the number of children in the container
*
* Since: 2.24
**/
gsize
@ -889,7 +901,6 @@ g_variant_n_children (GVariant *value)
* g_variant_get_child_value:
* @value: a container #GVariant
* @index_: the index of the child to fetch
* @returns: (transfer full): the child at the specified index
*
* Reads a child item out of a container #GVariant instance. This
* includes variants, maybes, arrays, tuples and dictionary
@ -904,6 +915,8 @@ g_variant_n_children (GVariant *value)
*
* This function is O(1).
*
* Returns: (transfer full): the child at the specified index
*
* Since: 2.24
**/
GVariant *
@ -1000,7 +1013,6 @@ g_variant_store (GVariant *value,
/**
* g_variant_is_normal_form:
* @value: a #GVariant instance
* @returns: %TRUE if @value is in normal form
*
* Checks if @value is in normal form.
*
@ -1013,6 +1025,8 @@ g_variant_store (GVariant *value,
* being trusted. If the value was already marked as being trusted then
* this function will immediately return %TRUE.
*
* Returns: %TRUE if @value is in normal form
*
* Since: 2.24
**/
gboolean

View File

@ -2406,7 +2406,6 @@ g_variant_parse (const GVariantType *type,
* g_variant_new_parsed_va:
* @format: a text format #GVariant
* @app: a pointer to a #va_list
* @returns: a new, usually floating, #GVariant
*
* Parses @format and returns the result.
*
@ -2425,6 +2424,8 @@ g_variant_parse (const GVariantType *type,
* At this point, the caller will have their own full reference to the
* result. This can also be done by adding the result to a container,
* or by passing it to another g_variant_new() call.
*
* Returns: a new, usually floating, #GVariant
**/
GVariant *
g_variant_new_parsed_va (const gchar *format,
@ -2461,7 +2462,6 @@ g_variant_new_parsed_va (const gchar *format,
* g_variant_new_parsed:
* @format: a text format #GVariant
* @...: arguments as per @format
* @returns: a new floating #GVariant instance
*
* Parses @format and returns the result.
*
@ -2489,6 +2489,8 @@ g_variant_new_parsed_va (const gchar *format,
* #GVariant pointer from the argument list. ie: @format may not solely
* be anything along the lines of "%*", "%?", "\%r", or anything starting
* with "%@".
*
* Returns: a new floating #GVariant instance
**/
GVariant *
g_variant_new_parsed (const gchar *format,

View File

@ -1300,11 +1300,12 @@ gvs_variant_is_normal (GVariantSerialised value)
/* < private >
* g_variant_serialised_n_children:
* @serialised: a #GVariantSerialised
* @returns: the number of children
*
* For serialised data that represents a container value (maybes,
* tuples, arrays, variants), determine how many child items are inside
* that container.
*
* Returns: the number of children
*/
gsize
g_variant_serialised_n_children (GVariantSerialised serialised)
@ -1323,7 +1324,6 @@ g_variant_serialised_n_children (GVariantSerialised serialised)
* g_variant_serialised_get_child:
* @serialised: a #GVariantSerialised
* @index_: the index of the child to fetch
* @returns: a #GVariantSerialised for the child
*
* Extracts a child from a serialised data representing a container
* value.
@ -1338,6 +1338,8 @@ g_variant_serialised_n_children (GVariantSerialised serialised)
* item of a variable-sized type is being returned.
*
* .data is never non-%NULL if size is 0.
*
* Returns: a #GVariantSerialised for the child
*/
GVariantSerialised
g_variant_serialised_get_child (GVariantSerialised serialised,

File diff suppressed because it is too large Load Diff

View File

@ -504,7 +504,6 @@ g_variant_type_check (const GVariantType *type)
* @string: a pointer to any string
* @limit: (allow-none): the end of @string, or %NULL
* @endptr: (out) (allow-none): location to store the end pointer, or %NULL
* @returns: %TRUE if a valid type string was found
*
* Scan for a single complete and valid GVariant type string in @string.
* The memory pointed to by @limit (or bytes beyond it) is never
@ -520,6 +519,8 @@ g_variant_type_check (const GVariantType *type)
* For the simple case of checking if a string is a valid type string,
* see g_variant_type_string_is_valid().
*
* Returns: %TRUE if a valid type string was found
*
* Since: 2.24
**/
gboolean
@ -572,12 +573,13 @@ g_variant_type_string_scan (const gchar *string,
/**
* g_variant_type_string_is_valid:
* @type_string: a pointer to any string
* @returns: %TRUE if @type_string is exactly one valid type string
*
* Checks if @type_string is a valid GVariant type string. This call is
* equivalent to calling g_variant_type_string_scan() and confirming
* that the following character is a nul terminator.
*
* Returns: %TRUE if @type_string is exactly one valid type string
*
* Since 2.24
**/
gboolean
@ -616,11 +618,12 @@ g_variant_type_free (GVariantType *type)
/**
* g_variant_type_copy:
* @type: a #GVariantType
* @returns: (transfer full): a new #GVariantType
*
* Makes a copy of a #GVariantType. It is appropriate to call
* g_variant_type_free() on the return value. @type may not be %NULL.
*
* Returns: (transfer full): a new #GVariantType
*
* Since 2.24
**/
GVariantType *
@ -643,7 +646,6 @@ g_variant_type_copy (const GVariantType *type)
/**
* g_variant_type_new:
* @type_string: a valid GVariant type string
* @returns: (transfer full): a new #GVariantType
*
* Creates a new #GVariantType corresponding to the type string given
* by @type_string. It is appropriate to call g_variant_type_free() on
@ -652,6 +654,8 @@ g_variant_type_copy (const GVariantType *type)
* It is a programmer error to call this function with an invalid type
* string. Use g_variant_type_string_is_valid() if you are unsure.
*
* Returns: (transfer full): a new #GVariantType
*
* Since: 2.24
*/
GVariantType *
@ -665,12 +669,13 @@ g_variant_type_new (const gchar *type_string)
/**
* g_variant_type_get_string_length:
* @type: a #GVariantType
* @returns: the length of the corresponding type string
*
* Returns the length of the type string corresponding to the given
* @type. This function must be used to determine the valid extent of
* the memory region returned by g_variant_type_peek_string().
*
* Returns: the length of the corresponding type string
*
* Since 2.24
**/
gsize
@ -707,7 +712,6 @@ g_variant_type_get_string_length (const GVariantType *type)
/**
* g_variant_type_peek_string: (skip)
* @type: a #GVariantType
* @returns: the corresponding type string (not nul-terminated)
*
* Returns the type string corresponding to the given @type. The
* result is not nul-terminated; in order to determine its length you
@ -715,6 +719,8 @@ g_variant_type_get_string_length (const GVariantType *type)
*
* To get a nul-terminated string, see g_variant_type_dup_string().
*
* Returns: the corresponding type string (not nul-terminated)
*
* Since 2.24
**/
const gchar *
@ -728,12 +734,13 @@ g_variant_type_peek_string (const GVariantType *type)
/**
* g_variant_type_dup_string:
* @type: a #GVariantType
* @returns: (transfer full): the corresponding type string
*
* Returns a newly-allocated copy of the type string corresponding to
* @type. The returned string is nul-terminated. It is appropriate to
* call g_free() on the return value.
*
* Returns: (transfer full): the corresponding type string
*
* Since 2.24
**/
gchar *
@ -748,7 +755,6 @@ g_variant_type_dup_string (const GVariantType *type)
/**
* g_variant_type_is_definite:
* @type: a #GVariantType
* @returns: %TRUE if @type is definite
*
* Determines if the given @type is definite (ie: not indefinite).
*
@ -761,6 +767,8 @@ g_variant_type_dup_string (const GVariantType *type)
* indefinite type like %G_VARIANT_TYPE_ARRAY, however, will result in
* %FALSE being returned.
*
* Returns: %TRUE if @type is definite
*
* Since 2.24
**/
gboolean
@ -787,7 +795,6 @@ g_variant_type_is_definite (const GVariantType *type)
/**
* g_variant_type_is_container:
* @type: a #GVariantType
* @returns: %TRUE if @type is a container type
*
* Determines if the given @type is a container type.
*
@ -798,6 +805,8 @@ g_variant_type_is_definite (const GVariantType *type)
* definite subtype is a container -- %G_VARIANT_TYPE_ARRAY, for
* example.
*
* Returns: %TRUE if @type is a container type
*
* Since 2.24
**/
gboolean
@ -826,7 +835,6 @@ g_variant_type_is_container (const GVariantType *type)
/**
* g_variant_type_is_basic:
* @type: a #GVariantType
* @returns: %TRUE if @type is a basic type
*
* Determines if the given @type is a basic type.
*
@ -838,6 +846,8 @@ g_variant_type_is_container (const GVariantType *type)
* This function returns %FALSE for all indefinite types except
* %G_VARIANT_TYPE_BASIC.
*
* Returns: %TRUE if @type is a basic type
*
* Since 2.24
**/
gboolean
@ -874,7 +884,6 @@ g_variant_type_is_basic (const GVariantType *type)
/**
* g_variant_type_is_maybe:
* @type: a #GVariantType
* @returns: %TRUE if @type is a maybe type
*
* Determines if the given @type is a maybe type. This is true if the
* type string for @type starts with an 'm'.
@ -883,6 +892,8 @@ g_variant_type_is_basic (const GVariantType *type)
* definite subtype is a maybe type -- %G_VARIANT_TYPE_MAYBE, for
* example.
*
* Returns: %TRUE if @type is a maybe type
*
* Since 2.24
**/
gboolean
@ -896,7 +907,6 @@ g_variant_type_is_maybe (const GVariantType *type)
/**
* g_variant_type_is_array:
* @type: a #GVariantType
* @returns: %TRUE if @type is an array type
*
* Determines if the given @type is an array type. This is true if the
* type string for @type starts with an 'a'.
@ -905,6 +915,8 @@ g_variant_type_is_maybe (const GVariantType *type)
* definite subtype is an array type -- %G_VARIANT_TYPE_ARRAY, for
* example.
*
* Returns: %TRUE if @type is an array type
*
* Since 2.24
**/
gboolean
@ -918,7 +930,6 @@ g_variant_type_is_array (const GVariantType *type)
/**
* g_variant_type_is_tuple:
* @type: a #GVariantType
* @returns: %TRUE if @type is a tuple type
*
* Determines if the given @type is a tuple type. This is true if the
* type string for @type starts with a '(' or if @type is
@ -928,6 +939,8 @@ g_variant_type_is_array (const GVariantType *type)
* definite subtype is a tuple type -- %G_VARIANT_TYPE_TUPLE, for
* example.
*
* Returns: %TRUE if @type is a tuple type
*
* Since 2.24
**/
gboolean
@ -944,7 +957,6 @@ g_variant_type_is_tuple (const GVariantType *type)
/**
* g_variant_type_is_dict_entry:
* @type: a #GVariantType
* @returns: %TRUE if @type is a dictionary entry type
*
* Determines if the given @type is a dictionary entry type. This is
* true if the type string for @type starts with a '{'.
@ -953,6 +965,8 @@ g_variant_type_is_tuple (const GVariantType *type)
* definite subtype is a dictionary entry type --
* %G_VARIANT_TYPE_DICT_ENTRY, for example.
*
* Returns: %TRUE if @type is a dictionary entry type
*
* Since 2.24
**/
gboolean
@ -966,10 +980,11 @@ g_variant_type_is_dict_entry (const GVariantType *type)
/**
* g_variant_type_is_variant:
* @type: a #GVariantType
* @returns: %TRUE if @type is the variant type
*
* Determines if the given @type is the variant type.
*
* Returns: %TRUE if @type is the variant type
*
* Since 2.24
**/
gboolean
@ -983,7 +998,6 @@ g_variant_type_is_variant (const GVariantType *type)
/**
* g_variant_type_hash:
* @type: (type GVariantType): a #GVariantType
* @returns: the hash value
*
* Hashes @type.
*
@ -991,6 +1005,8 @@ g_variant_type_is_variant (const GVariantType *type)
* #GHashTable without function pointer casting. A valid
* #GVariantType must be provided.
*
* Returns: the hash value
*
* Since 2.24
**/
guint
@ -1016,7 +1032,6 @@ g_variant_type_hash (gconstpointer type)
* g_variant_type_equal:
* @type1: (type GVariantType): a #GVariantType
* @type2: (type GVariantType): a #GVariantType
* @returns: %TRUE if @type1 and @type2 are exactly equal
*
* Compares @type1 and @type2 for equality.
*
@ -1029,6 +1044,8 @@ g_variant_type_hash (gconstpointer type)
* allow use with #GHashTable without function pointer casting. For
* both arguments, a valid #GVariantType must be provided.
*
* Returns: %TRUE if @type1 and @type2 are exactly equal
*
* Since 2.24
**/
gboolean
@ -1060,7 +1077,6 @@ g_variant_type_equal (gconstpointer type1,
* g_variant_type_is_subtype_of:
* @type: a #GVariantType
* @supertype: a #GVariantType
* @returns: %TRUE if @type is a subtype of @supertype
*
* Checks if @type is a subtype of @supertype.
*
@ -1068,6 +1084,8 @@ g_variant_type_equal (gconstpointer type1,
* types are considered to be subtypes of themselves. Aside from that,
* only indefinite types can have subtypes.
*
* Returns: %TRUE if @type is a subtype of @supertype
*
* Since 2.24
**/
gboolean
@ -1133,12 +1151,13 @@ g_variant_type_is_subtype_of (const GVariantType *type,
/**
* g_variant_type_element:
* @type: an array or maybe #GVariantType
* @returns: (transfer none): the element type of @type
*
* Determines the element type of an array or maybe type.
*
* This function may only be used with array or maybe types.
*
* Returns: (transfer none): the element type of @type
*
* Since 2.24
**/
const GVariantType *
@ -1158,7 +1177,6 @@ g_variant_type_element (const GVariantType *type)
/**
* g_variant_type_first:
* @type: a tuple or dictionary entry #GVariantType
* @returns: (transfer none): the first item type of @type, or %NULL
*
* Determines the first item type of a tuple or dictionary entry
* type.
@ -1175,6 +1193,8 @@ g_variant_type_element (const GVariantType *type)
* This call, together with g_variant_type_next() provides an iterator
* interface over tuple and dictionary entry types.
*
* Returns: (transfer none): the first item type of @type, or %NULL
*
* Since 2.24
**/
const GVariantType *
@ -1196,7 +1216,6 @@ g_variant_type_first (const GVariantType *type)
/**
* g_variant_type_next:
* @type: a #GVariantType from a previous call
* @returns: (transfer none): the next #GVariantType after @type, or %NULL
*
* Determines the next item type of a tuple or dictionary entry
* type.
@ -1210,6 +1229,8 @@ g_variant_type_first (const GVariantType *type)
*
* For tuples, %NULL is returned when @type is the last item in a tuple.
*
* Returns: (transfer none): the next #GVariantType after @type, or %NULL
*
* Since 2.24
**/
const GVariantType *
@ -1231,7 +1252,6 @@ g_variant_type_next (const GVariantType *type)
/**
* g_variant_type_n_items:
* @type: a tuple or dictionary entry #GVariantType
* @returns: the number of items in @type
*
* Determines the number of items contained in a tuple or
* dictionary entry type.
@ -1243,6 +1263,8 @@ g_variant_type_next (const GVariantType *type)
* In the case of a dictionary entry type, this function will always
* return 2.
*
* Returns: the number of items in @type
*
* Since 2.24
**/
gsize
@ -1263,7 +1285,6 @@ g_variant_type_n_items (const GVariantType *type)
/**
* g_variant_type_key:
* @type: a dictionary entry #GVariantType
* @returns: (transfer none): the key type of the dictionary entry
*
* Determines the key type of a dictionary entry type.
*
@ -1271,6 +1292,8 @@ g_variant_type_n_items (const GVariantType *type)
* than the additional restriction, this call is equivalent to
* g_variant_type_first().
*
* Returns: (transfer none): the key type of the dictionary entry
*
* Since 2.24
**/
const GVariantType *
@ -1289,12 +1312,13 @@ g_variant_type_key (const GVariantType *type)
/**
* g_variant_type_value:
* @type: a dictionary entry #GVariantType
* @returns: (transfer none): the value type of the dictionary entry
*
* Determines the value type of a dictionary entry type.
*
* This function may only be used with a dictionary entry type.
*
* Returns: (transfer none): the value type of the dictionary entry
*
* Since 2.24
**/
const GVariantType *
@ -1314,7 +1338,6 @@ g_variant_type_value (const GVariantType *type)
* g_variant_type_new_tuple:
* @items: (array length=length): an array of #GVariantTypes, one for each item
* @length: the length of @items, or -1
* @returns: (transfer full): a new tuple #GVariantType
*
* Constructs a new tuple type, from @items.
*
@ -1323,6 +1346,8 @@ g_variant_type_value (const GVariantType *type)
*
* It is appropriate to call g_variant_type_free() on the return value.
*
* Returns: (transfer full): a new tuple #GVariantType
*
* Since 2.24
**/
static GVariantType *
@ -1395,13 +1420,14 @@ g_variant_type_new_tuple (const GVariantType * const *items,
/**
* g_variant_type_new_array:
* @element: a #GVariantType
* @returns: (transfer full): a new array #GVariantType
*
* Constructs the type corresponding to an array of elements of the
* type @type.
*
* It is appropriate to call g_variant_type_free() on the return value.
*
* Returns: (transfer full): a new array #GVariantType
*
* Since 2.24
**/
GVariantType *
@ -1424,13 +1450,14 @@ g_variant_type_new_array (const GVariantType *element)
/**
* g_variant_type_new_maybe:
* @element: a #GVariantType
* @returns: (transfer full): a new maybe #GVariantType
*
* Constructs the type corresponding to a maybe instance containing
* type @type or Nothing.
*
* It is appropriate to call g_variant_type_free() on the return value.
*
* Returns: (transfer full): a new maybe #GVariantType
*
* Since 2.24
**/
GVariantType *
@ -1454,13 +1481,14 @@ g_variant_type_new_maybe (const GVariantType *element)
* g_variant_type_new_dict_entry:
* @key: a basic #GVariantType
* @value: a #GVariantType
* @returns: (transfer full): a new dictionary entry #GVariantType
*
* Constructs the type corresponding to a dictionary entry with a key
* of type @key and a value of type @value.
*
* It is appropriate to call g_variant_type_free() on the return value.
*
* Returns: (transfer full): a new dictionary entry #GVariantType
*
* Since 2.24
**/
GVariantType *