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>gnome-vfs-module-callback</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.74.3">
7
<link rel="home" href="index.html" title="GnomeVFS - Filesystem Abstraction library">
8
<link rel="up" href="modules.html" title="Filesystem Modules">
9
<link rel="prev" href="gnome-vfs-2.0-gnome-vfs-standard-callbacks.html" title="gnome-vfs-standard-callbacks">
10
<meta name="generator" content="GTK-Doc V1.12 (XML mode)">
11
<link rel="stylesheet" href="style.css" type="text/css">
12
<link rel="chapter" href="about.html" title="Introduction to GnomeVFS">
13
<link rel="chapter" href="data-types.html" title="Basic Data Types">
14
<link rel="chapter" href="gnome-vfs-basic-file-ops.html" title="File Operations">
15
<link rel="chapter" href="gnome-vfs-directory-ops.html" title="Directory-Specific Operations">
16
<link rel="chapter" href="gnome-vfs-file-and-dirs-ops.html" title="Advanced File/Directory Operations">
17
<link rel="chapter" href="gnome-vfs-file-async-ops.html" title="Asynchronous Operations">
18
<link rel="chapter" href="volumes.html" title="Volumes and Drives Handling">
19
<link rel="chapter" href="networking.html" title="Networking">
20
<link rel="chapter" href="mime-registry.html" title="MIME Registry">
21
<link rel="chapter" href="modules.html" title="Filesystem Modules">
23
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
24
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
26
<td><a accesskey="p" href="gnome-vfs-2.0-gnome-vfs-standard-callbacks.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
27
<td><a accesskey="u" href="modules.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
28
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
29
<th width="100%" align="center">GnomeVFS - Filesystem Abstraction library</th>
32
<tr><td colspan="5" class="shortcuts">
33
<a href="#gnome-vfs-2.0-gnome-vfs-module-callback.synopsis" class="shortcut">Top</a>
35
<a href="#gnome-vfs-2.0-gnome-vfs-module-callback.description" class="shortcut">Description</a>
38
<div class="refentry" lang="en">
39
<a name="gnome-vfs-2.0-gnome-vfs-module-callback"></a><div class="titlepage"></div>
40
<div class="refnamediv"><table width="100%"><tr>
42
<h2><span class="refentrytitle"><a name="gnome-vfs-2.0-gnome-vfs-module-callback.top_of_page"></a>gnome-vfs-module-callback</span></h2>
43
<p>gnome-vfs-module-callback — functions used by apps if they want to answer to callback invocations by gnome-vfs modules</p>
45
<td valign="top" align="right"></td>
47
<div class="refsynopsisdiv">
48
<a name="gnome-vfs-2.0-gnome-vfs-module-callback.synopsis"></a><h2>Synopsis</h2>
49
<pre class="synopsis">
50
void (<a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#GnomeVFSModuleCallback" title="GnomeVFSModuleCallback ()">*GnomeVFSModuleCallback</a>) (gconstpointer in,
54
gpointer callback_data);
55
void (<a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#GnomeVFSModuleCallbackResponse" title="GnomeVFSModuleCallbackResponse ()">*GnomeVFSModuleCallbackResponse</a>) (gpointer response_data);
56
void (<a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#GnomeVFSAsyncModuleCallback" title="GnomeVFSAsyncModuleCallback ()">*GnomeVFSAsyncModuleCallback</a>) (gconstpointer in,
60
gpointer callback_data,
61
<a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#GnomeVFSModuleCallbackResponse" title="GnomeVFSModuleCallbackResponse ()">GnomeVFSModuleCallbackResponse</a> response,
62
gpointer response_data);
63
void <a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#gnome-vfs-module-callback-set-default" title="gnome_vfs_module_callback_set_default ()">gnome_vfs_module_callback_set_default</a>
64
(const char *callback_name,
65
<a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#GnomeVFSModuleCallback" title="GnomeVFSModuleCallback ()">GnomeVFSModuleCallback</a> callback,
66
gpointer callback_data,
67
GDestroyNotify destroy_notify);
68
void <a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#gnome-vfs-module-callback-push" title="gnome_vfs_module_callback_push ()">gnome_vfs_module_callback_push</a> (const char *callback_name,
69
<a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#GnomeVFSModuleCallback" title="GnomeVFSModuleCallback ()">GnomeVFSModuleCallback</a> callback,
70
gpointer callback_data,
71
GDestroyNotify destroy_notify);
72
void <a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#gnome-vfs-module-callback-pop" title="gnome_vfs_module_callback_pop ()">gnome_vfs_module_callback_pop</a> (const char *callback_name);
73
void <a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#gnome-vfs-async-module-callback-set-default" title="gnome_vfs_async_module_callback_set_default ()">gnome_vfs_async_module_callback_set_default</a>
74
(const char *callback_name,
75
<a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#GnomeVFSAsyncModuleCallback" title="GnomeVFSAsyncModuleCallback ()">GnomeVFSAsyncModuleCallback</a> callback,
76
gpointer callback_data,
77
GDestroyNotify destroy_notify);
78
void <a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#gnome-vfs-async-module-callback-push" title="gnome_vfs_async_module_callback_push ()">gnome_vfs_async_module_callback_push</a>
79
(const char *callback_name,
80
<a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#GnomeVFSAsyncModuleCallback" title="GnomeVFSAsyncModuleCallback ()">GnomeVFSAsyncModuleCallback</a> callback,
81
gpointer callback_data,
82
GDestroyNotify destroy_notify);
83
void <a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#gnome-vfs-async-module-callback-pop" title="gnome_vfs_async_module_callback_pop ()">gnome_vfs_async_module_callback_pop</a> (const char *callback_name);
86
<div class="refsect1" lang="en">
87
<a name="gnome-vfs-2.0-gnome-vfs-module-callback.description"></a><h2>Description</h2>
91
<div class="refsect1" lang="en">
92
<a name="gnome-vfs-2.0-gnome-vfs-module-callback.details"></a><h2>Details</h2>
93
<div class="refsect2" lang="en">
94
<a name="GnomeVFSModuleCallback"></a><h3>GnomeVFSModuleCallback ()</h3>
95
<pre class="programlisting">void (*GnomeVFSModuleCallback) (gconstpointer in,
99
gpointer callback_data);</pre>
101
Modules use a <a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#GnomeVFSModuleCallback" title="GnomeVFSModuleCallback ()"><span class="type">GnomeVFSModuleCallback</span></a> to send data to
102
client applications and request data from them synchronously.
105
The format of <em class="parameter"><code>in</code></em> and <em class="parameter"><code>out</code></em> is determined by the callback name.</p>
108
<div class="variablelist"><table border="0">
109
<col align="left" valign="top">
112
<td><p><span class="term"><em class="parameter"><code>in</code></em> :</span></p></td>
113
<td> data passed from module to application.
117
<td><p><span class="term"><em class="parameter"><code>in_size</code></em> :</span></p></td>
118
<td> size of <em class="parameter"><code>in</code></em> bytes.
122
<td><p><span class="term"><em class="parameter"><code>out</code></em> :</span></p></td>
123
<td> data passed from application to module.
127
<td><p><span class="term"><em class="parameter"><code>out_size</code></em> :</span></p></td>
128
<td> size of <em class="parameter"><code>out</code></em> in bytes.
132
<td><p><span class="term"><em class="parameter"><code>callback_data</code></em> :</span></p></td>
133
<td> user data passed when connecting the callback.
140
<div class="refsect2" lang="en">
141
<a name="GnomeVFSModuleCallbackResponse"></a><h3>GnomeVFSModuleCallbackResponse ()</h3>
142
<pre class="programlisting">void (*GnomeVFSModuleCallbackResponse) (gpointer response_data);</pre>
144
This is the type of the response function passed to a
145
<a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#GnomeVFSAsyncModuleCallback" title="GnomeVFSAsyncModuleCallback ()"><code class="function">GnomeVFSAsyncModuleCallback()</code></a>. It should be called when the async
146
callback has completed.</p>
149
<div class="variablelist"><table border="0">
150
<col align="left" valign="top">
152
<td><p><span class="term"><em class="parameter"><code>response_data</code></em> :</span></p></td>
153
<td> pass the response data argument originally passed to the async callback.
159
<div class="refsect2" lang="en">
160
<a name="GnomeVFSAsyncModuleCallback"></a><h3>GnomeVFSAsyncModuleCallback ()</h3>
161
<pre class="programlisting">void (*GnomeVFSAsyncModuleCallback) (gconstpointer in,
165
gpointer callback_data,
166
<a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#GnomeVFSModuleCallbackResponse" title="GnomeVFSModuleCallbackResponse ()">GnomeVFSModuleCallbackResponse</a> response,
167
gpointer response_data);</pre>
169
Modules use a <a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#GnomeVFSModuleCallback" title="GnomeVFSModuleCallback ()"><span class="type">GnomeVFSModuleCallback</span></a> to send data to
170
client applications and request data from them asynchronously.
173
The application is expected to invoke the <em class="parameter"><code>response</code></em> with <em class="parameter"><code>response_data</code></em>
174
when it is able to satisfy the request.
177
The format of <em class="parameter"><code>in</code></em> and <em class="parameter"><code>out</code></em> is determined by the callback name.</p>
180
<div class="variablelist"><table border="0">
181
<col align="left" valign="top">
184
<td><p><span class="term"><em class="parameter"><code>in</code></em> :</span></p></td>
185
<td> data passed from module to application.
189
<td><p><span class="term"><em class="parameter"><code>in_size</code></em> :</span></p></td>
190
<td> size of <em class="parameter"><code>in</code></em> bytes.
194
<td><p><span class="term"><em class="parameter"><code>out</code></em> :</span></p></td>
195
<td> data passed from application to module.
199
<td><p><span class="term"><em class="parameter"><code>out_size</code></em> :</span></p></td>
200
<td> size of <em class="parameter"><code>out</code></em> in bytes.
204
<td><p><span class="term"><em class="parameter"><code>callback_data</code></em> :</span></p></td>
205
<td> user data passed when connecting the callback.
209
<td><p><span class="term"><em class="parameter"><code>response</code></em> :</span></p></td>
210
<td> <a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#GnomeVFSModuleCallbackResponse" title="GnomeVFSModuleCallbackResponse ()"><span class="type">GnomeVFSModuleCallbackResponse</span></a> that must be invoked when the request is satisfied.
214
<td><p><span class="term"><em class="parameter"><code>response_data</code></em> :</span></p></td>
215
<td> data that must be passed to <em class="parameter"><code>response</code></em> when the request is satisfied.
222
<div class="refsect2" lang="en">
223
<a name="gnome-vfs-module-callback-set-default"></a><h3>gnome_vfs_module_callback_set_default ()</h3>
224
<pre class="programlisting">void gnome_vfs_module_callback_set_default
225
(const char *callback_name,
226
<a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#GnomeVFSModuleCallback" title="GnomeVFSModuleCallback ()">GnomeVFSModuleCallback</a> callback,
227
gpointer callback_data,
228
GDestroyNotify destroy_notify);</pre>
230
Set the default callback for <em class="parameter"><code>callback_name</code></em> to
231
<em class="parameter"><code>callback</code></em>. <em class="parameter"><code>callback</code></em> will be called with <em class="parameter"><code>callback_data</code></em> on the
232
same thread as the gnome-vfs operation that invokes it. The default
233
value is shared for all threads, but setting it is thread-safe.
236
Use this function if you want to set a handler to be used by your
237
whole application. You can use <a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#gnome-vfs-module-callback-push" title="gnome_vfs_module_callback_push ()"><code class="function">gnome_vfs_module_callback_push()</code></a> to
238
set a callback function that will temporarily override the default
239
on the current thread instead. Or you can also use
240
<a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#gnome-vfs-async-module-callback-set-default" title="gnome_vfs_async_module_callback_set_default ()"><code class="function">gnome_vfs_async_module_callback_set_default()</code></a> to set an async
244
Note: <em class="parameter"><code>destroy_notify</code></em> may be called on any thread - it is not
245
guaranteed to be called on the main thread.</p>
248
<div class="variablelist"><table border="0">
249
<col align="left" valign="top">
252
<td><p><span class="term"><em class="parameter"><code>callback_name</code></em> :</span></p></td>
253
<td> name of the module callback to set.
257
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
258
<td> function to call when the <em class="parameter"><code>callback</code></em> is invoked.
262
<td><p><span class="term"><em class="parameter"><code>callback_data</code></em> :</span></p></td>
263
<td> data to pass to <em class="parameter"><code>callback</code></em>.
267
<td><p><span class="term"><em class="parameter"><code>destroy_notify</code></em> :</span></p></td>
268
<td> function to call when <em class="parameter"><code>callback_data</code></em> is to be freed.
275
<div class="refsect2" lang="en">
276
<a name="gnome-vfs-module-callback-push"></a><h3>gnome_vfs_module_callback_push ()</h3>
277
<pre class="programlisting">void gnome_vfs_module_callback_push (const char *callback_name,
278
<a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#GnomeVFSModuleCallback" title="GnomeVFSModuleCallback ()">GnomeVFSModuleCallback</a> callback,
279
gpointer callback_data,
280
GDestroyNotify destroy_notify);</pre>
282
Set <em class="parameter"><code>callback</code></em> as a temprary handler for <em class="parameter"><code>callback_name</code></em>. <em class="parameter"><code>callback</code></em>
283
will be called with <em class="parameter"><code>callback_data</code></em> on the same thread as the
284
gnome-vfs operation that invokes it. The temporary handler is set
288
<a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#gnome-vfs-module-callback-pop" title="gnome_vfs_module_callback_pop ()"><code class="function">gnome_vfs_module_callback_pop()</code></a> removes the most recently set
289
temporary handler. The temporary handlers are treated as a first-in
293
Use this function to set a temporary callback handler for a single
294
call or a few calls. You can use
295
<a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#gnome-vfs-module-callback-set-default" title="gnome_vfs_module_callback_set_default ()"><code class="function">gnome_vfs_module_callback_set_default()</code></a> to set a callback function
296
that will establish a permanent global setting for all threads
300
Note: <em class="parameter"><code>destroy_notify</code></em> may be called on any thread - it is not
301
guaranteed to be called on the main thread.</p>
304
<div class="variablelist"><table border="0">
305
<col align="left" valign="top">
308
<td><p><span class="term"><em class="parameter"><code>callback_name</code></em> :</span></p></td>
309
<td> name of the module callback to set temporarily.
313
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
314
<td> function to call when the <em class="parameter"><code>callback</code></em> is invoked.
318
<td><p><span class="term"><em class="parameter"><code>callback_data</code></em> :</span></p></td>
319
<td> data to pass to <em class="parameter"><code>callback</code></em>.
323
<td><p><span class="term"><em class="parameter"><code>destroy_notify</code></em> :</span></p></td>
324
<td> function to call when <em class="parameter"><code>callback_data</code></em> is to be freed.
331
<div class="refsect2" lang="en">
332
<a name="gnome-vfs-module-callback-pop"></a><h3>gnome_vfs_module_callback_pop ()</h3>
333
<pre class="programlisting">void gnome_vfs_module_callback_pop (const char *callback_name);</pre>
336
<div class="variablelist"><table border="0">
337
<col align="left" valign="top">
339
<td><p><span class="term"><em class="parameter"><code>callback_name</code></em> :</span></p></td>
346
<div class="refsect2" lang="en">
347
<a name="gnome-vfs-async-module-callback-set-default"></a><h3>gnome_vfs_async_module_callback_set_default ()</h3>
348
<pre class="programlisting">void gnome_vfs_async_module_callback_set_default
349
(const char *callback_name,
350
<a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#GnomeVFSAsyncModuleCallback" title="GnomeVFSAsyncModuleCallback ()">GnomeVFSAsyncModuleCallback</a> callback,
351
gpointer callback_data,
352
GDestroyNotify destroy_notify);</pre>
354
Set the default async callback for <em class="parameter"><code>callback_name</code></em> to
355
<em class="parameter"><code>callback</code></em>. <em class="parameter"><code>callback</code></em> will be called with <em class="parameter"><code>callback_data</code></em>
356
from a callback on the main thread. It will be passed a response
357
function which should be called to signal completion of the callback.
358
The callback function itself may return in the meantime.
361
The default value is shared for all threads, but setting it is
365
Use this function if you want to globally set a callback handler
366
for use with async operations.
369
You can use <a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#gnome-vfs-async-module-callback-push" title="gnome_vfs_async_module_callback_push ()"><code class="function">gnome_vfs_async_module_callback_push()</code></a> to set an async
370
callback function that will temporarily override the default on the
371
current thread instead. Or you can also use
372
<a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#gnome-vfs-module-callback-set-default" title="gnome_vfs_module_callback_set_default ()"><code class="function">gnome_vfs_module_callback_set_default()</code></a> to set a regular callback
376
Note: <em class="parameter"><code>destroy_notify</code></em> may be called on any thread - it is not
377
guaranteed to be called on the main thread.</p>
380
<div class="variablelist"><table border="0">
381
<col align="left" valign="top">
384
<td><p><span class="term"><em class="parameter"><code>callback_name</code></em> :</span></p></td>
385
<td> name of the async module callback to set.
389
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
390
<td> function to call when <em class="parameter"><code>callback</code></em> is invoked.
394
<td><p><span class="term"><em class="parameter"><code>callback_data</code></em> :</span></p></td>
395
<td> data to pass to <em class="parameter"><code>callback</code></em>.
399
<td><p><span class="term"><em class="parameter"><code>destroy_notify</code></em> :</span></p></td>
400
<td> function to call when <em class="parameter"><code>callback_data</code></em> is to be freed.
407
<div class="refsect2" lang="en">
408
<a name="gnome-vfs-async-module-callback-push"></a><h3>gnome_vfs_async_module_callback_push ()</h3>
409
<pre class="programlisting">void gnome_vfs_async_module_callback_push
410
(const char *callback_name,
411
<a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#GnomeVFSAsyncModuleCallback" title="GnomeVFSAsyncModuleCallback ()">GnomeVFSAsyncModuleCallback</a> callback,
412
gpointer callback_data,
413
GDestroyNotify destroy_notify);</pre>
415
Set <em class="parameter"><code>callback</code></em> as a temprary async handler for
416
<em class="parameter"><code>callback_name</code></em>. <em class="parameter"><code>callback</code></em> will be called with <em class="parameter"><code>callback_data</code></em>
417
from a callback on the main thread. It will be passed a response
418
function which should be called to signal completion of the
419
callback. The callback function itself may return in the meantime.
422
The temporary async handler is set per-thread.
425
<a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#gnome-vfs-async-module-callback-pop" title="gnome_vfs_async_module_callback_pop ()"><code class="function">gnome_vfs_async_module_callback_pop()</code></a> removes the most recently set
426
temporary handler. The temporary async handlers are
427
treated as a first-in first-out stack.
430
Use this function to set a temporary async callback handler for a
431
single call or a few calls. You can use
432
<a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#gnome-vfs-async-module-callback-set-default" title="gnome_vfs_async_module_callback_set_default ()"><code class="function">gnome_vfs_async_module_callback_set_default()</code></a> to set an async
433
callback function that will establish a permanent global setting
434
for all threads instead.
437
Note: <em class="parameter"><code>destroy_notify</code></em> may be called on any thread - it is not
438
guaranteed to be called on the main thread.</p>
441
<div class="variablelist"><table border="0">
442
<col align="left" valign="top">
445
<td><p><span class="term"><em class="parameter"><code>callback_name</code></em> :</span></p></td>
446
<td> name of the module callback to set temporarily.
450
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
451
<td> function to call when <em class="parameter"><code>callback</code></em> is invoked.
455
<td><p><span class="term"><em class="parameter"><code>callback_data</code></em> :</span></p></td>
456
<td> data to pass to <em class="parameter"><code>callback</code></em>.
460
<td><p><span class="term"><em class="parameter"><code>destroy_notify</code></em> :</span></p></td>
461
<td> function to call when <em class="parameter"><code>callback_data</code></em> is to be freed.
468
<div class="refsect2" lang="en">
469
<a name="gnome-vfs-async-module-callback-pop"></a><h3>gnome_vfs_async_module_callback_pop ()</h3>
470
<pre class="programlisting">void gnome_vfs_async_module_callback_pop (const char *callback_name);</pre>
472
Remove the temporary async handler for <em class="parameter"><code>callback_name</code></em> most recently
473
set with <a class="link" href="gnome-vfs-2.0-gnome-vfs-module-callback.html#gnome-vfs-async-module-callback-push" title="gnome_vfs_async_module_callback_push ()"><code class="function">gnome_vfs_async_module_callback_push()</code></a>. If another
474
temporary async handler was previously set on the same thread, it
475
becomes the current handler. Otherwise, the default async handler,
476
if any, becomes current.
479
The temporary async handlers are treated as a first-in first-out
483
<div class="variablelist"><table border="0">
484
<col align="left" valign="top">
486
<td><p><span class="term"><em class="parameter"><code>callback_name</code></em> :</span></p></td>
487
<td> name of the module callback to remove a temporary handler for.
496
Generated by GTK-Doc V1.12</div>