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
gboolean g_file_load_partial_contents_finish(GFile* file, GAsyncResult* res,
                                             char** contents, gsize* length,
                                             char** etag_out, GError** error)
{
    GTask* task;
    LoadContentsData* data;

    g_return_val_if_fail(G_IS_FILE(file), FALSE);
    g_return_val_if_fail(g_task_is_valid(res, file), FALSE);
    g_return_val_if_fail(contents != NULL, FALSE);

    task = G_TASK(res);

    if (!g_task_propagate_boolean(task, error))
    {
        if (length)
            *length = 0;
        return FALSE;
    }

    data = g_task_get_task_data(task);

    if (length)
        *length = data->pos;

    if (etag_out)
    {
        *etag_out = data->etag;
        data->etag = NULL;
    }

    /* Zero terminate */
    g_byte_array_set_size(data->content, data->pos + 1);
    data->content->data[data->pos] = 0;

    *contents = (char*)g_byte_array_free(data->content, FALSE);
    data->content = NULL;

    return TRUE;
}
/**
 * g_file_load_partial_contents_finish:
 * @file: input #GFile
 * @res: a #GAsyncResult
 * @contents: (out) (transfer full) (element-type guint8) (array length=length):
 * a location to place the contents of the file
 * @length: (out) (optional): a location to place the length of the contents of
 * the file, or %NULL if the length is not needed
 * @etag_out: (out) (optional): a location to place the current entity tag for
 * the file, or %NULL if the entity tag is not needed
 * @error: a #GError, or %NULL
 *
 * Finishes an asynchronous partial load operation that was started
 * with g_file_load_partial_contents_async(). The data is always
 * zero-terminated, but this is not included in the resultant @length.
 * The returned @content should be freed with g_free() when no longer
 * needed.
 *
 * Returns: %TRUE if the load was successful. If %FALSE and @error is
 *     present, it will be set appropriately.
 */


Finishes an asynchronous partial load operation that was started
with g_file_load_partial_contents_async(). The data is always
zero-terminated, but this is not included in the resultant @length.
The returned @content should be freed with g_free() when no longer
needed.

%TRUE if the load was successful. If %FALSE and @error is
present, it will be set appropriately.
Finishes an asynchronous partial load operation that was started with g_file_load_partial_contents_async () . The data is always zero - terminated but this is not included in the resultant @length . The returned @content should be freed with g_free () when no longer needed . %TRUE if the load was successful . If %FALSE and @error is present it will be set appropriately .
gboolean g_file_load_partial_contents_finish(GFile* file, GAsyncResult* res,
                                             char** contents, gsize* length,
                                             char** etag_out, GError** error)
{
    GTask* task;
    LoadContentsData* data;
    g_return_val_if_fail(G_IS_FILE(file), FALSE);
    g_return_val_if_fail(g_task_is_valid(res, file), FALSE);
    g_return_val_if_fail(contents != NULL, FALSE);
    task = G_TASK(res);
    if (!g_task_propagate_boolean(task, error))
    {
        if (length)
            *length = 0;
        return FALSE;
    }
    data = g_task_get_task_data(task);
    if (length)
        *length = data->pos;
    if (etag_out)
    {
        *etag_out = data->etag;
        data->etag = NULL;
    }
    g_byte_array_set_size(data->content, data->pos + 1);
    data->content->data[data->pos] = 0;
    *contents = (char*)g_byte_array_free(data->content, FALSE);
    data->content = NULL;
    return TRUE;
}
gboolean g_file_load_partial_contents_finish ( GFile * file , GAsyncResult * res , char * * contents , gsize * length , char * * etag_out , GError * * error ) { GTask * task ; LoadContentsData * data ; g_return_val_if_fail ( G_IS_FILE ( file ) , FALSE ) ; g_return_val_if_fail ( g_task_is_valid ( res , file ) , FALSE ) ; g_return_val_if_fail ( contents != NULL , FALSE ) ; task = G_TASK ( res ) ; if ( ! g_task_propagate_boolean ( task , error ) ) { if ( length ) * length = 0 ; return FALSE ; } data = g_task_get_task_data ( task ) ; if ( length ) * length = data -> pos ; if ( etag_out ) { * etag_out = data -> etag ; data -> etag = NULL ; } g_byte_array_set_size ( data -> content , data -> pos + 1 ) ; data -> content -> data [ data -> pos ] = 0 ; * contents = ( char * ) g_byte_array_free ( data -> content , FALSE ) ; data -> content = NULL ; return TRUE ; }
g_file_load_partial_contents_finish:
 @file: input #GFile
 @res: a #GAsyncResult
 @contents: (out) (transfer full) (element-type guint8) (array length=length):
 a location to place the contents of the file
 @length: (out) (optional): a location to place the length of the contents of
 the file, or %NULL if the length is not needed
 @etag_out: (out) (optional): a location to place the current entity tag for
 the file, or %NULL if the entity tag is not needed
 @error: a #GError, or %NULL
g_file_load_partial_contents_finish : @file : input #GFile @res : a #GAsyncResult @contents : ( out ) ( transfer full ) ( element - type guint8 ) ( array length = length ) : a location to place the contents of the file @length : ( out ) ( optional ) : a location to place the length of the contents of the file or %NULL if the length is not needed @etag_out : ( out ) ( optional ) : a location to place the current entity tag for the file or %NULL if the entity tag is not needed @error : a #GError or %NULL
/* Zero terminate */