61017db0ccab99c124fa6b515e9edf89439d1361
[platform/upstream/glib2.0.git] / docs / reference / gio / html / GUnixInputStream.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>GUnixInputStream</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="GDataOutputStream.html" title="GDataOutputStream">
10 <link rel="next" href="GUnixOutputStream.html" title="GUnixOutputStream">
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="GDataOutputStream.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="GUnixOutputStream.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="#GUnixInputStream.synopsis" class="shortcut">Top</a>
55                    | 
56                   <a href="#GUnixInputStream.description" class="shortcut">Description</a>
57                    | 
58                   <a href="#GUnixInputStream.object-hierarchy" class="shortcut">Object Hierarchy</a>
59                    | 
60                   <a href="#GUnixInputStream.properties" class="shortcut">Properties</a>
61 </td></tr>
62 </table>
63 <div class="refentry" title="GUnixInputStream">
64 <a name="GUnixInputStream"></a><div class="titlepage"></div>
65 <div class="refnamediv"><table width="100%"><tr>
66 <td valign="top">
67 <h2><span class="refentrytitle"><a name="GUnixInputStream.top_of_page"></a>GUnixInputStream</span></h2>
68 <p>GUnixInputStream — Streaming input operations for UNIX file descriptors</p>
69 </td>
70 <td valign="top" align="right"></td>
71 </tr></table></div>
72 <div class="refsynopsisdiv" title="Synopsis">
73 <a name="GUnixInputStream.synopsis"></a><h2>Synopsis</h2>
74 <pre class="synopsis">
75 #include &lt;gio/gunixinputstream.h&gt;
76
77                     <a class="link" href="GUnixInputStream.html#GUnixInputStream-struct" title="GUnixInputStream">GUnixInputStream</a>;
78 <a class="link" href="GInputStream.html" title="GInputStream"><span class="returnvalue">GInputStream</span></a> *      <a class="link" href="GUnixInputStream.html#g-unix-input-stream-new" title="g_unix_input_stream_new ()">g_unix_input_stream_new</a>             (<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> fd,
79                                                          <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> close_fd);
80 <span class="returnvalue">void</span>                <a class="link" href="GUnixInputStream.html#g-unix-input-stream-set-close-fd" title="g_unix_input_stream_set_close_fd ()">g_unix_input_stream_set_close_fd</a>    (<a class="link" href="GUnixInputStream.html" title="GUnixInputStream"><span class="returnvalue">GUnixInputStream</span></a> *stream,
81                                                          <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> close_fd);
82 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GUnixInputStream.html#g-unix-input-stream-get-close-fd" title="g_unix_input_stream_get_close_fd ()">g_unix_input_stream_get_close_fd</a>    (<a class="link" href="GUnixInputStream.html" title="GUnixInputStream"><span class="returnvalue">GUnixInputStream</span></a> *stream);
83 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                <a class="link" href="GUnixInputStream.html#g-unix-input-stream-get-fd" title="g_unix_input_stream_get_fd ()">g_unix_input_stream_get_fd</a>          (<a class="link" href="GUnixInputStream.html" title="GUnixInputStream"><span class="returnvalue">GUnixInputStream</span></a> *stream);
84 </pre>
85 </div>
86 <div class="refsect1" title="Object Hierarchy">
87 <a name="GUnixInputStream.object-hierarchy"></a><h2>Object Hierarchy</h2>
88 <pre class="synopsis">
89   <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
90    +----<a class="link" href="GInputStream.html" title="GInputStream">GInputStream</a>
91          +----GUnixInputStream
92 </pre>
93 </div>
94 <div class="refsect1" title="Properties">
95 <a name="GUnixInputStream.properties"></a><h2>Properties</h2>
96 <pre class="synopsis">
97   "<a class="link" href="GUnixInputStream.html#GUnixInputStream--close-fd" title='The "close-fd" property'>close-fd</a>"                 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>              : Read / Write
98   "<a class="link" href="GUnixInputStream.html#GUnixInputStream--fd" title='The "fd" property'>fd</a>"                       <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a>                  : Read / Write / Construct Only
99 </pre>
100 </div>
101 <div class="refsect1" title="Description">
102 <a name="GUnixInputStream.description"></a><h2>Description</h2>
103 <p>
104 <a class="link" href="GUnixInputStream.html" title="GUnixInputStream"><span class="type">GUnixInputStream</span></a> implements <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a> for reading from a
105 UNIX file descriptor, including asynchronous operations. The file
106 descriptor must be selectable, so it doesn't work with opened files.
107 </p>
108 <p>
109 Note that <code class="filename">&lt;gio/gunixinputstream.h&gt;</code> belongs 
110 to the UNIX-specific GIO interfaces, thus you have to use the 
111 <code class="filename">gio-unix-2.0.pc</code> pkg-config file when using it.</p>
112 </div>
113 <div class="refsect1" title="Details">
114 <a name="GUnixInputStream.details"></a><h2>Details</h2>
115 <div class="refsect2" title="GUnixInputStream">
116 <a name="GUnixInputStream-struct"></a><h3>GUnixInputStream</h3>
117 <pre class="programlisting">typedef struct _GUnixInputStream GUnixInputStream;</pre>
118 <p>
119 Implements <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a> for reading from selectable unix file descriptors</p>
120 </div>
121 <hr>
122 <div class="refsect2" title="g_unix_input_stream_new ()">
123 <a name="g-unix-input-stream-new"></a><h3>g_unix_input_stream_new ()</h3>
124 <pre class="programlisting"><a class="link" href="GInputStream.html" title="GInputStream"><span class="returnvalue">GInputStream</span></a> *      g_unix_input_stream_new             (<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> fd,
125                                                          <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> close_fd);</pre>
126 <p>
127 Creates a new <a class="link" href="GUnixInputStream.html" title="GUnixInputStream"><span class="type">GUnixInputStream</span></a> for the given <em class="parameter"><code>fd</code></em>. 
128 </p>
129 <p>
130 If <em class="parameter"><code>close_fd</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, the file descriptor will be closed 
131 when the stream is closed.</p>
132 <div class="variablelist"><table border="0">
133 <col align="left" valign="top">
134 <tbody>
135 <tr>
136 <td><p><span class="term"><em class="parameter"><code>fd</code></em> :</span></p></td>
137 <td> a UNIX file descriptor
138 </td>
139 </tr>
140 <tr>
141 <td><p><span class="term"><em class="parameter"><code>close_fd</code></em> :</span></p></td>
142 <td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to close the file descriptor when done
143 </td>
144 </tr>
145 <tr>
146 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
147 <td> a new <a class="link" href="GUnixInputStream.html" title="GUnixInputStream"><span class="type">GUnixInputStream</span></a>
148 </td>
149 </tr>
150 </tbody>
151 </table></div>
152 </div>
153 <hr>
154 <div class="refsect2" title="g_unix_input_stream_set_close_fd ()">
155 <a name="g-unix-input-stream-set-close-fd"></a><h3>g_unix_input_stream_set_close_fd ()</h3>
156 <pre class="programlisting"><span class="returnvalue">void</span>                g_unix_input_stream_set_close_fd    (<a class="link" href="GUnixInputStream.html" title="GUnixInputStream"><span class="returnvalue">GUnixInputStream</span></a> *stream,
157                                                          <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> close_fd);</pre>
158 <p>
159 Sets whether the file descriptor of <em class="parameter"><code>stream</code></em> shall be closed
160 when the stream is closed.</p>
161 <div class="variablelist"><table border="0">
162 <col align="left" valign="top">
163 <tbody>
164 <tr>
165 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
166 <td> a <a class="link" href="GUnixInputStream.html" title="GUnixInputStream"><span class="type">GUnixInputStream</span></a>
167 </td>
168 </tr>
169 <tr>
170 <td><p><span class="term"><em class="parameter"><code>close_fd</code></em> :</span></p></td>
171 <td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to close the file descriptor when done
172 </td>
173 </tr>
174 </tbody>
175 </table></div>
176 <p class="since">Since 2.20</p>
177 </div>
178 <hr>
179 <div class="refsect2" title="g_unix_input_stream_get_close_fd ()">
180 <a name="g-unix-input-stream-get-close-fd"></a><h3>g_unix_input_stream_get_close_fd ()</h3>
181 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_unix_input_stream_get_close_fd    (<a class="link" href="GUnixInputStream.html" title="GUnixInputStream"><span class="returnvalue">GUnixInputStream</span></a> *stream);</pre>
182 <p>
183 Returns whether the file descriptor of <em class="parameter"><code>stream</code></em> will be
184 closed when the stream is closed.</p>
185 <div class="variablelist"><table border="0">
186 <col align="left" valign="top">
187 <tbody>
188 <tr>
189 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
190 <td> a <a class="link" href="GUnixInputStream.html" title="GUnixInputStream"><span class="type">GUnixInputStream</span></a>
191 </td>
192 </tr>
193 <tr>
194 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
195 <td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the file descriptor is closed when done
196
197 </td>
198 </tr>
199 </tbody>
200 </table></div>
201 <p class="since">Since 2.20</p>
202 </div>
203 <hr>
204 <div class="refsect2" title="g_unix_input_stream_get_fd ()">
205 <a name="g-unix-input-stream-get-fd"></a><h3>g_unix_input_stream_get_fd ()</h3>
206 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                g_unix_input_stream_get_fd          (<a class="link" href="GUnixInputStream.html" title="GUnixInputStream"><span class="returnvalue">GUnixInputStream</span></a> *stream);</pre>
207 <p>
208 Return the UNIX file descriptor that the stream reads from.</p>
209 <div class="variablelist"><table border="0">
210 <col align="left" valign="top">
211 <tbody>
212 <tr>
213 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
214 <td> a <a class="link" href="GUnixInputStream.html" title="GUnixInputStream"><span class="type">GUnixInputStream</span></a>
215 </td>
216 </tr>
217 <tr>
218 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
219 <td> The file descriptor of <em class="parameter"><code>stream</code></em>
220
221 </td>
222 </tr>
223 </tbody>
224 </table></div>
225 <p class="since">Since 2.20</p>
226 </div>
227 </div>
228 <div class="refsect1" title="Property Details">
229 <a name="GUnixInputStream.property-details"></a><h2>Property Details</h2>
230 <div class="refsect2" title='The "close-fd" property'>
231 <a name="GUnixInputStream--close-fd"></a><h3>The <code class="literal">"close-fd"</code> property</h3>
232 <pre class="programlisting">  "close-fd"                 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>              : Read / Write</pre>
233 <p>
234 Whether to close the file descriptor when the stream is closed.</p>
235 <p>Default value: TRUE</p>
236 <p class="since">Since 2.20</p>
237 </div>
238 <hr>
239 <div class="refsect2" title='The "fd" property'>
240 <a name="GUnixInputStream--fd"></a><h3>The <code class="literal">"fd"</code> property</h3>
241 <pre class="programlisting">  "fd"                       <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a>                  : Read / Write / Construct Only</pre>
242 <p>
243 The file descriptor that the stream reads from.</p>
244 <p>Default value: -1</p>
245 <p class="since">Since 2.20</p>
246 </div>
247 </div>
248 <div class="refsect1" title="See Also">
249 <a name="GUnixInputStream.see-also"></a><h2>See Also</h2>
250 <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a>
251 </div>
252 </div>
253 <div class="footer">
254 <hr>
255           Generated by GTK-Doc V1.13</div>
256 </body>
257 </html>