e03f5a48d21a611ff5d9f975a2676d9e3491b6b0
[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.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="GDataOutputStream.html" title="GDataOutputStream">
10 <link rel="next" href="GUnixOutputStream.html" title="GUnixOutputStream">
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="GDataOutputStream.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="GUnixOutputStream.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="#GUnixInputStream.synopsis" class="shortcut">Top</a>
25                    | 
26                   <a href="#GUnixInputStream.description" class="shortcut">Description</a>
27                    | 
28                   <a href="#GUnixInputStream.object-hierarchy" class="shortcut">Object Hierarchy</a>
29                    | 
30                   <a href="#GUnixInputStream.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
31                    | 
32                   <a href="#GUnixInputStream.properties" class="shortcut">Properties</a>
33 </td></tr>
34 </table>
35 <div class="refentry">
36 <a name="GUnixInputStream"></a><div class="titlepage"></div>
37 <div class="refnamediv"><table width="100%"><tr>
38 <td valign="top">
39 <h2><span class="refentrytitle"><a name="GUnixInputStream.top_of_page"></a>GUnixInputStream</span></h2>
40 <p>GUnixInputStream — Streaming input operations for UNIX file descriptors</p>
41 </td>
42 <td valign="top" align="right"></td>
43 </tr></table></div>
44 <div class="refsynopsisdiv">
45 <a name="GUnixInputStream.synopsis"></a><h2>Synopsis</h2>
46 <pre class="synopsis">
47 #include &lt;gio/gunixinputstream.h&gt;
48
49 struct              <a class="link" href="GUnixInputStream.html#GUnixInputStream-struct" title="struct GUnixInputStream">GUnixInputStream</a>;
50 <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>             (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> fd</code></em>,
51                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> close_fd</code></em>);
52 <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>    (<em class="parameter"><code><a class="link" href="GUnixInputStream.html" title="GUnixInputStream"><span class="type">GUnixInputStream</span></a> *stream</code></em>,
53                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> close_fd</code></em>);
54 <a href="./../glib/glib/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>    (<em class="parameter"><code><a class="link" href="GUnixInputStream.html" title="GUnixInputStream"><span class="type">GUnixInputStream</span></a> *stream</code></em>);
55 <a href="./../glib/glib/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>          (<em class="parameter"><code><a class="link" href="GUnixInputStream.html" title="GUnixInputStream"><span class="type">GUnixInputStream</span></a> *stream</code></em>);
56 </pre>
57 </div>
58 <div class="refsect1">
59 <a name="GUnixInputStream.object-hierarchy"></a><h2>Object Hierarchy</h2>
60 <pre class="synopsis">
61   <a href="./../gobject/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>
62    +----<a class="link" href="GInputStream.html" title="GInputStream">GInputStream</a>
63          +----GUnixInputStream
64 </pre>
65 </div>
66 <div class="refsect1">
67 <a name="GUnixInputStream.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
68 <p>
69 GUnixInputStream implements
70  <a class="link" href="GPollableInputStream.html" title="GPollableInputStream">GPollableInputStream</a> and  <a class="link" href="GFileDescriptorBased.html" title="GFileDescriptorBased">GFileDescriptorBased</a>.</p>
71 </div>
72 <div class="refsect1">
73 <a name="GUnixInputStream.properties"></a><h2>Properties</h2>
74 <pre class="synopsis">
75   "<a class="link" href="GUnixInputStream.html#GUnixInputStream--close-fd" title='The "close-fd" property'>close-fd</a>"                 <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>              : Read / Write
76   "<a class="link" href="GUnixInputStream.html#GUnixInputStream--fd" title='The "fd" property'>fd</a>"                       <a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a>                  : Read / Write / Construct Only
77 </pre>
78 </div>
79 <div class="refsect1">
80 <a name="GUnixInputStream.description"></a><h2>Description</h2>
81 <p>
82 <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 UNIX
83 file descriptor, including asynchronous operations. (If the file
84 descriptor refers to a socket or pipe, this will use <code class="function">poll()</code> to do
85 asynchronous I/O. If it refers to a regular file, it will fall back
86 to doing asynchronous I/O in another thread.)
87 </p>
88 <p>
89 Note that <code class="filename">&lt;gio/gunixinputstream.h&gt;</code> belongs
90 to the UNIX-specific GIO interfaces, thus you have to use the
91 <code class="filename">gio-unix-2.0.pc</code> pkg-config file when using it.
92 </p>
93 </div>
94 <div class="refsect1">
95 <a name="GUnixInputStream.details"></a><h2>Details</h2>
96 <div class="refsect2">
97 <a name="GUnixInputStream-struct"></a><h3>struct GUnixInputStream</h3>
98 <pre class="programlisting">struct GUnixInputStream;</pre>
99 <p>
100 Implements <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a> for reading from selectable unix file descriptors
101 </p>
102 </div>
103 <hr>
104 <div class="refsect2">
105 <a name="g-unix-input-stream-new"></a><h3>g_unix_input_stream_new ()</h3>
106 <pre class="programlisting"><a class="link" href="GInputStream.html" title="GInputStream"><span class="returnvalue">GInputStream</span></a> *      g_unix_input_stream_new             (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> fd</code></em>,
107                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> close_fd</code></em>);</pre>
108 <p>
109 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>. 
110 </p>
111 <p>
112 If <em class="parameter"><code>close_fd</code></em> is <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, the file descriptor will be closed 
113 when the stream is closed.
114 </p>
115 <div class="variablelist"><table border="0">
116 <col align="left" valign="top">
117 <tbody>
118 <tr>
119 <td><p><span class="term"><em class="parameter"><code>fd</code></em> :</span></p></td>
120 <td>a UNIX file descriptor</td>
121 </tr>
122 <tr>
123 <td><p><span class="term"><em class="parameter"><code>close_fd</code></em> :</span></p></td>
124 <td>
125 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to close the file descriptor when done</td>
126 </tr>
127 <tr>
128 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
129 <td>a new <a class="link" href="GUnixInputStream.html" title="GUnixInputStream"><span class="type">GUnixInputStream</span></a>
130 </td>
131 </tr>
132 </tbody>
133 </table></div>
134 </div>
135 <hr>
136 <div class="refsect2">
137 <a name="g-unix-input-stream-set-close-fd"></a><h3>g_unix_input_stream_set_close_fd ()</h3>
138 <pre class="programlisting"><span class="returnvalue">void</span>                g_unix_input_stream_set_close_fd    (<em class="parameter"><code><a class="link" href="GUnixInputStream.html" title="GUnixInputStream"><span class="type">GUnixInputStream</span></a> *stream</code></em>,
139                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> close_fd</code></em>);</pre>
140 <p>
141 Sets whether the file descriptor of <em class="parameter"><code>stream</code></em> shall be closed
142 when the stream is closed.
143 </p>
144 <div class="variablelist"><table border="0">
145 <col align="left" valign="top">
146 <tbody>
147 <tr>
148 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
149 <td>a <a class="link" href="GUnixInputStream.html" title="GUnixInputStream"><span class="type">GUnixInputStream</span></a>
150 </td>
151 </tr>
152 <tr>
153 <td><p><span class="term"><em class="parameter"><code>close_fd</code></em> :</span></p></td>
154 <td>
155 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to close the file descriptor when done</td>
156 </tr>
157 </tbody>
158 </table></div>
159 <p class="since">Since 2.20</p>
160 </div>
161 <hr>
162 <div class="refsect2">
163 <a name="g-unix-input-stream-get-close-fd"></a><h3>g_unix_input_stream_get_close_fd ()</h3>
164 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_unix_input_stream_get_close_fd    (<em class="parameter"><code><a class="link" href="GUnixInputStream.html" title="GUnixInputStream"><span class="type">GUnixInputStream</span></a> *stream</code></em>);</pre>
165 <p>
166 Returns whether the file descriptor of <em class="parameter"><code>stream</code></em> will be
167 closed when the stream is closed.
168 </p>
169 <div class="variablelist"><table border="0">
170 <col align="left" valign="top">
171 <tbody>
172 <tr>
173 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
174 <td>a <a class="link" href="GUnixInputStream.html" title="GUnixInputStream"><span class="type">GUnixInputStream</span></a>
175 </td>
176 </tr>
177 <tr>
178 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
179 <td>
180 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the file descriptor is closed when done</td>
181 </tr>
182 </tbody>
183 </table></div>
184 <p class="since">Since 2.20</p>
185 </div>
186 <hr>
187 <div class="refsect2">
188 <a name="g-unix-input-stream-get-fd"></a><h3>g_unix_input_stream_get_fd ()</h3>
189 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                g_unix_input_stream_get_fd          (<em class="parameter"><code><a class="link" href="GUnixInputStream.html" title="GUnixInputStream"><span class="type">GUnixInputStream</span></a> *stream</code></em>);</pre>
190 <p>
191 Return the UNIX file descriptor that the stream reads from.
192 </p>
193 <div class="variablelist"><table border="0">
194 <col align="left" valign="top">
195 <tbody>
196 <tr>
197 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
198 <td>a <a class="link" href="GUnixInputStream.html" title="GUnixInputStream"><span class="type">GUnixInputStream</span></a>
199 </td>
200 </tr>
201 <tr>
202 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
203 <td>The file descriptor of <em class="parameter"><code>stream</code></em>
204 </td>
205 </tr>
206 </tbody>
207 </table></div>
208 <p class="since">Since 2.20</p>
209 </div>
210 </div>
211 <div class="refsect1">
212 <a name="GUnixInputStream.property-details"></a><h2>Property Details</h2>
213 <div class="refsect2">
214 <a name="GUnixInputStream--close-fd"></a><h3>The <code class="literal">"close-fd"</code> property</h3>
215 <pre class="programlisting">  "close-fd"                 <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>              : Read / Write</pre>
216 <p>
217 Whether to close the file descriptor when the stream is closed.
218 </p>
219 <p>Default value: TRUE</p>
220 <p class="since">Since 2.20</p>
221 </div>
222 <hr>
223 <div class="refsect2">
224 <a name="GUnixInputStream--fd"></a><h3>The <code class="literal">"fd"</code> property</h3>
225 <pre class="programlisting">  "fd"                       <a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a>                  : Read / Write / Construct Only</pre>
226 <p>
227 The file descriptor that the stream reads from.
228 </p>
229 <p>Default value: -1</p>
230 <p class="since">Since 2.20</p>
231 </div>
232 </div>
233 <div class="refsect1">
234 <a name="GUnixInputStream.see-also"></a><h2>See Also</h2>
235 <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a>
236 </div>
237 </div>
238 <div class="footer">
239 <hr>
240           Generated by GTK-Doc V1.18</div>
241 </body>
242 </html>