Update to version 2.33.1
[profile/ivi/glib2.git] / docs / reference / gio / html / GOutputStream.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>GOutputStream</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GIO Reference Manual">
8 <link rel="up" href="streaming.html" title="Streaming I/O">
9 <link rel="prev" href="GInputStream.html" title="GInputStream">
10 <link rel="next" href="GIOStream.html" title="GIOStream">
11 <meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
16 <tr valign="middle">
17 <td><a accesskey="p" href="GInputStream.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="streaming.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">GIO Reference Manual</th>
21 <td><a accesskey="n" href="GIOStream.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
22 </tr>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#GOutputStream.synopsis" class="shortcut">Top</a>
25                    | 
26                   <a href="#GOutputStream.description" class="shortcut">Description</a>
27                    | 
28                   <a href="#GOutputStream.object-hierarchy" class="shortcut">Object Hierarchy</a>
29                    | 
30                   <a href="#GOutputStream.derived-interfaces" class="shortcut">Known Derived Interfaces</a>
31 </td></tr>
32 </table>
33 <div class="refentry">
34 <a name="GOutputStream"></a><div class="titlepage"></div>
35 <div class="refnamediv"><table width="100%"><tr>
36 <td valign="top">
37 <h2><span class="refentrytitle"><a name="GOutputStream.top_of_page"></a>GOutputStream</span></h2>
38 <p>GOutputStream — Base class for implementing streaming output</p>
39 </td>
40 <td valign="top" align="right"></td>
41 </tr></table></div>
42 <div class="refsynopsisdiv">
43 <a name="GOutputStream.synopsis"></a><h2>Synopsis</h2>
44 <pre class="synopsis">
45 #include &lt;gio/gio.h&gt;
46
47 enum                <a class="link" href="GOutputStream.html#GOutputStreamSpliceFlags" title="enum GOutputStreamSpliceFlags">GOutputStreamSpliceFlags</a>;
48                     <a class="link" href="GOutputStream.html#GOutputStream-struct" title="GOutputStream">GOutputStream</a>;
49 <a href="./../glib/glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>              <a class="link" href="GOutputStream.html#g-output-stream-write" title="g_output_stream_write ()">g_output_stream_write</a>               (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
50                                                          <em class="parameter"><code>const <span class="type">void</span> *buffer</code></em>,
51                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> count</code></em>,
52                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
53                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
54 <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GOutputStream.html#g-output-stream-write-all" title="g_output_stream_write_all ()">g_output_stream_write_all</a>           (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
55                                                          <em class="parameter"><code>const <span class="type">void</span> *buffer</code></em>,
56                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> count</code></em>,
57                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *bytes_written</code></em>,
58                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
59                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
60 <a href="./../glib/glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>              <a class="link" href="GOutputStream.html#g-output-stream-splice" title="g_output_stream_splice ()">g_output_stream_splice</a>              (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
61                                                          <em class="parameter"><code><a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a> *source</code></em>,
62                                                          <em class="parameter"><code><a class="link" href="GOutputStream.html#GOutputStreamSpliceFlags" title="enum GOutputStreamSpliceFlags"><span class="type">GOutputStreamSpliceFlags</span></a> flags</code></em>,
63                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
64                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
65 <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GOutputStream.html#g-output-stream-flush" title="g_output_stream_flush ()">g_output_stream_flush</a>               (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
66                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
67                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
68 <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GOutputStream.html#g-output-stream-close" title="g_output_stream_close ()">g_output_stream_close</a>               (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
69                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
70                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
71 <span class="returnvalue">void</span>                <a class="link" href="GOutputStream.html#g-output-stream-write-async" title="g_output_stream_write_async ()">g_output_stream_write_async</a>         (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
72                                                          <em class="parameter"><code>const <span class="type">void</span> *buffer</code></em>,
73                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> count</code></em>,
74                                                          <em class="parameter"><code><span class="type">int</span> io_priority</code></em>,
75                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
76                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
77                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
78 <a href="./../glib/glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>              <a class="link" href="GOutputStream.html#g-output-stream-write-finish" title="g_output_stream_write_finish ()">g_output_stream_write_finish</a>        (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
79                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
80                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
81 <span class="returnvalue">void</span>                <a class="link" href="GOutputStream.html#g-output-stream-splice-async" title="g_output_stream_splice_async ()">g_output_stream_splice_async</a>        (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
82                                                          <em class="parameter"><code><a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a> *source</code></em>,
83                                                          <em class="parameter"><code><a class="link" href="GOutputStream.html#GOutputStreamSpliceFlags" title="enum GOutputStreamSpliceFlags"><span class="type">GOutputStreamSpliceFlags</span></a> flags</code></em>,
84                                                          <em class="parameter"><code><span class="type">int</span> io_priority</code></em>,
85                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
86                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
87                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
88 <a href="./../glib/glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>              <a class="link" href="GOutputStream.html#g-output-stream-splice-finish" title="g_output_stream_splice_finish ()">g_output_stream_splice_finish</a>       (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
89                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
90                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
91 <span class="returnvalue">void</span>                <a class="link" href="GOutputStream.html#g-output-stream-flush-async" title="g_output_stream_flush_async ()">g_output_stream_flush_async</a>         (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
92                                                          <em class="parameter"><code><span class="type">int</span> io_priority</code></em>,
93                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
94                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
95                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
96 <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GOutputStream.html#g-output-stream-flush-finish" title="g_output_stream_flush_finish ()">g_output_stream_flush_finish</a>        (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
97                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
98                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
99 <span class="returnvalue">void</span>                <a class="link" href="GOutputStream.html#g-output-stream-close-async" title="g_output_stream_close_async ()">g_output_stream_close_async</a>         (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
100                                                          <em class="parameter"><code><span class="type">int</span> io_priority</code></em>,
101                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
102                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
103                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
104 <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GOutputStream.html#g-output-stream-close-finish" title="g_output_stream_close_finish ()">g_output_stream_close_finish</a>        (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
105                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
106                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
107 <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GOutputStream.html#g-output-stream-is-closing" title="g_output_stream_is_closing ()">g_output_stream_is_closing</a>          (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>);
108 <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GOutputStream.html#g-output-stream-is-closed" title="g_output_stream_is_closed ()">g_output_stream_is_closed</a>           (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>);
109 <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GOutputStream.html#g-output-stream-has-pending" title="g_output_stream_has_pending ()">g_output_stream_has_pending</a>         (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>);
110 <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GOutputStream.html#g-output-stream-set-pending" title="g_output_stream_set_pending ()">g_output_stream_set_pending</a>         (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
111                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
112 <span class="returnvalue">void</span>                <a class="link" href="GOutputStream.html#g-output-stream-clear-pending" title="g_output_stream_clear_pending ()">g_output_stream_clear_pending</a>       (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>);
113 </pre>
114 </div>
115 <div class="refsect1">
116 <a name="GOutputStream.object-hierarchy"></a><h2>Object Hierarchy</h2>
117 <pre class="synopsis">
118   <a href="./../gobject/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>
119    +----GOutputStream
120          +----<a class="link" href="GFilterOutputStream.html" title="GFilterOutputStream">GFilterOutputStream</a>
121          +----<a class="link" href="GFileOutputStream.html" title="GFileOutputStream">GFileOutputStream</a>
122          +----<a class="link" href="GMemoryOutputStream.html" title="GMemoryOutputStream">GMemoryOutputStream</a>
123          +----<a class="link" href="GUnixOutputStream.html" title="GUnixOutputStream">GUnixOutputStream</a>
124 </pre>
125 </div>
126 <div class="refsect1">
127 <a name="GOutputStream.derived-interfaces"></a><h2>Known Derived Interfaces</h2>
128 <p>
129 GOutputStream is required by
130  <a class="link" href="GPollableOutputStream.html" title="GPollableOutputStream">GPollableOutputStream</a>.</p>
131 </div>
132 <div class="refsect1">
133 <a name="GOutputStream.description"></a><h2>Description</h2>
134 <p>
135 <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> 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>),
136 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
137 (<a class="link" href="GOutputStream.html#g-output-stream-flush" title="g_output_stream_flush ()"><code class="function">g_output_stream_flush()</code></a>). 
138 </p>
139 <p>
140 To copy the content of an input stream to an output stream without 
141 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>. 
142 </p>
143 <p>
144 All of these functions have async variants too.
145 </p>
146 </div>
147 <div class="refsect1">
148 <a name="GOutputStream.details"></a><h2>Details</h2>
149 <div class="refsect2">
150 <a name="GOutputStreamSpliceFlags"></a><h3>enum GOutputStreamSpliceFlags</h3>
151 <pre class="programlisting">typedef enum {
152   G_OUTPUT_STREAM_SPLICE_NONE         = 0,
153   G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE = (1 &lt;&lt; 0),
154   G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET = (1 &lt;&lt; 1)
155 } GOutputStreamSpliceFlags;
156 </pre>
157 <p>
158 GOutputStreamSpliceFlags determine how streams should be spliced.
159 </p>
160 <div class="variablelist"><table border="0">
161 <col align="left" valign="top">
162 <tbody>
163 <tr>
164 <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>
165 <td>Do not close either stream.
166 </td>
167 </tr>
168 <tr>
169 <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>
170 <td>Close the source stream after
171     the splice.
172 </td>
173 </tr>
174 <tr>
175 <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>
176 <td>Close the target stream after
177     the splice.
178 </td>
179 </tr>
180 </tbody>
181 </table></div>
182 </div>
183 <hr>
184 <div class="refsect2">
185 <a name="GOutputStream-struct"></a><h3>GOutputStream</h3>
186 <pre class="programlisting">typedef struct _GOutputStream GOutputStream;</pre>
187 <p>
188 Base class for writing output.
189 </p>
190 <p>
191 All classes derived from GOutputStream should implement synchronous
192 writing, splicing, flushing and closing streams, but may implement
193 asynchronous versions.
194 </p>
195 </div>
196 <hr>
197 <div class="refsect2">
198 <a name="g-output-stream-write"></a><h3>g_output_stream_write ()</h3>
199 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>              g_output_stream_write               (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
200                                                          <em class="parameter"><code>const <span class="type">void</span> *buffer</code></em>,
201                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> count</code></em>,
202                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
203                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
204 <p>
205 Tries to write <em class="parameter"><code>count</code></em> bytes from <em class="parameter"><code>buffer</code></em> into the stream. Will block
206 during the operation.
207 </p>
208 <p>
209 If count is 0, returns 0 and does nothing. A value of <em class="parameter"><code>count</code></em>
210 larger than <a href="./../glib/glib/glib-Basic-Types.html#G-MAXSSIZE:CAPS"><code class="literal">G_MAXSSIZE</code></a> will cause a <a class="link" href="gio-GIOError.html#G-IO-ERROR-INVALID-ARGUMENT:CAPS"><code class="literal">G_IO_ERROR_INVALID_ARGUMENT</code></a> error.
211 </p>
212 <p>
213 On success, the number of bytes written to the stream is returned.
214 It is not an error if this is not the same as the requested size, as it
215 can happen e.g. on a partial I/O error, or if there is not enough
216 storage in the stream. All writes block until at least one byte
217 is written or an error occurs; 0 is never returned (unless
218 <em class="parameter"><code>count</code></em> is 0).
219 </p>
220 <p>
221 If <em class="parameter"><code>cancellable</code></em> is not <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then the operation can be cancelled by
222 triggering the cancellable object from another thread. If the operation
223 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. If an
224 operation was partially finished when the operation was cancelled the
225 partial result will be returned, without an error.
226 </p>
227 <p>
228 On error -1 is returned and <em class="parameter"><code>error</code></em> is set accordingly.
229 </p>
230 <p>
231 Virtual: write_fn
232 </p>
233 <div class="variablelist"><table border="0">
234 <col align="left" valign="top">
235 <tbody>
236 <tr>
237 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
238 <td>a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.</td>
239 </tr>
240 <tr>
241 <td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
242 <td>the buffer containing the data to write. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=count][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> guint8]</span>
243 </td>
244 </tr>
245 <tr>
246 <td><p><span class="term"><em class="parameter"><code>count</code></em> :</span></p></td>
247 <td>the number of bytes to write</td>
248 </tr>
249 <tr>
250 <td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
251 <td>optional cancellable object. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
252 </td>
253 </tr>
254 <tr>
255 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
256 <td>location to store the error occurring, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore</td>
257 </tr>
258 <tr>
259 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
260 <td>Number of bytes written, or -1 on error</td>
261 </tr>
262 </tbody>
263 </table></div>
264 </div>
265 <hr>
266 <div class="refsect2">
267 <a name="g-output-stream-write-all"></a><h3>g_output_stream_write_all ()</h3>
268 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_output_stream_write_all           (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
269                                                          <em class="parameter"><code>const <span class="type">void</span> *buffer</code></em>,
270                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> count</code></em>,
271                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *bytes_written</code></em>,
272                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
273                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
274 <p>
275 Tries to write <em class="parameter"><code>count</code></em> bytes from <em class="parameter"><code>buffer</code></em> into the stream. Will block
276 during the operation.
277 </p>
278 <p>
279 This function is similar to <a class="link" href="GOutputStream.html#g-output-stream-write" title="g_output_stream_write ()"><code class="function">g_output_stream_write()</code></a>, except it tries to
280 write as many bytes as requested, only stopping on an error.
281 </p>
282 <p>
283 On a successful write of <em class="parameter"><code>count</code></em> bytes, <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> is returned, and <em class="parameter"><code>bytes_written</code></em>
284 is set to <em class="parameter"><code>count</code></em>.
285 </p>
286 <p>
287 If there is an error during the operation <a href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> is returned and <em class="parameter"><code>error</code></em>
288 is set to indicate the error status, <em class="parameter"><code>bytes_written</code></em> is updated to contain
289 the number of bytes written into the stream before the error occurred.
290 </p>
291 <div class="variablelist"><table border="0">
292 <col align="left" valign="top">
293 <tbody>
294 <tr>
295 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
296 <td>a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.</td>
297 </tr>
298 <tr>
299 <td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
300 <td>the buffer containing the data to write. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=count][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> guint8]</span>
301 </td>
302 </tr>
303 <tr>
304 <td><p><span class="term"><em class="parameter"><code>count</code></em> :</span></p></td>
305 <td>the number of bytes to write</td>
306 </tr>
307 <tr>
308 <td><p><span class="term"><em class="parameter"><code>bytes_written</code></em> :</span></p></td>
309 <td>location to store the number of bytes that was
310 written to the stream. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span>
311 </td>
312 </tr>
313 <tr>
314 <td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
315 <td>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
316 </td>
317 </tr>
318 <tr>
319 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
320 <td>location to store the error occurring, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore</td>
321 </tr>
322 <tr>
323 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
324 <td>
325 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, <a href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if there was an error</td>
326 </tr>
327 </tbody>
328 </table></div>
329 </div>
330 <hr>
331 <div class="refsect2">
332 <a name="g-output-stream-splice"></a><h3>g_output_stream_splice ()</h3>
333 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>              g_output_stream_splice              (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
334                                                          <em class="parameter"><code><a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a> *source</code></em>,
335                                                          <em class="parameter"><code><a class="link" href="GOutputStream.html#GOutputStreamSpliceFlags" title="enum GOutputStreamSpliceFlags"><span class="type">GOutputStreamSpliceFlags</span></a> flags</code></em>,
336                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
337                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
338 <p>
339 Splices an input stream into an output stream.
340 </p>
341 <div class="variablelist"><table border="0">
342 <col align="left" valign="top">
343 <tbody>
344 <tr>
345 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
346 <td>a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.</td>
347 </tr>
348 <tr>
349 <td><p><span class="term"><em class="parameter"><code>source</code></em> :</span></p></td>
350 <td>a <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a>.</td>
351 </tr>
352 <tr>
353 <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
354 <td>a set of <a class="link" href="GOutputStream.html#GOutputStreamSpliceFlags" title="enum GOutputStreamSpliceFlags"><span class="type">GOutputStreamSpliceFlags</span></a>.</td>
355 </tr>
356 <tr>
357 <td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
358 <td>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
359 </td>
360 </tr>
361 <tr>
362 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
363 <td>a <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> location to store the error occurring, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to
364 ignore.</td>
365 </tr>
366 <tr>
367 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
368 <td>a <a href="./../glib/glib/glib-Basic-Types.html#gssize"><span class="type">gssize</span></a> containing the size of the data spliced, or
369 -1 if an error occurred. Note that if the number of bytes
370 spliced is greater than <a href="./../glib/glib/glib-Basic-Types.html#G-MAXSSIZE:CAPS"><code class="literal">G_MAXSSIZE</code></a>, then that will be
371 returned, and there is no way to determine the actual number
372 of bytes spliced.</td>
373 </tr>
374 </tbody>
375 </table></div>
376 </div>
377 <hr>
378 <div class="refsect2">
379 <a name="g-output-stream-flush"></a><h3>g_output_stream_flush ()</h3>
380 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_output_stream_flush               (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
381                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
382                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
383 <p>
384 Forces a write of all user-space buffered data for the given
385 <em class="parameter"><code>stream</code></em>. Will block during the operation. Closing the stream will
386 implicitly cause a flush.
387 </p>
388 <p>
389 This function is optional for inherited classes.
390 </p>
391 <p>
392 If <em class="parameter"><code>cancellable</code></em> is not <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then the operation can be cancelled by
393 triggering the cancellable object from another thread. If the operation
394 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.
395 </p>
396 <div class="variablelist"><table border="0">
397 <col align="left" valign="top">
398 <tbody>
399 <tr>
400 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
401 <td>a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.</td>
402 </tr>
403 <tr>
404 <td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
405 <td>optional cancellable object. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
406 </td>
407 </tr>
408 <tr>
409 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
410 <td>location to store the error occurring, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore</td>
411 </tr>
412 <tr>
413 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
414 <td>
415 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, <a href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> on error</td>
416 </tr>
417 </tbody>
418 </table></div>
419 </div>
420 <hr>
421 <div class="refsect2">
422 <a name="g-output-stream-close"></a><h3>g_output_stream_close ()</h3>
423 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_output_stream_close               (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
424                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
425                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
426 <p>
427 Closes the stream, releasing resources related to it.
428 </p>
429 <p>
430 Once the stream is closed, all other operations will return <a class="link" href="gio-GIOError.html#G-IO-ERROR-CLOSED:CAPS"><code class="literal">G_IO_ERROR_CLOSED</code></a>.
431 Closing a stream multiple times will not return an error.
432 </p>
433 <p>
434 Closing a stream will automatically flush any outstanding buffers in the
435 stream.
436 </p>
437 <p>
438 Streams will be automatically closed when the last reference
439 is dropped, but you might want to call this function to make sure 
440 resources are released as early as possible.
441 </p>
442 <p>
443 Some streams might keep the backing store of the stream (e.g. a file descriptor)
444 open after the stream is closed. See the documentation for the individual
445 stream for details.
446 </p>
447 <p>
448 On failure the first error that happened will be reported, but the close
449 operation will finish as much as possible. A stream that failed to
450 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
451 is important to check and report the error to the user, otherwise
452 there might be a loss of data as all data might not be written.
453 </p>
454 <p>
455 If <em class="parameter"><code>cancellable</code></em> is not <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then the operation can be cancelled by
456 triggering the cancellable object from another thread. If the operation
457 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.
458 Cancelling a close will still leave the stream closed, but there some streams
459 can use a faster close that doesn't block to e.g. check errors. On
460 cancellation (as with any error) there is no guarantee that all written
461 data will reach the target.
462 </p>
463 <div class="variablelist"><table border="0">
464 <col align="left" valign="top">
465 <tbody>
466 <tr>
467 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
468 <td>A <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.</td>
469 </tr>
470 <tr>
471 <td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
472 <td>optional cancellable object. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
473 </td>
474 </tr>
475 <tr>
476 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
477 <td>location to store the error occurring, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore</td>
478 </tr>
479 <tr>
480 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
481 <td>
482 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, <a href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> on failure</td>
483 </tr>
484 </tbody>
485 </table></div>
486 </div>
487 <hr>
488 <div class="refsect2">
489 <a name="g-output-stream-write-async"></a><h3>g_output_stream_write_async ()</h3>
490 <pre class="programlisting"><span class="returnvalue">void</span>                g_output_stream_write_async         (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
491                                                          <em class="parameter"><code>const <span class="type">void</span> *buffer</code></em>,
492                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> count</code></em>,
493                                                          <em class="parameter"><code><span class="type">int</span> io_priority</code></em>,
494                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
495                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
496                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
497 <p>
498 Request an asynchronous write of <em class="parameter"><code>count</code></em> bytes from <em class="parameter"><code>buffer</code></em> into 
499 the stream. When the operation is finished <em class="parameter"><code>callback</code></em> will be called.
500 You can then call <a class="link" href="GOutputStream.html#g-output-stream-write-finish" title="g_output_stream_write_finish ()"><code class="function">g_output_stream_write_finish()</code></a> to get the result of the 
501 operation.
502 </p>
503 <p>
504 During an async request no other sync and async calls are allowed, 
505 and will result in <a class="link" href="gio-GIOError.html#G-IO-ERROR-PENDING:CAPS"><code class="literal">G_IO_ERROR_PENDING</code></a> errors. 
506 </p>
507 <p>
508 A value of <em class="parameter"><code>count</code></em> larger than <a href="./../glib/glib/glib-Basic-Types.html#G-MAXSSIZE:CAPS"><code class="literal">G_MAXSSIZE</code></a> will cause a 
509 <a class="link" href="gio-GIOError.html#G-IO-ERROR-INVALID-ARGUMENT:CAPS"><code class="literal">G_IO_ERROR_INVALID_ARGUMENT</code></a> error.
510 </p>
511 <p>
512 On success, the number of bytes written will be passed to the
513 <em class="parameter"><code>callback</code></em>. It is not an error if this is not the same as the 
514 requested size, as it can happen e.g. on a partial I/O error, 
515 but generally we try to write as many bytes as requested. 
516 </p>
517 <p>
518 You are guaranteed that this method will never fail with
519 <a class="link" href="gio-GIOError.html#G-IO-ERROR-WOULD-BLOCK:CAPS"><code class="literal">G_IO_ERROR_WOULD_BLOCK</code></a> - if <em class="parameter"><code>stream</code></em> can't accept more data, the
520 method will just wait until this changes.
521 </p>
522 <p>
523 Any outstanding I/O request with higher priority (lower numerical 
524 value) will be executed before an outstanding request with lower 
525 priority. Default priority is <a href="./../glib/glib/glib-The-Main-Event-Loop.html#G-PRIORITY-DEFAULT:CAPS"><code class="literal">G_PRIORITY_DEFAULT</code></a>.
526 </p>
527 <p>
528 The asyncronous methods have a default fallback that uses threads 
529 to implement asynchronicity, so they are optional for inheriting 
530 classes. However, if you override one you must override all.
531 </p>
532 <p>
533 For the synchronous, blocking version of this function, see 
534 <a class="link" href="GOutputStream.html#g-output-stream-write" title="g_output_stream_write ()"><code class="function">g_output_stream_write()</code></a>.
535 </p>
536 <div class="variablelist"><table border="0">
537 <col align="left" valign="top">
538 <tbody>
539 <tr>
540 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
541 <td>A <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.</td>
542 </tr>
543 <tr>
544 <td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
545 <td>the buffer containing the data to write. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=count][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> guint8]</span>
546 </td>
547 </tr>
548 <tr>
549 <td><p><span class="term"><em class="parameter"><code>count</code></em> :</span></p></td>
550 <td>the number of bytes to write</td>
551 </tr>
552 <tr>
553 <td><p><span class="term"><em class="parameter"><code>io_priority</code></em> :</span></p></td>
554 <td>the io priority of the request.</td>
555 </tr>
556 <tr>
557 <td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
558 <td>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
559 </td>
560 </tr>
561 <tr>
562 <td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
563 <td>callback to call when the request is satisfied. <span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span>
564 </td>
565 </tr>
566 <tr>
567 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
568 <td>the data to pass to callback function. <span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span>
569 </td>
570 </tr>
571 </tbody>
572 </table></div>
573 </div>
574 <hr>
575 <div class="refsect2">
576 <a name="g-output-stream-write-finish"></a><h3>g_output_stream_write_finish ()</h3>
577 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>              g_output_stream_write_finish        (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
578                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
579                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
580 <p>
581 Finishes a stream write operation.
582 </p>
583 <div class="variablelist"><table border="0">
584 <col align="left" valign="top">
585 <tbody>
586 <tr>
587 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
588 <td>a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.</td>
589 </tr>
590 <tr>
591 <td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
592 <td>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.</td>
593 </tr>
594 <tr>
595 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
596 <td>a <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> location to store the error occurring, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to
597 ignore.</td>
598 </tr>
599 <tr>
600 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
601 <td>a <a href="./../glib/glib/glib-Basic-Types.html#gssize"><span class="type">gssize</span></a> containing the number of bytes written to the stream.</td>
602 </tr>
603 </tbody>
604 </table></div>
605 </div>
606 <hr>
607 <div class="refsect2">
608 <a name="g-output-stream-splice-async"></a><h3>g_output_stream_splice_async ()</h3>
609 <pre class="programlisting"><span class="returnvalue">void</span>                g_output_stream_splice_async        (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
610                                                          <em class="parameter"><code><a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a> *source</code></em>,
611                                                          <em class="parameter"><code><a class="link" href="GOutputStream.html#GOutputStreamSpliceFlags" title="enum GOutputStreamSpliceFlags"><span class="type">GOutputStreamSpliceFlags</span></a> flags</code></em>,
612                                                          <em class="parameter"><code><span class="type">int</span> io_priority</code></em>,
613                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
614                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
615                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
616 <p>
617 Splices a stream asynchronously.
618 When the operation is finished <em class="parameter"><code>callback</code></em> will be called.
619 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 
620 result of the operation.
621 </p>
622 <p>
623 For the synchronous, blocking version of this function, see 
624 <a class="link" href="GOutputStream.html#g-output-stream-splice" title="g_output_stream_splice ()"><code class="function">g_output_stream_splice()</code></a>.
625 </p>
626 <div class="variablelist"><table border="0">
627 <col align="left" valign="top">
628 <tbody>
629 <tr>
630 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
631 <td>a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.</td>
632 </tr>
633 <tr>
634 <td><p><span class="term"><em class="parameter"><code>source</code></em> :</span></p></td>
635 <td>a <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a>.</td>
636 </tr>
637 <tr>
638 <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
639 <td>a set of <a class="link" href="GOutputStream.html#GOutputStreamSpliceFlags" title="enum GOutputStreamSpliceFlags"><span class="type">GOutputStreamSpliceFlags</span></a>.</td>
640 </tr>
641 <tr>
642 <td><p><span class="term"><em class="parameter"><code>io_priority</code></em> :</span></p></td>
643 <td>the io priority of the request.</td>
644 </tr>
645 <tr>
646 <td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
647 <td>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
648 </td>
649 </tr>
650 <tr>
651 <td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
652 <td>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>. <span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span>
653 </td>
654 </tr>
655 <tr>
656 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
657 <td>user data passed to <em class="parameter"><code>callback</code></em>. <span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span>
658 </td>
659 </tr>
660 </tbody>
661 </table></div>
662 </div>
663 <hr>
664 <div class="refsect2">
665 <a name="g-output-stream-splice-finish"></a><h3>g_output_stream_splice_finish ()</h3>
666 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>              g_output_stream_splice_finish       (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
667                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
668                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
669 <p>
670 Finishes an asynchronous stream splice operation.
671 </p>
672 <div class="variablelist"><table border="0">
673 <col align="left" valign="top">
674 <tbody>
675 <tr>
676 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
677 <td>a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.</td>
678 </tr>
679 <tr>
680 <td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
681 <td>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.</td>
682 </tr>
683 <tr>
684 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
685 <td>a <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> location to store the error occurring, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to
686 ignore.</td>
687 </tr>
688 <tr>
689 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
690 <td>a <a href="./../glib/glib/glib-Basic-Types.html#gssize"><span class="type">gssize</span></a> of the number of bytes spliced. Note that if the
691 number of bytes spliced is greater than <a href="./../glib/glib/glib-Basic-Types.html#G-MAXSSIZE:CAPS"><code class="literal">G_MAXSSIZE</code></a>, then that
692 will be returned, and there is no way to determine the actual
693 number of bytes spliced.</td>
694 </tr>
695 </tbody>
696 </table></div>
697 </div>
698 <hr>
699 <div class="refsect2">
700 <a name="g-output-stream-flush-async"></a><h3>g_output_stream_flush_async ()</h3>
701 <pre class="programlisting"><span class="returnvalue">void</span>                g_output_stream_flush_async         (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
702                                                          <em class="parameter"><code><span class="type">int</span> io_priority</code></em>,
703                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
704                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
705                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
706 <p>
707 Forces an asynchronous write of all user-space buffered data for
708 the given <em class="parameter"><code>stream</code></em>.
709 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>.
710 </p>
711 <p>
712 When the operation is finished <em class="parameter"><code>callback</code></em> will be 
713 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 
714 result of the operation.
715 </p>
716 <div class="variablelist"><table border="0">
717 <col align="left" valign="top">
718 <tbody>
719 <tr>
720 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
721 <td>a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.</td>
722 </tr>
723 <tr>
724 <td><p><span class="term"><em class="parameter"><code>io_priority</code></em> :</span></p></td>
725 <td>the io priority of the request.</td>
726 </tr>
727 <tr>
728 <td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
729 <td>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
730 </td>
731 </tr>
732 <tr>
733 <td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
734 <td>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied. <span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span>
735 </td>
736 </tr>
737 <tr>
738 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
739 <td>the data to pass to callback function. <span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span>
740 </td>
741 </tr>
742 </tbody>
743 </table></div>
744 </div>
745 <hr>
746 <div class="refsect2">
747 <a name="g-output-stream-flush-finish"></a><h3>g_output_stream_flush_finish ()</h3>
748 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_output_stream_flush_finish        (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
749                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
750                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
751 <p>
752 Finishes flushing an output stream.
753 </p>
754 <div class="variablelist"><table border="0">
755 <col align="left" valign="top">
756 <tbody>
757 <tr>
758 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
759 <td>a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.</td>
760 </tr>
761 <tr>
762 <td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
763 <td>a GAsyncResult.</td>
764 </tr>
765 <tr>
766 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
767 <td>a <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> location to store the error occurring, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to
768 ignore.</td>
769 </tr>
770 <tr>
771 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
772 <td>
773 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if flush operation succeeded, <a href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</td>
774 </tr>
775 </tbody>
776 </table></div>
777 </div>
778 <hr>
779 <div class="refsect2">
780 <a name="g-output-stream-close-async"></a><h3>g_output_stream_close_async ()</h3>
781 <pre class="programlisting"><span class="returnvalue">void</span>                g_output_stream_close_async         (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
782                                                          <em class="parameter"><code><span class="type">int</span> io_priority</code></em>,
783                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
784                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
785                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
786 <p>
787 Requests an asynchronous close of the stream, releasing resources 
788 related to it. When the operation is finished <em class="parameter"><code>callback</code></em> will be 
789 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 
790 the result of the operation.
791 </p>
792 <p>
793 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>.
794 </p>
795 <p>
796 The asyncronous methods have a default fallback that uses threads 
797 to implement asynchronicity, so they are optional for inheriting 
798 classes. However, if you override one you must override all.
799 </p>
800 <div class="variablelist"><table border="0">
801 <col align="left" valign="top">
802 <tbody>
803 <tr>
804 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
805 <td>A <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.</td>
806 </tr>
807 <tr>
808 <td><p><span class="term"><em class="parameter"><code>io_priority</code></em> :</span></p></td>
809 <td>the io priority of the request.</td>
810 </tr>
811 <tr>
812 <td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
813 <td>optional cancellable object. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
814 </td>
815 </tr>
816 <tr>
817 <td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
818 <td>callback to call when the request is satisfied. <span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span>
819 </td>
820 </tr>
821 <tr>
822 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
823 <td>the data to pass to callback function. <span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span>
824 </td>
825 </tr>
826 </tbody>
827 </table></div>
828 </div>
829 <hr>
830 <div class="refsect2">
831 <a name="g-output-stream-close-finish"></a><h3>g_output_stream_close_finish ()</h3>
832 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_output_stream_close_finish        (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
833                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
834                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
835 <p>
836 Closes an output stream.
837 </p>
838 <div class="variablelist"><table border="0">
839 <col align="left" valign="top">
840 <tbody>
841 <tr>
842 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
843 <td>a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.</td>
844 </tr>
845 <tr>
846 <td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
847 <td>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.</td>
848 </tr>
849 <tr>
850 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
851 <td>a <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> location to store the error occurring, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to
852 ignore.</td>
853 </tr>
854 <tr>
855 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
856 <td>
857 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if stream was successfully closed, <a href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</td>
858 </tr>
859 </tbody>
860 </table></div>
861 </div>
862 <hr>
863 <div class="refsect2">
864 <a name="g-output-stream-is-closing"></a><h3>g_output_stream_is_closing ()</h3>
865 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_output_stream_is_closing          (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>);</pre>
866 <p>
867 Checks if an output stream is being closed. This can be
868 used inside e.g. a flush implementation to see if the
869 flush (or other i/o operation) is called from within
870 the closing operation.
871 </p>
872 <div class="variablelist"><table border="0">
873 <col align="left" valign="top">
874 <tbody>
875 <tr>
876 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
877 <td>a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.</td>
878 </tr>
879 <tr>
880 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
881 <td>
882 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>stream</code></em> is being closed. <a href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</td>
883 </tr>
884 </tbody>
885 </table></div>
886 <p class="since">Since 2.24</p>
887 </div>
888 <hr>
889 <div class="refsect2">
890 <a name="g-output-stream-is-closed"></a><h3>g_output_stream_is_closed ()</h3>
891 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_output_stream_is_closed           (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>);</pre>
892 <p>
893 Checks if an output stream has already been closed.
894 </p>
895 <div class="variablelist"><table border="0">
896 <col align="left" valign="top">
897 <tbody>
898 <tr>
899 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
900 <td>a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.</td>
901 </tr>
902 <tr>
903 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
904 <td>
905 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>stream</code></em> is closed. <a href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</td>
906 </tr>
907 </tbody>
908 </table></div>
909 </div>
910 <hr>
911 <div class="refsect2">
912 <a name="g-output-stream-has-pending"></a><h3>g_output_stream_has_pending ()</h3>
913 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_output_stream_has_pending         (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>);</pre>
914 <p>
915 Checks if an ouput stream has pending actions.
916 </p>
917 <div class="variablelist"><table border="0">
918 <col align="left" valign="top">
919 <tbody>
920 <tr>
921 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
922 <td>a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.</td>
923 </tr>
924 <tr>
925 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
926 <td>
927 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>stream</code></em> has pending actions.</td>
928 </tr>
929 </tbody>
930 </table></div>
931 </div>
932 <hr>
933 <div class="refsect2">
934 <a name="g-output-stream-set-pending"></a><h3>g_output_stream_set_pending ()</h3>
935 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_output_stream_set_pending         (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>,
936                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
937 <p>
938 Sets <em class="parameter"><code>stream</code></em> to have actions pending. If the pending flag is
939 already set or <em class="parameter"><code>stream</code></em> is closed, it will return <a href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> and set
940 <em class="parameter"><code>error</code></em>.
941 </p>
942 <div class="variablelist"><table border="0">
943 <col align="left" valign="top">
944 <tbody>
945 <tr>
946 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
947 <td>a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.</td>
948 </tr>
949 <tr>
950 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
951 <td>a <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> location to store the error occurring, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to
952 ignore.</td>
953 </tr>
954 <tr>
955 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
956 <td>
957 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if pending was previously unset and is now set.</td>
958 </tr>
959 </tbody>
960 </table></div>
961 </div>
962 <hr>
963 <div class="refsect2">
964 <a name="g-output-stream-clear-pending"></a><h3>g_output_stream_clear_pending ()</h3>
965 <pre class="programlisting"><span class="returnvalue">void</span>                g_output_stream_clear_pending       (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>);</pre>
966 <p>
967 Clears the pending flag on <em class="parameter"><code>stream</code></em>.
968 </p>
969 <div class="variablelist"><table border="0">
970 <col align="left" valign="top">
971 <tbody><tr>
972 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
973 <td>output stream</td>
974 </tr></tbody>
975 </table></div>
976 </div>
977 </div>
978 </div>
979 <div class="footer">
980 <hr>
981           Generated by GTK-Doc V1.18</div>
982 </body>
983 </html>