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
gssize g_output_stream_splice(GOutputStream* stream, GInputStream* source,
                              GOutputStreamSpliceFlags flags,
                              GCancellable* cancellable, GError** error)
{
    GOutputStreamClass* class;
    gssize bytes_copied;

    g_return_val_if_fail(G_IS_OUTPUT_STREAM(stream), -1);
    g_return_val_if_fail(G_IS_INPUT_STREAM(source), -1);

    if (g_input_stream_is_closed(source))
    {
        g_set_error_literal(error, G_IO_ERROR, G_IO_ERROR_CLOSED,
                            _("Source stream is already closed"));
        return -1;
    }

    if (!g_output_stream_set_pending(stream, error))
        return -1;

    class = G_OUTPUT_STREAM_GET_CLASS(stream);

    if (cancellable)
        g_cancellable_push_current(cancellable);

    bytes_copied = class->splice(stream, source, flags, cancellable, error);

    if (cancellable)
        g_cancellable_pop_current(cancellable);

    g_output_stream_clear_pending(stream);

    return bytes_copied;
}
/**
 * g_output_stream_splice:
 * @stream: a #GOutputStream.
 * @source: a #GInputStream.
 * @flags: a set of #GOutputStreamSpliceFlags.
 * @cancellable: (nullable): optional #GCancellable object, %NULL to ignore.
 * @error: a #GError location to store the error occurring, or %NULL to
 * ignore.
 *
 * Splices an input stream into an output stream.
 *
 * Returns: a #gssize containing the size of the data spliced, or
 *     -1 if an error occurred. Note that if the number of bytes
 *     spliced is greater than %G_MAXSSIZE, then that will be
 *     returned, and there is no way to determine the actual number
 *     of bytes spliced.
 **/


Splices an input stream into an output stream.

a #gssize containing the size of the data spliced, or
-1 if an error occurred. Note that if the number of bytes
spliced is greater than %G_MAXSSIZE, then that will be
returned, and there is no way to determine the actual number
of bytes spliced.
Splices an input stream into an output stream . a #gssize containing the size of the data spliced or - 1 if an error occurred . Note that if the number of bytes spliced is greater than %G_MAXSSIZE then that will be returned and there is no way to determine the actual number of bytes spliced .
gssize g_output_stream_splice(GOutputStream* stream, GInputStream* source,
                              GOutputStreamSpliceFlags flags,
                              GCancellable* cancellable, GError** error)
{
    GOutputStreamClass* class;
    gssize bytes_copied;
    g_return_val_if_fail(G_IS_OUTPUT_STREAM(stream), -1);
    g_return_val_if_fail(G_IS_INPUT_STREAM(source), -1);
    if (g_input_stream_is_closed(source))
    {
        g_set_error_literal(error, G_IO_ERROR, G_IO_ERROR_CLOSED,
                            _("Source stream is already closed"));
        return -1;
    }
    if (!g_output_stream_set_pending(stream, error))
        return -1;
    class = G_OUTPUT_STREAM_GET_CLASS(stream);
    if (cancellable)
        g_cancellable_push_current(cancellable);
    bytes_copied = class->splice(stream, source, flags, cancellable, error);
    if (cancellable)
        g_cancellable_pop_current(cancellable);
    g_output_stream_clear_pending(stream);
    return bytes_copied;
}
gssize g_output_stream_splice ( GOutputStream * stream , GInputStream * source , GOutputStreamSpliceFlags flags , GCancellable * cancellable , GError * * error ) { GOutputStreamClass * class ; gssize bytes_copied ; g_return_val_if_fail ( G_IS_OUTPUT_STREAM ( stream ) , -1 ) ; g_return_val_if_fail ( G_IS_INPUT_STREAM ( source ) , -1 ) ; if ( g_input_stream_is_closed ( source ) ) { g_set_error_literal ( error , G_IO_ERROR , G_IO_ERROR_CLOSED , _ ( " " ) ) ; return -1 ; } if ( ! g_output_stream_set_pending ( stream , error ) ) return -1 ; class = G_OUTPUT_STREAM_GET_CLASS ( stream ) ; if ( cancellable ) g_cancellable_push_current ( cancellable ) ; bytes_copied = class -> splice ( stream , source , flags , cancellable , error ) ; if ( cancellable ) g_cancellable_pop_current ( cancellable ) ; g_output_stream_clear_pending ( stream ) ; return bytes_copied ; }
g_output_stream_splice:
 @stream: a #GOutputStream.
g_output_stream_splice : @stream : a #GOutputStream .