From c1a75ca783f602d3edf465c28918dac7ea57a1e7 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Fri, 11 Mar 2011 09:59:09 +0100 Subject: [PATCH] g_file_info_get/set_attribute_string*(): Document the UTF-8ness. * gio/gfileattribute.c: (_g_file_attribute_value_get_string, _g_file_attribute_value_set_string): These use G_FILE_ATTRIBUTE_TYPE_STRING, which is documented as UTF-8, so document these private functions as using UTF-8. * gio/gfileinfo.c: (g_file_info_get_attribute_string, g_file_info_set_attribute_string, and stringv versions): Document that the strings are UTF-8 because the implementation uses those private functions, that use UTF-8. This helps language bindings (such as glibmm) whose API distinguishes between known and unknown encodings. --- gio/gfileattribute.c | 112 ++++----- gio/gfileinfo.c | 574 +++++++++++++++++++++---------------------- 2 files changed, 343 insertions(+), 343 deletions(-) diff --git a/gio/gfileattribute.c b/gio/gfileattribute.c index 47b942547..88ceb4ce0 100644 --- a/gio/gfileattribute.c +++ b/gio/gfileattribute.c @@ -1,5 +1,5 @@ /* GIO - GLib Input, Output and Streaming Library - * + * * Copyright (C) 2006-2007 Red Hat, Inc. * * This library is free software; you can redistribute it and/or @@ -35,29 +35,29 @@ * @short_description: Key-Value Paired File Attributes * @include: gio/gio.h * @see_also: #GFile, #GFileInfo - * - * File attributes in GIO consist of a list of key-value pairs. - * + * + * File attributes in GIO consist of a list of key-value pairs. + * * Keys are strings that contain a key namespace and a key name, separated * by a colon, e.g. "namespace:keyname". Namespaces are included to sort - * key-value pairs by namespaces for relevance. Keys can be retrived - * using wildcards, e.g. "standard::*" will return all of the keys in the + * key-value pairs by namespaces for relevance. Keys can be retrived + * using wildcards, e.g. "standard::*" will return all of the keys in the * "standard" namespace. - * + * * Values are stored within the list in #GFileAttributeValue structures. * Values can store different types, listed in the enum #GFileAttributeType. - * Upon creation of a #GFileAttributeValue, the type will be set to - * %G_FILE_ATTRIBUTE_TYPE_INVALID. - * + * Upon creation of a #GFileAttributeValue, the type will be set to + * %G_FILE_ATTRIBUTE_TYPE_INVALID. + * * The list of possible attributes for a filesystem (pointed to by a #GFile) is - * availible as a #GFileAttributeInfoList. This list is queryable by key names + * availible as a #GFileAttributeInfoList. This list is queryable by key names * as indicated earlier. - * - * Classes that implement #GFileIface will create a #GFileAttributeInfoList and - * install default keys and values for their given file system, architecture, - * and other possible implementation details (e.g., on a UNIX system, a file + * + * Classes that implement #GFileIface will create a #GFileAttributeInfoList and + * install default keys and values for their given file system, architecture, + * and other possible implementation details (e.g., on a UNIX system, a file * attribute key will be registered for the user id for a given file). - * + * * * * GFileAttributes Default Namespaces @@ -66,29 +66,29 @@ * * * "standard"The "Standard" namespace. General file - * information that any application may need should be put in this namespace. - * Examples include the file's name, type, and size. - * "etag"The "Entity Tag" - * namespace. Currently, the only key in this namespace is "value", which contains + * information that any application may need should be put in this namespace. + * Examples include the file's name, type, and size. + * "etag"The "Entity Tag" + * namespace. Currently, the only key in this namespace is "value", which contains * the value of the current entity tag. - * "id"The "Identification" namespace. This + * "id"The "Identification" namespace. This * namespace is used by file managers and applications that list directories * to check for loops and to uniquely identify files. * "access"The "Access" namespace. Used to check * if a user has the proper privilidges to access files and perform - * file operations. Keys in this namespace are made to be generic - * and easily understood, e.g. the "can_read" key is %TRUE if + * file operations. Keys in this namespace are made to be generic + * and easily understood, e.g. the "can_read" key is %TRUE if * the current user has permission to read the file. UNIX permissions and * NTFS ACLs in Windows should be mapped to these values. - * "mountable"The "Mountable" namespace. Includes + * "mountable"The "Mountable" namespace. Includes * simple boolean keys for checking if a file or path supports mount operations, e.g. * mount, unmount, eject. These are used for files of type %G_FILE_TYPE_MOUNTABLE. - * "time"The "Time" namespace. Includes file + * "time"The "Time" namespace. Includes file * access, changed, created times. * "unix"The "Unix" namespace. Includes UNIX-specific - * information and may not be available for all files. Examples include + * information and may not be available for all files. Examples include * the UNIX "UID", "GID", etc. - * "dos"The "DOS" namespace. Includes DOS-specific + * "dos"The "DOS" namespace. Includes DOS-specific * information and may not be available for all files. Examples include * "is_system" for checking if a file is marked as a system file, and "is_archive" * for checking if a file is marked as an archive file. @@ -96,8 +96,8 @@ * about who owns a file. May not be available for all file systems. Examples include * "user" for getting the user name of the file owner. This information is often mapped from * some backend specific data such as a unix UID. - * "thumbnail"The "Thumbnail" namespace. Includes - * information about file thumbnails and their location within the file system. Exaples of + * "thumbnail"The "Thumbnail" namespace. Includes + * information about file thumbnails and their location within the file system. Exaples of * keys in this namespace include "path" to get the location of a thumbnail, and "failed" * to check if thumbnailing of the file failed. * "filesystem"The "Filesystem" namespace. Gets information @@ -105,14 +105,14 @@ * space is left available, and the overall size of the file system. * "gvfs"The "GVFS" namespace. Keys in this namespace * contain information about the current GVFS backend in use. - * "xattr"The "xattr" namespace. Gets information + * "xattr"The "xattr" namespace. Gets information * about extended user attributes. See attr(5). The "user." prefix of the * extended user attribute name is stripped away when constructing keys in - * this namespace, e.g. "xattr::mime_type" for the extended attribute with + * this namespace, e.g. "xattr::mime_type" for the extended attribute with * the name "user.mime_type". Note that this information is only available * if GLib has been built with extended attribute support. - * "xattr-sys"The "xattr-sys" namespace. - * Gets information about extended attributes which are not user-specific. + * "xattr-sys"The "xattr-sys" namespace. + * Gets information about extended attributes which are not user-specific. * See attr(5). Note that this information is only available if GLib * has been built with extended attribute support. * "selinux"The "SELinux" namespace. Includes @@ -122,14 +122,14 @@ * *
*
- * + * * Please note that these are not all of the possible namespaces. - * More namespaces can be added from GIO modules or by individual applications. + * More namespaces can be added from GIO modules or by individual applications. * For more information about writing GIO modules, see #GIOModule. * - * - * + * * * GFileAttributes Built-in Keys and Value Types * @@ -199,21 +199,21 @@ * %G_FILE_ATTRIBUTE_GVFS_BACKENDgvfs::backendstring * %G_FILE_ATTRIBUTE_SELINUX_CONTEXTselinux::contextstring *
- * - * Note that there are no predefined keys in the "xattr" and "xattr-sys" + * + * Note that there are no predefined keys in the "xattr" and "xattr-sys" * namespaces. Keys for the "xattr" namespace are constructed by stripping * away the "user." prefix from the extended user attribute, and prepending - * "xattr::". Keys for the "xattr-sys" namespace are constructed by + * "xattr::". Keys for the "xattr-sys" namespace are constructed by * concatenating "xattr-sys::" with the extended attribute name. All extended * attribute values are returned as hex-encoded strings in which bytes outside * the ASCII range are encoded as hexadecimal escape sequences of the form * \xnn. - **/ + **/ /* * _g_file_attribute_value_free: - * @attr: a #GFileAttributeValue. - * + * @attr: a #GFileAttributeValue. + * * Frees the memory used by @attr. * **/ @@ -230,9 +230,9 @@ _g_file_attribute_value_free (GFileAttributeValue *attr) * _g_file_attribute_value_clear: * @attr: a #GFileAttributeValue. * - * Clears the value of @attr and sets its type to + * Clears the value of @attr and sets its type to * %G_FILE_ATTRIBUTE_TYPE_INVALID. - * + * **/ void _g_file_attribute_value_clear (GFileAttributeValue *attr) @@ -242,14 +242,14 @@ _g_file_attribute_value_clear (GFileAttributeValue *attr) if (attr->type == G_FILE_ATTRIBUTE_TYPE_STRING || attr->type == G_FILE_ATTRIBUTE_TYPE_BYTE_STRING) g_free (attr->u.string); - + if (attr->type == G_FILE_ATTRIBUTE_TYPE_STRINGV) g_strfreev (attr->u.stringv); if (attr->type == G_FILE_ATTRIBUTE_TYPE_OBJECT && attr->u.obj != NULL) g_object_unref (attr->u.obj); - + attr->type = G_FILE_ATTRIBUTE_TYPE_INVALID; } @@ -257,7 +257,7 @@ _g_file_attribute_value_clear (GFileAttributeValue *attr) * g_file_attribute_value_set: * @attr: a #GFileAttributeValue to set the value in. * @new_value: a #GFileAttributeValue to get the value from. - * + * * Sets an attribute's value from another attribute. **/ void @@ -273,7 +273,7 @@ _g_file_attribute_value_set (GFileAttributeValue *attr, if (attr->type == G_FILE_ATTRIBUTE_TYPE_STRING || attr->type == G_FILE_ATTRIBUTE_TYPE_BYTE_STRING) attr->u.string = g_strdup (attr->u.string); - + if (attr->type == G_FILE_ATTRIBUTE_TYPE_STRINGV) attr->u.stringv = g_strdupv (attr->u.stringv); @@ -284,9 +284,9 @@ _g_file_attribute_value_set (GFileAttributeValue *attr, /* * _g_file_attribute_value_new: - * + * * Creates a new file attribute. - * + * * Returns: a #GFileAttributeValue. **/ GFileAttributeValue * @@ -318,9 +318,9 @@ _g_file_attribute_value_peek_as_pointer (GFileAttributeValue *attr) /* * g_file_attribute_value_dup: * @other: a #GFileAttributeValue to duplicate. - * + * * Duplicates a file attribute. - * + * * Returns: a duplicate of the @other. **/ GFileAttributeValue * @@ -466,7 +466,7 @@ _g_file_attribute_value_as_string (const GFileAttributeValue *attr) * Gets the string from a file attribute value. If the value is not the * right type then %NULL will be returned. * - * Returns: the string value contained within the attribute, or %NULL. + * Returns: the UTF-8 string value contained within the attribute, or %NULL. */ const char * _g_file_attribute_value_get_string (const GFileAttributeValue *attr) @@ -695,9 +695,9 @@ _g_file_attribute_value_set_from_pointer (GFileAttributeValue *value, /* * _g_file_attribute_value_set_string: * @attr: a #GFileAttributeValue. - * @string: a string to set within the type. + * @string: a UTF-8 string to set within the type. * - * Sets the attribute value to a given string. + * Sets the attribute value to a given UTF-8 string. */ void _g_file_attribute_value_set_string (GFileAttributeValue *attr, diff --git a/gio/gfileinfo.c b/gio/gfileinfo.c index 073937bea..41c242d4b 100644 --- a/gio/gfileinfo.c +++ b/gio/gfileinfo.c @@ -1,5 +1,5 @@ /* GIO - GLib Input, Output and Streaming Library - * + * * Copyright (C) 2006-2007 Red Hat, Inc. * * This library is free software; you can redistribute it and/or @@ -100,8 +100,8 @@ static char ***attributes = NULL; /* Attribute ids are 32bit, we split it up like this: * |------------|--------------------| - * 12 bit 20 bit - * namespace attribute id + * 12 bit 20 bit + * namespace attribute id * * This way the attributes gets sorted in namespace order */ @@ -124,7 +124,7 @@ static NSInfo * _lookup_namespace (const char *namespace) { NSInfo *ns_info; - + ns_info = g_hash_table_lookup (ns_hash, namespace); if (ns_info == NULL) { @@ -144,7 +144,7 @@ _lookup_attribute (const char *attribute) char *ns; const char *colon; NSInfo *ns_info; - + attr_id = GPOINTER_TO_UINT (g_hash_table_lookup (attribute_hash, attribute)); if (attr_id != 0) @@ -162,7 +162,7 @@ _lookup_attribute (const char *attribute) id = ++ns_info->attribute_id_counter; attributes[ns_info->id] = g_realloc (attributes[ns_info->id], (id + 1) * sizeof (char *)); attributes[ns_info->id][id] = g_strdup (attribute); - + attr_id = MAKE_ATTR_ID (ns_info->id, id); g_hash_table_insert (attribute_hash, attributes[ns_info->id][id], GUINT_TO_POINTER (attr_id)); @@ -269,16 +269,16 @@ lookup_namespace (const char *namespace) { NSInfo *ns_info; guint32 id; - + G_LOCK (attribute_hash); - + ensure_attribute_hash (); ns_info = _lookup_namespace (namespace); id = 0; if (ns_info) id = ns_info->id; - + G_UNLOCK (attribute_hash); return id; @@ -298,14 +298,14 @@ static guint32 lookup_attribute (const char *attribute) { guint32 attr_id; - + G_LOCK (attribute_hash); ensure_attribute_hash (); attr_id = _lookup_attribute (attribute); - + G_UNLOCK (attribute_hash); - + return attr_id; } @@ -333,7 +333,7 @@ static void g_file_info_class_init (GFileInfoClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - + gobject_class->finalize = g_file_info_finalize; } @@ -347,9 +347,9 @@ g_file_info_init (GFileInfo *info) /** * g_file_info_new: - * + * * Creates a new file info structure. - * + * * Returns: a #GFileInfo. **/ GFileInfo * @@ -362,11 +362,11 @@ g_file_info_new (void) * g_file_info_copy_into: * @src_info: source to copy attributes from. * @dest_info: destination to copy attributes to. - * + * * Copies all of the #GFileAttributes from @src_info to @dest_info. **/ void -g_file_info_copy_into (GFileInfo *src_info, +g_file_info_copy_into (GFileInfo *src_info, GFileInfo *dest_info) { GFileAttribute *source, *dest; @@ -378,13 +378,13 @@ g_file_info_copy_into (GFileInfo *src_info, dest = (GFileAttribute *)dest_info->attributes->data; for (i = 0; i < dest_info->attributes->len; i++) _g_file_attribute_value_clear (&dest[i].value); - + g_array_set_size (dest_info->attributes, src_info->attributes->len); source = (GFileAttribute *)src_info->attributes->data; dest = (GFileAttribute *)dest_info->attributes->data; - + for (i = 0; i < src_info->attributes->len; i++) { dest[i].attribute = source[i].attribute; @@ -404,18 +404,18 @@ g_file_info_copy_into (GFileInfo *src_info, /** * g_file_info_dup: * @other: a #GFileInfo. - * + * * Duplicates a file info structure. - * + * * Returns: (transfer full): a duplicate #GFileInfo of @other. **/ GFileInfo * g_file_info_dup (GFileInfo *other) { GFileInfo *new; - + g_return_val_if_fail (G_IS_FILE_INFO (other), NULL); - + new = g_file_info_new (); g_file_info_copy_into (other, new); return new; @@ -434,9 +434,9 @@ g_file_info_set_attribute_mask (GFileInfo *info, { GFileAttribute *attr; int i; - + g_return_if_fail (G_IS_FILE_INFO (info)); - + if (mask != info->mask) { if (info->mask != NO_ATTRIBUTE_MASK) @@ -461,7 +461,7 @@ g_file_info_set_attribute_mask (GFileInfo *info, /** * g_file_info_unset_attribute_mask: * @info: #GFileInfo. - * + * * Unsets a mask set by g_file_info_set_attribute_mask(), if one * is set. **/ @@ -486,7 +486,7 @@ g_file_info_clear_status (GFileInfo *info) { GFileAttribute *attrs; int i; - + g_return_if_fail (G_IS_FILE_INFO (info)); attrs = (GFileAttribute *)info->attributes->data; @@ -537,7 +537,7 @@ g_file_info_find_value (GFileInfo *info, if (i < info->attributes->len && attrs[i].attribute == attr_id) return &attrs[i].value; - + return NULL; } @@ -555,10 +555,10 @@ g_file_info_find_value_by_name (GFileInfo *info, * g_file_info_has_attribute: * @info: a #GFileInfo. * @attribute: a file attribute key. - * + * * Checks if a file info structure has an attribute named @attribute. - * - * Returns: %TRUE if @Ginfo has an attribute named @attribute, + * + * Returns: %TRUE if @Ginfo has an attribute named @attribute, * %FALSE otherwise. **/ gboolean @@ -614,11 +614,11 @@ g_file_info_has_namespace (GFileInfo *info, * g_file_info_list_attributes: * @info: a #GFileInfo. * @name_space: a file attribute key's namespace. - * + * * Lists the file info structure's attributes. - * - * Returns: (array zero-terminated=1) (transfer full): a null-terminated array of strings of all of the - * possible attribute types for the given @name_space, or + * + * Returns: (array zero-terminated=1) (transfer full): a null-terminated array of strings of all of the + * possible attribute types for the given @name_space, or * %NULL on error. **/ char ** @@ -630,7 +630,7 @@ g_file_info_list_attributes (GFileInfo *info, guint32 attribute; guint32 ns_id = (name_space) ? lookup_namespace (name_space) : 0; int i; - + g_return_val_if_fail (G_IS_FILE_INFO (info), NULL); names = g_ptr_array_new (); @@ -644,7 +644,7 @@ g_file_info_list_attributes (GFileInfo *info, /* NULL terminate */ g_ptr_array_add (names, NULL); - + return (char **)g_ptr_array_free (names, FALSE); } @@ -652,10 +652,10 @@ g_file_info_list_attributes (GFileInfo *info, * g_file_info_get_attribute_type: * @info: a #GFileInfo. * @attribute: a file attribute key. - * + * * Gets the attribute type for an attribute key. - * - * Returns: a #GFileAttributeType for the given @attribute, or + * + * Returns: a #GFileAttributeType for the given @attribute, or * %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set. **/ GFileAttributeType @@ -663,7 +663,7 @@ g_file_info_get_attribute_type (GFileInfo *info, const char *attribute) { GFileAttributeValue *value; - + g_return_val_if_fail (G_IS_FILE_INFO (info), G_FILE_ATTRIBUTE_TYPE_INVALID); g_return_val_if_fail (attribute != NULL && *attribute != '\0', G_FILE_ATTRIBUTE_TYPE_INVALID); @@ -678,7 +678,7 @@ g_file_info_get_attribute_type (GFileInfo *info, * g_file_info_remove_attribute: * @info: a #GFileInfo. * @attribute: a file attribute key. - * + * * Removes all cases of @attribute from @info if it exists. **/ void @@ -693,7 +693,7 @@ g_file_info_remove_attribute (GFileInfo *info, g_return_if_fail (attribute != NULL && *attribute != '\0'); attr_id = lookup_attribute (attribute); - + i = g_file_info_find_place (info, attr_id); attrs = (GFileAttribute *)info->attributes->data; if (i < info->attributes->len && @@ -714,7 +714,7 @@ g_file_info_remove_attribute (GFileInfo *info, * * Gets the attribute type, value and status for an attribute key. * - * Returns: (transfer none): %TRUE if @info has an attribute named @attribute, + * Returns: (transfer none): %TRUE if @info has an attribute named @attribute, * %FALSE otherwise. */ gboolean @@ -738,18 +738,18 @@ g_file_info_get_attribute_data (GFileInfo *info, if (value_pp) *value_pp = _g_file_attribute_value_peek_as_pointer (value); - + return TRUE; } -/** +/** * g_file_info_get_attribute_status: * @info: a #GFileInfo * @attribute: a file attribute key * * Gets the attribute status for an attribute key. * - * Returns: a #GFileAttributeStatus for the given @attribute, or + * Returns: a #GFileAttributeStatus for the given @attribute, or * %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid. * */ @@ -758,7 +758,7 @@ g_file_info_get_attribute_status (GFileInfo *info, const char *attribute) { GFileAttributeValue *val; - + g_return_val_if_fail (G_IS_FILE_INFO (info), 0); g_return_val_if_fail (attribute != NULL && *attribute != '\0', 0); @@ -809,7 +809,7 @@ g_file_info_set_attribute_status (GFileInfo *info, GFileAttributeValue * _g_file_info_get_attribute_value (GFileInfo *info, const char *attribute) - + { g_return_val_if_fail (G_IS_FILE_INFO (info), NULL); g_return_val_if_fail (attribute != NULL && *attribute != '\0', NULL); @@ -821,11 +821,11 @@ _g_file_info_get_attribute_value (GFileInfo *info, * g_file_info_get_attribute_as_string: * @info: a #GFileInfo. * @attribute: a file attribute key. - * + * * Gets the value of a attribute, formated as a string. * This escapes things as needed to make the string valid * utf8. - * + * * Returns: a UTF-8 string associated with the given @attribute. * When you're done with the string it must be freed with g_free(). **/ @@ -835,7 +835,7 @@ g_file_info_get_attribute_as_string (GFileInfo *info, { GFileAttributeValue *val; val = _g_file_info_get_attribute_value (info, attribute); - if (val) + if (val) return _g_file_attribute_value_as_string (val); return NULL; } @@ -845,10 +845,10 @@ g_file_info_get_attribute_as_string (GFileInfo *info, * g_file_info_get_attribute_object: * @info: a #GFileInfo. * @attribute: a file attribute key. - * - * Gets the value of a #GObject attribute. If the attribute does + * + * Gets the value of a #GObject attribute. If the attribute does * not contain a #GObject, %NULL will be returned. - * + * * Returns: (transfer none): a #GObject associated with the given @attribute, or * %NULL otherwise. **/ @@ -857,7 +857,7 @@ g_file_info_get_attribute_object (GFileInfo *info, const char *attribute) { GFileAttributeValue *value; - + g_return_val_if_fail (G_IS_FILE_INFO (info), NULL); g_return_val_if_fail (attribute != NULL && *attribute != '\0', NULL); @@ -869,11 +869,11 @@ g_file_info_get_attribute_object (GFileInfo *info, * g_file_info_get_attribute_string: * @info: a #GFileInfo. * @attribute: a file attribute key. - * - * Gets the value of a string attribute. If the attribute does + * + * Gets the value of a string attribute. If the attribute does * not contain a string, %NULL will be returned. - * - * Returns: the contents of the @attribute value as a string, or + * + * Returns: the contents of the @attribute value as a UTF-8 string, or * %NULL otherwise. **/ const char * @@ -881,7 +881,7 @@ g_file_info_get_attribute_string (GFileInfo *info, const char *attribute) { GFileAttributeValue *value; - + g_return_val_if_fail (G_IS_FILE_INFO (info), NULL); g_return_val_if_fail (attribute != NULL && *attribute != '\0', NULL); @@ -893,11 +893,11 @@ g_file_info_get_attribute_string (GFileInfo *info, * g_file_info_get_attribute_byte_string: * @info: a #GFileInfo. * @attribute: a file attribute key. - * - * Gets the value of a byte string attribute. If the attribute does + * + * Gets the value of a byte string attribute. If the attribute does * not contain a byte string, %NULL will be returned. - * - * Returns: the contents of the @attribute value as a byte string, or + * + * Returns: the contents of the @attribute value as a byte string, or * %NULL otherwise. **/ const char * @@ -905,7 +905,7 @@ g_file_info_get_attribute_byte_string (GFileInfo *info, const char *attribute) { GFileAttributeValue *value; - + g_return_val_if_fail (G_IS_FILE_INFO (info), NULL); g_return_val_if_fail (attribute != NULL && *attribute != '\0', NULL); @@ -922,7 +922,7 @@ g_file_info_get_attribute_byte_string (GFileInfo *info, * not contain a stringv, %NULL will be returned. * * Returns: (transfer none): the contents of the @attribute value as a stringv, or - * %NULL otherwise. Do not free. + * %NULL otherwise. Do not free. These returned strings are UTF-8. * * Since: 2.22 **/ @@ -943,18 +943,18 @@ g_file_info_get_attribute_stringv (GFileInfo *info, * g_file_info_get_attribute_boolean: * @info: a #GFileInfo. * @attribute: a file attribute key. - * + * * Gets the value of a boolean attribute. If the attribute does not * contain a boolean value, %FALSE will be returned. - * - * Returns: the boolean value contained within the attribute. + * + * Returns: the boolean value contained within the attribute. **/ gboolean g_file_info_get_attribute_boolean (GFileInfo *info, const char *attribute) { GFileAttributeValue *value; - + g_return_val_if_fail (G_IS_FILE_INFO (info), FALSE); g_return_val_if_fail (attribute != NULL && *attribute != '\0', FALSE); @@ -966,19 +966,19 @@ g_file_info_get_attribute_boolean (GFileInfo *info, * g_file_info_get_attribute_uint32: * @info: a #GFileInfo. * @attribute: a file attribute key. - * - * Gets an unsigned 32-bit integer contained within the attribute. If the - * attribute does not contain an unsigned 32-bit integer, or is invalid, + * + * Gets an unsigned 32-bit integer contained within the attribute. If the + * attribute does not contain an unsigned 32-bit integer, or is invalid, * 0 will be returned. - * - * Returns: an unsigned 32-bit integer from the attribute. + * + * Returns: an unsigned 32-bit integer from the attribute. **/ guint32 g_file_info_get_attribute_uint32 (GFileInfo *info, const char *attribute) { GFileAttributeValue *value; - + g_return_val_if_fail (G_IS_FILE_INFO (info), 0); g_return_val_if_fail (attribute != NULL && *attribute != '\0', 0); @@ -990,11 +990,11 @@ g_file_info_get_attribute_uint32 (GFileInfo *info, * g_file_info_get_attribute_int32: * @info: a #GFileInfo. * @attribute: a file attribute key. - * - * Gets a signed 32-bit integer contained within the attribute. If the - * attribute does not contain a signed 32-bit integer, or is invalid, + * + * Gets a signed 32-bit integer contained within the attribute. If the + * attribute does not contain a signed 32-bit integer, or is invalid, * 0 will be returned. - * + * * Returns: a signed 32-bit integer from the attribute. **/ gint32 @@ -1014,12 +1014,12 @@ g_file_info_get_attribute_int32 (GFileInfo *info, * g_file_info_get_attribute_uint64: * @info: a #GFileInfo. * @attribute: a file attribute key. - * - * Gets a unsigned 64-bit integer contained within the attribute. If the - * attribute does not contain an unsigned 64-bit integer, or is invalid, + * + * Gets a unsigned 64-bit integer contained within the attribute. If the + * attribute does not contain an unsigned 64-bit integer, or is invalid, * 0 will be returned. - * - * Returns: a unsigned 64-bit integer from the attribute. + * + * Returns: a unsigned 64-bit integer from the attribute. **/ guint64 g_file_info_get_attribute_uint64 (GFileInfo *info, @@ -1038,12 +1038,12 @@ g_file_info_get_attribute_uint64 (GFileInfo *info, * g_file_info_get_attribute_int64: * @info: a #GFileInfo. * @attribute: a file attribute key. - * - * Gets a signed 64-bit integer contained within the attribute. If the - * attribute does not contain an signed 64-bit integer, or is invalid, + * + * Gets a signed 64-bit integer contained within the attribute. If the + * attribute does not contain an signed 64-bit integer, or is invalid, * 0 will be returned. - * - * Returns: a signed 64-bit integer from the attribute. + * + * Returns: a signed 64-bit integer from the attribute. **/ gint64 g_file_info_get_attribute_int64 (GFileInfo *info, @@ -1068,9 +1068,9 @@ g_file_info_create_value (GFileInfo *info, if (info->mask != NO_ATTRIBUTE_MASK && !_g_file_attribute_matcher_matches_id (info->mask, attr_id)) return NULL; - + i = g_file_info_find_place (info, attr_id); - + attrs = (GFileAttribute *)info->attributes->data; if (i < info->attributes->len && attrs[i].attribute == attr_id) @@ -1106,7 +1106,7 @@ _g_file_info_set_attribute_by_id (GFileInfo *info, * @attribute: a file attribute key. * @type: a #GFileAttributeType * @value_p: pointer to the value - * + * * Sets the @attribute to contain the given value, if possible. **/ void @@ -1138,8 +1138,8 @@ _g_file_info_set_attribute_object_by_id (GFileInfo *info, * @info: a #GFileInfo. * @attribute: a file attribute key. * @attr_value: a #GObject. - * - * Sets the @attribute to contain the given @attr_value, + * + * Sets the @attribute to contain the given @attr_value, * if possible. **/ void @@ -1171,8 +1171,8 @@ _g_file_info_set_attribute_stringv_by_id (GFileInfo *info, /** * g_file_info_set_attribute_stringv: * @info: a #GFileInfo. - * @attribute: a file attribute key. - * @attr_value: a %NULL terminated string array + * @attribute: a file attribute key + * @attr_value: a %NULL terminated array of UTF-8 strings. * * Sets the @attribute to contain the given @attr_value, * if possible. @@ -1188,7 +1188,7 @@ g_file_info_set_attribute_stringv (GFileInfo *info, g_return_if_fail (attribute != NULL && *attribute != '\0'); g_return_if_fail (attr_value != NULL); - _g_file_info_set_attribute_stringv_by_id (info, + _g_file_info_set_attribute_stringv_by_id (info, lookup_attribute (attribute), attr_value); } @@ -1209,9 +1209,9 @@ _g_file_info_set_attribute_string_by_id (GFileInfo *info, * g_file_info_set_attribute_string: * @info: a #GFileInfo. * @attribute: a file attribute key. - * @attr_value: a string. - * - * Sets the @attribute to contain the given @attr_value, + * @attr_value: a UTF-8 string. + * + * Sets the @attribute to contain the given @attr_value, * if possible. **/ void @@ -1245,8 +1245,8 @@ _g_file_info_set_attribute_byte_string_by_id (GFileInfo *info, * @info: a #GFileInfo. * @attribute: a file attribute key. * @attr_value: a byte string. - * - * Sets the @attribute to contain the given @attr_value, + * + * Sets the @attribute to contain the given @attr_value, * if possible. **/ void @@ -1280,8 +1280,8 @@ _g_file_info_set_attribute_boolean_by_id (GFileInfo *info, * @info: a #GFileInfo. * @attribute: a file attribute key. * @attr_value: a boolean value. - * - * Sets the @attribute to contain the given @attr_value, + * + * Sets the @attribute to contain the given @attr_value, * if possible. **/ void @@ -1314,8 +1314,8 @@ _g_file_info_set_attribute_uint32_by_id (GFileInfo *info, * @info: a #GFileInfo. * @attribute: a file attribute key. * @attr_value: an unsigned 32-bit integer. - * - * Sets the @attribute to contain the given @attr_value, + * + * Sets the @attribute to contain the given @attr_value, * if possible. **/ void @@ -1348,8 +1348,8 @@ _g_file_info_set_attribute_int32_by_id (GFileInfo *info, * @info: a #GFileInfo. * @attribute: a file attribute key. * @attr_value: a signed 32-bit integer - * - * Sets the @attribute to contain the given @attr_value, + * + * Sets the @attribute to contain the given @attr_value, * if possible. **/ void @@ -1382,8 +1382,8 @@ _g_file_info_set_attribute_uint64_by_id (GFileInfo *info, * @info: a #GFileInfo. * @attribute: a file attribute key. * @attr_value: an unsigned 64-bit integer. - * - * Sets the @attribute to contain the given @attr_value, + * + * Sets the @attribute to contain the given @attr_value, * if possible. **/ void @@ -1416,10 +1416,10 @@ _g_file_info_set_attribute_int64_by_id (GFileInfo *info, * @info: a #GFileInfo. * @attribute: attribute name to set. * @attr_value: int64 value to set attribute to. - * - * Sets the @attribute to contain the given @attr_value, + * + * Sets the @attribute to contain the given @attr_value, * if possible. - * + * **/ void g_file_info_set_attribute_int64 (GFileInfo *info, @@ -1438,10 +1438,10 @@ g_file_info_set_attribute_int64 (GFileInfo *info, /** * g_file_info_get_file_type: * @info: a #GFileInfo. - * - * Gets a file's type (whether it is a regular file, symlink, etc). + * + * Gets a file's type (whether it is a regular file, symlink, etc). * This is different from the file's content type, see g_file_info_get_content_type(). - * + * * Returns: a #GFileType for the given file. **/ GFileType @@ -1451,10 +1451,10 @@ g_file_info_get_file_type (GFileInfo *info) GFileAttributeValue *value; g_return_val_if_fail (G_IS_FILE_INFO (info), G_FILE_TYPE_UNKNOWN); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_STANDARD_TYPE); - + value = g_file_info_find_value (info, attr); return (GFileType)_g_file_attribute_value_get_uint32 (value); } @@ -1462,9 +1462,9 @@ g_file_info_get_file_type (GFileInfo *info) /** * g_file_info_get_is_hidden: * @info: a #GFileInfo. - * + * * Checks if a file is hidden. - * + * * Returns: %TRUE if the file is a hidden file, %FALSE otherwise. **/ gboolean @@ -1472,12 +1472,12 @@ g_file_info_get_is_hidden (GFileInfo *info) { static guint32 attr = 0; GFileAttributeValue *value; - + g_return_val_if_fail (G_IS_FILE_INFO (info), FALSE); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN); - + value = g_file_info_find_value (info, attr); return (GFileType)_g_file_attribute_value_get_boolean (value); } @@ -1485,9 +1485,9 @@ g_file_info_get_is_hidden (GFileInfo *info) /** * g_file_info_get_is_backup: * @info: a #GFileInfo. - * + * * Checks if a file is a backup file. - * + * * Returns: %TRUE if file is a backup file, %FALSE otherwise. **/ gboolean @@ -1495,12 +1495,12 @@ g_file_info_get_is_backup (GFileInfo *info) { static guint32 attr = 0; GFileAttributeValue *value; - + g_return_val_if_fail (G_IS_FILE_INFO (info), FALSE); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP); - + value = g_file_info_find_value (info, attr); return (GFileType)_g_file_attribute_value_get_boolean (value); } @@ -1508,9 +1508,9 @@ g_file_info_get_is_backup (GFileInfo *info) /** * g_file_info_get_is_symlink: * @info: a #GFileInfo. - * + * * Checks if a file is a symlink. - * + * * Returns: %TRUE if the given @info is a symlink. **/ gboolean @@ -1518,12 +1518,12 @@ g_file_info_get_is_symlink (GFileInfo *info) { static guint32 attr = 0; GFileAttributeValue *value; - + g_return_val_if_fail (G_IS_FILE_INFO (info), FALSE); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK); - + value = g_file_info_find_value (info, attr); return (GFileType)_g_file_attribute_value_get_boolean (value); } @@ -1531,9 +1531,9 @@ g_file_info_get_is_symlink (GFileInfo *info) /** * g_file_info_get_name: * @info: a #GFileInfo. - * + * * Gets the name for a file. - * + * * Returns: a string containing the file name. **/ const char * @@ -1541,12 +1541,12 @@ g_file_info_get_name (GFileInfo *info) { static guint32 attr = 0; GFileAttributeValue *value; - + g_return_val_if_fail (G_IS_FILE_INFO (info), NULL); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_STANDARD_NAME); - + value = g_file_info_find_value (info, attr); return _g_file_attribute_value_get_byte_string (value); } @@ -1554,9 +1554,9 @@ g_file_info_get_name (GFileInfo *info) /** * g_file_info_get_display_name: * @info: a #GFileInfo. - * + * * Gets a display name for a file. - * + * * Returns: a string containing the display name. **/ const char * @@ -1564,12 +1564,12 @@ g_file_info_get_display_name (GFileInfo *info) { static guint32 attr = 0; GFileAttributeValue *value; - + g_return_val_if_fail (G_IS_FILE_INFO (info), NULL); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME); - + value = g_file_info_find_value (info, attr); return _g_file_attribute_value_get_string (value); } @@ -1577,9 +1577,9 @@ g_file_info_get_display_name (GFileInfo *info) /** * g_file_info_get_edit_name: * @info: a #GFileInfo. - * + * * Gets the edit name for a file. - * + * * Returns: a string containing the edit name. **/ const char * @@ -1587,12 +1587,12 @@ g_file_info_get_edit_name (GFileInfo *info) { static guint32 attr = 0; GFileAttributeValue *value; - + g_return_val_if_fail (G_IS_FILE_INFO (info), NULL); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME); - + value = g_file_info_find_value (info, attr); return _g_file_attribute_value_get_string (value); } @@ -1600,9 +1600,9 @@ g_file_info_get_edit_name (GFileInfo *info) /** * g_file_info_get_icon: * @info: a #GFileInfo. - * + * * Gets the icon for a file. - * + * * Returns: (transfer none): #GIcon for the given @info. **/ GIcon * @@ -1611,12 +1611,12 @@ g_file_info_get_icon (GFileInfo *info) static guint32 attr = 0; GFileAttributeValue *value; GObject *obj; - + g_return_val_if_fail (G_IS_FILE_INFO (info), NULL); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_STANDARD_ICON); - + value = g_file_info_find_value (info, attr); obj = _g_file_attribute_value_get_object (value); if (G_IS_ICON (obj)) @@ -1627,9 +1627,9 @@ g_file_info_get_icon (GFileInfo *info) /** * g_file_info_get_content_type: * @info: a #GFileInfo. - * + * * Gets the file's content type. - * + * * Returns: a string containing the file's content type. **/ const char * @@ -1637,12 +1637,12 @@ g_file_info_get_content_type (GFileInfo *info) { static guint32 attr = 0; GFileAttributeValue *value; - + g_return_val_if_fail (G_IS_FILE_INFO (info), NULL); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE); - + value = g_file_info_find_value (info, attr); return _g_file_attribute_value_get_string (value); } @@ -1650,22 +1650,22 @@ g_file_info_get_content_type (GFileInfo *info) /** * g_file_info_get_size: * @info: a #GFileInfo. - * + * * Gets the file's size. - * - * Returns: a #goffset containing the file's size. + * + * Returns: a #goffset containing the file's size. **/ goffset g_file_info_get_size (GFileInfo *info) { static guint32 attr = 0; GFileAttributeValue *value; - + g_return_val_if_fail (G_IS_FILE_INFO (info), (goffset) 0); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_STANDARD_SIZE); - + value = g_file_info_find_value (info, attr); return (goffset) _g_file_attribute_value_get_uint64 (value); } @@ -1674,7 +1674,7 @@ g_file_info_get_size (GFileInfo *info) * g_file_info_get_modification_time: * @info: a #GFileInfo. * @result: a #GTimeVal. - * + * * Gets the modification time of the current @info and sets it * in @result. **/ @@ -1687,13 +1687,13 @@ g_file_info_get_modification_time (GFileInfo *info, g_return_if_fail (G_IS_FILE_INFO (info)); g_return_if_fail (result != NULL); - + if (attr_mtime == 0) { attr_mtime = lookup_attribute (G_FILE_ATTRIBUTE_TIME_MODIFIED); attr_mtime_usec = lookup_attribute (G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC); } - + value = g_file_info_find_value (info, attr_mtime); result->tv_sec = _g_file_attribute_value_get_uint64 (value); value = g_file_info_find_value (info, attr_mtime_usec); @@ -1703,9 +1703,9 @@ g_file_info_get_modification_time (GFileInfo *info, /** * g_file_info_get_symlink_target: * @info: a #GFileInfo. - * + * * Gets the symlink target for a given #GFileInfo. - * + * * Returns: a string containing the symlink target. **/ const char * @@ -1713,12 +1713,12 @@ g_file_info_get_symlink_target (GFileInfo *info) { static guint32 attr = 0; GFileAttributeValue *value; - + g_return_val_if_fail (G_IS_FILE_INFO (info), NULL); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET); - + value = g_file_info_find_value (info, attr); return _g_file_attribute_value_get_byte_string (value); } @@ -1726,10 +1726,10 @@ g_file_info_get_symlink_target (GFileInfo *info) /** * g_file_info_get_etag: * @info: a #GFileInfo. - * - * Gets the entity tag for a given + * + * Gets the entity tag for a given * #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE. - * + * * Returns: a string containing the value of the "etag:value" attribute. **/ const char * @@ -1737,12 +1737,12 @@ g_file_info_get_etag (GFileInfo *info) { static guint32 attr = 0; GFileAttributeValue *value; - + g_return_val_if_fail (G_IS_FILE_INFO (info), NULL); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_ETAG_VALUE); - + value = g_file_info_find_value (info, attr); return _g_file_attribute_value_get_string (value); } @@ -1750,10 +1750,10 @@ g_file_info_get_etag (GFileInfo *info) /** * g_file_info_get_sort_order: * @info: a #GFileInfo. - * + * * Gets the value of the sort_order attribute from the #GFileInfo. * See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER. - * + * * Returns: a #gint32 containing the value of the "standard::sort_order" attribute. **/ gint32 @@ -1761,12 +1761,12 @@ g_file_info_get_sort_order (GFileInfo *info) { static guint32 attr = 0; GFileAttributeValue *value; - + g_return_val_if_fail (G_IS_FILE_INFO (info), 0); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER); - + value = g_file_info_find_value (info, attr); return _g_file_attribute_value_get_int32 (value); } @@ -1776,7 +1776,7 @@ g_file_info_get_sort_order (GFileInfo *info) * g_file_info_set_file_type: * @info: a #GFileInfo. * @type: a #GFileType. - * + * * Sets the file type in a #GFileInfo to @type. * See %G_FILE_ATTRIBUTE_STANDARD_TYPE. **/ @@ -1786,12 +1786,12 @@ g_file_info_set_file_type (GFileInfo *info, { static guint32 attr = 0; GFileAttributeValue *value; - + g_return_if_fail (G_IS_FILE_INFO (info)); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_STANDARD_TYPE); - + value = g_file_info_create_value (info, attr); if (value) _g_file_attribute_value_set_uint32 (value, type); @@ -1801,7 +1801,7 @@ g_file_info_set_file_type (GFileInfo *info, * g_file_info_set_is_hidden: * @info: a #GFileInfo. * @is_hidden: a #gboolean. - * + * * Sets the "is_hidden" attribute in a #GFileInfo according to @is_symlink. * See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN. **/ @@ -1811,12 +1811,12 @@ g_file_info_set_is_hidden (GFileInfo *info, { static guint32 attr = 0; GFileAttributeValue *value; - + g_return_if_fail (G_IS_FILE_INFO (info)); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN); - + value = g_file_info_create_value (info, attr); if (value) _g_file_attribute_value_set_boolean (value, is_hidden); @@ -1826,7 +1826,7 @@ g_file_info_set_is_hidden (GFileInfo *info, * g_file_info_set_is_symlink: * @info: a #GFileInfo. * @is_symlink: a #gboolean. - * + * * Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink. * See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK. **/ @@ -1836,12 +1836,12 @@ g_file_info_set_is_symlink (GFileInfo *info, { static guint32 attr = 0; GFileAttributeValue *value; - + g_return_if_fail (G_IS_FILE_INFO (info)); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK); - + value = g_file_info_create_value (info, attr); if (value) _g_file_attribute_value_set_boolean (value, is_symlink); @@ -1851,8 +1851,8 @@ g_file_info_set_is_symlink (GFileInfo *info, * g_file_info_set_name: * @info: a #GFileInfo. * @name: a string containing a name. - * - * Sets the name attribute for the current #GFileInfo. + * + * Sets the name attribute for the current #GFileInfo. * See %G_FILE_ATTRIBUTE_STANDARD_NAME. **/ void @@ -1861,13 +1861,13 @@ g_file_info_set_name (GFileInfo *info, { static guint32 attr = 0; GFileAttributeValue *value; - + g_return_if_fail (G_IS_FILE_INFO (info)); g_return_if_fail (name != NULL); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_STANDARD_NAME); - + value = g_file_info_create_value (info, attr); if (value) _g_file_attribute_value_set_byte_string (value, name); @@ -1877,7 +1877,7 @@ g_file_info_set_name (GFileInfo *info, * g_file_info_set_display_name: * @info: a #GFileInfo. * @display_name: a string containing a display name. - * + * * Sets the display name for the current #GFileInfo. * See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME. **/ @@ -1887,13 +1887,13 @@ g_file_info_set_display_name (GFileInfo *info, { static guint32 attr = 0; GFileAttributeValue *value; - + g_return_if_fail (G_IS_FILE_INFO (info)); g_return_if_fail (display_name != NULL); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME); - + value = g_file_info_create_value (info, attr); if (value) _g_file_attribute_value_set_string (value, display_name); @@ -1903,7 +1903,7 @@ g_file_info_set_display_name (GFileInfo *info, * g_file_info_set_edit_name: * @info: a #GFileInfo. * @edit_name: a string containing an edit name. - * + * * Sets the edit name for the current file. * See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME. **/ @@ -1913,13 +1913,13 @@ g_file_info_set_edit_name (GFileInfo *info, { static guint32 attr = 0; GFileAttributeValue *value; - + g_return_if_fail (G_IS_FILE_INFO (info)); g_return_if_fail (edit_name != NULL); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME); - + value = g_file_info_create_value (info, attr); if (value) _g_file_attribute_value_set_string (value, edit_name); @@ -1929,8 +1929,8 @@ g_file_info_set_edit_name (GFileInfo *info, * g_file_info_set_icon: * @info: a #GFileInfo. * @icon: a #GIcon. - * - * Sets the icon for a given #GFileInfo. + * + * Sets the icon for a given #GFileInfo. * See %G_FILE_ATTRIBUTE_STANDARD_ICON. **/ void @@ -1939,13 +1939,13 @@ g_file_info_set_icon (GFileInfo *info, { static guint32 attr = 0; GFileAttributeValue *value; - + g_return_if_fail (G_IS_FILE_INFO (info)); g_return_if_fail (G_IS_ICON (icon)); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_STANDARD_ICON); - + value = g_file_info_create_value (info, attr); if (value) _g_file_attribute_value_set_object (value, G_OBJECT (icon)); @@ -1955,7 +1955,7 @@ g_file_info_set_icon (GFileInfo *info, * g_file_info_set_content_type: * @info: a #GFileInfo. * @content_type: a content type. See #GContentType. - * + * * Sets the content type attribute for a given #GFileInfo. * See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE. **/ @@ -1965,13 +1965,13 @@ g_file_info_set_content_type (GFileInfo *info, { static guint32 attr = 0; GFileAttributeValue *value; - + g_return_if_fail (G_IS_FILE_INFO (info)); g_return_if_fail (content_type != NULL); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE); - + value = g_file_info_create_value (info, attr); if (value) _g_file_attribute_value_set_string (value, content_type); @@ -1981,8 +1981,8 @@ g_file_info_set_content_type (GFileInfo *info, * g_file_info_set_size: * @info: a #GFileInfo. * @size: a #goffset containing the file's size. - * - * Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info + * + * Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info * to the given size. **/ void @@ -1991,12 +1991,12 @@ g_file_info_set_size (GFileInfo *info, { static guint32 attr = 0; GFileAttributeValue *value; - + g_return_if_fail (G_IS_FILE_INFO (info)); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_STANDARD_SIZE); - + value = g_file_info_create_value (info, attr); if (value) _g_file_attribute_value_set_uint64 (value, size); @@ -2006,7 +2006,7 @@ g_file_info_set_size (GFileInfo *info, * g_file_info_set_modification_time * @info: a #GFileInfo. * @mtime: a #GTimeVal. - * + * * Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file * info to the given time value. **/ @@ -2016,16 +2016,16 @@ g_file_info_set_modification_time (GFileInfo *info, { static guint32 attr_mtime = 0, attr_mtime_usec; GFileAttributeValue *value; - + g_return_if_fail (G_IS_FILE_INFO (info)); g_return_if_fail (mtime != NULL); - + if (attr_mtime == 0) { attr_mtime = lookup_attribute (G_FILE_ATTRIBUTE_TIME_MODIFIED); attr_mtime_usec = lookup_attribute (G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC); } - + value = g_file_info_create_value (info, attr_mtime); if (value) _g_file_attribute_value_set_uint64 (value, mtime->tv_sec); @@ -2038,8 +2038,8 @@ g_file_info_set_modification_time (GFileInfo *info, * g_file_info_set_symlink_target: * @info: a #GFileInfo. * @symlink_target: a static string containing a path to a symlink target. - * - * Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info + * + * Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info * to the given symlink target. **/ void @@ -2048,13 +2048,13 @@ g_file_info_set_symlink_target (GFileInfo *info, { static guint32 attr = 0; GFileAttributeValue *value; - + g_return_if_fail (G_IS_FILE_INFO (info)); g_return_if_fail (symlink_target != NULL); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET); - + value = g_file_info_create_value (info, attr); if (value) _g_file_attribute_value_set_byte_string (value, symlink_target); @@ -2064,8 +2064,8 @@ g_file_info_set_symlink_target (GFileInfo *info, * g_file_info_set_sort_order: * @info: a #GFileInfo. * @sort_order: a sort order integer. - * - * Sets the sort order attribute in the file info structure. See + * + * Sets the sort order attribute in the file info structure. See * %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER. **/ void @@ -2074,12 +2074,12 @@ g_file_info_set_sort_order (GFileInfo *info, { static guint32 attr = 0; GFileAttributeValue *value; - + g_return_if_fail (G_IS_FILE_INFO (info)); - + if (attr == 0) attr = lookup_attribute (G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER); - + value = g_file_info_create_value (info, attr); if (value) _g_file_attribute_value_set_int32 (value, sort_order); @@ -2122,7 +2122,7 @@ matcher_add (GFileAttributeMatcher *matcher, matcher->sub_matchers[i].mask = mask; return; } - + /* Already added */ if (matcher->sub_matchers[i].id == id && matcher->sub_matchers[i].mask == mask) @@ -2131,7 +2131,7 @@ matcher_add (GFileAttributeMatcher *matcher, if (matcher->more_sub_matchers == NULL) matcher->more_sub_matchers = g_array_new (FALSE, FALSE, sizeof (SubMatcher)); - + sub_matchers = (SubMatcher *)matcher->more_sub_matchers->data; for (i = 0; i < matcher->more_sub_matchers->len; i++) { @@ -2143,7 +2143,7 @@ matcher_add (GFileAttributeMatcher *matcher, s.id = id; s.mask = mask; - + g_array_append_val (matcher->more_sub_matchers, s); } @@ -2154,19 +2154,19 @@ G_DEFINE_BOXED_TYPE (GFileAttributeMatcher, g_file_attribute_matcher, /** * g_file_attribute_matcher_new: * @attributes: an attribute string to match. - * - * Creates a new file attribute matcher, which matches attributes - * against a given string. #GFileAttributeMatchers are reference - * counted structures, and are created with a reference count of 1. If - * the number of references falls to 0, the #GFileAttributeMatcher is + * + * Creates a new file attribute matcher, which matches attributes + * against a given string. #GFileAttributeMatchers are reference + * counted structures, and are created with a reference count of 1. If + * the number of references falls to 0, the #GFileAttributeMatcher is * automatically destroyed. - * + * * The @attribute string should be formatted with specific keys separated - * from namespaces with a double colon. Several "namespace::key" strings may be - * concatenated with a single comma (e.g. "standard::type,standard::is-hidden"). - * The wildcard "*" may be used to match all keys and namespaces, or - * "namespace::*" will match all keys in a given namespace. - * + * from namespaces with a double colon. Several "namespace::key" strings may be + * concatenated with a single comma (e.g. "standard::type,standard::is-hidden"). + * The wildcard "*" may be used to match all keys and namespaces, or + * "namespace::*" will match all keys in a given namespace. + * * Examples of strings to use: * * File Attribute Matcher strings and results @@ -2179,7 +2179,7 @@ G_DEFINE_BOXED_TYPE (GFileAttributeMatcher, g_file_attribute_matcher, * all keys in the unix namespace. * *
- * + * * Returns: a #GFileAttributeMatcher. **/ GFileAttributeMatcher * @@ -2205,7 +2205,7 @@ g_file_attribute_matcher_new (const char *attributes) else { guint32 id, mask; - + colon = strstr (split[i], "::"); if (colon != NULL && !(colon[2] == 0 || @@ -2223,7 +2223,7 @@ g_file_attribute_matcher_new (const char *attributes) id = lookup_namespace (split[i]) << NS_POS; mask = NS_MASK << NS_POS; } - + matcher_add (matcher, id, mask); } } @@ -2236,9 +2236,9 @@ g_file_attribute_matcher_new (const char *attributes) /** * g_file_attribute_matcher_ref: * @matcher: a #GFileAttributeMatcher. - * + * * References a file attribute matcher. - * + * * Returns: a #GFileAttributeMatcher. **/ GFileAttributeMatcher * @@ -2255,10 +2255,10 @@ g_file_attribute_matcher_ref (GFileAttributeMatcher *matcher) /** * g_file_attribute_matcher_unref: * @matcher: a #GFileAttributeMatcher. - * - * Unreferences @matcher. If the reference count falls below 1, + * + * Unreferences @matcher. If the reference count falls below 1, * the @matcher is automatically freed. - * + * **/ void g_file_attribute_matcher_unref (GFileAttributeMatcher *matcher) @@ -2266,12 +2266,12 @@ g_file_attribute_matcher_unref (GFileAttributeMatcher *matcher) if (matcher) { g_return_if_fail (matcher->ref > 0); - + if (g_atomic_int_dec_and_test (&matcher->ref)) { if (matcher->more_sub_matchers) g_array_free (matcher->more_sub_matchers, TRUE); - + g_free (matcher); } } @@ -2281,10 +2281,10 @@ g_file_attribute_matcher_unref (GFileAttributeMatcher *matcher) * g_file_attribute_matcher_matches_only: * @matcher: a #GFileAttributeMatcher. * @attribute: a file attribute key. - * + * * Checks if a attribute matcher only matches a given attribute. Always * returns %FALSE if "*" was used when creating the matcher. - * + * * Returns: %TRUE if the matcher only matches @attribute. %FALSE otherwise. **/ gboolean @@ -2298,7 +2298,7 @@ g_file_attribute_matcher_matches_only (GFileAttributeMatcher *matcher, if (matcher == NULL || matcher->all) return FALSE; - + id = lookup_attribute (attribute); if (matcher->sub_matchers[0].id != 0 && @@ -2306,7 +2306,7 @@ g_file_attribute_matcher_matches_only (GFileAttributeMatcher *matcher, matcher->sub_matchers[0].mask == 0xffffffff && matcher->sub_matchers[0].id == id) return TRUE; - + return FALSE; } @@ -2316,12 +2316,12 @@ matcher_matches_id (GFileAttributeMatcher *matcher, { SubMatcher *sub_matchers; int i; - + for (i = 0; i < ON_STACK_MATCHERS; i++) { if (matcher->sub_matchers[i].id == 0) return FALSE; - + if (matcher->sub_matchers[i].id == (id & matcher->sub_matchers[i].mask)) return TRUE; } @@ -2335,7 +2335,7 @@ matcher_matches_id (GFileAttributeMatcher *matcher, return TRUE; } } - + return FALSE; } @@ -2346,10 +2346,10 @@ _g_file_attribute_matcher_matches_id (GFileAttributeMatcher *matcher, /* We return a NULL matcher for an empty match string, so handle this */ if (matcher == NULL) return FALSE; - + if (matcher->all) return TRUE; - + return matcher_matches_id (matcher, id); } @@ -2358,10 +2358,10 @@ _g_file_attribute_matcher_matches_id (GFileAttributeMatcher *matcher, * @matcher: a #GFileAttributeMatcher. * @attribute: a file attribute key. * - * Checks if an attribute will be matched by an attribute matcher. If + * Checks if an attribute will be matched by an attribute matcher. If * the matcher was created with the "*" matching string, this function * will always return %TRUE. - * + * * Returns: %TRUE if @attribute matches @matcher. %FALSE otherwise. **/ gboolean @@ -2373,10 +2373,10 @@ g_file_attribute_matcher_matches (GFileAttributeMatcher *matcher, /* We return a NULL matcher for an empty match string, so handle this */ if (matcher == NULL) return FALSE; - + if (matcher->all) return TRUE; - + return matcher_matches_id (matcher, lookup_attribute (attribute)); } @@ -2385,14 +2385,14 @@ g_file_attribute_matcher_matches (GFileAttributeMatcher *matcher, * g_file_attribute_matcher_enumerate_namespace: * @matcher: a #GFileAttributeMatcher. * @ns: a string containing a file attribute namespace. - * + * * Checks if the matcher will match all of the keys in a given namespace. - * This will always return %TRUE if a wildcard character is in use (e.g. if + * This will always return %TRUE if a wildcard character is in use (e.g. if * matcher was created with "standard::*" and @ns is "standard", or if matcher was created - * using "*" and namespace is anything.) - * + * using "*" and namespace is anything.) + * * TODO: this is awkwardly worded. - * + * * Returns: %TRUE if the matcher matches all of the entries * in the given @ns, %FALSE otherwise. **/ @@ -2403,13 +2403,13 @@ g_file_attribute_matcher_enumerate_namespace (GFileAttributeMatcher *matcher, SubMatcher *sub_matchers; int ns_id; int i; - + g_return_val_if_fail (ns != NULL && *ns != '\0', FALSE); /* We return a NULL matcher for an empty match string, so handle this */ if (matcher == NULL) return FALSE; - + if (matcher->all) return TRUE; @@ -2433,17 +2433,17 @@ g_file_attribute_matcher_enumerate_namespace (GFileAttributeMatcher *matcher, matcher->iterator_ns = ns_id; matcher->iterator_pos = 0; - + return FALSE; } /** * g_file_attribute_matcher_enumerate_next: * @matcher: a #GFileAttributeMatcher. - * + * * Gets the next matched attribute from a #GFileAttributeMatcher. - * - * Returns: a string containing the next attribute or %NULL if + * + * Returns: a string containing the next attribute or %NULL if * no more attribute exist. **/ const char * @@ -2471,7 +2471,7 @@ g_file_attribute_matcher_enumerate_next (GFileAttributeMatcher *matcher) { if (matcher->more_sub_matchers == NULL) return NULL; - + i -= ON_STACK_MATCHERS; if (i < matcher->more_sub_matchers->len) sub_matcher = &g_array_index (matcher->more_sub_matchers, SubMatcher, i);