Initial commit
[platform/upstream/glib2.0.git] / docs / reference / gio / html / GIOStream.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>GIOStream</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
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="GOutputStream.html" title="GOutputStream">
10 <link rel="next" href="GFileInputStream.html" title="GFileInputStream">
11 <meta name="generator" content="GTK-Doc V1.13 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 <link rel="part" href="pt01.html" title="Part I. GIO Overview">
14 <link rel="chapter" href="ch01.html" title="Introduction">
15 <link rel="chapter" href="ch02.html" title="Compiling GIO applications">
16 <link rel="chapter" href="ch03.html" title="Running GIO applications">
17 <link rel="chapter" href="extending-gio.html" title="Extending GIO">
18 <link rel="part" href="pt02.html" title="Part II. API Reference">
19 <link rel="chapter" href="file_ops.html" title="File Operations">
20 <link rel="chapter" href="file_mon.html" title="File System Monitoring">
21 <link rel="chapter" href="async.html" title="Asynchronous I/O">
22 <link rel="chapter" href="conversion.html" title="Data conversion">
23 <link rel="chapter" href="streaming.html" title="Streaming I/O">
24 <link rel="chapter" href="types.html" title="File types and applications">
25 <link rel="chapter" href="volume_mon.html" title="Volumes and Drives">
26 <link rel="chapter" href="icons.html" title="Icons">
27 <link rel="chapter" href="failable_initialization.html" title="Failable Initialization">
28 <link rel="chapter" href="networking.html" title="Lowlevel platform-independent network support">
29 <link rel="chapter" href="resolver.html" title="DNS resolution">
30 <link rel="chapter" href="highlevel-socket.html" title="Highlevel network functionallity">
31 <link rel="chapter" href="utils.html" title="Utilities">
32 <link rel="chapter" href="extending.html" title="Extending GIO">
33 <link rel="part" href="migrating.html" title="Part III. Migrating to GIO">
34 <link rel="chapter" href="ch19.html" title="Migrating from POSIX to GIO">
35 <link rel="chapter" href="ch20.html" title="Migrating from GnomeVFS to GIO">
36 <link rel="chapter" href="gio-hierarchy.html" title="Object Hierarchy">
37 <link rel="index" href="api-index-full.html" title="Index">
38 <link rel="index" href="api-index-deprecated.html" title="Index of deprecated symbols">
39 <link rel="index" href="api-index-2-18.html" title="Index of new symbols in 2.18">
40 <link rel="index" href="api-index-2-20.html" title="Index of new symbols in 2.20">
41 <link rel="index" href="api-index-2-22.html" title="Index of new symbols in 2.22">
42 <link rel="index" href="api-index-2-24.html" title="Index of new symbols in 2.24">
43 </head>
44 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
45 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
46 <tr valign="middle">
47 <td><a accesskey="p" href="GOutputStream.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
48 <td><a accesskey="u" href="streaming.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
49 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
50 <th width="100%" align="center">GIO Reference Manual</th>
51 <td><a accesskey="n" href="GFileInputStream.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
52 </tr>
53 <tr><td colspan="5" class="shortcuts">
54 <a href="#GIOStream.synopsis" class="shortcut">Top</a>
55                    | 
56                   <a href="#GIOStream.description" class="shortcut">Description</a>
57                    | 
58                   <a href="#GIOStream.object-hierarchy" class="shortcut">Object Hierarchy</a>
59                    | 
60                   <a href="#GIOStream.properties" class="shortcut">Properties</a>
61 </td></tr>
62 </table>
63 <div class="refentry" title="GIOStream">
64 <a name="GIOStream"></a><div class="titlepage"></div>
65 <div class="refnamediv"><table width="100%"><tr>
66 <td valign="top">
67 <h2><span class="refentrytitle"><a name="GIOStream.top_of_page"></a>GIOStream</span></h2>
68 <p>GIOStream — Base class for implementing read/write streams</p>
69 </td>
70 <td valign="top" align="right"></td>
71 </tr></table></div>
72 <div class="refsynopsisdiv" title="Synopsis">
73 <a name="GIOStream.synopsis"></a><h2>Synopsis</h2>
74 <pre class="synopsis">
75 #include &lt;gio/gio.h&gt;
76
77                     <a class="link" href="GIOStream.html#GIOStream-struct" title="GIOStream">GIOStream</a>;
78 <a class="link" href="GInputStream.html" title="GInputStream"><span class="returnvalue">GInputStream</span></a> *      <a class="link" href="GIOStream.html#g-io-stream-get-input-stream" title="g_io_stream_get_input_stream ()">g_io_stream_get_input_stream</a>        (<a class="link" href="GIOStream.html" title="GIOStream"><span class="returnvalue">GIOStream</span></a> *stream);
79 <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="returnvalue">GOutputStream</span></a> *     <a class="link" href="GIOStream.html#g-io-stream-get-output-stream" title="g_io_stream_get_output_stream ()">g_io_stream_get_output_stream</a>       (<a class="link" href="GIOStream.html" title="GIOStream"><span class="returnvalue">GIOStream</span></a> *stream);
80 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GIOStream.html#g-io-stream-close" title="g_io_stream_close ()">g_io_stream_close</a>                   (<a class="link" href="GIOStream.html" title="GIOStream"><span class="returnvalue">GIOStream</span></a> *stream,
81                                                          <a class="link" href="GCancellable.html" title="GCancellable"><span class="returnvalue">GCancellable</span></a> *cancellable,
82                                                          <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="returnvalue">GError</span></a> **error);
83 <span class="returnvalue">void</span>                <a class="link" href="GIOStream.html#g-io-stream-close-async" title="g_io_stream_close_async ()">g_io_stream_close_async</a>             (<a class="link" href="GIOStream.html" title="GIOStream"><span class="returnvalue">GIOStream</span></a> *stream,
84                                                          <span class="returnvalue">int</span> io_priority,
85                                                          <a class="link" href="GCancellable.html" title="GCancellable"><span class="returnvalue">GCancellable</span></a> *cancellable,
86                                                          <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="returnvalue">GAsyncReadyCallback</span></a> callback,
87                                                          <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> user_data);
88 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GIOStream.html#g-io-stream-close-finish" title="g_io_stream_close_finish ()">g_io_stream_close_finish</a>            (<a class="link" href="GIOStream.html" title="GIOStream"><span class="returnvalue">GIOStream</span></a> *stream,
89                                                          <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="returnvalue">GAsyncResult</span></a> *result,
90                                                          <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="returnvalue">GError</span></a> **error);
91 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GIOStream.html#g-io-stream-is-closed" title="g_io_stream_is_closed ()">g_io_stream_is_closed</a>               (<a class="link" href="GIOStream.html" title="GIOStream"><span class="returnvalue">GIOStream</span></a> *stream);
92 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GIOStream.html#g-io-stream-has-pending" title="g_io_stream_has_pending ()">g_io_stream_has_pending</a>             (<a class="link" href="GIOStream.html" title="GIOStream"><span class="returnvalue">GIOStream</span></a> *stream);
93 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GIOStream.html#g-io-stream-set-pending" title="g_io_stream_set_pending ()">g_io_stream_set_pending</a>             (<a class="link" href="GIOStream.html" title="GIOStream"><span class="returnvalue">GIOStream</span></a> *stream,
94                                                          <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="returnvalue">GError</span></a> **error);
95 <span class="returnvalue">void</span>                <a class="link" href="GIOStream.html#g-io-stream-clear-pending" title="g_io_stream_clear_pending ()">g_io_stream_clear_pending</a>           (<a class="link" href="GIOStream.html" title="GIOStream"><span class="returnvalue">GIOStream</span></a> *stream);
96 </pre>
97 </div>
98 <div class="refsect1" title="Object Hierarchy">
99 <a name="GIOStream.object-hierarchy"></a><h2>Object Hierarchy</h2>
100 <pre class="synopsis">
101   <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
102    +----GIOStream
103          +----<a class="link" href="GFileIOStream.html" title="GFileIOStream">GFileIOStream</a>
104          +----<a class="link" href="GSocketConnection.html" title="GSocketConnection">GSocketConnection</a>
105 </pre>
106 </div>
107 <div class="refsect1" title="Properties">
108 <a name="GIOStream.properties"></a><h2>Properties</h2>
109 <pre class="synopsis">
110   "<a class="link" href="GIOStream.html#GIOStream--closed" title='The "closed" property'>closed</a>"                   <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>              : Read / Write
111   "<a class="link" href="GIOStream.html#GIOStream--input-stream" title='The "input-stream" property'>input-stream</a>"             <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a>*         : Read
112   "<a class="link" href="GIOStream.html#GIOStream--output-stream" title='The "output-stream" property'>output-stream</a>"            <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>*        : Read
113 </pre>
114 </div>
115 <div class="refsect1" title="Description">
116 <a name="GIOStream.description"></a><h2>Description</h2>
117 <p>
118 GIOStream represents an object that has both read and write streams.
119 Generally the two streams acts as separate input and output streams,
120 but they share some common resources and state. For instance, for
121 seekable streams they may use the same position in both streams.
122 </p>
123 <p>
124 Examples of <a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a> objects are <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> which represents
125 a two-way network connection, and <a class="link" href="GFileIOStream.html" title="GFileIOStream"><span class="type">GFileIOStream</span></a> which represent a
126 file handle opened in read-write mode.
127 </p>
128 <p>
129 To do the actual reading and writing you need to get the substreams
130 with <a class="link" href="GIOStream.html#g-io-stream-get-input-stream" title="g_io_stream_get_input_stream ()"><code class="function">g_io_stream_get_input_stream()</code></a> and <a class="link" href="GIOStream.html#g-io-stream-get-output-stream" title="g_io_stream_get_output_stream ()"><code class="function">g_io_stream_get_output_stream()</code></a>.
131 </p>
132 <p>
133 The <a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a> object owns the input and the output streams, not the other
134 way around, so keeping the substreams alive will not keep the <a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a>
135 object alive. If the <a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a> object is freed it will be closed, thus
136 closing the substream, so even if the substreams stay alive they will
137 always just return a <a class="link" href="gio-GIOError.html#G-IO-ERROR-CLOSED:CAPS"><code class="literal">G_IO_ERROR_CLOSED</code></a> for all operations.
138 </p>
139 <p>
140 To close a stream use <a class="link" href="GIOStream.html#g-io-stream-close" title="g_io_stream_close ()"><code class="function">g_io_stream_close()</code></a> which will close the common
141 stream object and also the individual substreams. You can also close
142 the substreams themselves. In most cases this only marks the
143 substream as closed, so further I/O on it fails. However, some streams
144 may support "half-closed" states where one direction of the stream
145 is actually shut down.</p>
146 </div>
147 <div class="refsect1" title="Details">
148 <a name="GIOStream.details"></a><h2>Details</h2>
149 <div class="refsect2" title="GIOStream">
150 <a name="GIOStream-struct"></a><h3>GIOStream</h3>
151 <pre class="programlisting">typedef struct _GIOStream GIOStream;</pre>
152 <p>
153 Base class for read-write streams.</p>
154 </div>
155 <hr>
156 <div class="refsect2" title="g_io_stream_get_input_stream ()">
157 <a name="g-io-stream-get-input-stream"></a><h3>g_io_stream_get_input_stream ()</h3>
158 <pre class="programlisting"><a class="link" href="GInputStream.html" title="GInputStream"><span class="returnvalue">GInputStream</span></a> *      g_io_stream_get_input_stream        (<a class="link" href="GIOStream.html" title="GIOStream"><span class="returnvalue">GIOStream</span></a> *stream);</pre>
159 <p>
160 Gets the input stream for this object. This is used
161 for reading.</p>
162 <div class="variablelist"><table border="0">
163 <col align="left" valign="top">
164 <tbody>
165 <tr>
166 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
167 <td> a <a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a>
168 </td>
169 </tr>
170 <tr>
171 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
172 <td> a <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a>, owned by the <a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a>. Do not free.
173
174 </td>
175 </tr>
176 </tbody>
177 </table></div>
178 <p class="since">Since 2.22</p>
179 </div>
180 <hr>
181 <div class="refsect2" title="g_io_stream_get_output_stream ()">
182 <a name="g-io-stream-get-output-stream"></a><h3>g_io_stream_get_output_stream ()</h3>
183 <pre class="programlisting"><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="returnvalue">GOutputStream</span></a> *     g_io_stream_get_output_stream       (<a class="link" href="GIOStream.html" title="GIOStream"><span class="returnvalue">GIOStream</span></a> *stream);</pre>
184 <p>
185 Gets the output stream for this object. This is used for
186 writing.</p>
187 <div class="variablelist"><table border="0">
188 <col align="left" valign="top">
189 <tbody>
190 <tr>
191 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
192 <td> a <a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a>
193 </td>
194 </tr>
195 <tr>
196 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
197 <td> a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>, owned by the <a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a>. Do not free.
198
199 </td>
200 </tr>
201 </tbody>
202 </table></div>
203 <p class="since">Since 2.22</p>
204 </div>
205 <hr>
206 <div class="refsect2" title="g_io_stream_close ()">
207 <a name="g-io-stream-close"></a><h3>g_io_stream_close ()</h3>
208 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_io_stream_close                   (<a class="link" href="GIOStream.html" title="GIOStream"><span class="returnvalue">GIOStream</span></a> *stream,
209                                                          <a class="link" href="GCancellable.html" title="GCancellable"><span class="returnvalue">GCancellable</span></a> *cancellable,
210                                                          <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="returnvalue">GError</span></a> **error);</pre>
211 <p>
212 Closes the stream, releasing resources related to it. This will also
213 closes the individual input and output streams, if they are not already
214 closed.
215 </p>
216 <p>
217 Once the stream is closed, all other operations will return
218 <a class="link" href="gio-GIOError.html#G-IO-ERROR-CLOSED:CAPS"><code class="literal">G_IO_ERROR_CLOSED</code></a>. Closing a stream multiple times will not
219 return an error.
220 </p>
221 <p>
222 Closing a stream will automatically flush any outstanding buffers
223 in the stream.
224 </p>
225 <p>
226 Streams will be automatically closed when the last reference
227 is dropped, but you might want to call this function to make sure
228 resources are released as early as possible.
229 </p>
230 <p>
231 Some streams might keep the backing store of the stream (e.g. a file
232 descriptor) open after the stream is closed. See the documentation for
233 the individual stream for details.
234 </p>
235 <p>
236 On failure the first error that happened will be reported, but the
237 close operation will finish as much as possible. A stream that failed
238 to 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.
239 Still, it is important to check and report the error to the user,
240 otherwise there might be a loss of data as all data might not be written.
241 </p>
242 <p>
243 If <em class="parameter"><code>cancellable</code></em> is not NULL, then the operation can be cancelled by
244 triggering the cancellable object from another thread. If the operation
245 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.
246 Cancelling a close will still leave the stream closed, but some streams
247 can use a faster close that doesn't block to e.g. check errors.
248 </p>
249 <p>
250 The default implementation of this method just calls close on the
251 individual input/output streams.</p>
252 <div class="variablelist"><table border="0">
253 <col align="left" valign="top">
254 <tbody>
255 <tr>
256 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
257 <td> a <a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a>
258 </td>
259 </tr>
260 <tr>
261 <td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
262 <td> optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore
263 </td>
264 </tr>
265 <tr>
266 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
267 <td> location to store the error occuring, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore
268 </td>
269 </tr>
270 <tr>
271 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
272 <td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> on failure
273
274 </td>
275 </tr>
276 </tbody>
277 </table></div>
278 <p class="since">Since 2.22</p>
279 </div>
280 <hr>
281 <div class="refsect2" title="g_io_stream_close_async ()">
282 <a name="g-io-stream-close-async"></a><h3>g_io_stream_close_async ()</h3>
283 <pre class="programlisting"><span class="returnvalue">void</span>                g_io_stream_close_async             (<a class="link" href="GIOStream.html" title="GIOStream"><span class="returnvalue">GIOStream</span></a> *stream,
284                                                          <span class="returnvalue">int</span> io_priority,
285                                                          <a class="link" href="GCancellable.html" title="GCancellable"><span class="returnvalue">GCancellable</span></a> *cancellable,
286                                                          <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="returnvalue">GAsyncReadyCallback</span></a> callback,
287                                                          <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> user_data);</pre>
288 <p>
289 Requests an asynchronous close of the stream, releasing resources
290 related to it. When the operation is finished <em class="parameter"><code>callback</code></em> will be
291 called. You can then call <a class="link" href="GIOStream.html#g-io-stream-close-finish" title="g_io_stream_close_finish ()"><code class="function">g_io_stream_close_finish()</code></a> to get
292 the result of the operation.
293 </p>
294 <p>
295 For behaviour details see <a class="link" href="GIOStream.html#g-io-stream-close" title="g_io_stream_close ()"><code class="function">g_io_stream_close()</code></a>.
296 </p>
297 <p>
298 The asynchronous methods have a default fallback that uses threads
299 to implement asynchronicity, so they are optional for inheriting
300 classes. However, if you override one you must override all.</p>
301 <div class="variablelist"><table border="0">
302 <col align="left" valign="top">
303 <tbody>
304 <tr>
305 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
306 <td> a <a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a>
307 </td>
308 </tr>
309 <tr>
310 <td><p><span class="term"><em class="parameter"><code>io_priority</code></em> :</span></p></td>
311 <td> the io priority of the request
312 </td>
313 </tr>
314 <tr>
315 <td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
316 <td> optional cancellable object
317 </td>
318 </tr>
319 <tr>
320 <td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
321 <td> callback to call when the request is satisfied
322 </td>
323 </tr>
324 <tr>
325 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
326 <td> the data to pass to callback function
327 </td>
328 </tr>
329 </tbody>
330 </table></div>
331 <p class="since">Since 2.22</p>
332 </div>
333 <hr>
334 <div class="refsect2" title="g_io_stream_close_finish ()">
335 <a name="g-io-stream-close-finish"></a><h3>g_io_stream_close_finish ()</h3>
336 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_io_stream_close_finish            (<a class="link" href="GIOStream.html" title="GIOStream"><span class="returnvalue">GIOStream</span></a> *stream,
337                                                          <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="returnvalue">GAsyncResult</span></a> *result,
338                                                          <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="returnvalue">GError</span></a> **error);</pre>
339 <p>
340 Closes a stream.</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="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a>
347 </td>
348 </tr>
349 <tr>
350 <td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
351 <td> a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>
352 </td>
353 </tr>
354 <tr>
355 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
356 <td> a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> location to store the error occuring, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to
357    ignore
358 </td>
359 </tr>
360 <tr>
361 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
362 <td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if stream was successfully closed, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.
363
364 </td>
365 </tr>
366 </tbody>
367 </table></div>
368 <p class="since">Since 2.22</p>
369 </div>
370 <hr>
371 <div class="refsect2" title="g_io_stream_is_closed ()">
372 <a name="g-io-stream-is-closed"></a><h3>g_io_stream_is_closed ()</h3>
373 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_io_stream_is_closed               (<a class="link" href="GIOStream.html" title="GIOStream"><span class="returnvalue">GIOStream</span></a> *stream);</pre>
374 <p>
375 Checks if a stream is closed.</p>
376 <div class="variablelist"><table border="0">
377 <col align="left" valign="top">
378 <tbody>
379 <tr>
380 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
381 <td> a <a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a>
382 </td>
383 </tr>
384 <tr>
385 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
386 <td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the stream is closed.
387
388 </td>
389 </tr>
390 </tbody>
391 </table></div>
392 <p class="since">Since 2.22</p>
393 </div>
394 <hr>
395 <div class="refsect2" title="g_io_stream_has_pending ()">
396 <a name="g-io-stream-has-pending"></a><h3>g_io_stream_has_pending ()</h3>
397 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_io_stream_has_pending             (<a class="link" href="GIOStream.html" title="GIOStream"><span class="returnvalue">GIOStream</span></a> *stream);</pre>
398 <p>
399 Checks if a stream has pending actions.</p>
400 <div class="variablelist"><table border="0">
401 <col align="left" valign="top">
402 <tbody>
403 <tr>
404 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
405 <td> a <a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a>
406 </td>
407 </tr>
408 <tr>
409 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
410 <td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>stream</code></em> has pending actions.
411
412 </td>
413 </tr>
414 </tbody>
415 </table></div>
416 <p class="since">Since 2.22</p>
417 </div>
418 <hr>
419 <div class="refsect2" title="g_io_stream_set_pending ()">
420 <a name="g-io-stream-set-pending"></a><h3>g_io_stream_set_pending ()</h3>
421 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_io_stream_set_pending             (<a class="link" href="GIOStream.html" title="GIOStream"><span class="returnvalue">GIOStream</span></a> *stream,
422                                                          <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="returnvalue">GError</span></a> **error);</pre>
423 <p>
424 Sets <em class="parameter"><code>stream</code></em> to have actions pending. If the pending flag is
425 already set or <em class="parameter"><code>stream</code></em> is closed, it will return <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> and set
426 <em class="parameter"><code>error</code></em>.</p>
427 <div class="variablelist"><table border="0">
428 <col align="left" valign="top">
429 <tbody>
430 <tr>
431 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
432 <td> a <a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a>
433 </td>
434 </tr>
435 <tr>
436 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
437 <td> a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> location to store the error occuring, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to
438     ignore
439 </td>
440 </tr>
441 <tr>
442 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
443 <td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if pending was previously unset and is now set.
444
445 </td>
446 </tr>
447 </tbody>
448 </table></div>
449 <p class="since">Since 2.22</p>
450 </div>
451 <hr>
452 <div class="refsect2" title="g_io_stream_clear_pending ()">
453 <a name="g-io-stream-clear-pending"></a><h3>g_io_stream_clear_pending ()</h3>
454 <pre class="programlisting"><span class="returnvalue">void</span>                g_io_stream_clear_pending           (<a class="link" href="GIOStream.html" title="GIOStream"><span class="returnvalue">GIOStream</span></a> *stream);</pre>
455 <p>
456 Clears the pending flag on <em class="parameter"><code>stream</code></em>.</p>
457 <div class="variablelist"><table border="0">
458 <col align="left" valign="top">
459 <tbody><tr>
460 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
461 <td> a <a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a>
462 </td>
463 </tr></tbody>
464 </table></div>
465 <p class="since">Since 2.22</p>
466 </div>
467 </div>
468 <div class="refsect1" title="Property Details">
469 <a name="GIOStream.property-details"></a><h2>Property Details</h2>
470 <div class="refsect2" title='The "closed" property'>
471 <a name="GIOStream--closed"></a><h3>The <code class="literal">"closed"</code> property</h3>
472 <pre class="programlisting">  "closed"                   <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>              : Read / Write</pre>
473 <p>Is the stream closed.</p>
474 <p>Default value: FALSE</p>
475 </div>
476 <hr>
477 <div class="refsect2" title='The "input-stream" property'>
478 <a name="GIOStream--input-stream"></a><h3>The <code class="literal">"input-stream"</code> property</h3>
479 <pre class="programlisting">  "input-stream"             <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a>*         : Read</pre>
480 <p>The GInputStream to read from.</p>
481 </div>
482 <hr>
483 <div class="refsect2" title='The "output-stream" property'>
484 <a name="GIOStream--output-stream"></a><h3>The <code class="literal">"output-stream"</code> property</h3>
485 <pre class="programlisting">  "output-stream"            <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>*        : Read</pre>
486 <p>The GOutputStream to write to.</p>
487 </div>
488 </div>
489 <div class="refsect1" title="See Also">
490 <a name="GIOStream.see-also"></a><h2>See Also</h2>
491 <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a>, <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>
492 </div>
493 </div>
494 <div class="footer">
495 <hr>
496           Generated by GTK-Doc V1.13</div>
497 </body>
498 </html>