openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/glib-2.0/1_2.60.3-r0/glib-2.60.3/gio/gfile.c
GFile* g_file_set_display_name(GFile* file, const gchar* display_name,
                               GCancellable* cancellable, GError** error)
{
    GFileIface* iface;

    g_return_val_if_fail(G_IS_FILE(file), NULL);
    g_return_val_if_fail(display_name != NULL, NULL);

    if (strchr(display_name, G_DIR_SEPARATOR) != NULL)
    {
        g_set_error(error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
                    _("File names cannot contain “%c”"), G_DIR_SEPARATOR);
        return NULL;
    }

    if (g_cancellable_set_error_if_cancelled(cancellable, error))
        return NULL;

    iface = G_FILE_GET_IFACE(file);

    return (*iface->set_display_name)(file, display_name, cancellable, error);
}
/**
 * g_file_set_display_name:
 * @file: input #GFile
 * @display_name: a string
 * @cancellable: (nullable): optional #GCancellable object,
 *     %NULL to ignore
 * @error: a #GError, or %NULL
 *
 * Renames @file to the specified display name.
 *
 * The display name is converted from UTF-8 to the correct encoding
 * for the target filesystem if possible and the @file is renamed to this.
 *
 * If you want to implement a rename operation in the user interface the
 * edit name (#G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the
 * initial value in the rename widget, and then the result after editing
 * should be passed to g_file_set_display_name().
 *
 * On success the resulting converted filename is returned.
 *
 * If @cancellable is not %NULL, then the operation can be cancelled by
 * triggering the cancellable object from another thread. If the operation
 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
 *
 * Returns: (transfer full): a #GFile specifying what @file was renamed to,
 *     or %NULL if there was an error.
 *     Free the returned object with g_object_unref().
 */


Renames @file to the specified display name.

The display name is converted from UTF-8 to the correct encoding
for the target filesystem if possible and the @file is renamed to this.

If you want to implement a rename operation in the user interface the
edit name (#G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the
initial value in the rename widget, and then the result after editing
should be passed to g_file_set_display_name().

On success the resulting converted filename is returned.

If @cancellable is not %NULL, then the operation can be cancelled by
triggering the cancellable object from another thread. If the operation
was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.

(transfer full): a #GFile specifying what @file was renamed to,
or %NULL if there was an error.
Free the returned object with g_object_unref().
Renames @file to the specified display name . The display name is converted from UTF - 8 to the correct encoding for the target filesystem if possible and the @file is renamed to this . If you want to implement a rename operation in the user interface the edit name ( #G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME ) should be used as the initial value in the rename widget and then the result after editing should be passed to g_file_set_display_name () . On success the resulting converted filename is returned . If @cancellable is not %NULL then the operation can be cancelled by triggering the cancellable object from another thread . If the operation was cancelled the error %G_IO_ERROR_CANCELLED will be returned . ( transfer full ) : a #GFile specifying what @file was renamed to or %NULL if there was an error . Free the returned object with g_object_unref () .
GFile* g_file_set_display_name(GFile* file, const gchar* display_name,
                               GCancellable* cancellable, GError** error)
{
    GFileIface* iface;
    g_return_val_if_fail(G_IS_FILE(file), NULL);
    g_return_val_if_fail(display_name != NULL, NULL);
    if (strchr(display_name, G_DIR_SEPARATOR) != NULL)
    {
        g_set_error(error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
                    _("File names cannot contain “%c”"), G_DIR_SEPARATOR);
        return NULL;
    }
    if (g_cancellable_set_error_if_cancelled(cancellable, error))
        return NULL;
    iface = G_FILE_GET_IFACE(file);
    return (*iface->set_display_name)(file, display_name, cancellable, error);
}
GFile * g_file_set_display_name ( GFile * file , const gchar * display_name , GCancellable * cancellable , GError * * error ) { GFileIface * iface ; g_return_val_if_fail ( G_IS_FILE ( file ) , NULL ) ; g_return_val_if_fail ( display_name != NULL , NULL ) ; if ( strchr ( display_name , G_DIR_SEPARATOR ) != NULL ) { g_set_error ( error , G_IO_ERROR , G_IO_ERROR_INVALID_ARGUMENT , _ ( " G _ D R_SEPARATOR); return NULL ; } if ( g_cancellable_set_error_if_cancelled ( cancellable , error ) ) return NULL ; iface = G_FILE_GET_IFACE ( file ) ; return ( * iface -> set_display_name ) ( file , display_name , cancellable , error ) ; }
g_file_set_display_name:
 @file: input #GFile
 @display_name: a string
 @cancellable: (nullable): optional #GCancellable object,
     %NULL to ignore
 @error: a #GError, or %NULL
g_file_set_display_name : @file : input #GFile @display_name : a string @cancellable : ( nullable ) : optional #GCancellable object %NULL to ignore @error : a #GError or %NULL