⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.10
Server IP:
157.245.101.34
Server:
Linux skvinfotech-website 5.4.0-131-generic #147-Ubuntu SMP Fri Oct 14 17:07:22 UTC 2022 x86_64
Server Software:
Apache/2.4.41 (Ubuntu)
PHP Version:
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
self
/
root
/
usr
/
share
/
doc
/
libglib2.0-doc
/
gio
/
View File Name :
gio-gpollableutils.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>gpollableutils: GIO Reference Manual</title> <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> <link rel="home" href="index.html" title="GIO Reference Manual"> <link rel="up" href="streaming.html" title="Streaming I/O"> <link rel="prev" href="GPollableOutputStream.html" title="GPollableOutputStream"> <link rel="next" href="types.html" title="File types and applications"> <meta name="generator" content="GTK-Doc V1.32 (XML mode)"> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle"> <td width="100%" align="left" class="shortcuts"> <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> <a href="#gio-gpollableutils.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span> <a href="#gio-gpollableutils.object-hierarchy" class="shortcut">Object Hierarchy</a></span> </td> <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> <td><a accesskey="u" href="streaming.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> <td><a accesskey="p" href="GPollableOutputStream.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> <td><a accesskey="n" href="types.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> </tr></table> <div class="refentry"> <a name="gio-gpollableutils"></a><div class="titlepage"></div> <div class="refnamediv"><table width="100%"><tr> <td valign="top"> <h2><span class="refentrytitle"><a name="gio-gpollableutils.top_of_page"></a>gpollableutils</span></h2> <p>gpollableutils — Utilities for pollable streams</p> </td> <td class="gallery_image" valign="top" align="right"></td> </tr></table></div> <div class="refsect1"> <a name="gio-gpollableutils.functions"></a><h2>Functions</h2> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="functions_proto_type"> <col class="functions_proto_name"> </colgroup> <tbody> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <span class="c_punctuation">(</span><a class="link" href="gio-gpollableutils.html#GPollableSourceFunc" title="GPollableSourceFunc ()">*GPollableSourceFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">GSource</span> * </td> <td class="function_name"> <a class="link" href="gio-gpollableutils.html#g-pollable-source-new" title="g_pollable_source_new ()">g_pollable_source_new</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">GSource</span> * </td> <td class="function_name"> <a class="link" href="gio-gpollableutils.html#g-pollable-source-new-full" title="g_pollable_source_new_full ()">g_pollable_source_new_full</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gssize</span> </td> <td class="function_name"> <a class="link" href="gio-gpollableutils.html#g-pollable-stream-read" title="g_pollable_stream_read ()">g_pollable_stream_read</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gssize</span> </td> <td class="function_name"> <a class="link" href="gio-gpollableutils.html#g-pollable-stream-write" title="g_pollable_stream_write ()">g_pollable_stream_write</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="gio-gpollableutils.html#g-pollable-stream-write-all" title="g_pollable_stream_write_all ()">g_pollable_stream_write_all</a> <span class="c_punctuation">()</span> </td> </tr> </tbody> </table></div> </div> <div class="refsect1"> <a name="gio-gpollableutils.other"></a><h2>Types and Values</h2> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="other_proto_type"> <col class="other_proto_name"> </colgroup> <tbody><tr> <td class="datatype_keyword">enum</td> <td class="function_name"><a class="link" href="gio-gpollableutils.html#GPollableReturn" title="enum GPollableReturn">GPollableReturn</a></td> </tr></tbody> </table></div> </div> <div class="refsect1"> <a name="gio-gpollableutils.object-hierarchy"></a><h2>Object Hierarchy</h2> <pre class="screen"> GEnum <span class="lineart">╰──</span> GPollableReturn </pre> </div> <div class="refsect1"> <a name="gio-gpollableutils.includes"></a><h2>Includes</h2> <pre class="synopsis">#include <gio/gio.h> </pre> </div> <div class="refsect1"> <a name="gio-gpollableutils.description"></a><h2>Description</h2> <p>Utility functions for <a class="link" href="GPollableInputStream.html" title="GPollableInputStream"><span class="type">GPollableInputStream</span></a> and <a class="link" href="GPollableOutputStream.html" title="GPollableOutputStream"><span class="type">GPollableOutputStream</span></a> implementations.</p> </div> <div class="refsect1"> <a name="gio-gpollableutils.functions_details"></a><h2>Functions</h2> <div class="refsect2"> <a name="GPollableSourceFunc"></a><h3>GPollableSourceFunc ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> <span class="c_punctuation">(</span>*GPollableSourceFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><span class="type">GObject</span> *pollable_stream</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>This is the function type of the callback used for the <span class="type">GSource</span> returned by <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> and <a class="link" href="GPollableOutputStream.html#g-pollable-output-stream-create-source" title="g_pollable_output_stream_create_source ()"><code class="function">g_pollable_output_stream_create_source()</code></a>.</p> <div class="refsect3"> <a name="GPollableSourceFunc.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>pollable_stream</p></td> <td class="parameter_description"><p>the <a class="link" href="GPollableInputStream.html" title="GPollableInputStream"><span class="type">GPollableInputStream</span></a> or <a class="link" href="GPollableOutputStream.html" title="GPollableOutputStream"><span class="type">GPollableOutputStream</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>data passed in by the user.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="GPollableSourceFunc.returns"></a><h4>Returns</h4> <p> it should return <code class="literal">FALSE</code> if the source should be removed.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p> </div> <hr> <div class="refsect2"> <a name="g-pollable-source-new"></a><h3>g_pollable_source_new ()</h3> <pre class="programlisting"><span class="returnvalue">GSource</span> * g_pollable_source_new (<em class="parameter"><code><span class="type">GObject</span> *pollable_stream</code></em>);</pre> <p>Utility method for <a class="link" href="GPollableInputStream.html" title="GPollableInputStream"><span class="type">GPollableInputStream</span></a> and <a class="link" href="GPollableOutputStream.html" title="GPollableOutputStream"><span class="type">GPollableOutputStream</span></a> implementations. Creates a new <span class="type">GSource</span> that expects a callback of type <a class="link" href="gio-gpollableutils.html#GPollableSourceFunc" title="GPollableSourceFunc ()"><span class="type">GPollableSourceFunc</span></a>. The new source does not actually do anything on its own; use <code class="function">g_source_add_child_source()</code> to add other sources to it to cause it to trigger.</p> <div class="refsect3"> <a name="g-pollable-source-new.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>pollable_stream</p></td> <td class="parameter_description"><p>the stream associated with the new source</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-pollable-source-new.returns"></a><h4>Returns</h4> <p>the new <span class="type">GSource</span>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p> </div> <hr> <div class="refsect2"> <a name="g-pollable-source-new-full"></a><h3>g_pollable_source_new_full ()</h3> <pre class="programlisting"><span class="returnvalue">GSource</span> * g_pollable_source_new_full (<em class="parameter"><code><span class="type">gpointer</span> pollable_stream</code></em>, <em class="parameter"><code><span class="type">GSource</span> *child_source</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>);</pre> <p>Utility method for <a class="link" href="GPollableInputStream.html" title="GPollableInputStream"><span class="type">GPollableInputStream</span></a> and <a class="link" href="GPollableOutputStream.html" title="GPollableOutputStream"><span class="type">GPollableOutputStream</span></a> implementations. Creates a new <span class="type">GSource</span>, as with <a class="link" href="gio-gpollableutils.html#g-pollable-source-new" title="g_pollable_source_new ()"><code class="function">g_pollable_source_new()</code></a>, but also attaching <em class="parameter"><code>child_source</code></em> (with a dummy callback), and <em class="parameter"><code>cancellable</code></em> , if they are non-<code class="literal">NULL</code>.</p> <div class="refsect3"> <a name="g-pollable-source-new-full.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>pollable_stream</p></td> <td class="parameter_description"><p>the stream associated with the new source. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject]</span></td> </tr> <tr> <td class="parameter_name"><p>child_source</p></td> <td class="parameter_description"><p>optional child source to attach. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> to attach. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-pollable-source-new-full.returns"></a><h4>Returns</h4> <p>the new <span class="type">GSource</span>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-34.html#api-index-2.34">2.34</a></p> </div> <hr> <div class="refsect2"> <a name="g-pollable-stream-read"></a><h3>g_pollable_stream_read ()</h3> <pre class="programlisting"><span class="returnvalue">gssize</span> g_pollable_stream_read (<em class="parameter"><code><a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a> *stream</code></em>, <em class="parameter"><code><span class="type">void</span> *buffer</code></em>, <em class="parameter"><code><span class="type">gsize</span> count</code></em>, <em class="parameter"><code><span class="type">gboolean</span> blocking</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Tries to read from <em class="parameter"><code>stream</code></em> , as 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>blocking</code></em> is <code class="literal">TRUE</code>) or <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> (if <em class="parameter"><code>blocking</code></em> is <code class="literal">FALSE</code>). This can be used to more easily share code between blocking and non-blocking implementations of a method.</p> <p>If <em class="parameter"><code>blocking</code></em> is <code class="literal">FALSE</code>, then <em class="parameter"><code>stream</code></em> must be a <a class="link" href="GPollableInputStream.html" title="GPollableInputStream"><span class="type">GPollableInputStream</span></a> for which <a class="link" href="GPollableInputStream.html#g-pollable-input-stream-can-poll" title="g_pollable_input_stream_can_poll ()"><code class="function">g_pollable_input_stream_can_poll()</code></a> returns <code class="literal">TRUE</code>, or else the behavior is undefined. If <em class="parameter"><code>blocking</code></em> is <code class="literal">TRUE</code>, then <em class="parameter"><code>stream</code></em> does not need to be a <a class="link" href="GPollableInputStream.html" title="GPollableInputStream"><span class="type">GPollableInputStream</span></a>.</p> <div class="refsect3"> <a name="g-pollable-stream-read.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>stream</p></td> <td class="parameter_description"><p>a <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>buffer</p></td> <td class="parameter_description"><p>a buffer to read data into. </p></td> <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> </tr> <tr> <td class="parameter_name"><p>count</p></td> <td class="parameter_description"><p>the number of bytes to read</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>blocking</p></td> <td class="parameter_description"><p>whether to do blocking I/O</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>location to store the error occurring, or <code class="literal">NULL</code> to ignore</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-pollable-stream-read.returns"></a><h4>Returns</h4> <p> the number of bytes read, or -1 on error.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-34.html#api-index-2.34">2.34</a></p> </div> <hr> <div class="refsect2"> <a name="g-pollable-stream-write"></a><h3>g_pollable_stream_write ()</h3> <pre class="programlisting"><span class="returnvalue">gssize</span> g_pollable_stream_write (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>, <em class="parameter"><code>const <span class="type">void</span> *buffer</code></em>, <em class="parameter"><code><span class="type">gsize</span> count</code></em>, <em class="parameter"><code><span class="type">gboolean</span> blocking</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Tries to write to <em class="parameter"><code>stream</code></em> , as with <a class="link" href="GOutputStream.html#g-output-stream-write" title="g_output_stream_write ()"><code class="function">g_output_stream_write()</code></a> (if <em class="parameter"><code>blocking</code></em> is <code class="literal">TRUE</code>) or <a class="link" href="GPollableOutputStream.html#g-pollable-output-stream-write-nonblocking" title="g_pollable_output_stream_write_nonblocking ()"><code class="function">g_pollable_output_stream_write_nonblocking()</code></a> (if <em class="parameter"><code>blocking</code></em> is <code class="literal">FALSE</code>). This can be used to more easily share code between blocking and non-blocking implementations of a method.</p> <p>If <em class="parameter"><code>blocking</code></em> is <code class="literal">FALSE</code>, then <em class="parameter"><code>stream</code></em> must be a <a class="link" href="GPollableOutputStream.html" title="GPollableOutputStream"><span class="type">GPollableOutputStream</span></a> for which <a class="link" href="GPollableOutputStream.html#g-pollable-output-stream-can-poll" title="g_pollable_output_stream_can_poll ()"><code class="function">g_pollable_output_stream_can_poll()</code></a> returns <code class="literal">TRUE</code> or else the behavior is undefined. If <em class="parameter"><code>blocking</code></em> is <code class="literal">TRUE</code>, then <em class="parameter"><code>stream</code></em> does not need to be a <a class="link" href="GPollableOutputStream.html" title="GPollableOutputStream"><span class="type">GPollableOutputStream</span></a>.</p> <div class="refsect3"> <a name="g-pollable-stream-write.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>stream</p></td> <td class="parameter_description"><p>a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>buffer</p></td> <td class="parameter_description"><p>the buffer containing the data to write. </p></td> <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> </tr> <tr> <td class="parameter_name"><p>count</p></td> <td class="parameter_description"><p>the number of bytes to write</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>blocking</p></td> <td class="parameter_description"><p>whether to do blocking I/O</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>location to store the error occurring, or <code class="literal">NULL</code> to ignore</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-pollable-stream-write.returns"></a><h4>Returns</h4> <p> the number of bytes written, or -1 on error.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-34.html#api-index-2.34">2.34</a></p> </div> <hr> <div class="refsect2"> <a name="g-pollable-stream-write-all"></a><h3>g_pollable_stream_write_all ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_pollable_stream_write_all (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *stream</code></em>, <em class="parameter"><code>const <span class="type">void</span> *buffer</code></em>, <em class="parameter"><code><span class="type">gsize</span> count</code></em>, <em class="parameter"><code><span class="type">gboolean</span> blocking</code></em>, <em class="parameter"><code><span class="type">gsize</span> *bytes_written</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Tries to write <em class="parameter"><code>count</code></em> bytes to <em class="parameter"><code>stream</code></em> , as with <a class="link" href="GOutputStream.html#g-output-stream-write-all" title="g_output_stream_write_all ()"><code class="function">g_output_stream_write_all()</code></a>, but using <a class="link" href="gio-gpollableutils.html#g-pollable-stream-write" title="g_pollable_stream_write ()"><code class="function">g_pollable_stream_write()</code></a> rather than <a class="link" href="GOutputStream.html#g-output-stream-write" title="g_output_stream_write ()"><code class="function">g_output_stream_write()</code></a>.</p> <p>On a successful write of <em class="parameter"><code>count</code></em> bytes, <code class="literal">TRUE</code> is returned, and <em class="parameter"><code>bytes_written</code></em> is set to <em class="parameter"><code>count</code></em> .</p> <p>If there is an error during the operation (including <a class="link" href="gio-GIOError.html#G-IO-ERROR-WOULD-BLOCK:CAPS"><code class="literal">G_IO_ERROR_WOULD_BLOCK</code></a> in the non-blocking case), <code class="literal">FALSE</code> is returned and <em class="parameter"><code>error</code></em> is set to indicate the error status, <em class="parameter"><code>bytes_written</code></em> is updated to contain the number of bytes written into the stream before the error occurred.</p> <p>As with <a class="link" href="gio-gpollableutils.html#g-pollable-stream-write" title="g_pollable_stream_write ()"><code class="function">g_pollable_stream_write()</code></a>, if <em class="parameter"><code>blocking</code></em> is <code class="literal">FALSE</code>, then <em class="parameter"><code>stream</code></em> must be a <a class="link" href="GPollableOutputStream.html" title="GPollableOutputStream"><span class="type">GPollableOutputStream</span></a> for which <a class="link" href="GPollableOutputStream.html#g-pollable-output-stream-can-poll" title="g_pollable_output_stream_can_poll ()"><code class="function">g_pollable_output_stream_can_poll()</code></a> returns <code class="literal">TRUE</code> or else the behavior is undefined. If <em class="parameter"><code>blocking</code></em> is <code class="literal">TRUE</code>, then <em class="parameter"><code>stream</code></em> does not need to be a <a class="link" href="GPollableOutputStream.html" title="GPollableOutputStream"><span class="type">GPollableOutputStream</span></a>.</p> <div class="refsect3"> <a name="g-pollable-stream-write-all.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>stream</p></td> <td class="parameter_description"><p>a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>buffer</p></td> <td class="parameter_description"><p>the buffer containing the data to write. </p></td> <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> </tr> <tr> <td class="parameter_name"><p>count</p></td> <td class="parameter_description"><p>the number of bytes to write</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>blocking</p></td> <td class="parameter_description"><p>whether to do blocking I/O</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>bytes_written</p></td> <td class="parameter_description"><p>location to store the number of bytes that was written to the stream. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>location to store the error occurring, or <code class="literal">NULL</code> to ignore</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-pollable-stream-write-all.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> on success, <code class="literal">FALSE</code> if there was an error</p> </div> <p class="since">Since: <a class="link" href="api-index-2-34.html#api-index-2.34">2.34</a></p> </div> </div> <div class="refsect1"> <a name="gio-gpollableutils.other_details"></a><h2>Types and Values</h2> <div class="refsect2"> <a name="GPollableReturn"></a><h3>enum GPollableReturn</h3> <p>Return value for various IO operations that signal errors via the return value and not necessarily via a <span class="type">GError</span>.</p> <p>This enum exists to be able to return errors to callers without having to allocate a <span class="type">GError</span>. Allocating <span class="type">GErrors</span> can be quite expensive for regularly happening errors like <a class="link" href="gio-GIOError.html#G-IO-ERROR-WOULD-BLOCK:CAPS"><code class="literal">G_IO_ERROR_WOULD_BLOCK</code></a>.</p> <p>In case of <a class="link" href="gio-gpollableutils.html#G-POLLABLE-RETURN-FAILED:CAPS"><code class="literal">G_POLLABLE_RETURN_FAILED</code></a> a <span class="type">GError</span> should be set for the operation to give details about the error that happened.</p> <div class="refsect3"> <a name="GPollableReturn.members"></a><h4>Members</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="300px" class="enum_members_name"> <col class="enum_members_description"> <col width="200px" class="enum_members_annotations"> </colgroup> <tbody> <tr> <td class="enum_member_name"><p><a name="G-POLLABLE-RETURN-FAILED:CAPS"></a>G_POLLABLE_RETURN_FAILED</p></td> <td class="enum_member_description"> <p>Generic error condition for when an operation fails.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-POLLABLE-RETURN-OK:CAPS"></a>G_POLLABLE_RETURN_OK</p></td> <td class="enum_member_description"> <p>The operation was successfully finished.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-POLLABLE-RETURN-WOULD-BLOCK:CAPS"></a>G_POLLABLE_RETURN_WOULD_BLOCK</p></td> <td class="enum_member_description"> <p>The operation would block.</p> </td> <td class="enum_member_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-60.html#api-index-2.60">2.60</a></p> </div> </div> </div> <div class="footer"> <hr>Generated by GTK-Doc V1.32</div> </body> </html>