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>GSimpleAsyncResult: 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="async.html" title="Asynchronous I/O">
9 <link rel="prev" href="gio-GIOScheduler.html" title="GIOScheduler">
10 <link rel="next" href="conversion.html" title="Data conversion">
11 <meta name="generator" content="GTK-Doc V1.25.1 (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="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="#GSimpleAsyncResult.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span>
19 <a href="#GSimpleAsyncResult.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_interfaces"> <span class="dim">|</span>
20 <a href="#GSimpleAsyncResult.implemented-interfaces" class="shortcut">Implemented Interfaces</a></span>
22 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
23 <td><a accesskey="u" href="async.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
24 <td><a accesskey="p" href="gio-GIOScheduler.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
25 <td><a accesskey="n" href="conversion.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
27 <div class="refentry">
28 <a name="GSimpleAsyncResult"></a><div class="titlepage"></div>
29 <div class="refnamediv"><table width="100%"><tr>
31 <h2><span class="refentrytitle"><a name="GSimpleAsyncResult.top_of_page"></a>GSimpleAsyncResult</span></h2>
32 <p>GSimpleAsyncResult — Simple asynchronous results implementation</p>
34 <td class="gallery_image" valign="top" align="right"></td>
36 <div class="refsect1">
37 <a name="GSimpleAsyncResult.functions"></a><h2>Functions</h2>
38 <div class="informaltable"><table class="informaltable" width="100%" border="0">
40 <col width="150px" class="functions_return">
41 <col class="functions_name">
45 <td class="function_type">
46 <span class="returnvalue">void</span>
48 <td class="function_name">
49 <span class="c_punctuation">(</span><a class="link" href="GSimpleAsyncResult.html#GSimpleAsyncThreadFunc" title="GSimpleAsyncThreadFunc ()">*GSimpleAsyncThreadFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
53 <td class="function_type">
54 <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="returnvalue">GSimpleAsyncResult</span></a> *
56 <td class="function_name">
57 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-new" title="g_simple_async_result_new ()">g_simple_async_result_new</a> <span class="c_punctuation">()</span>
61 <td class="function_type">
62 <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="returnvalue">GSimpleAsyncResult</span></a> *
64 <td class="function_name">
65 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-new-error" title="g_simple_async_result_new_error ()">g_simple_async_result_new_error</a> <span class="c_punctuation">()</span>
69 <td class="function_type">
70 <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="returnvalue">GSimpleAsyncResult</span></a> *
72 <td class="function_name">
73 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-new-from-error" title="g_simple_async_result_new_from_error ()">g_simple_async_result_new_from_error</a> <span class="c_punctuation">()</span>
77 <td class="function_type">
78 <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="returnvalue">GSimpleAsyncResult</span></a> *
80 <td class="function_name">
81 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-new-take-error" title="g_simple_async_result_new_take_error ()">g_simple_async_result_new_take_error</a> <span class="c_punctuation">()</span>
85 <td class="function_type">
86 <span class="returnvalue">void</span>
88 <td class="function_name">
89 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-set-check-cancellable" title="g_simple_async_result_set_check_cancellable ()">g_simple_async_result_set_check_cancellable</a> <span class="c_punctuation">()</span>
93 <td class="function_type">
94 <span class="returnvalue">void</span>
96 <td class="function_name">
97 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-set-op-res-gpointer" title="g_simple_async_result_set_op_res_gpointer ()">g_simple_async_result_set_op_res_gpointer</a> <span class="c_punctuation">()</span>
101 <td class="function_type">
102 <a href="../glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>
104 <td class="function_name">
105 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-get-op-res-gpointer" title="g_simple_async_result_get_op_res_gpointer ()">g_simple_async_result_get_op_res_gpointer</a> <span class="c_punctuation">()</span>
109 <td class="function_type">
110 <span class="returnvalue">void</span>
112 <td class="function_name">
113 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-set-op-res-gssize" title="g_simple_async_result_set_op_res_gssize ()">g_simple_async_result_set_op_res_gssize</a> <span class="c_punctuation">()</span>
117 <td class="function_type">
118 <a href="../glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
120 <td class="function_name">
121 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-get-op-res-gssize" title="g_simple_async_result_get_op_res_gssize ()">g_simple_async_result_get_op_res_gssize</a> <span class="c_punctuation">()</span>
125 <td class="function_type">
126 <span class="returnvalue">void</span>
128 <td class="function_name">
129 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-set-op-res-gboolean" title="g_simple_async_result_set_op_res_gboolean ()">g_simple_async_result_set_op_res_gboolean</a> <span class="c_punctuation">()</span>
133 <td class="function_type">
134 <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
136 <td class="function_name">
137 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-get-op-res-gboolean" title="g_simple_async_result_get_op_res_gboolean ()">g_simple_async_result_get_op_res_gboolean</a> <span class="c_punctuation">()</span>
141 <td class="function_type">
142 <a href="../glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>
144 <td class="function_name">
145 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-get-source-tag" title="g_simple_async_result_get_source_tag ()">g_simple_async_result_get_source_tag</a> <span class="c_punctuation">()</span>
149 <td class="function_type">
150 <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
152 <td class="function_name">
153 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-is-valid" title="g_simple_async_result_is_valid ()">g_simple_async_result_is_valid</a> <span class="c_punctuation">()</span>
157 <td class="function_type">
158 <span class="returnvalue">void</span>
160 <td class="function_name">
161 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-set-handle-cancellation" title="g_simple_async_result_set_handle_cancellation ()">g_simple_async_result_set_handle_cancellation</a> <span class="c_punctuation">()</span>
165 <td class="function_type">
166 <span class="returnvalue">void</span>
168 <td class="function_name">
169 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-complete" title="g_simple_async_result_complete ()">g_simple_async_result_complete</a> <span class="c_punctuation">()</span>
173 <td class="function_type">
174 <span class="returnvalue">void</span>
176 <td class="function_name">
177 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-complete-in-idle" title="g_simple_async_result_complete_in_idle ()">g_simple_async_result_complete_in_idle</a> <span class="c_punctuation">()</span>
181 <td class="function_type">
182 <span class="returnvalue">void</span>
184 <td class="function_name">
185 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-run-in-thread" title="g_simple_async_result_run_in_thread ()">g_simple_async_result_run_in_thread</a> <span class="c_punctuation">()</span>
189 <td class="function_type">
190 <span class="returnvalue">void</span>
192 <td class="function_name">
193 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-set-from-error" title="g_simple_async_result_set_from_error ()">g_simple_async_result_set_from_error</a> <span class="c_punctuation">()</span>
197 <td class="function_type">
198 <span class="returnvalue">void</span>
200 <td class="function_name">
201 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-take-error" title="g_simple_async_result_take_error ()">g_simple_async_result_take_error</a> <span class="c_punctuation">()</span>
205 <td class="function_type">
206 <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
208 <td class="function_name">
209 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-propagate-error" title="g_simple_async_result_propagate_error ()">g_simple_async_result_propagate_error</a> <span class="c_punctuation">()</span>
213 <td class="function_type">
214 <span class="returnvalue">void</span>
216 <td class="function_name">
217 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-set-error" title="g_simple_async_result_set_error ()">g_simple_async_result_set_error</a> <span class="c_punctuation">()</span>
221 <td class="function_type">
222 <span class="returnvalue">void</span>
224 <td class="function_name">
225 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-set-error-va" title="g_simple_async_result_set_error_va ()">g_simple_async_result_set_error_va</a> <span class="c_punctuation">()</span>
229 <td class="function_type">
230 <span class="returnvalue">void</span>
232 <td class="function_name">
233 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-report-error-in-idle" title="g_simple_async_report_error_in_idle ()">g_simple_async_report_error_in_idle</a> <span class="c_punctuation">()</span>
237 <td class="function_type">
238 <span class="returnvalue">void</span>
240 <td class="function_name">
241 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-report-gerror-in-idle" title="g_simple_async_report_gerror_in_idle ()">g_simple_async_report_gerror_in_idle</a> <span class="c_punctuation">()</span>
245 <td class="function_type">
246 <span class="returnvalue">void</span>
248 <td class="function_name">
249 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-report-take-gerror-in-idle" title="g_simple_async_report_take_gerror_in_idle ()">g_simple_async_report_take_gerror_in_idle</a> <span class="c_punctuation">()</span>
255 <div class="refsect1">
256 <a name="GSimpleAsyncResult.other"></a><h2>Types and Values</h2>
257 <div class="informaltable"><table class="informaltable" width="100%" border="0">
259 <col width="150px" class="name">
260 <col class="description">
263 <td class="datatype_keyword"> </td>
264 <td class="function_name"><a class="link" href="GSimpleAsyncResult.html#GSimpleAsyncResult-struct" title="GSimpleAsyncResult">GSimpleAsyncResult</a></td>
268 <div class="refsect1">
269 <a name="GSimpleAsyncResult.object-hierarchy"></a><h2>Object Hierarchy</h2>
270 <pre class="screen"> <a href="../gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>
271 <span class="lineart">╰──</span> GSimpleAsyncResult
274 <div class="refsect1">
275 <a name="GSimpleAsyncResult.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
277 GSimpleAsyncResult implements
278 <a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a>.</p>
280 <div class="refsect1">
281 <a name="GSimpleAsyncResult.includes"></a><h2>Includes</h2>
282 <pre class="synopsis">#include <gio/gio.h>
285 <div class="refsect1">
286 <a name="GSimpleAsyncResult.description"></a><h2>Description</h2>
287 <p>As of GLib 2.46, <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> is deprecated in favor of
288 <a class="link" href="GTask.html" title="GTask"><span class="type">GTask</span></a>, which provides a simpler API.</p>
289 <p><a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> implements <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.</p>
290 <p>GSimpleAsyncResult handles <a href="GAsyncResult.html#GAsyncReadyCallback"><span class="type">GAsyncReadyCallbacks</span></a>, error
291 reporting, operation cancellation and the final state of an operation,
292 completely transparent to the application. Results can be returned
293 as a pointer e.g. for functions that return data that is collected
294 asynchronously, a boolean value for checking the success or failure
295 of an operation, or a <a href="../glib-Basic-Types.html#gssize"><span class="type">gssize</span></a> for operations which return the number
296 of bytes modified by the operation; all of the simple return cases
298 <p>Most of the time, an application will not need to know of the details
299 of this API; it is handled transparently, and any necessary operations
300 are handled by <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>'s interface. However, if implementing a
301 new GIO module, for writing language bindings, or for complex
302 applications that need better control of how asynchronous operations
303 are completed, it is important to understand this functionality.</p>
304 <p>GSimpleAsyncResults are tagged with the calling function to ensure
305 that asynchronous functions and their finishing functions are used
306 together correctly.</p>
307 <p>To create a new <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>, call <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-new" title="g_simple_async_result_new ()"><code class="function">g_simple_async_result_new()</code></a>.
308 If the result needs to be created for a <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, use
309 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-new-from-error" title="g_simple_async_result_new_from_error ()"><code class="function">g_simple_async_result_new_from_error()</code></a> or
310 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-new-take-error" title="g_simple_async_result_new_take_error ()"><code class="function">g_simple_async_result_new_take_error()</code></a>. If a <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> is not available
311 (e.g. the asynchronous operation's doesn't take a <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> argument),
312 but the result still needs to be created for an error condition, use
313 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-new-error" title="g_simple_async_result_new_error ()"><code class="function">g_simple_async_result_new_error()</code></a> (or <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-set-error-va" title="g_simple_async_result_set_error_va ()"><code class="function">g_simple_async_result_set_error_va()</code></a>
314 if your application or binding requires passing a variable argument list
315 directly), and the error can then be propagated through the use of
316 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-propagate-error" title="g_simple_async_result_propagate_error ()"><code class="function">g_simple_async_result_propagate_error()</code></a>.</p>
317 <p>An asynchronous operation can be made to ignore a cancellation event by
318 calling <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-set-handle-cancellation" title="g_simple_async_result_set_handle_cancellation ()"><code class="function">g_simple_async_result_set_handle_cancellation()</code></a> with a
319 <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> for the operation and <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>. This is useful for
320 operations that are dangerous to cancel, such as close (which would
321 cause a leak if cancelled before being run).</p>
322 <p>GSimpleAsyncResult can integrate into GLib's event loop, <a href="../glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a>,
323 or it can use <a href="../glib-Threads.html#GThread"><span class="type">GThreads</span></a>.
324 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-complete" title="g_simple_async_result_complete ()"><code class="function">g_simple_async_result_complete()</code></a> will finish an I/O task directly
325 from the point where it is called. <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-complete-in-idle" title="g_simple_async_result_complete_in_idle ()"><code class="function">g_simple_async_result_complete_in_idle()</code></a>
326 will finish it from an idle handler in the
327 <a href="../glib-The-Main-Event-Loop.html#g-main-context-push-thread-default">thread-default main context</a>
328 . <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-run-in-thread" title="g_simple_async_result_run_in_thread ()"><code class="function">g_simple_async_result_run_in_thread()</code></a> will run the
329 job in a separate thread and then deliver the result to the
330 thread-default main context.</p>
331 <p>To set the results of an asynchronous function,
332 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-set-op-res-gpointer" title="g_simple_async_result_set_op_res_gpointer ()"><code class="function">g_simple_async_result_set_op_res_gpointer()</code></a>,
333 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-set-op-res-gboolean" title="g_simple_async_result_set_op_res_gboolean ()"><code class="function">g_simple_async_result_set_op_res_gboolean()</code></a>, and
334 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-set-op-res-gssize" title="g_simple_async_result_set_op_res_gssize ()"><code class="function">g_simple_async_result_set_op_res_gssize()</code></a>
335 are provided, setting the operation's result to a gpointer, gboolean, or
336 gssize, respectively.</p>
337 <p>Likewise, to get the result of an asynchronous function,
338 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-get-op-res-gpointer" title="g_simple_async_result_get_op_res_gpointer ()"><code class="function">g_simple_async_result_get_op_res_gpointer()</code></a>,
339 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-get-op-res-gboolean" title="g_simple_async_result_get_op_res_gboolean ()"><code class="function">g_simple_async_result_get_op_res_gboolean()</code></a>, and
340 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-get-op-res-gssize" title="g_simple_async_result_get_op_res_gssize ()"><code class="function">g_simple_async_result_get_op_res_gssize()</code></a> are
341 provided, getting the operation's result as a gpointer, gboolean, and
342 gssize, respectively.</p>
343 <p>For the details of the requirements implementations must respect, see
344 <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>. A typical implementation of an asynchronous operation
345 using GSimpleAsyncResult looks something like this:</p>
346 <div class="informalexample">
347 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
350 <td class="listing_lines" align="right"><pre>1
442 <td class="listing_code"><pre class="programlisting"><span class="gtkdoc kwb">static void</span>
443 <span class="function">baked_cb</span> <span class="gtkdoc opt">(</span>Cake <span class="gtkdoc opt">*</span>cake<span class="gtkdoc opt">,</span>
444 gpointer user_data<span class="gtkdoc opt">)</span>
445 <span class="gtkdoc opt">{</span>
446 <span class="gtkdoc slc">// In this example, this callback is not given a reference to the cake,</span>
447 <span class="gtkdoc slc">// so the GSimpleAsyncResult has to take a reference to it.</span>
448 GSimpleAsyncResult <span class="gtkdoc opt">*</span>result <span class="gtkdoc opt">=</span> user_data<span class="gtkdoc opt">;</span>
450 <span class="keyword">if</span> <span class="gtkdoc opt">(</span>cake <span class="gtkdoc opt">==</span> NULL<span class="gtkdoc opt">)</span>
451 <span class="function"><a href="GSimpleAsyncResult.html#g-simple-async-result-set-error">g_simple_async_result_set_error</a></span> <span class="gtkdoc opt">(</span>result<span class="gtkdoc opt">,</span>
452 BAKER_ERRORS<span class="gtkdoc opt">,</span>
453 BAKER_ERROR_NO_FLOUR<span class="gtkdoc opt">,</span>
454 <span class="string">"Go to the supermarket"</span><span class="gtkdoc opt">);</span>
455 <span class="keyword">else</span>
456 <span class="function"><a href="GSimpleAsyncResult.html#g-simple-async-result-set-op-res-gpointer">g_simple_async_result_set_op_res_gpointer</a></span> <span class="gtkdoc opt">(</span>result<span class="gtkdoc opt">,</span>
457 <span class="function"><a href="../gobject-The-Base-Object-Type.html#g-object-ref">g_object_ref</a></span> <span class="gtkdoc opt">(</span>cake<span class="gtkdoc opt">),</span>
458 g_object_unref<span class="gtkdoc opt">);</span>
461 <span class="gtkdoc slc">// In this example, we assume that baked_cb is called as a callback from</span>
462 <span class="gtkdoc slc">// the mainloop, so it's safe to complete the operation synchronously here.</span>
463 <span class="gtkdoc slc">// If, however, _baker_prepare_cake () might call its callback without</span>
464 <span class="gtkdoc slc">// first returning to the mainloop — inadvisable, but some APIs do so —</span>
465 <span class="gtkdoc slc">// we would need to use g_simple_async_result_complete_in_idle().</span>
466 <span class="function"><a href="GSimpleAsyncResult.html#g-simple-async-result-complete">g_simple_async_result_complete</a></span> <span class="gtkdoc opt">(</span>result<span class="gtkdoc opt">);</span>
467 <span class="function"><a href="../gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span> <span class="gtkdoc opt">(</span>result<span class="gtkdoc opt">);</span>
468 <span class="gtkdoc opt">}</span>
470 <span class="gtkdoc kwb">void</span>
471 <span class="function">baker_bake_cake_async</span> <span class="gtkdoc opt">(</span>Baker <span class="gtkdoc opt">*</span>self<span class="gtkdoc opt">,</span>
472 guint radius<span class="gtkdoc opt">,</span>
473 GAsyncReadyCallback callback<span class="gtkdoc opt">,</span>
474 gpointer user_data<span class="gtkdoc opt">)</span>
475 <span class="gtkdoc opt">{</span>
476 GSimpleAsyncResult <span class="gtkdoc opt">*</span>simple<span class="gtkdoc opt">;</span>
477 Cake <span class="gtkdoc opt">*</span>cake<span class="gtkdoc opt">;</span>
479 <span class="keyword">if</span> <span class="gtkdoc opt">(</span>radius <span class="gtkdoc opt"><</span> <span class="number">3</span><span class="gtkdoc opt">)</span>
480 <span class="gtkdoc opt">{</span>
481 <span class="function"><a href="GSimpleAsyncResult.html#g-simple-async-report-error-in-idle">g_simple_async_report_error_in_idle</a></span> <span class="gtkdoc opt">(</span><span class="function"><a href="../gobject-The-Base-Object-Type.html#G-OBJECT:CAPS">G_OBJECT</a></span> <span class="gtkdoc opt">(</span>self<span class="gtkdoc opt">),</span>
482 callback<span class="gtkdoc opt">,</span>
483 user_data<span class="gtkdoc opt">,</span>
484 BAKER_ERRORS<span class="gtkdoc opt">,</span>
485 BAKER_ERROR_TOO_SMALL<span class="gtkdoc opt">,</span>
486 <span class="string">"%ucm radius cakes are silly"</span><span class="gtkdoc opt">,</span>
487 radius<span class="gtkdoc opt">);</span>
488 <span class="keyword">return</span><span class="gtkdoc opt">;</span>
489 <span class="gtkdoc opt">}</span>
491 simple <span class="gtkdoc opt">=</span> <span class="function"><a href="GSimpleAsyncResult.html#g-simple-async-result-new">g_simple_async_result_new</a></span> <span class="gtkdoc opt">(</span><span class="function"><a href="../gobject-The-Base-Object-Type.html#G-OBJECT:CAPS">G_OBJECT</a></span> <span class="gtkdoc opt">(</span>self<span class="gtkdoc opt">),</span>
492 callback<span class="gtkdoc opt">,</span>
493 user_data<span class="gtkdoc opt">,</span>
494 baker_bake_cake_async<span class="gtkdoc opt">);</span>
495 cake <span class="gtkdoc opt">=</span> <span class="function">_baker_get_cached_cake</span> <span class="gtkdoc opt">(</span>self<span class="gtkdoc opt">,</span> radius<span class="gtkdoc opt">);</span>
497 <span class="keyword">if</span> <span class="gtkdoc opt">(</span>cake <span class="gtkdoc opt">!=</span> NULL<span class="gtkdoc opt">)</span>
498 <span class="gtkdoc opt">{</span>
499 <span class="function"><a href="GSimpleAsyncResult.html#g-simple-async-result-set-op-res-gpointer">g_simple_async_result_set_op_res_gpointer</a></span> <span class="gtkdoc opt">(</span>simple<span class="gtkdoc opt">,</span>
500 <span class="function"><a href="../gobject-The-Base-Object-Type.html#g-object-ref">g_object_ref</a></span> <span class="gtkdoc opt">(</span>cake<span class="gtkdoc opt">),</span>
501 g_object_unref<span class="gtkdoc opt">);</span>
502 <span class="function"><a href="GSimpleAsyncResult.html#g-simple-async-result-complete-in-idle">g_simple_async_result_complete_in_idle</a></span> <span class="gtkdoc opt">(</span>simple<span class="gtkdoc opt">);</span>
503 <span class="function"><a href="../gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span> <span class="gtkdoc opt">(</span>simple<span class="gtkdoc opt">);</span>
504 <span class="gtkdoc slc">// Drop the reference returned by _baker_get_cached_cake();</span>
505 <span class="gtkdoc slc">// the GSimpleAsyncResult has taken its own reference.</span>
506 <span class="function"><a href="../gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span> <span class="gtkdoc opt">(</span>cake<span class="gtkdoc opt">);</span>
507 <span class="keyword">return</span><span class="gtkdoc opt">;</span>
508 <span class="gtkdoc opt">}</span>
510 <span class="function">_baker_prepare_cake</span> <span class="gtkdoc opt">(</span>self<span class="gtkdoc opt">,</span> radius<span class="gtkdoc opt">,</span> baked_cb<span class="gtkdoc opt">,</span> simple<span class="gtkdoc opt">);</span>
511 <span class="gtkdoc opt">}</span>
513 Cake <span class="gtkdoc opt">*</span>
514 <span class="function">baker_bake_cake_finish</span> <span class="gtkdoc opt">(</span>Baker <span class="gtkdoc opt">*</span>self<span class="gtkdoc opt">,</span>
515 GAsyncResult <span class="gtkdoc opt">*</span>result<span class="gtkdoc opt">,</span>
516 GError <span class="gtkdoc opt">**</span>error<span class="gtkdoc opt">)</span>
517 <span class="gtkdoc opt">{</span>
518 GSimpleAsyncResult <span class="gtkdoc opt">*</span>simple<span class="gtkdoc opt">;</span>
519 Cake <span class="gtkdoc opt">*</span>cake<span class="gtkdoc opt">;</span>
521 <span class="function"><a href="../glib-Warnings-and-Assertions.html#g-return-val-if-fail">g_return_val_if_fail</a></span> <span class="gtkdoc opt">(</span><span class="function"><a href="GSimpleAsyncResult.html#g-simple-async-result-is-valid">g_simple_async_result_is_valid</a></span> <span class="gtkdoc opt">(</span>result<span class="gtkdoc opt">,</span>
522 <span class="function"><a href="../gobject-The-Base-Object-Type.html#G-OBJECT:CAPS">G_OBJECT</a></span> <span class="gtkdoc opt">(</span>self<span class="gtkdoc opt">),</span>
523 baker_bake_cake_async<span class="gtkdoc opt">),</span>
524 NULL<span class="gtkdoc opt">);</span>
526 simple <span class="gtkdoc opt">= (</span>GSimpleAsyncResult <span class="gtkdoc opt">*)</span> result<span class="gtkdoc opt">;</span>
528 <span class="keyword">if</span> <span class="gtkdoc opt">(</span><span class="function"><a href="GSimpleAsyncResult.html#g-simple-async-result-propagate-error">g_simple_async_result_propagate_error</a></span> <span class="gtkdoc opt">(</span>simple<span class="gtkdoc opt">,</span> error<span class="gtkdoc opt">))</span>
529 <span class="keyword">return</span> NULL<span class="gtkdoc opt">;</span>
531 cake <span class="gtkdoc opt">=</span> <span class="function">CAKE</span> <span class="gtkdoc opt">(</span><span class="function"><a href="GSimpleAsyncResult.html#g-simple-async-result-get-op-res-gpointer">g_simple_async_result_get_op_res_gpointer</a></span> <span class="gtkdoc opt">(</span>simple<span class="gtkdoc opt">));</span>
532 <span class="keyword">return</span> <span class="function"><a href="../gobject-The-Base-Object-Type.html#g-object-ref">g_object_ref</a></span> <span class="gtkdoc opt">(</span>cake<span class="gtkdoc opt">);</span>
533 <span class="gtkdoc opt">}</span></pre></td>
541 <div class="refsect1">
542 <a name="GSimpleAsyncResult.functions_details"></a><h2>Functions</h2>
543 <div class="refsect2">
544 <a name="GSimpleAsyncThreadFunc"></a><h3>GSimpleAsyncThreadFunc ()</h3>
545 <pre class="programlisting"><span class="returnvalue">void</span>
546 <span class="c_punctuation">(</span>*GSimpleAsyncThreadFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *res</code></em>,
547 <em class="parameter"><code><a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> *object</code></em>,
548 <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>);</pre>
549 <p>Simple thread function that runs an asynchronous operation and
550 checks for cancellation.</p>
551 <div class="refsect3">
552 <a name="GSimpleAsyncThreadFunc.parameters"></a><h4>Parameters</h4>
553 <div class="informaltable"><table class="informaltable" width="100%" border="0">
555 <col width="150px" class="parameters_name">
556 <col class="parameters_description">
557 <col width="200px" class="parameters_annotations">
561 <td class="parameter_name"><p>res</p></td>
562 <td class="parameter_description"><p>a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</p></td>
563 <td class="parameter_annotations"> </td>
566 <td class="parameter_name"><p>object</p></td>
567 <td class="parameter_description"><p>a <a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a>.</p></td>
568 <td class="parameter_annotations"> </td>
571 <td class="parameter_name"><p>cancellable</p></td>
572 <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</p></td>
573 <td class="parameter_annotations"> </td>
580 <div class="refsect2">
581 <a name="g-simple-async-result-new"></a><h3>g_simple_async_result_new ()</h3>
582 <pre class="programlisting"><a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="returnvalue">GSimpleAsyncResult</span></a> *
583 g_simple_async_result_new (<em class="parameter"><code><a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> *source_object</code></em>,
584 <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
585 <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
586 <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> source_tag</code></em>);</pre>
587 <div class="warning">
588 <p><code class="literal">g_simple_async_result_new</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p>
589 <p>Use <a class="link" href="GTask.html#g-task-new" title="g_task_new ()"><code class="function">g_task_new()</code></a> instead.</p>
591 <p>Creates a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</p>
592 <p>The common convention is to create the <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> in the
593 function that starts the asynchronous operation and use that same
594 function as the <em class="parameter"><code>source_tag</code></em>
596 <p>If your operation supports cancellation with <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> (which it
597 probably should) then you should provide the user's cancellable to
598 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-set-check-cancellable" title="g_simple_async_result_set_check_cancellable ()"><code class="function">g_simple_async_result_set_check_cancellable()</code></a> immediately after
599 this function returns.</p>
600 <div class="refsect3">
601 <a name="g-simple-async-result-new.parameters"></a><h4>Parameters</h4>
602 <div class="informaltable"><table class="informaltable" width="100%" border="0">
604 <col width="150px" class="parameters_name">
605 <col class="parameters_description">
606 <col width="200px" class="parameters_annotations">
610 <td class="parameter_name"><p>source_object</p></td>
611 <td class="parameter_description"><p> a <a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
612 <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>
615 <td class="parameter_name"><p>callback</p></td>
616 <td class="parameter_description"><p> a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>. </p></td>
617 <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td>
620 <td class="parameter_name"><p>user_data</p></td>
621 <td class="parameter_description"><p> user data passed to <em class="parameter"><code>callback</code></em>
623 <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
626 <td class="parameter_name"><p>source_tag</p></td>
627 <td class="parameter_description"><p>the asynchronous function.</p></td>
628 <td class="parameter_annotations"> </td>
633 <div class="refsect3">
634 <a name="g-simple-async-result-new.returns"></a><h4>Returns</h4>
635 <p> a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</p>
639 <div class="refsect2">
640 <a name="g-simple-async-result-new-error"></a><h3>g_simple_async_result_new_error ()</h3>
641 <pre class="programlisting"><a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="returnvalue">GSimpleAsyncResult</span></a> *
642 g_simple_async_result_new_error (<em class="parameter"><code><a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> *source_object</code></em>,
643 <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
644 <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
645 <em class="parameter"><code><a href="../glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> domain</code></em>,
646 <em class="parameter"><code><a href="../glib-Basic-Types.html#gint"><span class="type">gint</span></a> code</code></em>,
647 <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
648 <em class="parameter"><code>...</code></em>);</pre>
649 <div class="warning">
650 <p><code class="literal">g_simple_async_result_new_error</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p>
651 <p>Use <a class="link" href="GTask.html#g-task-new" title="g_task_new ()"><code class="function">g_task_new()</code></a> and <a class="link" href="GTask.html#g-task-return-new-error" title="g_task_return_new_error ()"><code class="function">g_task_return_new_error()</code></a> instead.</p>
653 <p>Creates a new <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> with a set error.</p>
654 <div class="refsect3">
655 <a name="g-simple-async-result-new-error.parameters"></a><h4>Parameters</h4>
656 <div class="informaltable"><table class="informaltable" width="100%" border="0">
658 <col width="150px" class="parameters_name">
659 <col class="parameters_description">
660 <col width="200px" class="parameters_annotations">
664 <td class="parameter_name"><p>source_object</p></td>
665 <td class="parameter_description"><p> a <a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
666 <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>
669 <td class="parameter_name"><p>callback</p></td>
670 <td class="parameter_description"><p> a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>. </p></td>
671 <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td>
674 <td class="parameter_name"><p>user_data</p></td>
675 <td class="parameter_description"><p> user data passed to <em class="parameter"><code>callback</code></em>
677 <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
680 <td class="parameter_name"><p>domain</p></td>
681 <td class="parameter_description"><p>a <a href="../glib-Quarks.html#GQuark"><span class="type">GQuark</span></a>.</p></td>
682 <td class="parameter_annotations"> </td>
685 <td class="parameter_name"><p>code</p></td>
686 <td class="parameter_description"><p>an error code.</p></td>
687 <td class="parameter_annotations"> </td>
690 <td class="parameter_name"><p>format</p></td>
691 <td class="parameter_description"><p>a string with format characters.</p></td>
692 <td class="parameter_annotations"> </td>
695 <td class="parameter_name"><p>...</p></td>
696 <td class="parameter_description"><p>a list of values to insert into <em class="parameter"><code>format</code></em>
698 <td class="parameter_annotations"> </td>
703 <div class="refsect3">
704 <a name="g-simple-async-result-new-error.returns"></a><h4>Returns</h4>
705 <p> a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</p>
709 <div class="refsect2">
710 <a name="g-simple-async-result-new-from-error"></a><h3>g_simple_async_result_new_from_error ()</h3>
711 <pre class="programlisting"><a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="returnvalue">GSimpleAsyncResult</span></a> *
712 g_simple_async_result_new_from_error (<em class="parameter"><code><a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> *source_object</code></em>,
713 <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
714 <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
715 <em class="parameter"><code>const <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);</pre>
716 <div class="warning">
717 <p><code class="literal">g_simple_async_result_new_from_error</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p>
718 <p>Use <a class="link" href="GTask.html#g-task-new" title="g_task_new ()"><code class="function">g_task_new()</code></a> and <a class="link" href="GTask.html#g-task-return-error" title="g_task_return_error ()"><code class="function">g_task_return_error()</code></a> instead.</p>
720 <p>Creates a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> from an error condition.</p>
721 <div class="refsect3">
722 <a name="g-simple-async-result-new-from-error.parameters"></a><h4>Parameters</h4>
723 <div class="informaltable"><table class="informaltable" width="100%" border="0">
725 <col width="150px" class="parameters_name">
726 <col class="parameters_description">
727 <col width="200px" class="parameters_annotations">
731 <td class="parameter_name"><p>source_object</p></td>
732 <td class="parameter_description"><p> a <a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
733 <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>
736 <td class="parameter_name"><p>callback</p></td>
737 <td class="parameter_description"><p> a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>. </p></td>
738 <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td>
741 <td class="parameter_name"><p>user_data</p></td>
742 <td class="parameter_description"><p> user data passed to <em class="parameter"><code>callback</code></em>
744 <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
747 <td class="parameter_name"><p>error</p></td>
748 <td class="parameter_description"><p>a <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a></p></td>
749 <td class="parameter_annotations"> </td>
754 <div class="refsect3">
755 <a name="g-simple-async-result-new-from-error.returns"></a><h4>Returns</h4>
756 <p> a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</p>
760 <div class="refsect2">
761 <a name="g-simple-async-result-new-take-error"></a><h3>g_simple_async_result_new_take_error ()</h3>
762 <pre class="programlisting"><a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="returnvalue">GSimpleAsyncResult</span></a> *
763 g_simple_async_result_new_take_error (<em class="parameter"><code><a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> *source_object</code></em>,
764 <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
765 <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
766 <em class="parameter"><code><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);</pre>
767 <div class="warning">
768 <p><code class="literal">g_simple_async_result_new_take_error</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p>
769 <p>Use <a class="link" href="GTask.html#g-task-new" title="g_task_new ()"><code class="function">g_task_new()</code></a> and <a class="link" href="GTask.html#g-task-return-error" title="g_task_return_error ()"><code class="function">g_task_return_error()</code></a> instead.</p>
771 <p>Creates a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> from an error condition, and takes over the
772 caller's ownership of <em class="parameter"><code>error</code></em>
773 , so the caller does not need to free it anymore.</p>
774 <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
775 <div class="refsect3">
776 <a name="g-simple-async-result-new-take-error.parameters"></a><h4>Parameters</h4>
777 <div class="informaltable"><table class="informaltable" width="100%" border="0">
779 <col width="150px" class="parameters_name">
780 <col class="parameters_description">
781 <col width="200px" class="parameters_annotations">
785 <td class="parameter_name"><p>source_object</p></td>
786 <td class="parameter_description"><p> a <a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
787 <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>
790 <td class="parameter_name"><p>callback</p></td>
791 <td class="parameter_description"><p> a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>. </p></td>
792 <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td>
795 <td class="parameter_name"><p>user_data</p></td>
796 <td class="parameter_description"><p> user data passed to <em class="parameter"><code>callback</code></em>
798 <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
801 <td class="parameter_name"><p>error</p></td>
802 <td class="parameter_description"><p>a <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a></p></td>
803 <td class="parameter_annotations"> </td>
808 <div class="refsect3">
809 <a name="g-simple-async-result-new-take-error.returns"></a><h4>Returns</h4>
810 <p> a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a></p>
812 <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
815 <div class="refsect2">
816 <a name="g-simple-async-result-set-check-cancellable"></a><h3>g_simple_async_result_set_check_cancellable ()</h3>
817 <pre class="programlisting"><span class="returnvalue">void</span>
818 g_simple_async_result_set_check_cancellable
819 (<em class="parameter"><code><a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
820 <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *check_cancellable</code></em>);</pre>
821 <div class="warning">
822 <p><code class="literal">g_simple_async_result_set_check_cancellable</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p>
823 <p>Use <a class="link" href="GTask.html" title="GTask"><span class="type">GTask</span></a> instead.</p>
825 <p>Sets a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> to check before dispatching results.</p>
826 <p>This function has one very specific purpose: the provided cancellable
827 is checked at the time of <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-propagate-error" title="g_simple_async_result_propagate_error ()"><code class="function">g_simple_async_result_propagate_error()</code></a> If
828 it is cancelled, these functions will return an "Operation was
829 cancelled" error (<a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a>).</p>
830 <p>Implementors of cancellable asynchronous functions should use this in
831 order to provide a guarantee to their callers that cancelling an
832 async operation will reliably result in an error being returned for
833 that operation (even if a positive result for the operation has
834 already been sent as an idle to the main context to be dispatched).</p>
835 <p>The checking described above is done regardless of any call to the
836 unrelated <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-set-handle-cancellation" title="g_simple_async_result_set_handle_cancellation ()"><code class="function">g_simple_async_result_set_handle_cancellation()</code></a> function.</p>
837 <div class="refsect3">
838 <a name="g-simple-async-result-set-check-cancellable.parameters"></a><h4>Parameters</h4>
839 <div class="informaltable"><table class="informaltable" width="100%" border="0">
841 <col width="150px" class="parameters_name">
842 <col class="parameters_description">
843 <col width="200px" class="parameters_annotations">
847 <td class="parameter_name"><p>simple</p></td>
848 <td class="parameter_description"><p>a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a></p></td>
849 <td class="parameter_annotations"> </td>
852 <td class="parameter_name"><p>check_cancellable</p></td>
853 <td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> to check, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to unset. </p></td>
854 <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>
859 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
862 <div class="refsect2">
863 <a name="g-simple-async-result-set-op-res-gpointer"></a><h3>g_simple_async_result_set_op_res_gpointer ()</h3>
864 <pre class="programlisting"><span class="returnvalue">void</span>
865 g_simple_async_result_set_op_res_gpointer
866 (<em class="parameter"><code><a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
867 <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> op_res</code></em>,
868 <em class="parameter"><code><a href="../glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy_op_res</code></em>);</pre>
869 <div class="warning">
870 <p><code class="literal">g_simple_async_result_set_op_res_gpointer</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p>
871 <p>Use <a class="link" href="GTask.html" title="GTask"><span class="type">GTask</span></a> and <a class="link" href="GTask.html#g-task-return-pointer" title="g_task_return_pointer ()"><code class="function">g_task_return_pointer()</code></a> instead.</p>
873 <p>Sets the operation result within the asynchronous result to a pointer.</p>
874 <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
875 <div class="refsect3">
876 <a name="g-simple-async-result-set-op-res-gpointer.parameters"></a><h4>Parameters</h4>
877 <div class="informaltable"><table class="informaltable" width="100%" border="0">
879 <col width="150px" class="parameters_name">
880 <col class="parameters_description">
881 <col width="200px" class="parameters_annotations">
885 <td class="parameter_name"><p>simple</p></td>
886 <td class="parameter_description"><p>a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</p></td>
887 <td class="parameter_annotations"> </td>
890 <td class="parameter_name"><p>op_res</p></td>
891 <td class="parameter_description"><p>a pointer result from an asynchronous function.</p></td>
892 <td class="parameter_annotations"> </td>
895 <td class="parameter_name"><p>destroy_op_res</p></td>
896 <td class="parameter_description"><p>a <a href="../glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> function.</p></td>
897 <td class="parameter_annotations"> </td>
904 <div class="refsect2">
905 <a name="g-simple-async-result-get-op-res-gpointer"></a><h3>g_simple_async_result_get_op_res_gpointer ()</h3>
906 <pre class="programlisting"><a href="../glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>
907 g_simple_async_result_get_op_res_gpointer
908 (<em class="parameter"><code><a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>);</pre>
909 <div class="warning">
910 <p><code class="literal">g_simple_async_result_get_op_res_gpointer</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p>
911 <p>Use <a class="link" href="GTask.html" title="GTask"><span class="type">GTask</span></a> and <a class="link" href="GTask.html#g-task-propagate-pointer" title="g_task_propagate_pointer ()"><code class="function">g_task_propagate_pointer()</code></a> instead.</p>
913 <p>Gets a pointer result as returned by the asynchronous function.</p>
914 <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
915 <div class="refsect3">
916 <a name="g-simple-async-result-get-op-res-gpointer.parameters"></a><h4>Parameters</h4>
917 <div class="informaltable"><table class="informaltable" width="100%" border="0">
919 <col width="150px" class="parameters_name">
920 <col class="parameters_description">
921 <col width="200px" class="parameters_annotations">
924 <td class="parameter_name"><p>simple</p></td>
925 <td class="parameter_description"><p>a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</p></td>
926 <td class="parameter_annotations"> </td>
930 <div class="refsect3">
931 <a name="g-simple-async-result-get-op-res-gpointer.returns"></a><h4>Returns</h4>
932 <p> a pointer from the result.</p>
936 <div class="refsect2">
937 <a name="g-simple-async-result-set-op-res-gssize"></a><h3>g_simple_async_result_set_op_res_gssize ()</h3>
938 <pre class="programlisting"><span class="returnvalue">void</span>
939 g_simple_async_result_set_op_res_gssize
940 (<em class="parameter"><code><a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
941 <em class="parameter"><code><a href="../glib-Basic-Types.html#gssize"><span class="type">gssize</span></a> op_res</code></em>);</pre>
942 <div class="warning">
943 <p><code class="literal">g_simple_async_result_set_op_res_gssize</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p>
944 <p>Use <a class="link" href="GTask.html" title="GTask"><span class="type">GTask</span></a> and <a class="link" href="GTask.html#g-task-return-int" title="g_task_return_int ()"><code class="function">g_task_return_int()</code></a> instead.</p>
946 <p>Sets the operation result within the asynchronous result to
947 the given <em class="parameter"><code>op_res</code></em>
949 <div class="refsect3">
950 <a name="g-simple-async-result-set-op-res-gssize.parameters"></a><h4>Parameters</h4>
951 <div class="informaltable"><table class="informaltable" width="100%" border="0">
953 <col width="150px" class="parameters_name">
954 <col class="parameters_description">
955 <col width="200px" class="parameters_annotations">
959 <td class="parameter_name"><p>simple</p></td>
960 <td class="parameter_description"><p>a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</p></td>
961 <td class="parameter_annotations"> </td>
964 <td class="parameter_name"><p>op_res</p></td>
965 <td class="parameter_description"><p>a <a href="../glib-Basic-Types.html#gssize"><span class="type">gssize</span></a>.</p></td>
966 <td class="parameter_annotations"> </td>
973 <div class="refsect2">
974 <a name="g-simple-async-result-get-op-res-gssize"></a><h3>g_simple_async_result_get_op_res_gssize ()</h3>
975 <pre class="programlisting"><a href="../glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
976 g_simple_async_result_get_op_res_gssize
977 (<em class="parameter"><code><a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>);</pre>
978 <div class="warning">
979 <p><code class="literal">g_simple_async_result_get_op_res_gssize</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p>
980 <p>Use <a class="link" href="GTask.html" title="GTask"><span class="type">GTask</span></a> and <a class="link" href="GTask.html#g-task-propagate-int" title="g_task_propagate_int ()"><code class="function">g_task_propagate_int()</code></a> instead.</p>
982 <p>Gets a gssize from the asynchronous result.</p>
983 <div class="refsect3">
984 <a name="g-simple-async-result-get-op-res-gssize.parameters"></a><h4>Parameters</h4>
985 <div class="informaltable"><table class="informaltable" width="100%" border="0">
987 <col width="150px" class="parameters_name">
988 <col class="parameters_description">
989 <col width="200px" class="parameters_annotations">
992 <td class="parameter_name"><p>simple</p></td>
993 <td class="parameter_description"><p>a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</p></td>
994 <td class="parameter_annotations"> </td>
998 <div class="refsect3">
999 <a name="g-simple-async-result-get-op-res-gssize.returns"></a><h4>Returns</h4>
1000 <p> a gssize returned from the asynchronous function.</p>
1004 <div class="refsect2">
1005 <a name="g-simple-async-result-set-op-res-gboolean"></a><h3>g_simple_async_result_set_op_res_gboolean ()</h3>
1006 <pre class="programlisting"><span class="returnvalue">void</span>
1007 g_simple_async_result_set_op_res_gboolean
1008 (<em class="parameter"><code><a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
1009 <em class="parameter"><code><a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> op_res</code></em>);</pre>
1010 <div class="warning">
1011 <p><code class="literal">g_simple_async_result_set_op_res_gboolean</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p>
1012 <p>Use <a class="link" href="GTask.html" title="GTask"><span class="type">GTask</span></a> and <a class="link" href="GTask.html#g-task-return-boolean" title="g_task_return_boolean ()"><code class="function">g_task_return_boolean()</code></a> instead.</p>
1014 <p>Sets the operation result to a boolean within the asynchronous result.</p>
1015 <div class="refsect3">
1016 <a name="g-simple-async-result-set-op-res-gboolean.parameters"></a><h4>Parameters</h4>
1017 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1019 <col width="150px" class="parameters_name">
1020 <col class="parameters_description">
1021 <col width="200px" class="parameters_annotations">
1025 <td class="parameter_name"><p>simple</p></td>
1026 <td class="parameter_description"><p>a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</p></td>
1027 <td class="parameter_annotations"> </td>
1030 <td class="parameter_name"><p>op_res</p></td>
1031 <td class="parameter_description"><p>a <a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>.</p></td>
1032 <td class="parameter_annotations"> </td>
1039 <div class="refsect2">
1040 <a name="g-simple-async-result-get-op-res-gboolean"></a><h3>g_simple_async_result_get_op_res_gboolean ()</h3>
1041 <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
1042 g_simple_async_result_get_op_res_gboolean
1043 (<em class="parameter"><code><a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>);</pre>
1044 <div class="warning">
1045 <p><code class="literal">g_simple_async_result_get_op_res_gboolean</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p>
1046 <p>Use <a class="link" href="GTask.html" title="GTask"><span class="type">GTask</span></a> and <a class="link" href="GTask.html#g-task-propagate-boolean" title="g_task_propagate_boolean ()"><code class="function">g_task_propagate_boolean()</code></a> instead.</p>
1048 <p>Gets the operation result boolean from within the asynchronous result.</p>
1049 <div class="refsect3">
1050 <a name="g-simple-async-result-get-op-res-gboolean.parameters"></a><h4>Parameters</h4>
1051 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1053 <col width="150px" class="parameters_name">
1054 <col class="parameters_description">
1055 <col width="200px" class="parameters_annotations">
1058 <td class="parameter_name"><p>simple</p></td>
1059 <td class="parameter_description"><p>a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</p></td>
1060 <td class="parameter_annotations"> </td>
1064 <div class="refsect3">
1065 <a name="g-simple-async-result-get-op-res-gboolean.returns"></a><h4>Returns</h4>
1066 <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the operation's result was <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>
1067 if the operation's result was <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.</p>
1071 <div class="refsect2">
1072 <a name="g-simple-async-result-get-source-tag"></a><h3>g_simple_async_result_get_source_tag ()</h3>
1073 <pre class="programlisting"><a href="../glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>
1074 g_simple_async_result_get_source_tag (<em class="parameter"><code><a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>);</pre>
1075 <div class="warning">
1076 <p><code class="literal">g_simple_async_result_get_source_tag</code> has been deprecated since version 2.46. and should not be used in newly-written code.</p>
1077 <p>Use <a class="link" href="GTask.html" title="GTask"><span class="type">GTask</span></a> and <a class="link" href="GTask.html#g-task-get-source-tag" title="g_task_get_source_tag ()"><code class="function">g_task_get_source_tag()</code></a> instead.</p>
1079 <p>Gets the source tag for the <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</p>
1080 <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
1081 <div class="refsect3">
1082 <a name="g-simple-async-result-get-source-tag.parameters"></a><h4>Parameters</h4>
1083 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1085 <col width="150px" class="parameters_name">
1086 <col class="parameters_description">
1087 <col width="200px" class="parameters_annotations">
1090 <td class="parameter_name"><p>simple</p></td>
1091 <td class="parameter_description"><p>a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</p></td>
1092 <td class="parameter_annotations"> </td>
1096 <div class="refsect3">
1097 <a name="g-simple-async-result-get-source-tag.returns"></a><h4>Returns</h4>
1098 <p> a <a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> to the source object for the <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</p>
1102 <div class="refsect2">
1103 <a name="g-simple-async-result-is-valid"></a><h3>g_simple_async_result_is_valid ()</h3>
1104 <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
1105 g_simple_async_result_is_valid (<em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
1106 <em class="parameter"><code><a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> *source</code></em>,
1107 <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> source_tag</code></em>);</pre>
1108 <div class="warning">
1109 <p><code class="literal">g_simple_async_result_is_valid</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p>
1110 <p>Use <a class="link" href="GTask.html" title="GTask"><span class="type">GTask</span></a> and <a class="link" href="GTask.html#g-task-is-valid" title="g_task_is_valid ()"><code class="function">g_task_is_valid()</code></a> instead.</p>
1112 <p>Ensures that the data passed to the _finish function of an async
1113 operation is consistent. Three checks are performed.</p>
1114 <p>First, <em class="parameter"><code>result</code></em>
1115 is checked to ensure that it is really a
1116 <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>. Second, <em class="parameter"><code>source</code></em>
1117 is checked to ensure that it
1118 matches the source object of <em class="parameter"><code>result</code></em>
1119 . Third, <em class="parameter"><code>source_tag</code></em>
1121 checked to ensure that it is equal to the <em class="parameter"><code>source_tag</code></em>
1123 to <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-new" title="g_simple_async_result_new ()"><code class="function">g_simple_async_result_new()</code></a> (which, by convention, is a pointer
1124 to the _async function corresponding to the _finish function from
1125 which this function is called). (Alternatively, if either
1126 <em class="parameter"><code>source_tag</code></em>
1127 or <em class="parameter"><code>result</code></em>
1128 's source tag is <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then the source tag
1129 check is skipped.)</p>
1130 <div class="refsect3">
1131 <a name="g-simple-async-result-is-valid.parameters"></a><h4>Parameters</h4>
1132 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1134 <col width="150px" class="parameters_name">
1135 <col class="parameters_description">
1136 <col width="200px" class="parameters_annotations">
1140 <td class="parameter_name"><p>result</p></td>
1141 <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> passed to the _finish function.</p></td>
1142 <td class="parameter_annotations"> </td>
1145 <td class="parameter_name"><p>source</p></td>
1146 <td class="parameter_description"><p> the <a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> passed to the _finish function. </p></td>
1147 <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>
1150 <td class="parameter_name"><p>source_tag</p></td>
1151 <td class="parameter_description"><p> the asynchronous function. </p></td>
1152 <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>
1157 <div class="refsect3">
1158 <a name="g-simple-async-result-is-valid.returns"></a><h4>Returns</h4>
1159 <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><span class="type">TRUE</span></a> if all checks passed or <a href="../glib-Standard-Macros.html#FALSE:CAPS"><span class="type">FALSE</span></a> if any failed.</p>
1161 <p class="since">Since: <a class="link" href="api-index-2-20.html#api-index-2.20">2.20</a></p>
1164 <div class="refsect2">
1165 <a name="g-simple-async-result-set-handle-cancellation"></a><h3>g_simple_async_result_set_handle_cancellation ()</h3>
1166 <pre class="programlisting"><span class="returnvalue">void</span>
1167 g_simple_async_result_set_handle_cancellation
1168 (<em class="parameter"><code><a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
1169 <em class="parameter"><code><a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> handle_cancellation</code></em>);</pre>
1170 <div class="warning"><p><code class="literal">g_simple_async_result_set_handle_cancellation</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p></div>
1171 <p>Sets whether to handle cancellation within the asynchronous operation.</p>
1172 <p>This function has nothing to do with
1173 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-set-check-cancellable" title="g_simple_async_result_set_check_cancellable ()"><code class="function">g_simple_async_result_set_check_cancellable()</code></a>. It only refers to the
1174 <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> passed to <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-run-in-thread" title="g_simple_async_result_run_in_thread ()"><code class="function">g_simple_async_result_run_in_thread()</code></a>.</p>
1175 <div class="refsect3">
1176 <a name="g-simple-async-result-set-handle-cancellation.parameters"></a><h4>Parameters</h4>
1177 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1179 <col width="150px" class="parameters_name">
1180 <col class="parameters_description">
1181 <col width="200px" class="parameters_annotations">
1185 <td class="parameter_name"><p>simple</p></td>
1186 <td class="parameter_description"><p>a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</p></td>
1187 <td class="parameter_annotations"> </td>
1190 <td class="parameter_name"><p>handle_cancellation</p></td>
1191 <td class="parameter_description"><p>a <a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>.</p></td>
1192 <td class="parameter_annotations"> </td>
1199 <div class="refsect2">
1200 <a name="g-simple-async-result-complete"></a><h3>g_simple_async_result_complete ()</h3>
1201 <pre class="programlisting"><span class="returnvalue">void</span>
1202 g_simple_async_result_complete (<em class="parameter"><code><a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>);</pre>
1203 <div class="warning">
1204 <p><code class="literal">g_simple_async_result_complete</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p>
1205 <p>Use <a class="link" href="GTask.html" title="GTask"><span class="type">GTask</span></a> instead.</p>
1207 <p>Completes an asynchronous I/O job immediately. Must be called in
1208 the thread where the asynchronous result was to be delivered, as it
1209 invokes the callback directly. If you are in a different thread use
1210 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-complete-in-idle" title="g_simple_async_result_complete_in_idle ()"><code class="function">g_simple_async_result_complete_in_idle()</code></a>.</p>
1211 <p>Calling this function takes a reference to <em class="parameter"><code>simple</code></em>
1213 is needed to complete the call.</p>
1214 <div class="refsect3">
1215 <a name="g-simple-async-result-complete.parameters"></a><h4>Parameters</h4>
1216 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1218 <col width="150px" class="parameters_name">
1219 <col class="parameters_description">
1220 <col width="200px" class="parameters_annotations">
1223 <td class="parameter_name"><p>simple</p></td>
1224 <td class="parameter_description"><p>a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</p></td>
1225 <td class="parameter_annotations"> </td>
1231 <div class="refsect2">
1232 <a name="g-simple-async-result-complete-in-idle"></a><h3>g_simple_async_result_complete_in_idle ()</h3>
1233 <pre class="programlisting"><span class="returnvalue">void</span>
1234 g_simple_async_result_complete_in_idle
1235 (<em class="parameter"><code><a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>);</pre>
1236 <div class="warning">
1237 <p><code class="literal">g_simple_async_result_complete_in_idle</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p>
1238 <p>Use <a class="link" href="GTask.html" title="GTask"><span class="type">GTask</span></a> instead.</p>
1240 <p>Completes an asynchronous function in an idle handler in the
1241 <a href="../glib-The-Main-Event-Loop.html#g-main-context-push-thread-default">thread-default main context</a>
1242 of the thread that <em class="parameter"><code>simple</code></em>
1243 was initially created in
1244 (and re-pushes that context around the invocation of the callback).</p>
1245 <p>Calling this function takes a reference to <em class="parameter"><code>simple</code></em>
1247 is needed to complete the call.</p>
1248 <div class="refsect3">
1249 <a name="g-simple-async-result-complete-in-idle.parameters"></a><h4>Parameters</h4>
1250 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1252 <col width="150px" class="parameters_name">
1253 <col class="parameters_description">
1254 <col width="200px" class="parameters_annotations">
1257 <td class="parameter_name"><p>simple</p></td>
1258 <td class="parameter_description"><p>a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</p></td>
1259 <td class="parameter_annotations"> </td>
1265 <div class="refsect2">
1266 <a name="g-simple-async-result-run-in-thread"></a><h3>g_simple_async_result_run_in_thread ()</h3>
1267 <pre class="programlisting"><span class="returnvalue">void</span>
1268 g_simple_async_result_run_in_thread (<em class="parameter"><code><a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
1269 <em class="parameter"><code><a class="link" href="GSimpleAsyncResult.html#GSimpleAsyncThreadFunc" title="GSimpleAsyncThreadFunc ()"><span class="type">GSimpleAsyncThreadFunc</span></a> func</code></em>,
1270 <em class="parameter"><code><span class="type">int</span> io_priority</code></em>,
1271 <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>);</pre>
1272 <div class="warning">
1273 <p><code class="literal">g_simple_async_result_run_in_thread</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p>
1274 <p>Use <a class="link" href="GTask.html" title="GTask"><span class="type">GTask</span></a> and <a class="link" href="GTask.html#g-task-run-in-thread" title="g_task_run_in_thread ()"><code class="function">g_task_run_in_thread()</code></a> instead.</p>
1276 <p>Runs the asynchronous job in a separate thread and then calls
1277 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-complete-in-idle" title="g_simple_async_result_complete_in_idle ()"><code class="function">g_simple_async_result_complete_in_idle()</code></a> on <em class="parameter"><code>simple</code></em>
1279 the result to the appropriate main loop.</p>
1280 <p>Calling this function takes a reference to <em class="parameter"><code>simple</code></em>
1282 is needed to run the job and report its completion.</p>
1283 <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
1284 <div class="refsect3">
1285 <a name="g-simple-async-result-run-in-thread.parameters"></a><h4>Parameters</h4>
1286 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1288 <col width="150px" class="parameters_name">
1289 <col class="parameters_description">
1290 <col width="200px" class="parameters_annotations">
1294 <td class="parameter_name"><p>simple</p></td>
1295 <td class="parameter_description"><p>a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</p></td>
1296 <td class="parameter_annotations"> </td>
1299 <td class="parameter_name"><p>func</p></td>
1300 <td class="parameter_description"><p>a <a class="link" href="GSimpleAsyncResult.html#GSimpleAsyncThreadFunc" title="GSimpleAsyncThreadFunc ()"><span class="type">GSimpleAsyncThreadFunc</span></a>.</p></td>
1301 <td class="parameter_annotations"> </td>
1304 <td class="parameter_name"><p>io_priority</p></td>
1305 <td class="parameter_description"><p>the io priority of the request.</p></td>
1306 <td class="parameter_annotations"> </td>
1309 <td class="parameter_name"><p>cancellable</p></td>
1310 <td class="parameter_description"><p> optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore. </p></td>
1311 <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>
1318 <div class="refsect2">
1319 <a name="g-simple-async-result-set-from-error"></a><h3>g_simple_async_result_set_from_error ()</h3>
1320 <pre class="programlisting"><span class="returnvalue">void</span>
1321 g_simple_async_result_set_from_error (<em class="parameter"><code><a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
1322 <em class="parameter"><code>const <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);</pre>
1323 <div class="warning">
1324 <p><code class="literal">g_simple_async_result_set_from_error</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p>
1325 <p>Use <a class="link" href="GTask.html" title="GTask"><span class="type">GTask</span></a> and <a class="link" href="GTask.html#g-task-return-error" title="g_task_return_error ()"><code class="function">g_task_return_error()</code></a> instead.</p>
1327 <p>Sets the result from a <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a>.</p>
1328 <div class="refsect3">
1329 <a name="g-simple-async-result-set-from-error.parameters"></a><h4>Parameters</h4>
1330 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1332 <col width="150px" class="parameters_name">
1333 <col class="parameters_description">
1334 <col width="200px" class="parameters_annotations">
1338 <td class="parameter_name"><p>simple</p></td>
1339 <td class="parameter_description"><p>a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</p></td>
1340 <td class="parameter_annotations"> </td>
1343 <td class="parameter_name"><p>error</p></td>
1344 <td class="parameter_description"><p><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a>.</p></td>
1345 <td class="parameter_annotations"> </td>
1352 <div class="refsect2">
1353 <a name="g-simple-async-result-take-error"></a><h3>g_simple_async_result_take_error ()</h3>
1354 <pre class="programlisting"><span class="returnvalue">void</span>
1355 g_simple_async_result_take_error (<em class="parameter"><code><a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
1356 <em class="parameter"><code><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);</pre>
1357 <div class="warning">
1358 <p><code class="literal">g_simple_async_result_take_error</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p>
1359 <p>Use <a class="link" href="GTask.html" title="GTask"><span class="type">GTask</span></a> and <a class="link" href="GTask.html#g-task-return-error" title="g_task_return_error ()"><code class="function">g_task_return_error()</code></a> instead.</p>
1361 <p>Sets the result from <em class="parameter"><code>error</code></em>
1362 , and takes over the caller's ownership
1363 of <em class="parameter"><code>error</code></em>
1364 , so the caller does not need to free it any more.</p>
1365 <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
1366 <div class="refsect3">
1367 <a name="g-simple-async-result-take-error.parameters"></a><h4>Parameters</h4>
1368 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1370 <col width="150px" class="parameters_name">
1371 <col class="parameters_description">
1372 <col width="200px" class="parameters_annotations">
1376 <td class="parameter_name"><p>simple</p></td>
1377 <td class="parameter_description"><p>a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a></p></td>
1378 <td class="parameter_annotations"> </td>
1381 <td class="parameter_name"><p>error</p></td>
1382 <td class="parameter_description"><p>a <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a></p></td>
1383 <td class="parameter_annotations"> </td>
1388 <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
1391 <div class="refsect2">
1392 <a name="g-simple-async-result-propagate-error"></a><h3>g_simple_async_result_propagate_error ()</h3>
1393 <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
1394 g_simple_async_result_propagate_error (<em class="parameter"><code><a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
1395 <em class="parameter"><code><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **dest</code></em>);</pre>
1396 <div class="warning">
1397 <p><code class="literal">g_simple_async_result_propagate_error</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p>
1398 <p>Use <a class="link" href="GTask.html" title="GTask"><span class="type">GTask</span></a> instead.</p>
1400 <p>Propagates an error from within the simple asynchronous result to
1401 a given destination.</p>
1402 <p>If the <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> given to a prior call to
1403 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-set-check-cancellable" title="g_simple_async_result_set_check_cancellable ()"><code class="function">g_simple_async_result_set_check_cancellable()</code></a> is cancelled then this
1404 function will return <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> with <em class="parameter"><code>dest</code></em>
1405 set appropriately.</p>
1406 <div class="refsect3">
1407 <a name="g-simple-async-result-propagate-error.parameters"></a><h4>Parameters</h4>
1408 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1410 <col width="150px" class="parameters_name">
1411 <col class="parameters_description">
1412 <col width="200px" class="parameters_annotations">
1416 <td class="parameter_name"><p>simple</p></td>
1417 <td class="parameter_description"><p>a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</p></td>
1418 <td class="parameter_annotations"> </td>
1421 <td class="parameter_name"><p>dest</p></td>
1422 <td class="parameter_description"><p> a location to propagate the error to. </p></td>
1423 <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>
1428 <div class="refsect3">
1429 <a name="g-simple-async-result-propagate-error.returns"></a><h4>Returns</h4>
1430 <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the error was propagated to <em class="parameter"><code>dest</code></em>
1431 . <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</p>
1435 <div class="refsect2">
1436 <a name="g-simple-async-result-set-error"></a><h3>g_simple_async_result_set_error ()</h3>
1437 <pre class="programlisting"><span class="returnvalue">void</span>
1438 g_simple_async_result_set_error (<em class="parameter"><code><a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
1439 <em class="parameter"><code><a href="../glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> domain</code></em>,
1440 <em class="parameter"><code><a href="../glib-Basic-Types.html#gint"><span class="type">gint</span></a> code</code></em>,
1441 <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
1442 <em class="parameter"><code>...</code></em>);</pre>
1443 <div class="warning">
1444 <p><code class="literal">g_simple_async_result_set_error</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p>
1445 <p>Use <a class="link" href="GTask.html" title="GTask"><span class="type">GTask</span></a> and <a class="link" href="GTask.html#g-task-return-new-error" title="g_task_return_new_error ()"><code class="function">g_task_return_new_error()</code></a> instead.</p>
1447 <p>Sets an error within the asynchronous result without a <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a>.</p>
1448 <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
1449 <div class="refsect3">
1450 <a name="g-simple-async-result-set-error.parameters"></a><h4>Parameters</h4>
1451 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1453 <col width="150px" class="parameters_name">
1454 <col class="parameters_description">
1455 <col width="200px" class="parameters_annotations">
1459 <td class="parameter_name"><p>simple</p></td>
1460 <td class="parameter_description"><p>a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</p></td>
1461 <td class="parameter_annotations"> </td>
1464 <td class="parameter_name"><p>domain</p></td>
1465 <td class="parameter_description"><p>a <a href="../glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> (usually <a class="link" href="gio-GIOError.html#G-IO-ERROR:CAPS" title="G_IO_ERROR"><span class="type">G_IO_ERROR</span></a>).</p></td>
1466 <td class="parameter_annotations"> </td>
1469 <td class="parameter_name"><p>code</p></td>
1470 <td class="parameter_description"><p>an error code.</p></td>
1471 <td class="parameter_annotations"> </td>
1474 <td class="parameter_name"><p>format</p></td>
1475 <td class="parameter_description"><p>a formatted error reporting string.</p></td>
1476 <td class="parameter_annotations"> </td>
1479 <td class="parameter_name"><p>...</p></td>
1480 <td class="parameter_description"><p>a list of variables to fill in <em class="parameter"><code>format</code></em>
1482 <td class="parameter_annotations"> </td>
1489 <div class="refsect2">
1490 <a name="g-simple-async-result-set-error-va"></a><h3>g_simple_async_result_set_error_va ()</h3>
1491 <pre class="programlisting"><span class="returnvalue">void</span>
1492 g_simple_async_result_set_error_va (<em class="parameter"><code><a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
1493 <em class="parameter"><code><a href="../glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> domain</code></em>,
1494 <em class="parameter"><code><a href="../glib-Basic-Types.html#gint"><span class="type">gint</span></a> code</code></em>,
1495 <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
1496 <em class="parameter"><code><span class="type">va_list</span> args</code></em>);</pre>
1497 <div class="warning">
1498 <p><code class="literal">g_simple_async_result_set_error_va</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p>
1499 <p>Use <a class="link" href="GTask.html" title="GTask"><span class="type">GTask</span></a> and <a class="link" href="GTask.html#g-task-return-error" title="g_task_return_error ()"><code class="function">g_task_return_error()</code></a> instead.</p>
1501 <p>Sets an error within the asynchronous result without a <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a>.
1502 Unless writing a binding, see <a class="link" href="GSimpleAsyncResult.html#g-simple-async-result-set-error" title="g_simple_async_result_set_error ()"><code class="function">g_simple_async_result_set_error()</code></a>.</p>
1503 <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
1504 <div class="refsect3">
1505 <a name="g-simple-async-result-set-error-va.parameters"></a><h4>Parameters</h4>
1506 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1508 <col width="150px" class="parameters_name">
1509 <col class="parameters_description">
1510 <col width="200px" class="parameters_annotations">
1514 <td class="parameter_name"><p>simple</p></td>
1515 <td class="parameter_description"><p>a <a class="link" href="GSimpleAsyncResult.html" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</p></td>
1516 <td class="parameter_annotations"> </td>
1519 <td class="parameter_name"><p>domain</p></td>
1520 <td class="parameter_description"><p>a <a href="../glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> (usually <a class="link" href="gio-GIOError.html#G-IO-ERROR:CAPS" title="G_IO_ERROR"><span class="type">G_IO_ERROR</span></a>).</p></td>
1521 <td class="parameter_annotations"> </td>
1524 <td class="parameter_name"><p>code</p></td>
1525 <td class="parameter_description"><p>an error code.</p></td>
1526 <td class="parameter_annotations"> </td>
1529 <td class="parameter_name"><p>format</p></td>
1530 <td class="parameter_description"><p>a formatted error reporting string.</p></td>
1531 <td class="parameter_annotations"> </td>
1534 <td class="parameter_name"><p>args</p></td>
1535 <td class="parameter_description"><p>va_list of arguments.</p></td>
1536 <td class="parameter_annotations"> </td>
1543 <div class="refsect2">
1544 <a name="g-simple-async-report-error-in-idle"></a><h3>g_simple_async_report_error_in_idle ()</h3>
1545 <pre class="programlisting"><span class="returnvalue">void</span>
1546 g_simple_async_report_error_in_idle (<em class="parameter"><code><a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> *object</code></em>,
1547 <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
1548 <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
1549 <em class="parameter"><code><a href="../glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> domain</code></em>,
1550 <em class="parameter"><code><a href="../glib-Basic-Types.html#gint"><span class="type">gint</span></a> code</code></em>,
1551 <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
1552 <em class="parameter"><code>...</code></em>);</pre>
1553 <div class="warning">
1554 <p><code class="literal">g_simple_async_report_error_in_idle</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p>
1555 <p>Use <a class="link" href="GTask.html#g-task-report-error" title="g_task_report_error ()"><code class="function">g_task_report_error()</code></a>.</p>
1557 <p>Reports an error in an asynchronous function in an idle function by
1558 directly setting the contents of the <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> with the given error
1560 <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
1561 <div class="refsect3">
1562 <a name="g-simple-async-report-error-in-idle.parameters"></a><h4>Parameters</h4>
1563 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1565 <col width="150px" class="parameters_name">
1566 <col class="parameters_description">
1567 <col width="200px" class="parameters_annotations">
1571 <td class="parameter_name"><p>object</p></td>
1572 <td class="parameter_description"><p> a <a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1573 <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>
1576 <td class="parameter_name"><p>callback</p></td>
1577 <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>.</p></td>
1578 <td class="parameter_annotations"> </td>
1581 <td class="parameter_name"><p>user_data</p></td>
1582 <td class="parameter_description"><p>user data passed to <em class="parameter"><code>callback</code></em>
1584 <td class="parameter_annotations"> </td>
1587 <td class="parameter_name"><p>domain</p></td>
1588 <td class="parameter_description"><p>a <a href="../glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> containing the error domain (usually <a class="link" href="gio-GIOError.html#G-IO-ERROR:CAPS" title="G_IO_ERROR"><span class="type">G_IO_ERROR</span></a>).</p></td>
1589 <td class="parameter_annotations"> </td>
1592 <td class="parameter_name"><p>code</p></td>
1593 <td class="parameter_description"><p>a specific error code.</p></td>
1594 <td class="parameter_annotations"> </td>
1597 <td class="parameter_name"><p>format</p></td>
1598 <td class="parameter_description"><p>a formatted error reporting string.</p></td>
1599 <td class="parameter_annotations"> </td>
1602 <td class="parameter_name"><p>...</p></td>
1603 <td class="parameter_description"><p>a list of variables to fill in <em class="parameter"><code>format</code></em>
1605 <td class="parameter_annotations"> </td>
1612 <div class="refsect2">
1613 <a name="g-simple-async-report-gerror-in-idle"></a><h3>g_simple_async_report_gerror_in_idle ()</h3>
1614 <pre class="programlisting"><span class="returnvalue">void</span>
1615 g_simple_async_report_gerror_in_idle (<em class="parameter"><code><a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> *object</code></em>,
1616 <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
1617 <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
1618 <em class="parameter"><code>const <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);</pre>
1619 <div class="warning">
1620 <p><code class="literal">g_simple_async_report_gerror_in_idle</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p>
1621 <p>Use <a class="link" href="GTask.html#g-task-report-error" title="g_task_report_error ()"><code class="function">g_task_report_error()</code></a>.</p>
1623 <p>Reports an error in an idle function. Similar to
1624 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-report-error-in-idle" title="g_simple_async_report_error_in_idle ()"><code class="function">g_simple_async_report_error_in_idle()</code></a>, but takes a <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> rather
1625 than building a new one.</p>
1626 <div class="refsect3">
1627 <a name="g-simple-async-report-gerror-in-idle.parameters"></a><h4>Parameters</h4>
1628 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1630 <col width="150px" class="parameters_name">
1631 <col class="parameters_description">
1632 <col width="200px" class="parameters_annotations">
1636 <td class="parameter_name"><p>object</p></td>
1637 <td class="parameter_description"><p> a <a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1638 <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>
1641 <td class="parameter_name"><p>callback</p></td>
1642 <td class="parameter_description"><p> a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>. </p></td>
1643 <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td>
1646 <td class="parameter_name"><p>user_data</p></td>
1647 <td class="parameter_description"><p> user data passed to <em class="parameter"><code>callback</code></em>
1649 <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
1652 <td class="parameter_name"><p>error</p></td>
1653 <td class="parameter_description"><p>the <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> to report</p></td>
1654 <td class="parameter_annotations"> </td>
1661 <div class="refsect2">
1662 <a name="g-simple-async-report-take-gerror-in-idle"></a><h3>g_simple_async_report_take_gerror_in_idle ()</h3>
1663 <pre class="programlisting"><span class="returnvalue">void</span>
1664 g_simple_async_report_take_gerror_in_idle
1665 (<em class="parameter"><code><a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> *object</code></em>,
1666 <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
1667 <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
1668 <em class="parameter"><code><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);</pre>
1669 <div class="warning">
1670 <p><code class="literal">g_simple_async_report_take_gerror_in_idle</code> has been deprecated since version 2.46 and should not be used in newly-written code.</p>
1671 <p>Use <a class="link" href="GTask.html#g-task-report-error" title="g_task_report_error ()"><code class="function">g_task_report_error()</code></a>.</p>
1673 <p>Reports an error in an idle function. Similar to
1674 <a class="link" href="GSimpleAsyncResult.html#g-simple-async-report-gerror-in-idle" title="g_simple_async_report_gerror_in_idle ()"><code class="function">g_simple_async_report_gerror_in_idle()</code></a>, but takes over the caller's
1675 ownership of <em class="parameter"><code>error</code></em>
1676 , so the caller does not have to free it any more.</p>
1677 <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
1678 <div class="refsect3">
1679 <a name="g-simple-async-report-take-gerror-in-idle.parameters"></a><h4>Parameters</h4>
1680 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1682 <col width="150px" class="parameters_name">
1683 <col class="parameters_description">
1684 <col width="200px" class="parameters_annotations">
1688 <td class="parameter_name"><p>object</p></td>
1689 <td class="parameter_description"><p> a <a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1690 <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>
1693 <td class="parameter_name"><p>callback</p></td>
1694 <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>.</p></td>
1695 <td class="parameter_annotations"> </td>
1698 <td class="parameter_name"><p>user_data</p></td>
1699 <td class="parameter_description"><p>user data passed to <em class="parameter"><code>callback</code></em>
1701 <td class="parameter_annotations"> </td>
1704 <td class="parameter_name"><p>error</p></td>
1705 <td class="parameter_description"><p>the <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> to report</p></td>
1706 <td class="parameter_annotations"> </td>
1711 <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
1714 <div class="refsect1">
1715 <a name="GSimpleAsyncResult.other_details"></a><h2>Types and Values</h2>
1716 <div class="refsect2">
1717 <a name="GSimpleAsyncResult-struct"></a><h3>GSimpleAsyncResult</h3>
1718 <pre class="programlisting">typedef struct _GSimpleAsyncResult GSimpleAsyncResult;</pre>
1719 <p>A simple implementation of <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.</p>
1722 <div class="refsect1">
1723 <a name="GSimpleAsyncResult.see-also"></a><h2>See Also</h2>
1724 <p><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>, <a class="link" href="GTask.html" title="GTask"><span class="type">GTask</span></a></p>
1727 <div class="footer">
1728 <hr>Generated by GTK-Doc V1.25.1</div>