93
93
>GError</a> **error);
95
95
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gssize"
96
>gssize</a> <a class="link" href="GOutputStream.html#g-output-stream-splice">g_output_stream_splice</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
96
>gssize</a> <a class="link" href="GOutputStream.html#g-output-stream-splice" title="g_output_stream_splice ()">g_output_stream_splice</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
97
97
<a class="link" href="GInputStream.html" title="GInputStream">GInputStream</a> *source,
98
<a class="link" href="GOutputStream.html#GOutputStreamSpliceFlags">GOutputStreamSpliceFlags</a> flags,
99
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
101
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
102
>GError</a> **error);
104
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
105
>gboolean</a> <a class="link" href="GOutputStream.html#g-output-stream-flush">g_output_stream_flush</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
106
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
108
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
109
>GError</a> **error);
111
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
112
>gboolean</a> <a class="link" href="GOutputStream.html#g-output-stream-close">g_output_stream_close</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
113
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
115
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
116
>GError</a> **error);
117
void <a class="link" href="GOutputStream.html#g-output-stream-write-async">g_output_stream_write_async</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
98
<a class="link" href="GOutputStream.html#GOutputStreamSpliceFlags" title="enum GOutputStreamSpliceFlags">GOutputStreamSpliceFlags</a> flags,
99
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
101
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
102
>GError</a> **error);
104
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
105
>gboolean</a> <a class="link" href="GOutputStream.html#g-output-stream-flush" title="g_output_stream_flush ()">g_output_stream_flush</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
106
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
108
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
109
>GError</a> **error);
111
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
112
>gboolean</a> <a class="link" href="GOutputStream.html#g-output-stream-close" title="g_output_stream_close ()">g_output_stream_close</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
113
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
115
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
116
>GError</a> **error);
117
void <a class="link" href="GOutputStream.html#g-output-stream-write-async" title="g_output_stream_write_async ()">g_output_stream_write_async</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
118
118
const void *buffer,
120
120
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"
121
121
>gsize</a> count,
123
123
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
124
<a class="link" href="GAsyncResult.html#GAsyncReadyCallback">GAsyncReadyCallback</a> callback,
124
<a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()">GAsyncReadyCallback</a> callback,
126
126
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
127
127
>gpointer</a> user_data);
129
129
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gssize"
130
>gssize</a> <a class="link" href="GOutputStream.html#g-output-stream-write-finish">g_output_stream_write_finish</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
130
>gssize</a> <a class="link" href="GOutputStream.html#g-output-stream-write-finish" title="g_output_stream_write_finish ()">g_output_stream_write_finish</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
131
131
<a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,
133
133
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
134
134
>GError</a> **error);
135
void <a class="link" href="GOutputStream.html#g-output-stream-splice-async">g_output_stream_splice_async</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
135
void <a class="link" href="GOutputStream.html#g-output-stream-splice-async" title="g_output_stream_splice_async ()">g_output_stream_splice_async</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
136
136
<a class="link" href="GInputStream.html" title="GInputStream">GInputStream</a> *source,
137
<a class="link" href="GOutputStream.html#GOutputStreamSpliceFlags">GOutputStreamSpliceFlags</a> flags,
137
<a class="link" href="GOutputStream.html#GOutputStreamSpliceFlags" title="enum GOutputStreamSpliceFlags">GOutputStreamSpliceFlags</a> flags,
139
139
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
140
<a class="link" href="GAsyncResult.html#GAsyncReadyCallback">GAsyncReadyCallback</a> callback,
140
<a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()">GAsyncReadyCallback</a> callback,
142
142
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
143
143
>gpointer</a> user_data);
145
145
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gssize"
146
>gssize</a> <a class="link" href="GOutputStream.html#g-output-stream-splice-finish">g_output_stream_splice_finish</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
147
<a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,
149
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
150
>GError</a> **error);
151
void <a class="link" href="GOutputStream.html#g-output-stream-flush-async">g_output_stream_flush_async</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
153
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
154
<a class="link" href="GAsyncResult.html#GAsyncReadyCallback">GAsyncReadyCallback</a> callback,
156
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
157
>gpointer</a> user_data);
159
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
160
>gboolean</a> <a class="link" href="GOutputStream.html#g-output-stream-flush-finish">g_output_stream_flush_finish</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
161
<a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,
163
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
164
>GError</a> **error);
165
void <a class="link" href="GOutputStream.html#g-output-stream-close-async">g_output_stream_close_async</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
167
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
168
<a class="link" href="GAsyncResult.html#GAsyncReadyCallback">GAsyncReadyCallback</a> callback,
170
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
171
>gpointer</a> user_data);
173
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
174
>gboolean</a> <a class="link" href="GOutputStream.html#g-output-stream-close-finish">g_output_stream_close_finish</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
175
<a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,
177
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
178
>GError</a> **error);
180
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
181
>gboolean</a> <a class="link" href="GOutputStream.html#g-output-stream-is-closed">g_output_stream_is_closed</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream);
183
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
184
>gboolean</a> <a class="link" href="GOutputStream.html#g-output-stream-has-pending">g_output_stream_has_pending</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream);
186
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
187
>gboolean</a> <a class="link" href="GOutputStream.html#g-output-stream-set-pending">g_output_stream_set_pending</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
189
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
190
>GError</a> **error);
191
void <a class="link" href="GOutputStream.html#g-output-stream-clear-pending">g_output_stream_clear_pending</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream);
146
>gssize</a> <a class="link" href="GOutputStream.html#g-output-stream-splice-finish" title="g_output_stream_splice_finish ()">g_output_stream_splice_finish</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
147
<a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,
149
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
150
>GError</a> **error);
151
void <a class="link" href="GOutputStream.html#g-output-stream-flush-async" title="g_output_stream_flush_async ()">g_output_stream_flush_async</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
153
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
154
<a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()">GAsyncReadyCallback</a> callback,
156
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
157
>gpointer</a> user_data);
159
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
160
>gboolean</a> <a class="link" href="GOutputStream.html#g-output-stream-flush-finish" title="g_output_stream_flush_finish ()">g_output_stream_flush_finish</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
161
<a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,
163
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
164
>GError</a> **error);
165
void <a class="link" href="GOutputStream.html#g-output-stream-close-async" title="g_output_stream_close_async ()">g_output_stream_close_async</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
167
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
168
<a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()">GAsyncReadyCallback</a> callback,
170
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
171
>gpointer</a> user_data);
173
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
174
>gboolean</a> <a class="link" href="GOutputStream.html#g-output-stream-close-finish" title="g_output_stream_close_finish ()">g_output_stream_close_finish</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
175
<a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,
177
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
178
>GError</a> **error);
180
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
181
>gboolean</a> <a class="link" href="GOutputStream.html#g-output-stream-is-closed" title="g_output_stream_is_closed ()">g_output_stream_is_closed</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream);
183
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
184
>gboolean</a> <a class="link" href="GOutputStream.html#g-output-stream-has-pending" title="g_output_stream_has_pending ()">g_output_stream_has_pending</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream);
186
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
187
>gboolean</a> <a class="link" href="GOutputStream.html#g-output-stream-set-pending" title="g_output_stream_set_pending ()">g_output_stream_set_pending</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
189
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
190
>GError</a> **error);
191
void <a class="link" href="GOutputStream.html#g-output-stream-clear-pending" title="g_output_stream_clear_pending ()">g_output_stream_clear_pending</a> (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream);
196
194
<div class="refsect1" lang="en">
197
<a name="id2853617"></a><h2>Object Hierarchy</h2>
195
<a name="GOutputStream.object-hierarchy"></a><h2>Object Hierarchy</h2>
198
196
<pre class="synopsis">
201
198
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"
203
200
+----GOutputStream
204
201
+----<a class="link" href="GFilterOutputStream.html" title="GFilterOutputStream">GFilterOutputStream</a>
205
+----<a class="link" href="GUnixOutputStream.html" title="GUnixOutputStream">GUnixOutputStream</a>
206
202
+----<a class="link" href="GFileOutputStream.html" title="GFileOutputStream">GFileOutputStream</a>
207
203
+----<a class="link" href="GMemoryOutputStream.html" title="GMemoryOutputStream">GMemoryOutputStream</a>
204
+----<a class="link" href="GUnixOutputStream.html" title="GUnixOutputStream">GUnixOutputStream</a>
210
207
<div class="refsect1" lang="en">
211
<a name="id2853666"></a><h2>Description</h2>
208
<a name="GOutputStream.description"></a><h2>Description</h2>
210
GOutputStream has functions to write to a stream (<a class="link" href="GOutputStream.html#g-output-stream-write" title="g_output_stream_write ()"><code class="function">g_output_stream_write()</code></a>),
211
to close a stream (<a class="link" href="GOutputStream.html#g-output-stream-close" title="g_output_stream_close ()"><code class="function">g_output_stream_close()</code></a>) and to flush pending writes
212
(<a class="link" href="GOutputStream.html#g-output-stream-flush" title="g_output_stream_flush ()"><code class="function">g_output_stream_flush()</code></a>).
215
To copy the content of an input stream to an output stream without
216
manually handling the reads and writes, use <a class="link" href="GOutputStream.html#g-output-stream-splice" title="g_output_stream_splice ()"><code class="function">g_output_stream_splice()</code></a>.
219
All of these functions have async variants too.</p>
218
223
<div class="refsect1" lang="en">
219
<a name="id2853686"></a><h2>Details</h2>
224
<a name="GOutputStream.details"></a><h2>Details</h2>
220
225
<div class="refsect2" lang="en">
221
<a name="id2853697"></a><h3>
222
<a name="GOutputStreamSpliceFlags"></a>enum GOutputStreamSpliceFlags</h3>
223
<a class="indexterm" name="id2853708"></a><pre class="programlisting">typedef enum {
224
G_OUTPUT_STREAM_SPLICE_NONE = 0,
225
G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE = 1 << 0,
226
G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET = 1 << 1
226
<a name="GOutputStreamSpliceFlags"></a><h3>enum GOutputStreamSpliceFlags</h3>
227
<pre class="programlisting">typedef enum {
228
G_OUTPUT_STREAM_SPLICE_NONE = 0,
229
G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE = (1 << 0),
230
G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET = (1 << 1)
227
231
} GOutputStreamSpliceFlags;
230
234
GOutputStreamSpliceFlags determine how streams should be spliced.</p>
234
237
<div class="variablelist"><table border="0">
235
238
<col align="left" valign="top">
238
<td><p><span class="term"><a name="G-OUTPUT-STREAM-SPLICE-NONE:CAPS"></a><code class="literal">G_OUTPUT_STREAM_SPLICE_NONE</code></span></p></td>
241
<td><p><a name="G-OUTPUT-STREAM-SPLICE-NONE--CAPS"></a><span class="term"><code class="literal">G_OUTPUT_STREAM_SPLICE_NONE</code></span></p></td>
239
242
<td> Do not close either stream.
243
<td><p><span class="term"><a name="G-OUTPUT-STREAM-SPLICE-CLOSE-SOURCE:CAPS"></a><code class="literal">G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE</code></span></p></td>
244
<td> Close the source stream after the splice.
246
<td><p><a name="G-OUTPUT-STREAM-SPLICE-CLOSE-SOURCE--CAPS"></a><span class="term"><code class="literal">G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE</code></span></p></td>
247
<td> Close the source stream after
248
<td><p><span class="term"><a name="G-OUTPUT-STREAM-SPLICE-CLOSE-TARGET:CAPS"></a><code class="literal">G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET</code></span></p></td>
249
<td> Close the target stream after the splice.
252
<td><p><a name="G-OUTPUT-STREAM-SPLICE-CLOSE-TARGET--CAPS"></a><span class="term"><code class="literal">G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET</code></span></p></td>
253
<td> Close the target stream after
387
387
is set to indicate the error status, <em class="parameter"><code>bytes_written</code></em> is updated to contain
388
388
the number of bytes written into the stream before the error occurred.</p>
392
391
<div class="variablelist"><table border="0">
393
392
<col align="left" valign="top">
396
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
395
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
397
396
<td> a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.
401
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
400
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
402
401
<td> the buffer containing the data to write.
406
<td><p><span class="term"><em class="parameter"><code>count</code></em> :</span></p></td>
405
<td><p><span class="term"><em class="parameter"><code>count</code></em> :</span></p></td>
407
406
<td> the number of bytes to write
411
<td><p><span class="term"><em class="parameter"><code>bytes_written</code></em> :</span></p></td>
410
<td><p><span class="term"><em class="parameter"><code>bytes_written</code></em> :</span></p></td>
412
411
<td> location to store the number of bytes that was
413
412
written to the stream
417
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
416
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
418
417
<td> optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <a
419
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
418
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
420
419
><code class="literal">NULL</code></a> to ignore.
424
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
423
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
425
424
<td> location to store the error occuring, or <a
426
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
425
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
427
426
><code class="literal">NULL</code></a> to ignore
431
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
430
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
433
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"
432
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE--CAPS"
434
433
><code class="literal">TRUE</code></a> on success, <a
435
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"
434
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE--CAPS"
436
435
><code class="literal">FALSE</code></a> if there was an error
597
591
On failure the first error that happened will be reported, but the close
598
592
operation will finish as much as possible. A stream that failed to
599
close will still return <a class="link" href="gio-GIOError.html#G-IO-ERROR-CLOSED:CAPS"><code class="literal">G_IO_ERROR_CLOSED</code></a> for all operations. Still, it
593
close will still return <a class="link" href="gio-GIOError.html#G-IO-ERROR-CLOSED--CAPS"><code class="literal">G_IO_ERROR_CLOSED</code></a> for all operations. Still, it
600
594
is important to check and report the error to the user, otherwise
601
595
there might be a loss of data as all data might not be written.
604
598
If <em class="parameter"><code>cancellable</code></em> is not NULL, then the operation can be cancelled by
605
599
triggering the cancellable object from another thread. If the operation
606
was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.
600
was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED--CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.
607
601
Cancelling a close will still leave the stream closed, but there some streams
608
602
can use a faster close that doesn't block to e.g. check errors. On
609
603
cancellation (as with any error) there is no guarantee that all written
610
604
data will reach the target.</p>
614
607
<div class="variablelist"><table border="0">
615
608
<col align="left" valign="top">
618
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
611
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
619
612
<td> A <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.
623
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
616
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
624
617
<td> optional cancellable object
628
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
621
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
629
622
<td> location to store the error occuring, or <a
630
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
623
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
631
624
><code class="literal">NULL</code></a> to ignore
635
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
628
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
637
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"
630
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE--CAPS"
638
631
><code class="literal">TRUE</code></a> on success, <a
639
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"
632
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE--CAPS"
640
633
><code class="literal">FALSE</code></a> on failure
794
783
<div class="refsect2" lang="en">
795
<a name="id2855533"></a><h3>
796
<a name="g-output-stream-splice-async"></a>g_output_stream_splice_async ()</h3>
797
<a class="indexterm" name="id2855546"></a><pre class="programlisting">void g_output_stream_splice_async (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
784
<a name="g-output-stream-splice-async"></a><h3>g_output_stream_splice_async ()</h3>
785
<pre class="programlisting">void g_output_stream_splice_async (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
798
786
<a class="link" href="GInputStream.html" title="GInputStream">GInputStream</a> *source,
799
<a class="link" href="GOutputStream.html#GOutputStreamSpliceFlags">GOutputStreamSpliceFlags</a> flags,
787
<a class="link" href="GOutputStream.html#GOutputStreamSpliceFlags" title="enum GOutputStreamSpliceFlags">GOutputStreamSpliceFlags</a> flags,
801
789
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
802
<a class="link" href="GAsyncResult.html#GAsyncReadyCallback">GAsyncReadyCallback</a> callback,
790
<a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()">GAsyncReadyCallback</a> callback,
804
792
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
805
793
>gpointer</a> user_data);</pre>
807
795
Splices a stream asynchronously.
808
796
When the operation is finished <em class="parameter"><code>callback</code></em> will be called.
809
You can then call <a class="link" href="GOutputStream.html#g-output-stream-splice-finish"><code class="function">g_output_stream_splice_finish()</code></a> to get the
797
You can then call <a class="link" href="GOutputStream.html#g-output-stream-splice-finish" title="g_output_stream_splice_finish ()"><code class="function">g_output_stream_splice_finish()</code></a> to get the
810
798
result of the operation.
813
801
For the synchronous, blocking version of this function, see
814
<a class="link" href="GOutputStream.html#g-output-stream-splice"><code class="function">g_output_stream_splice()</code></a>.</p>
802
<a class="link" href="GOutputStream.html#g-output-stream-splice" title="g_output_stream_splice ()"><code class="function">g_output_stream_splice()</code></a>.</p>
818
805
<div class="variablelist"><table border="0">
819
806
<col align="left" valign="top">
822
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
809
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
823
810
<td> a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.
827
<td><p><span class="term"><em class="parameter"><code>source</code></em> :</span></p></td>
814
<td><p><span class="term"><em class="parameter"><code>source</code></em> :</span></p></td>
828
815
<td> a <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a>.
832
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
833
<td> a set of <a class="link" href="GOutputStream.html#GOutputStreamSpliceFlags"><span class="type">GOutputStreamSpliceFlags</span></a>.
819
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
820
<td> a set of <a class="link" href="GOutputStream.html#GOutputStreamSpliceFlags" title="enum GOutputStreamSpliceFlags"><span class="type">GOutputStreamSpliceFlags</span></a>.
837
<td><p><span class="term"><em class="parameter"><code>io_priority</code></em> :</span></p></td>
824
<td><p><span class="term"><em class="parameter"><code>io_priority</code></em> :</span></p></td>
838
825
<td> the io priority of the request.
842
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
829
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
843
830
<td> optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <a
844
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
831
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
845
832
><code class="literal">NULL</code></a> to ignore.
849
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
850
<td> a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback"><span class="type">GAsyncReadyCallback</span></a>.
836
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
837
<td> a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>.
854
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
841
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
855
842
<td> user data passed to <em class="parameter"><code>callback</code></em>.
911
896
<div class="refsect2" lang="en">
912
<a name="id2857480"></a><h3>
913
<a name="g-output-stream-flush-async"></a>g_output_stream_flush_async ()</h3>
914
<a class="indexterm" name="id2857491"></a><pre class="programlisting">void g_output_stream_flush_async (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
897
<a name="g-output-stream-flush-async"></a><h3>g_output_stream_flush_async ()</h3>
898
<pre class="programlisting">void g_output_stream_flush_async (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
916
900
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
917
<a class="link" href="GAsyncResult.html#GAsyncReadyCallback">GAsyncReadyCallback</a> callback,
901
<a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()">GAsyncReadyCallback</a> callback,
919
903
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
920
904
>gpointer</a> user_data);</pre>
922
906
Flushes a stream asynchronously.
923
For behaviour details see <a class="link" href="GOutputStream.html#g-output-stream-flush"><code class="function">g_output_stream_flush()</code></a>.
907
For behaviour details see <a class="link" href="GOutputStream.html#g-output-stream-flush" title="g_output_stream_flush ()"><code class="function">g_output_stream_flush()</code></a>.
926
910
When the operation is finished <em class="parameter"><code>callback</code></em> will be
927
called. You can then call <a class="link" href="GOutputStream.html#g-output-stream-flush-finish"><code class="function">g_output_stream_flush_finish()</code></a> to get the
911
called. You can then call <a class="link" href="GOutputStream.html#g-output-stream-flush-finish" title="g_output_stream_flush_finish ()"><code class="function">g_output_stream_flush_finish()</code></a> to get the
928
912
result of the operation.</p>
932
915
<div class="variablelist"><table border="0">
933
916
<col align="left" valign="top">
936
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
919
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
937
920
<td> a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.
941
<td><p><span class="term"><em class="parameter"><code>io_priority</code></em> :</span></p></td>
924
<td><p><span class="term"><em class="parameter"><code>io_priority</code></em> :</span></p></td>
942
925
<td> the io priority of the request.
946
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
929
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
947
930
<td> optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <a
948
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
931
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
949
932
><code class="literal">NULL</code></a> to ignore.
953
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
954
<td> a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied
936
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
937
<td> a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied
958
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
941
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
959
942
<td> the data to pass to callback function
1017
998
<div class="refsect2" lang="en">
1018
<a name="id2857815"></a><h3>
1019
<a name="g-output-stream-close-async"></a>g_output_stream_close_async ()</h3>
1020
<a class="indexterm" name="id2857826"></a><pre class="programlisting">void g_output_stream_close_async (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
999
<a name="g-output-stream-close-async"></a><h3>g_output_stream_close_async ()</h3>
1000
<pre class="programlisting">void g_output_stream_close_async (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
1021
1001
int io_priority,
1022
1002
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
1023
<a class="link" href="GAsyncResult.html#GAsyncReadyCallback">GAsyncReadyCallback</a> callback,
1003
<a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()">GAsyncReadyCallback</a> callback,
1025
1005
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
1026
1006
>gpointer</a> user_data);</pre>
1028
1008
Requests an asynchronous close of the stream, releasing resources
1029
1009
related to it. When the operation is finished <em class="parameter"><code>callback</code></em> will be
1030
called. You can then call <a class="link" href="GOutputStream.html#g-output-stream-close-finish"><code class="function">g_output_stream_close_finish()</code></a> to get
1010
called. You can then call <a class="link" href="GOutputStream.html#g-output-stream-close-finish" title="g_output_stream_close_finish ()"><code class="function">g_output_stream_close_finish()</code></a> to get
1031
1011
the result of the operation.
1034
For behaviour details see <a class="link" href="GOutputStream.html#g-output-stream-close"><code class="function">g_output_stream_close()</code></a>.
1014
For behaviour details see <a class="link" href="GOutputStream.html#g-output-stream-close" title="g_output_stream_close ()"><code class="function">g_output_stream_close()</code></a>.
1037
1017
The asyncronous methods have a default fallback that uses threads
1038
1018
to implement asynchronicity, so they are optional for inheriting
1039
1019
classes. However, if you override one you must override all.</p>
1043
1022
<div class="variablelist"><table border="0">
1044
1023
<col align="left" valign="top">
1047
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
1026
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
1048
1027
<td> A <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.
1052
<td><p><span class="term"><em class="parameter"><code>io_priority</code></em> :</span></p></td>
1031
<td><p><span class="term"><em class="parameter"><code>io_priority</code></em> :</span></p></td>
1053
1032
<td> the io priority of the request.
1057
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
1036
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
1058
1037
<td> optional cancellable object
1062
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
1041
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
1063
1042
<td> callback to call when the request is satisfied
1067
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
1046
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
1068
1047
<td> the data to pass to callback function