1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
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">
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">
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>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#GUnixInputStream.synopsis" class="shortcut">Top</a>
26 <a href="#GUnixInputStream.description" class="shortcut">Description</a>
28 <a href="#GUnixInputStream.object-hierarchy" class="shortcut">Object Hierarchy</a>
30 <a href="#GUnixInputStream.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
32 <a href="#GUnixInputStream.properties" class="shortcut">Properties</a>
35 <div class="refentry">
36 <a name="GUnixInputStream"></a><div class="titlepage"></div>
37 <div class="refnamediv"><table width="100%"><tr>
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>
42 <td valign="top" align="right"></td>
44 <div class="refsynopsisdiv">
45 <a name="GUnixInputStream.synopsis"></a><h2>Synopsis</h2>
46 <pre class="synopsis">
47 #include <gio/gunixinputstream.h>
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>);
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>
66 <div class="refsect1">
67 <a name="GUnixInputStream.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
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>
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
79 <div class="refsect1">
80 <a name="GUnixInputStream.description"></a><h2>Description</h2>
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.)
89 Note that <code class="filename"><gio/gunixinputstream.h></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.
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>
100 Implements <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a> for reading from selectable unix file descriptors
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>
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>.
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.
115 <div class="variablelist"><table border="0">
116 <col align="left" valign="top">
119 <td><p><span class="term"><em class="parameter"><code>fd</code></em> :</span></p></td>
120 <td>a UNIX file descriptor</td>
123 <td><p><span class="term"><em class="parameter"><code>close_fd</code></em> :</span></p></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>
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>
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>
141 Sets whether the file descriptor of <em class="parameter"><code>stream</code></em> shall be closed
142 when the stream is closed.
144 <div class="variablelist"><table border="0">
145 <col align="left" valign="top">
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>
153 <td><p><span class="term"><em class="parameter"><code>close_fd</code></em> :</span></p></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>
159 <p class="since">Since 2.20</p>
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>
166 Returns whether the file descriptor of <em class="parameter"><code>stream</code></em> will be
167 closed when the stream is closed.
169 <div class="variablelist"><table border="0">
170 <col align="left" valign="top">
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>
178 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></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>
184 <p class="since">Since 2.20</p>
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>
191 Return the UNIX file descriptor that the stream reads from.
193 <div class="variablelist"><table border="0">
194 <col align="left" valign="top">
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>
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>
208 <p class="since">Since 2.20</p>
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>
217 Whether to close the file descriptor when the stream is closed.
219 <p>Default value: TRUE</p>
220 <p class="since">Since 2.20</p>
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>
227 The file descriptor that the stream reads from.
229 <p>Default value: -1</p>
230 <p class="since">Since 2.20</p>
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>
240 Generated by GTK-Doc V1.18</div>