Imported Upstream version 2.50.2
[platform/upstream/glib.git] / docs / reference / gio / html / GPollableInputStream.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>GPollableInputStream: GIO Reference Manual</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.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="gio-GConverterOutputstream.html" title="GConverterOutputstream">
10 <link rel="next" href="GPollableOutputStream.html" title="GPollableOutputStream">
11 <meta name="generator" content="GTK-Doc V1.25.1 (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="5"><tr valign="middle">
16 <td width="100%" align="left" class="shortcuts">
17 <a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
18                   <a href="#GPollableInputStream.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
19                   <a href="#GPollableInputStream.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_prerequisites">  <span class="dim">|</span> 
20                   <a href="#GPollableInputStream.prerequisites" class="shortcut">Prerequisites</a></span><span id="nav_implementations">  <span class="dim">|</span> 
21                   <a href="#GPollableInputStream.implementations" class="shortcut">Known Implementations</a></span>
22 </td>
23 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
24 <td><a accesskey="u" href="streaming.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
25 <td><a accesskey="p" href="gio-GConverterOutputstream.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
26 <td><a accesskey="n" href="GPollableOutputStream.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
27 </tr></table>
28 <div class="refentry">
29 <a name="GPollableInputStream"></a><div class="titlepage"></div>
30 <div class="refnamediv"><table width="100%"><tr>
31 <td valign="top">
32 <h2><span class="refentrytitle"><a name="GPollableInputStream.top_of_page"></a>GPollableInputStream</span></h2>
33 <p>GPollableInputStream — Interface for pollable input streams</p>
34 </td>
35 <td class="gallery_image" valign="top" align="right"></td>
36 </tr></table></div>
37 <div class="refsect1">
38 <a name="GPollableInputStream.functions"></a><h2>Functions</h2>
39 <div class="informaltable"><table class="informaltable" width="100%" border="0">
40 <colgroup>
41 <col width="150px" class="functions_return">
42 <col class="functions_name">
43 </colgroup>
44 <tbody>
45 <tr>
46 <td class="function_type">
47 <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
48 </td>
49 <td class="function_name">
50 <a class="link" href="GPollableInputStream.html#g-pollable-input-stream-can-poll" title="g_pollable_input_stream_can_poll ()">g_pollable_input_stream_can_poll</a> <span class="c_punctuation">()</span>
51 </td>
52 </tr>
53 <tr>
54 <td class="function_type">
55 <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
56 </td>
57 <td class="function_name">
58 <a class="link" href="GPollableInputStream.html#g-pollable-input-stream-is-readable" title="g_pollable_input_stream_is_readable ()">g_pollable_input_stream_is_readable</a> <span class="c_punctuation">()</span>
59 </td>
60 </tr>
61 <tr>
62 <td class="function_type">
63 <a href="../glib-The-Main-Event-Loop.html#GSource"><span class="returnvalue">GSource</span></a> *
64 </td>
65 <td class="function_name">
66 <a class="link" href="GPollableInputStream.html#g-pollable-input-stream-create-source" title="g_pollable_input_stream_create_source ()">g_pollable_input_stream_create_source</a> <span class="c_punctuation">()</span>
67 </td>
68 </tr>
69 <tr>
70 <td class="function_type">
71 <a href="../glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
72 </td>
73 <td class="function_name">
74 <a class="link" href="GPollableInputStream.html#g-pollable-input-stream-read-nonblocking" title="g_pollable_input_stream_read_nonblocking ()">g_pollable_input_stream_read_nonblocking</a> <span class="c_punctuation">()</span>
75 </td>
76 </tr>
77 </tbody>
78 </table></div>
79 </div>
80 <div class="refsect1">
81 <a name="GPollableInputStream.other"></a><h2>Types and Values</h2>
82 <div class="informaltable"><table class="informaltable" width="100%" border="0">
83 <colgroup>
84 <col width="150px" class="name">
85 <col class="description">
86 </colgroup>
87 <tbody>
88 <tr>
89 <td class="datatype_keyword"> </td>
90 <td class="function_name"><a class="link" href="GPollableInputStream.html#GPollableInputStream-struct" title="GPollableInputStream">GPollableInputStream</a></td>
91 </tr>
92 <tr>
93 <td class="datatype_keyword">struct</td>
94 <td class="function_name"><a class="link" href="GPollableInputStream.html#GPollableInputStreamInterface" title="struct GPollableInputStreamInterface">GPollableInputStreamInterface</a></td>
95 </tr>
96 </tbody>
97 </table></div>
98 </div>
99 <div class="refsect1">
100 <a name="GPollableInputStream.object-hierarchy"></a><h2>Object Hierarchy</h2>
101 <pre class="screen">    <a href="https://developer.gnome.org/gobject/unstable/GTypeModule.html">GInterface</a>
102     <span class="lineart">╰──</span> GPollableInputStream
103 </pre>
104 </div>
105 <div class="refsect1">
106 <a name="GPollableInputStream.prerequisites"></a><h2>Prerequisites</h2>
107 <p>
108 GPollableInputStream requires
109  <a class="link" href="GInputStream.html" title="GInputStream">GInputStream</a>.</p>
110 </div>
111 <div class="refsect1">
112 <a name="GPollableInputStream.implementations"></a><h2>Known Implementations</h2>
113 <p>
114 GPollableInputStream is implemented by
115  <a class="link" href="gio-GConverterInputstream.html#GConverterInputStream">GConverterInputStream</a>,  <a class="link" href="GMemoryInputStream.html" title="GMemoryInputStream">GMemoryInputStream</a> and  <a class="link" href="GUnixInputStream.html" title="GUnixInputStream">GUnixInputStream</a>.</p>
116 </div>
117 <div class="refsect1">
118 <a name="GPollableInputStream.includes"></a><h2>Includes</h2>
119 <pre class="synopsis">#include &lt;gio/gio.h&gt;
120 </pre>
121 </div>
122 <div class="refsect1">
123 <a name="GPollableInputStream.description"></a><h2>Description</h2>
124 <p><a class="link" href="GPollableInputStream.html" title="GPollableInputStream"><span class="type">GPollableInputStream</span></a> is implemented by <a href="GInputStream.html#GInputStream-struct"><span class="type">GInputStreams</span></a> that
125 can be polled for readiness to read. This can be used when
126 interfacing with a non-GIO API that expects
127 UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.</p>
128 </div>
129 <div class="refsect1">
130 <a name="GPollableInputStream.functions_details"></a><h2>Functions</h2>
131 <div class="refsect2">
132 <a name="g-pollable-input-stream-can-poll"></a><h3>g_pollable_input_stream_can_poll ()</h3>
133 <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
134 g_pollable_input_stream_can_poll (<em class="parameter"><code><a class="link" href="GPollableInputStream.html" title="GPollableInputStream"><span class="type">GPollableInputStream</span></a> *stream</code></em>);</pre>
135 <p>Checks if <em class="parameter"><code>stream</code></em>
136  is actually pollable. Some classes may implement
137 <a class="link" href="GPollableInputStream.html" title="GPollableInputStream"><span class="type">GPollableInputStream</span></a> but have only certain instances of that class
138 be pollable. If this method returns <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, then the behavior of
139 other <a class="link" href="GPollableInputStream.html" title="GPollableInputStream"><span class="type">GPollableInputStream</span></a> methods is undefined.</p>
140 <p>For any given stream, the value returned by this method is constant;
141 a stream cannot switch from pollable to non-pollable or vice versa.</p>
142 <div class="refsect3">
143 <a name="g-pollable-input-stream-can-poll.parameters"></a><h4>Parameters</h4>
144 <div class="informaltable"><table class="informaltable" width="100%" border="0">
145 <colgroup>
146 <col width="150px" class="parameters_name">
147 <col class="parameters_description">
148 <col width="200px" class="parameters_annotations">
149 </colgroup>
150 <tbody><tr>
151 <td class="parameter_name"><p>stream</p></td>
152 <td class="parameter_description"><p>a <a class="link" href="GPollableInputStream.html" title="GPollableInputStream"><span class="type">GPollableInputStream</span></a>.</p></td>
153 <td class="parameter_annotations"> </td>
154 </tr></tbody>
155 </table></div>
156 </div>
157 <div class="refsect3">
158 <a name="g-pollable-input-stream-can-poll.returns"></a><h4>Returns</h4>
159 <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>stream</code></em>
160 is pollable, <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if not.</p>
161 </div>
162 <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
163 </div>
164 <hr>
165 <div class="refsect2">
166 <a name="g-pollable-input-stream-is-readable"></a><h3>g_pollable_input_stream_is_readable ()</h3>
167 <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
168 g_pollable_input_stream_is_readable (<em class="parameter"><code><a class="link" href="GPollableInputStream.html" title="GPollableInputStream"><span class="type">GPollableInputStream</span></a> *stream</code></em>);</pre>
169 <p>Checks if <em class="parameter"><code>stream</code></em>
170  can be read.</p>
171 <p>Note that some stream types may not be able to implement this 100%
172 reliably, and it is possible that a call to <a class="link" href="GInputStream.html#g-input-stream-read" title="g_input_stream_read ()"><code class="function">g_input_stream_read()</code></a>
173 after this returns <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> would still block. To guarantee
174 non-blocking behavior, you should always use
175 <a class="link" href="GPollableInputStream.html#g-pollable-input-stream-read-nonblocking" title="g_pollable_input_stream_read_nonblocking ()"><code class="function">g_pollable_input_stream_read_nonblocking()</code></a>, which will return a
176 <a class="link" href="gio-GIOError.html#G-IO-ERROR-WOULD-BLOCK:CAPS"><code class="literal">G_IO_ERROR_WOULD_BLOCK</code></a> error rather than blocking.</p>
177 <div class="refsect3">
178 <a name="g-pollable-input-stream-is-readable.parameters"></a><h4>Parameters</h4>
179 <div class="informaltable"><table class="informaltable" width="100%" border="0">
180 <colgroup>
181 <col width="150px" class="parameters_name">
182 <col class="parameters_description">
183 <col width="200px" class="parameters_annotations">
184 </colgroup>
185 <tbody><tr>
186 <td class="parameter_name"><p>stream</p></td>
187 <td class="parameter_description"><p>a <a class="link" href="GPollableInputStream.html" title="GPollableInputStream"><span class="type">GPollableInputStream</span></a>.</p></td>
188 <td class="parameter_annotations"> </td>
189 </tr></tbody>
190 </table></div>
191 </div>
192 <div class="refsect3">
193 <a name="g-pollable-input-stream-is-readable.returns"></a><h4>Returns</h4>
194 <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>stream</code></em>
195 is readable, <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if not. If an error
196 has occurred on <em class="parameter"><code>stream</code></em>
197 , this will result in
198 <a class="link" href="GPollableInputStream.html#g-pollable-input-stream-is-readable" title="g_pollable_input_stream_is_readable ()"><code class="function">g_pollable_input_stream_is_readable()</code></a> returning <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, and the
199 next attempt to read will return the error.</p>
200 </div>
201 <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
202 </div>
203 <hr>
204 <div class="refsect2">
205 <a name="g-pollable-input-stream-create-source"></a><h3>g_pollable_input_stream_create_source ()</h3>
206 <pre class="programlisting"><a href="../glib-The-Main-Event-Loop.html#GSource"><span class="returnvalue">GSource</span></a> *
207 g_pollable_input_stream_create_source (<em class="parameter"><code><a class="link" href="GPollableInputStream.html" title="GPollableInputStream"><span class="type">GPollableInputStream</span></a> *stream</code></em>,
208                                        <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>);</pre>
209 <p>Creates a <a href="../glib-The-Main-Event-Loop.html#GSource"><span class="type">GSource</span></a> that triggers when <em class="parameter"><code>stream</code></em>
210  can be read, or
211 <em class="parameter"><code>cancellable</code></em>
212  is triggered or an error occurs. The callback on the
213 source is of the <a class="link" href="gio-gpollableutils.html#GPollableSourceFunc" title="GPollableSourceFunc ()"><span class="type">GPollableSourceFunc</span></a> type.</p>
214 <p>As with <a class="link" href="GPollableInputStream.html#g-pollable-input-stream-is-readable" title="g_pollable_input_stream_is_readable ()"><code class="function">g_pollable_input_stream_is_readable()</code></a>, it is possible that
215 the stream may not actually be readable even after the source
216 triggers, so you should use <a class="link" href="GPollableInputStream.html#g-pollable-input-stream-read-nonblocking" title="g_pollable_input_stream_read_nonblocking ()"><code class="function">g_pollable_input_stream_read_nonblocking()</code></a>
217 rather than <a class="link" href="GInputStream.html#g-input-stream-read" title="g_input_stream_read ()"><code class="function">g_input_stream_read()</code></a> from the callback.</p>
218 <div class="refsect3">
219 <a name="g-pollable-input-stream-create-source.parameters"></a><h4>Parameters</h4>
220 <div class="informaltable"><table class="informaltable" width="100%" border="0">
221 <colgroup>
222 <col width="150px" class="parameters_name">
223 <col class="parameters_description">
224 <col width="200px" class="parameters_annotations">
225 </colgroup>
226 <tbody>
227 <tr>
228 <td class="parameter_name"><p>stream</p></td>
229 <td class="parameter_description"><p>a <a class="link" href="GPollableInputStream.html" title="GPollableInputStream"><span class="type">GPollableInputStream</span></a>.</p></td>
230 <td class="parameter_annotations"> </td>
231 </tr>
232 <tr>
233 <td class="parameter_name"><p>cancellable</p></td>
234 <td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
235 <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
236 </tr>
237 </tbody>
238 </table></div>
239 </div>
240 <div class="refsect3">
241 <a name="g-pollable-input-stream-create-source.returns"></a><h4>Returns</h4>
242 <p> a new <a href="../glib-The-Main-Event-Loop.html#GSource"><span class="type">GSource</span></a>. </p>
243 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
244 </div>
245 <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
246 </div>
247 <hr>
248 <div class="refsect2">
249 <a name="g-pollable-input-stream-read-nonblocking"></a><h3>g_pollable_input_stream_read_nonblocking ()</h3>
250 <pre class="programlisting"><a href="../glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
251 g_pollable_input_stream_read_nonblocking
252                                (<em class="parameter"><code><a class="link" href="GPollableInputStream.html" title="GPollableInputStream"><span class="type">GPollableInputStream</span></a> *stream</code></em>,
253                                 <em class="parameter"><code><span class="type">void</span> *buffer</code></em>,
254                                 <em class="parameter"><code><a href="../glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> count</code></em>,
255                                 <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
256                                 <em class="parameter"><code><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
257 <p>Attempts to read up to <em class="parameter"><code>count</code></em>
258  bytes from <em class="parameter"><code>stream</code></em>
259  into <em class="parameter"><code>buffer</code></em>
260 , as
261 with <a class="link" href="GInputStream.html#g-input-stream-read" title="g_input_stream_read ()"><code class="function">g_input_stream_read()</code></a>. If <em class="parameter"><code>stream</code></em>
262  is not currently readable,
263 this will immediately return <a class="link" href="gio-GIOError.html#G-IO-ERROR-WOULD-BLOCK:CAPS"><code class="literal">G_IO_ERROR_WOULD_BLOCK</code></a>, and you can
264 use <a class="link" href="GPollableInputStream.html#g-pollable-input-stream-create-source" title="g_pollable_input_stream_create_source ()"><code class="function">g_pollable_input_stream_create_source()</code></a> to create a <a href="../glib-The-Main-Event-Loop.html#GSource"><span class="type">GSource</span></a>
265 that will be triggered when <em class="parameter"><code>stream</code></em>
266  is readable.</p>
267 <p>Note that since this method never blocks, you cannot actually
268 use <em class="parameter"><code>cancellable</code></em>
269  to cancel it. However, it will return an error
270 if <em class="parameter"><code>cancellable</code></em>
271  has already been cancelled when you call, which
272 may happen if you call this method after a source triggers due
273 to having been cancelled.</p>
274 <p>Virtual: read_nonblocking</p>
275 <div class="refsect3">
276 <a name="g-pollable-input-stream-read-nonblocking.parameters"></a><h4>Parameters</h4>
277 <div class="informaltable"><table class="informaltable" width="100%" border="0">
278 <colgroup>
279 <col width="150px" class="parameters_name">
280 <col class="parameters_description">
281 <col width="200px" class="parameters_annotations">
282 </colgroup>
283 <tbody>
284 <tr>
285 <td class="parameter_name"><p>stream</p></td>
286 <td class="parameter_description"><p>a <a class="link" href="GPollableInputStream.html" title="GPollableInputStream"><span class="type">GPollableInputStream</span></a></p></td>
287 <td class="parameter_annotations"> </td>
288 </tr>
289 <tr>
290 <td class="parameter_name"><p>buffer</p></td>
291 <td class="parameter_description"><p> a buffer to
292 read data into (which should be at least <em class="parameter"><code>count</code></em>
293 bytes long). </p></td>
294 <td class="parameter_annotations"><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></td>
295 </tr>
296 <tr>
297 <td class="parameter_name"><p>count</p></td>
298 <td class="parameter_description"><p>the number of bytes you want to read</p></td>
299 <td class="parameter_annotations"> </td>
300 </tr>
301 <tr>
302 <td class="parameter_name"><p>cancellable</p></td>
303 <td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
304 <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
305 </tr>
306 <tr>
307 <td class="parameter_name"><p>error</p></td>
308 <td class="parameter_description"><p><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</p></td>
309 <td class="parameter_annotations"> </td>
310 </tr>
311 </tbody>
312 </table></div>
313 </div>
314 <div class="refsect3">
315 <a name="g-pollable-input-stream-read-nonblocking.returns"></a><h4>Returns</h4>
316 <p> the number of bytes read, or -1 on error (including
317 <a class="link" href="gio-GIOError.html#G-IO-ERROR-WOULD-BLOCK:CAPS"><code class="literal">G_IO_ERROR_WOULD_BLOCK</code></a>).</p>
318 </div>
319 </div>
320 </div>
321 <div class="refsect1">
322 <a name="GPollableInputStream.other_details"></a><h2>Types and Values</h2>
323 <div class="refsect2">
324 <a name="GPollableInputStream-struct"></a><h3>GPollableInputStream</h3>
325 <pre class="programlisting">typedef struct _GPollableInputStream GPollableInputStream;</pre>
326 <p>An interface for a <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a> that can be polled for readability.</p>
327 <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
328 </div>
329 <hr>
330 <div class="refsect2">
331 <a name="GPollableInputStreamInterface"></a><h3>struct GPollableInputStreamInterface</h3>
332 <pre class="programlisting">struct GPollableInputStreamInterface {
333   GTypeInterface g_iface;
334
335   /* Virtual Table */
336   gboolean     (*can_poll)         (GPollableInputStream  *stream);
337
338   gboolean     (*is_readable)      (GPollableInputStream  *stream);
339   GSource *    (*create_source)    (GPollableInputStream  *stream,
340                                     GCancellable          *cancellable);
341   gssize       (*read_nonblocking) (GPollableInputStream  *stream,
342                                     void                  *buffer,
343                                     gsize                  count,
344                                     GError               **error);
345 };
346 </pre>
347 <p>The interface for pollable input streams.</p>
348 <p>The default implementation of <em class="parameter"><code>can_poll</code></em>
349  always returns <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>.</p>
350 <p>The default implementation of <em class="parameter"><code>read_nonblocking</code></em>
351  calls
352 <a class="link" href="GPollableInputStream.html#g-pollable-input-stream-is-readable" title="g_pollable_input_stream_is_readable ()"><code class="function">g_pollable_input_stream_is_readable()</code></a>, and then calls
353 <a class="link" href="GInputStream.html#g-input-stream-read" title="g_input_stream_read ()"><code class="function">g_input_stream_read()</code></a> if it returns <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>. This means you only need
354 to override it if it is possible that your <em class="parameter"><code>is_readable</code></em>
355
356 implementation may return <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> when the stream is not actually
357 readable.</p>
358 <div class="refsect3">
359 <a name="GPollableInputStreamInterface.members"></a><h4>Members</h4>
360 <div class="informaltable"><table class="informaltable" width="100%" border="0">
361 <colgroup>
362 <col width="300px" class="struct_members_name">
363 <col class="struct_members_description">
364 <col width="200px" class="struct_members_annotations">
365 </colgroup>
366 <tbody>
367 <tr>
368 <td class="struct_member_name"><p><em class="structfield"><code><a name="GPollableInputStreamInterface.can-poll"></a>can_poll</code></em> ()</p></td>
369 <td class="struct_member_description"><p>Checks if the <a class="link" href="GPollableInputStream.html" title="GPollableInputStream"><span class="type">GPollableInputStream</span></a> instance is actually pollable</p></td>
370 <td class="struct_member_annotations"> </td>
371 </tr>
372 <tr>
373 <td class="struct_member_name"><p><em class="structfield"><code><a name="GPollableInputStreamInterface.is-readable"></a>is_readable</code></em> ()</p></td>
374 <td class="struct_member_description"><p>Checks if the stream is readable</p></td>
375 <td class="struct_member_annotations"> </td>
376 </tr>
377 <tr>
378 <td class="struct_member_name"><p><em class="structfield"><code><a name="GPollableInputStreamInterface.create-source"></a>create_source</code></em> ()</p></td>
379 <td class="struct_member_description"><p>Creates a <a href="../glib-The-Main-Event-Loop.html#GSource"><span class="type">GSource</span></a> to poll the stream</p></td>
380 <td class="struct_member_annotations"> </td>
381 </tr>
382 <tr>
383 <td class="struct_member_name"><p><em class="structfield"><code><a name="GPollableInputStreamInterface.read-nonblocking"></a>read_nonblocking</code></em> ()</p></td>
384 <td class="struct_member_description"><p>Does a non-blocking read or returns
385 <a class="link" href="gio-GIOError.html#G-IO-ERROR-WOULD-BLOCK:CAPS"><code class="literal">G_IO_ERROR_WOULD_BLOCK</code></a></p></td>
386 <td class="struct_member_annotations"> </td>
387 </tr>
388 </tbody>
389 </table></div>
390 </div>
391 <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
392 </div>
393 </div>
394 <div class="refsect1">
395 <a name="GPollableInputStream.see-also"></a><h2>See Also</h2>
396 <p><a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a>, <a class="link" href="GPollableOutputStream.html" title="GPollableOutputStream"><span class="type">GPollableOutputStream</span></a>, <a class="link" href="GFileDescriptorBased.html" title="GFileDescriptorBased"><span class="type">GFileDescriptorBased</span></a></p>
397 </div>
398 </div>
399 <div class="footer">
400 <hr>Generated by GTK-Doc V1.25.1</div>
401 </body>
402 </html>