gio: port annotations from the Vala metadata.

https://bugzilla.gnome.org/show_bug.cgi?id=730493
This commit is contained in:
Evan Nemerson 2014-05-21 00:27:36 -07:00
parent e3db9632e7
commit 570b27b9ac
19 changed files with 79 additions and 71 deletions

View File

@ -328,7 +328,7 @@ g_action_get_state_type (GAction *action)
* The return value (if non-%NULL) should be freed with * The return value (if non-%NULL) should be freed with
* g_variant_unref() when it is no longer required. * g_variant_unref() when it is no longer required.
* *
* Returns: (transfer full): the state range hint * Returns: (nullable) (transfer full): the state range hint
* *
* Since: 2.28 * Since: 2.28
**/ **/

View File

@ -389,7 +389,7 @@ g_action_group_has_action (GActionGroup *action_group,
* possible for an action to be removed and for a new action to be added * possible for an action to be removed and for a new action to be added
* with the same name but a different parameter type. * with the same name but a different parameter type.
* *
* Returns: the parameter type * Returns: (nullable): the parameter type
* *
* Since: 2.28 * Since: 2.28
**/ **/
@ -425,7 +425,8 @@ g_action_group_get_action_parameter_type (GActionGroup *action_group,
* possible for an action to be removed and for a new action to be added * possible for an action to be removed and for a new action to be added
* with the same name but a different state type. * with the same name but a different state type.
* *
* Returns: (transfer full): the state type, if the action is stateful * Returns: (nullable) (transfer full): the state type, if the action
* is stateful
* *
* Since: 2.28 * Since: 2.28
**/ **/
@ -463,7 +464,7 @@ g_action_group_get_action_state_type (GActionGroup *action_group,
* The return value (if non-%NULL) should be freed with * The return value (if non-%NULL) should be freed with
* g_variant_unref() when it is no longer required. * g_variant_unref() when it is no longer required.
* *
* Returns: (transfer full): the state range hint * Returns: (nullable) (transfer full): the state range hint
* *
* Since: 2.28 * Since: 2.28
**/ **/
@ -515,7 +516,7 @@ g_action_group_get_action_enabled (GActionGroup *action_group,
* The return value (if non-%NULL) should be freed with * The return value (if non-%NULL) should be freed with
* g_variant_unref() when it is no longer required. * g_variant_unref() when it is no longer required.
* *
* Returns: (allow-none): the current state of the action * Returns: (nullable): the current state of the action
* *
* Since: 2.28 * Since: 2.28
**/ **/

View File

@ -780,7 +780,7 @@ g_application_command_line_get_exit_status (GApplicationCommandLine *cmdline)
* *
* For local invocation, it will be %NULL. * For local invocation, it will be %NULL.
* *
* Returns: (allow-none): the platform data, or %NULL * Returns: (nullable): the platform data, or %NULL
* *
* Since: 2.28 * Since: 2.28
**/ **/

View File

@ -221,8 +221,8 @@ g_cancellable_pop_current (GCancellable *cancellable)
* *
* Gets the top cancellable from the stack. * Gets the top cancellable from the stack.
* *
* Returns: (transfer none): a #GCancellable from the top of the stack, or %NULL * Returns: (nullable) (transfer none): a #GCancellable from the top
* if the stack is empty. * of the stack, or %NULL if the stack is empty.
**/ **/
GCancellable * GCancellable *
g_cancellable_get_current (void) g_cancellable_get_current (void)

View File

@ -382,7 +382,7 @@ g_content_type_get_description (const gchar *type)
* *
* Gets the mime type for the content type, if one is registered. * Gets the mime type for the content type, if one is registered.
* *
* Returns: (allow-none): the registered mime type for the given @type, * Returns: (nullable): the registered mime type for the given @type,
* or %NULL if unknown. * or %NULL if unknown.
*/ */
char * char *
@ -569,8 +569,8 @@ looks_like_text (const guchar *data, gsize data_size)
* *
* Tries to find a content type based on the mime type name. * Tries to find a content type based on the mime type name.
* *
* Returns: (allow-none): Newly allocated string with content type * Returns: (nullable): Newly allocated string with content type or
* or %NULL. Free with g_free() * %NULL. Free with g_free()
* *
* Since: 2.18 * Since: 2.18
**/ **/

View File

@ -735,12 +735,12 @@ scan_for_newline (GDataInputStream *stream,
* triggering the cancellable object from another thread. If the operation * triggering the cancellable object from another thread. If the operation
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
* *
* Returns: (transfer full) (array zero-terminated=1) (element-type guint8): a * Returns: (nullable) (transfer full) (array zero-terminated=1) (element-type guint8):
* NUL terminated byte array with the line that was read in (without * a NUL terminated byte array with the line that was read in
* the newlines). Set @length to a #gsize to get the length of the * (without the newlines). Set @length to a #gsize to get the length
* read line. On an error, it will return %NULL and @error will be * of the read line. On an error, it will return %NULL and @error
* set. If there's no content to read, it will still return %NULL, * will be set. If there's no content to read, it will still return
* but @error won't be set. * %NULL, but @error won't be set.
**/ **/
char * char *
g_data_input_stream_read_line (GDataInputStream *stream, g_data_input_stream_read_line (GDataInputStream *stream,
@ -819,12 +819,13 @@ g_data_input_stream_read_line (GDataInputStream *stream,
* triggering the cancellable object from another thread. If the operation * triggering the cancellable object from another thread. If the operation
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
* *
* Returns: (transfer full): a NUL terminated UTF-8 string with the * Returns: (nullable) (transfer full): a NUL terminated UTF-8 string
* line that was read in (without the newlines). Set @length to a * with the line that was read in (without the newlines). Set
* #gsize to get the length of the read line. On an error, it will * @length to a #gsize to get the length of the read line. On an
* return %NULL and @error will be set. For UTF-8 conversion errors, * error, it will return %NULL and @error will be set. For UTF-8
* the set error domain is %G_CONVERT_ERROR. If there's no content to * conversion errors, the set error domain is %G_CONVERT_ERROR. If
* read, it will still return %NULL, but @error won't be set. * there's no content to read, it will still return %NULL, but @error
* won't be set.
* *
* Since: 2.30 * Since: 2.30
**/ **/
@ -1197,12 +1198,12 @@ g_data_input_stream_read_until_async (GDataInputStream *stream,
* string encoding in g_data_input_stream_read_line() applies here as * string encoding in g_data_input_stream_read_line() applies here as
* well. * well.
* *
* Returns: (transfer full) (array zero-terminated=1) (element-type guint8): a * Returns: (nullable) (transfer full) (array zero-terminated=1) (element-type guint8):
* NUL-terminated byte array with the line that was read in * a NUL-terminated byte array with the line that was read in
* (without the newlines). Set @length to a #gsize to get the * (without the newlines). Set @length to a #gsize to get the length
* length of the read line. On an error, it will return %NULL and * of the read line. On an error, it will return %NULL and @error
* @error will be set. If there's no content to read, it will * will be set. If there's no content to read, it will still return
* still return %NULL, but @error won't be set. * %NULL, but @error won't be set.
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -1227,12 +1228,12 @@ g_data_input_stream_read_line_finish (GDataInputStream *stream,
* Finish an asynchronous call started by * Finish an asynchronous call started by
* g_data_input_stream_read_line_async(). * g_data_input_stream_read_line_async().
* *
* Returns: (transfer full): a string with the line that was read in * Returns: (nullable) (transfer full): a string with the line that
* (without the newlines). Set @length to a #gsize to get the length * was read in (without the newlines). Set @length to a #gsize to
* of the read line. On an error, it will return %NULL and @error * get the length of the read line. On an error, it will return
* will be set. For UTF-8 conversion errors, the set error domain is * %NULL and @error will be set. For UTF-8 conversion errors, the set
* %G_CONVERT_ERROR. If there's no content to read, it will still * error domain is %G_CONVERT_ERROR. If there's no content to read,
* return %NULL, but @error won't be set. * it will still return %NULL, but @error won't be set.
* *
* Since: 2.30 * Since: 2.30
*/ */

View File

@ -1114,7 +1114,8 @@ g_dbus_message_get_header_fields (GDBusMessage *message)
* *
* Gets the body of a message. * Gets the body of a message.
* *
* Returns: A #GVariant or %NULL if the body is empty. Do not free, it is owned by @message. * Returns: (transfer none): A #GVariant or %NULL if the body is
* empty. Do not free, it is owned by @message.
* *
* Since: 2.26 * Since: 2.26
*/ */

View File

@ -957,8 +957,8 @@ g_dbus_object_manager_client_get_flags (GDBusObjectManagerClient *manager)
* #GObject::notify signal to track changes to the * #GObject::notify signal to track changes to the
* #GDBusObjectManagerClient:name-owner property. * #GDBusObjectManagerClient:name-owner property.
* *
* Returns: The name owner or %NULL if no name owner exists. Free with * Returns: (nullable): The name owner or %NULL if no name owner
* g_free(). * exists. Free with g_free().
* *
* Since: 2.30 * Since: 2.30
*/ */

View File

@ -486,8 +486,8 @@ g_file_get_uri_scheme (GFile *file)
* *
* This call does no blocking I/O. * This call does no blocking I/O.
* *
* Returns: string containing the #GFile's base name, or %NULL * Returns: (nullable): string containing the #GFile's base name, or
* if given #GFile is invalid. The returned string should be * %NULL if given #GFile is invalid. The returned string should be
* freed with g_free() when no longer needed. * freed with g_free() when no longer needed.
*/ */
char * char *
@ -510,9 +510,9 @@ g_file_get_basename (GFile *file)
* *
* This call does no blocking I/O. * This call does no blocking I/O.
* *
* Returns: string containing the #GFile's path, or %NULL if * Returns: (nullable): string containing the #GFile's path, or %NULL
* no such path exists. The returned string should be * if no such path exists. The returned string should be freed
* freed with g_free() when no longer needed. * with g_free() when no longer needed.
*/ */
char * char *
g_file_get_path (GFile *file) g_file_get_path (GFile *file)
@ -680,9 +680,9 @@ g_file_equal (GFile *file1,
* *
* This call does no blocking I/O. * This call does no blocking I/O.
* *
* Returns: (transfer full): a #GFile structure to the * Returns: (nullable) (transfer full): a #GFile structure to the
* parent of the given #GFile or %NULL if there is * parent of the given #GFile or %NULL if there is no parent. Free
* no parent. Free the returned object with g_object_unref(). * the returned object with g_object_unref().
*/ */
GFile * GFile *
g_file_get_parent (GFile *file) g_file_get_parent (GFile *file)
@ -849,10 +849,10 @@ g_file_has_prefix (GFile *file,
* *
* This call does no blocking I/O. * This call does no blocking I/O.
* *
* Returns: string with the relative path from @descendant * Returns: (nullable): string with the relative path from @descendant
* to @parent, or %NULL if @descendant doesn't have @parent * to @parent, or %NULL if @descendant doesn't have @parent as
* as prefix. The returned string should be freed with g_free() * prefix. The returned string should be freed with g_free() when
* when no longer needed. * no longer needed.
*/ */
char * char *
g_file_get_relative_path (GFile *parent, g_file_get_relative_path (GFile *parent,

View File

@ -191,8 +191,9 @@ g_file_enumerator_init (GFileEnumerator *enumerator)
* enumerator is at the end, %NULL will be returned and @error will * enumerator is at the end, %NULL will be returned and @error will
* be unset. * be unset.
* *
* Returns: (transfer full): A #GFileInfo or %NULL on error or end of enumerator. * Returns: (nullable) (transfer full): A #GFileInfo or %NULL on error
* Free the returned object with g_object_unref() when no longer needed. * or end of enumerator. Free the returned object with
* g_object_unref() when no longer needed.
**/ **/
GFileInfo * GFileInfo *
g_file_enumerator_next_file (GFileEnumerator *enumerator, g_file_enumerator_next_file (GFileEnumerator *enumerator,

View File

@ -619,9 +619,9 @@ g_file_info_has_namespace (GFileInfo *info,
* *
* Lists the file info structure's attributes. * Lists the file info structure's attributes.
* *
* Returns: (array zero-terminated=1) (transfer full): a null-terminated array of strings of all of the * Returns: (nullable) (array zero-terminated=1) (transfer full): a
* possible attribute types for the given @name_space, or * null-terminated array of strings of all of the possible attribute
* %NULL on error. * types for the given @name_space, or %NULL on error.
**/ **/
char ** char **
g_file_info_list_attributes (GFileInfo *info, g_file_info_list_attributes (GFileInfo *info,

View File

@ -203,8 +203,8 @@ g_icon_to_string_tokenized (GIcon *icon, GString *s)
* simply the name (such as `network-server`). * simply the name (such as `network-server`).
* *
* Virtual: to_tokens * Virtual: to_tokens
* Returns: An allocated NUL-terminated UTF8 string or %NULL if @icon can't * Returns: (nullable): An allocated NUL-terminated UTF8 string or
* be serialized. Use g_free() to free. * %NULL if @icon can't be serialized. Use g_free() to free.
* *
* Since: 2.20 * Since: 2.20
*/ */

View File

@ -60,11 +60,12 @@ g_loadable_icon_default_init (GLoadableIconIface *iface)
* g_loadable_icon_load: * g_loadable_icon_load:
* @icon: a #GLoadableIcon. * @icon: a #GLoadableIcon.
* @size: an integer. * @size: an integer.
* @type: (out) (allow-none): a location to store the type of the * @type: (out) (optional): a location to store the type of the loaded
* loaded icon, %NULL to ignore. * icon, %NULL to ignore.
* @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @cancellable: (allow-none): optional #GCancellable object, %NULL to
* @error: a #GError location to store the error occurring, or %NULL to
* ignore. * ignore.
* @error: a #GError location to store the error occurring, or %NULL
* to ignore.
* *
* Loads a loadable icon. For the asynchronous version of this function, * Loads a loadable icon. For the asynchronous version of this function,
* see g_loadable_icon_load_async(). * see g_loadable_icon_load_async().
@ -120,8 +121,8 @@ g_loadable_icon_load_async (GLoadableIcon *icon,
* g_loadable_icon_load_finish: * g_loadable_icon_load_finish:
* @icon: a #GLoadableIcon. * @icon: a #GLoadableIcon.
* @res: a #GAsyncResult. * @res: a #GAsyncResult.
* @type: (out) (allow-none): a location to store the type of the * @type: (out) (optional): a location to store the type of the loaded
* loaded icon, %NULL to ignore. * icon, %NULL to ignore.
* @error: a #GError location to store the error occurring, or %NULL to * @error: a #GError location to store the error occurring, or %NULL to
* ignore. * ignore.
* *

View File

@ -159,8 +159,8 @@ g_pollable_input_stream_default_read_nonblocking (GPollableInputStream *stream,
/** /**
* g_pollable_input_stream_read_nonblocking: * g_pollable_input_stream_read_nonblocking:
* @stream: a #GPollableInputStream * @stream: a #GPollableInputStream
* @buffer: a buffer to read data into (which should be at least @count * @buffer: (array length=count) (element-type guint8): a buffer to
* bytes long). * read data into (which should be at least @count bytes long).
* @count: the number of bytes you want to read * @count: the number of bytes you want to read
* @cancellable: (allow-none): a #GCancellable, or %NULL * @cancellable: (allow-none): a #GCancellable, or %NULL
* @error: #GError for error reporting, or %NULL to ignore. * @error: #GError for error reporting, or %NULL to ignore.

View File

@ -169,7 +169,8 @@ g_pollable_source_new_full (gpointer pollable_stream,
/** /**
* g_pollable_stream_read: * g_pollable_stream_read:
* @stream: a #GInputStream * @stream: a #GInputStream
* @buffer: a buffer to read data into * @buffer: (array length=count) (element-type guint8): a buffer to
* read data into
* @count: the number of bytes to read * @count: the number of bytes to read
* @blocking: whether to do blocking I/O * @blocking: whether to do blocking I/O
* @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.

View File

@ -394,7 +394,7 @@ g_settings_schema_source_get_default (void)
* *
* If the schema isn't found, %NULL is returned. * If the schema isn't found, %NULL is returned.
* *
* Returns: (transfer full): a new #GSettingsSchema * Returns: (nullable) (transfer full): a new #GSettingsSchema
* *
* Since: 2.32 * Since: 2.32
**/ **/

View File

@ -121,7 +121,7 @@ g_tls_client_connection_default_init (GTlsClientConnectionInterface *iface)
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
/** /**
* GTlsClientConnection:accepted-cas: * GTlsClientConnection:accepted-cas: (type GLib.List) (element-type GLib.ByteArray):
* *
* A list of the distinguished names of the Certificate Authorities * A list of the distinguished names of the Certificate Authorities
* that the server will accept client certificates signed by. If the * that the server will accept client certificates signed by. If the

View File

@ -568,7 +568,9 @@ g_tls_database_verify_chain_finish (GTlsDatabase *self,
* and between applications. If a certificate is modified in the database, * and between applications. If a certificate is modified in the database,
* then it is not guaranteed that this handle will continue to point to it. * then it is not guaranteed that this handle will continue to point to it.
* *
* Returns: (allow-none): a newly allocated string containing the handle. * Returns: (nullable): a newly allocated string containing the
* handle.
*
* Since: 2.30 * Since: 2.30
*/ */
gchar* gchar*

View File

@ -641,8 +641,8 @@ g_volume_enumerate_identifiers (GVolume *volume)
* implementations to find the underlying mount to shadow, see * implementations to find the underlying mount to shadow, see
* g_mount_is_shadowed() for more details. * g_mount_is_shadowed() for more details.
* *
* Returns: (transfer full): the activation root of @volume or %NULL. Use * Returns: (nullable) (transfer full): the activation root of @volume
* g_object_unref() to free. * or %NULL. Use g_object_unref() to free.
* *
* Since: 2.18 * Since: 2.18
*/ */