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/goutputstream.c
void g_output_stream_write_bytes_async(GOutputStream* stream, GBytes* bytes,
                                       int io_priority,
                                       GCancellable* cancellable,
                                       GAsyncReadyCallback callback,
                                       gpointer user_data)
{
    GTask* task;
    gsize size;
    gconstpointer data;

    data = g_bytes_get_data(bytes, &size);

    task = g_task_new(stream, cancellable, callback, user_data);
    g_task_set_source_tag(task, g_output_stream_write_bytes_async);
    g_task_set_task_data(task, g_bytes_ref(bytes),
                         (GDestroyNotify)g_bytes_unref);

    g_output_stream_write_async(stream, data, size, io_priority, cancellable,
                                write_bytes_callback, task);
}
/**
 * g_output_stream_write_bytes_async:
 * @stream: A #GOutputStream.
 * @bytes: The bytes to write
 * @io_priority: the io priority of the request.
 * @cancellable: (nullable): optional #GCancellable object, %NULL to ignore.
 * @callback: (scope async): callback to call when the request is satisfied
 * @user_data: (closure): the data to pass to callback function
 *
 * This function is similar to g_output_stream_write_async(), but
 * takes a #GBytes as input.  Due to the refcounted nature of #GBytes,
 * this allows the stream to avoid taking a copy of the data.
 *
 * However, note that this function may still perform partial writes,
 * just like g_output_stream_write_async(). If that occurs, to continue
 * writing, you will need to create a new #GBytes containing just the
 * remaining bytes, using g_bytes_new_from_bytes(). Passing the same
 * #GBytes instance multiple times potentially can result in duplicated
 * data in the output stream.
 *
 * For the synchronous, blocking version of this function, see
 * g_output_stream_write_bytes().
 **/


This function is similar to g_output_stream_write_async(), but
takes a #GBytes as input.  Due to the refcounted nature of #GBytes,
this allows the stream to avoid taking a copy of the data.

However, note that this function may still perform partial writes,
just like g_output_stream_write_async(). If that occurs, to continue
writing, you will need to create a new #GBytes containing just the
remaining bytes, using g_bytes_new_from_bytes(). Passing the same
#GBytes instance multiple times potentially can result in duplicated
data in the output stream.

For the synchronous, blocking version of this function, see
g_output_stream_write_bytes().
This function is similar to g_output_stream_write_async () but takes a #GBytes as input . Due to the refcounted nature of #GBytes this allows the stream to avoid taking a copy of the data . However note that this function may still perform partial writes just like g_output_stream_write_async () . If that occurs to continue writing you will need to create a new #GBytes containing just the remaining bytes using g_bytes_new_from_bytes () . Passing the same #GBytes instance multiple times potentially can result in duplicated data in the output stream . For the synchronous blocking version of this function see g_output_stream_write_bytes () .
void g_output_stream_write_bytes_async(GOutputStream* stream, GBytes* bytes,
                                       int io_priority,
                                       GCancellable* cancellable,
                                       GAsyncReadyCallback callback,
                                       gpointer user_data)
{
    GTask* task;
    gsize size;
    gconstpointer data;
    data = g_bytes_get_data(bytes, &size);
    task = g_task_new(stream, cancellable, callback, user_data);
    g_task_set_source_tag(task, g_output_stream_write_bytes_async);
    g_task_set_task_data(task, g_bytes_ref(bytes),
                         (GDestroyNotify)g_bytes_unref);
    g_output_stream_write_async(stream, data, size, io_priority, cancellable,
                                write_bytes_callback, task);
}
void g_output_stream_write_bytes_async ( GOutputStream * stream , GBytes * bytes , int io_priority , GCancellable * cancellable , GAsyncReadyCallback callback , gpointer user_data ) { GTask * task ; gsize size ; gconstpointer data ; data = g_bytes_get_data ( bytes , & size ) ; task = g_task_new ( stream , cancellable , callback , user_data ) ; g_task_set_source_tag ( task , g_output_stream_write_bytes_async ) ; g_task_set_task_data ( task , g_bytes_ref ( bytes ) , ( GDestroyNotify ) g_bytes_unref ) ; g_output_stream_write_async ( stream , data , size , io_priority , cancellable , write_bytes_callback , task ) ; }
g_output_stream_write_bytes_async:
 @stream: A #GOutputStream.
g_output_stream_write_bytes_async : @stream : A #GOutputStream .