GnomeVFS - Filesystem Abstraction library | ||||
---|---|---|---|---|
Top | Description |
gnome-vfs-module-callbackgnome-vfs-module-callback — functions used by apps if they want to answer to callback invocations by gnome-vfs modules |
Synopsis
void (*GnomeVFSModuleCallback) (gconstpointer in, gsize in_size, gpointer out, gsize out_size, gpointer callback_data); void (*GnomeVFSModuleCallbackResponse) (gpointer response_data); void (*GnomeVFSAsyncModuleCallback) (gconstpointer in, gsize in_size, gpointer out, gsize out_size, gpointer callback_data, GnomeVFSModuleCallbackResponse response, gpointer response_data); void gnome_vfs_module_callback_set_default (const char *callback_name, GnomeVFSModuleCallback callback, gpointer callback_data, GDestroyNotify destroy_notify); void gnome_vfs_module_callback_push (const char *callback_name, GnomeVFSModuleCallback callback, gpointer callback_data, GDestroyNotify destroy_notify); void gnome_vfs_module_callback_pop (const char *callback_name); void gnome_vfs_async_module_callback_set_default (const char *callback_name, GnomeVFSAsyncModuleCallback callback, gpointer callback_data, GDestroyNotify destroy_notify); void gnome_vfs_async_module_callback_push (const char *callback_name, GnomeVFSAsyncModuleCallback callback, gpointer callback_data, GDestroyNotify destroy_notify); void gnome_vfs_async_module_callback_pop (const char *callback_name);
Details
GnomeVFSModuleCallback ()
void (*GnomeVFSModuleCallback) (gconstpointer in, gsize in_size, gpointer out, gsize out_size, gpointer callback_data);
Modules use a GnomeVFSModuleCallback to send data to client applications and request data from them synchronously.
The format of in
and out
is determined by the callback name.
|
data passed from module to application. |
|
size of in bytes.
|
|
data passed from application to module. |
|
size of out in bytes.
|
|
user data passed when connecting the callback. |
GnomeVFSModuleCallbackResponse ()
void (*GnomeVFSModuleCallbackResponse) (gpointer response_data);
This is the type of the response function passed to a
GnomeVFSAsyncModuleCallback()
. It should be called when the async
callback has completed.
|
pass the response data argument originally passed to the async callback. |
GnomeVFSAsyncModuleCallback ()
void (*GnomeVFSAsyncModuleCallback) (gconstpointer in, gsize in_size, gpointer out, gsize out_size, gpointer callback_data, GnomeVFSModuleCallbackResponse response, gpointer response_data);
Modules use a GnomeVFSModuleCallback to send data to client applications and request data from them asynchronously.
The application is expected to invoke the response
with response_data
when it is able to satisfy the request.
The format of in
and out
is determined by the callback name.
|
data passed from module to application. |
|
size of in bytes.
|
|
data passed from application to module. |
|
size of out in bytes.
|
|
user data passed when connecting the callback. |
|
GnomeVFSModuleCallbackResponse that must be invoked when the request is satisfied. |
|
data that must be passed to response when the request is satisfied.
|
gnome_vfs_module_callback_set_default ()
void gnome_vfs_module_callback_set_default (const char *callback_name, GnomeVFSModuleCallback callback, gpointer callback_data, GDestroyNotify destroy_notify);
Set the default callback for callback_name
to
callback
. callback
will be called with callback_data
on the
same thread as the gnome-vfs operation that invokes it. The default
value is shared for all threads, but setting it is thread-safe.
Use this function if you want to set a handler to be used by your
whole application. You can use gnome_vfs_module_callback_push()
to
set a callback function that will temporarily override the default
on the current thread instead. Or you can also use
gnome_vfs_async_module_callback_set_default()
to set an async
callback function.
Note: destroy_notify
may be called on any thread - it is not
guaranteed to be called on the main thread.
|
name of the module callback to set. |
|
function to call when the callback is invoked.
|
|
data to pass to callback .
|
|
function to call when callback_data is to be freed.
|
gnome_vfs_module_callback_push ()
void gnome_vfs_module_callback_push (const char *callback_name, GnomeVFSModuleCallback callback, gpointer callback_data, GDestroyNotify destroy_notify);
Set callback
as a temprary handler for callback_name
. callback
will be called with callback_data
on the same thread as the
gnome-vfs operation that invokes it. The temporary handler is set
per-thread.
gnome_vfs_module_callback_pop()
removes the most recently set
temporary handler. The temporary handlers are treated as a first-in
first-out stack.
Use this function to set a temporary callback handler for a single
call or a few calls. You can use
gnome_vfs_module_callback_set_default()
to set a callback function
that will establish a permanent global setting for all threads
instead.
Note: destroy_notify
may be called on any thread - it is not
guaranteed to be called on the main thread.
|
name of the module callback to set temporarily. |
|
function to call when the callback is invoked.
|
|
data to pass to callback .
|
|
function to call when callback_data is to be freed.
|
gnome_vfs_module_callback_pop ()
void gnome_vfs_module_callback_pop (const char *callback_name);
|
gnome_vfs_async_module_callback_set_default ()
void gnome_vfs_async_module_callback_set_default (const char *callback_name, GnomeVFSAsyncModuleCallback callback, gpointer callback_data, GDestroyNotify destroy_notify);
Set the default async callback for callback_name
to
callback
. callback
will be called with callback_data
from a callback on the main thread. It will be passed a response
function which should be called to signal completion of the callback.
The callback function itself may return in the meantime.
The default value is shared for all threads, but setting it is thread-safe.
Use this function if you want to globally set a callback handler for use with async operations.
You can use gnome_vfs_async_module_callback_push()
to set an async
callback function that will temporarily override the default on the
current thread instead. Or you can also use
gnome_vfs_module_callback_set_default()
to set a regular callback
function.
Note: destroy_notify
may be called on any thread - it is not
guaranteed to be called on the main thread.
|
name of the async module callback to set. |
|
function to call when callback is invoked.
|
|
data to pass to callback .
|
|
function to call when callback_data is to be freed.
|
gnome_vfs_async_module_callback_push ()
void gnome_vfs_async_module_callback_push (const char *callback_name, GnomeVFSAsyncModuleCallback callback, gpointer callback_data, GDestroyNotify destroy_notify);
Set callback
as a temprary async handler for
callback_name
. callback
will be called with callback_data
from a callback on the main thread. It will be passed a response
function which should be called to signal completion of the
callback. The callback function itself may return in the meantime.
The temporary async handler is set per-thread.
gnome_vfs_async_module_callback_pop()
removes the most recently set
temporary handler. The temporary async handlers are
treated as a first-in first-out stack.
Use this function to set a temporary async callback handler for a
single call or a few calls. You can use
gnome_vfs_async_module_callback_set_default()
to set an async
callback function that will establish a permanent global setting
for all threads instead.
Note: destroy_notify
may be called on any thread - it is not
guaranteed to be called on the main thread.
|
name of the module callback to set temporarily. |
|
function to call when callback is invoked.
|
|
data to pass to callback .
|
|
function to call when callback_data is to be freed.
|
gnome_vfs_async_module_callback_pop ()
void gnome_vfs_async_module_callback_pop (const char *callback_name);
Remove the temporary async handler for callback_name
most recently
set with gnome_vfs_async_module_callback_push()
. If another
temporary async handler was previously set on the same thread, it
becomes the current handler. Otherwise, the default async handler,
if any, becomes current.
The temporary async handlers are treated as a first-in first-out stack.
|
name of the module callback to remove a temporary handler for. |