1999-08-16 17:58:30 +00:00
|
|
|
<!-- ##### SECTION Title ##### -->
|
|
|
|
Hook Functions
|
|
|
|
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
2007-07-22 04:14:54 +00:00
|
|
|
support for manipulating lists of hook functions
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
|
|
<para>
|
2000-09-07 16:36:56 +00:00
|
|
|
The #GHookList, #GHook and their related functions provide support for
|
|
|
|
lists of hook functions. Functions can be added and removed from the lists,
|
|
|
|
and the list of hook functions can be invoked.
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2005-05-05 14:57:29 +00:00
|
|
|
<!-- ##### SECTION Stability_Level ##### -->
|
|
|
|
|
|
|
|
|
2010-04-19 17:30:42 -04:00
|
|
|
<!-- ##### SECTION Image ##### -->
|
|
|
|
|
|
|
|
|
1999-08-16 17:58:30 +00:00
|
|
|
<!-- ##### STRUCT GHookList ##### -->
|
|
|
|
<para>
|
Documentation fixes.
* glib/gconvert.c, glib/grand.c, glib/ghash.c,
glib/gthreadpool.c, glib/gtree.c: Documentation fixes.
* glib/tmpl/allocators.sgml, glib/tmpl/arrays.sgml,
glib/tmpl/arrays_byte.sgml, glib/tmpl/arrays_pointer.sgml,
glib/tmpl/caches.sgml, glib/tmpl/completion.sgml,
glib/tmpl/conversions.sgml,
glib/tmpl/datalist.sgml, glib/tmpl/date.sgml,
glib/tmpl/error_reporting.sgml, glib/tmpl/fileutils.sgml,
glib/tmpl/hash_tables.sgml,
glib/tmpl/hooks.sgml, glib/tmpl/macros.sgml,
glib/tmpl/macros_misc.sgml, glib/tmpl/main.sgml, glib/tmpl/markup.sgml,
glib/tmpl/memory.sgml, glib/tmpl/memory_chunks.sgml,
glib/tmpl/messages.sgml, glib/tmpl/misc_utils.sgml,
glib/tmpl/modules.sgml, glib/tmpl/numerical.sgml,
glib/tmpl/patterns.sgml, glib/tmpl/queue.sgml,
glib/tmpl/shell.sgml, glib/tmpl/spawn.sgml,
glib/tmpl/string_utils.sgml, glib/tmpl/thread_pools.sgml,
glib/tmpl/threads.sgml, glib/tmpl/timers.sgml,
glib/tmpl/trees-binary.sgml, glib/tmpl/trees-nary.sgml,
glib/tmpl/type_conversion.sgml, glib/tmpl/unicode.sgml,
glib/tmpl/warnings.sgml, glib/tmpl/windows.sgml:
Improve markup of examples, general consistency improvements.
2001-12-12 20:32:07 +00:00
|
|
|
The <structname>GHookList</structname> struct represents a
|
|
|
|
list of hook functions.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@seq_id: the next free #GHook id
|
|
|
|
@hook_size: the size of the #GHookList elements, in bytes
|
|
|
|
@is_setup: 1 if the #GHookList has been initialized
|
|
|
|
@hooks: the first #GHook element in the list
|
2007-10-16 06:33:50 +00:00
|
|
|
@dummy3: unused
|
Documentation fixes.
* glib/gconvert.c, glib/grand.c, glib/ghash.c,
glib/gthreadpool.c, glib/gtree.c: Documentation fixes.
* glib/tmpl/allocators.sgml, glib/tmpl/arrays.sgml,
glib/tmpl/arrays_byte.sgml, glib/tmpl/arrays_pointer.sgml,
glib/tmpl/caches.sgml, glib/tmpl/completion.sgml,
glib/tmpl/conversions.sgml,
glib/tmpl/datalist.sgml, glib/tmpl/date.sgml,
glib/tmpl/error_reporting.sgml, glib/tmpl/fileutils.sgml,
glib/tmpl/hash_tables.sgml,
glib/tmpl/hooks.sgml, glib/tmpl/macros.sgml,
glib/tmpl/macros_misc.sgml, glib/tmpl/main.sgml, glib/tmpl/markup.sgml,
glib/tmpl/memory.sgml, glib/tmpl/memory_chunks.sgml,
glib/tmpl/messages.sgml, glib/tmpl/misc_utils.sgml,
glib/tmpl/modules.sgml, glib/tmpl/numerical.sgml,
glib/tmpl/patterns.sgml, glib/tmpl/queue.sgml,
glib/tmpl/shell.sgml, glib/tmpl/spawn.sgml,
glib/tmpl/string_utils.sgml, glib/tmpl/thread_pools.sgml,
glib/tmpl/threads.sgml, glib/tmpl/timers.sgml,
glib/tmpl/trees-binary.sgml, glib/tmpl/trees-nary.sgml,
glib/tmpl/type_conversion.sgml, glib/tmpl/unicode.sgml,
glib/tmpl/warnings.sgml, glib/tmpl/windows.sgml:
Improve markup of examples, general consistency improvements.
2001-12-12 20:32:07 +00:00
|
|
|
@finalize_hook: the function to call to finalize a #GHook element. The
|
2007-11-09 03:21:27 +00:00
|
|
|
default behaviour is to call the hooks <function>destroy</function> function
|
2007-09-16 18:03:57 +00:00
|
|
|
@dummy: unused
|
Documentation fixes.
* glib/gconvert.c, glib/grand.c, glib/ghash.c,
glib/gthreadpool.c, glib/gtree.c: Documentation fixes.
* glib/tmpl/allocators.sgml, glib/tmpl/arrays.sgml,
glib/tmpl/arrays_byte.sgml, glib/tmpl/arrays_pointer.sgml,
glib/tmpl/caches.sgml, glib/tmpl/completion.sgml,
glib/tmpl/conversions.sgml,
glib/tmpl/datalist.sgml, glib/tmpl/date.sgml,
glib/tmpl/error_reporting.sgml, glib/tmpl/fileutils.sgml,
glib/tmpl/hash_tables.sgml,
glib/tmpl/hooks.sgml, glib/tmpl/macros.sgml,
glib/tmpl/macros_misc.sgml, glib/tmpl/main.sgml, glib/tmpl/markup.sgml,
glib/tmpl/memory.sgml, glib/tmpl/memory_chunks.sgml,
glib/tmpl/messages.sgml, glib/tmpl/misc_utils.sgml,
glib/tmpl/modules.sgml, glib/tmpl/numerical.sgml,
glib/tmpl/patterns.sgml, glib/tmpl/queue.sgml,
glib/tmpl/shell.sgml, glib/tmpl/spawn.sgml,
glib/tmpl/string_utils.sgml, glib/tmpl/thread_pools.sgml,
glib/tmpl/threads.sgml, glib/tmpl/timers.sgml,
glib/tmpl/trees-binary.sgml, glib/tmpl/trees-nary.sgml,
glib/tmpl/type_conversion.sgml, glib/tmpl/unicode.sgml,
glib/tmpl/warnings.sgml, glib/tmpl/windows.sgml:
Improve markup of examples, general consistency improvements.
2001-12-12 20:32:07 +00:00
|
|
|
|
2001-10-04 22:26:23 +00:00
|
|
|
<!-- ##### USER_FUNCTION GHookFinalizeFunc ##### -->
|
|
|
|
<para>
|
|
|
|
Defines the type of function to be called when a hook in a
|
|
|
|
list of hooks gets finalized.
|
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
|
|
|
@hook: the hook in @hook_list that gets finalized
|
2001-10-04 22:26:23 +00:00
|
|
|
|
|
|
|
|
1999-08-16 17:58:30 +00:00
|
|
|
<!-- ##### STRUCT GHook ##### -->
|
|
|
|
<para>
|
Documentation fixes.
* glib/gconvert.c, glib/grand.c, glib/ghash.c,
glib/gthreadpool.c, glib/gtree.c: Documentation fixes.
* glib/tmpl/allocators.sgml, glib/tmpl/arrays.sgml,
glib/tmpl/arrays_byte.sgml, glib/tmpl/arrays_pointer.sgml,
glib/tmpl/caches.sgml, glib/tmpl/completion.sgml,
glib/tmpl/conversions.sgml,
glib/tmpl/datalist.sgml, glib/tmpl/date.sgml,
glib/tmpl/error_reporting.sgml, glib/tmpl/fileutils.sgml,
glib/tmpl/hash_tables.sgml,
glib/tmpl/hooks.sgml, glib/tmpl/macros.sgml,
glib/tmpl/macros_misc.sgml, glib/tmpl/main.sgml, glib/tmpl/markup.sgml,
glib/tmpl/memory.sgml, glib/tmpl/memory_chunks.sgml,
glib/tmpl/messages.sgml, glib/tmpl/misc_utils.sgml,
glib/tmpl/modules.sgml, glib/tmpl/numerical.sgml,
glib/tmpl/patterns.sgml, glib/tmpl/queue.sgml,
glib/tmpl/shell.sgml, glib/tmpl/spawn.sgml,
glib/tmpl/string_utils.sgml, glib/tmpl/thread_pools.sgml,
glib/tmpl/threads.sgml, glib/tmpl/timers.sgml,
glib/tmpl/trees-binary.sgml, glib/tmpl/trees-nary.sgml,
glib/tmpl/type_conversion.sgml, glib/tmpl/unicode.sgml,
glib/tmpl/warnings.sgml, glib/tmpl/windows.sgml:
Improve markup of examples, general consistency improvements.
2001-12-12 20:32:07 +00:00
|
|
|
The <structname>GHook</structname> struct represents a single hook
|
|
|
|
function in a #GHookList.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@data: data which is passed to func when this hook is invoked
|
|
|
|
@next: pointer to the next hook in the list
|
|
|
|
@prev: pointer to the previous hook in the list
|
|
|
|
@ref_count: the reference count of this hook
|
|
|
|
@hook_id: the id of this hook, which is unique within its list
|
Documentation fixes.
* glib/gconvert.c, glib/grand.c, glib/ghash.c,
glib/gthreadpool.c, glib/gtree.c: Documentation fixes.
* glib/tmpl/allocators.sgml, glib/tmpl/arrays.sgml,
glib/tmpl/arrays_byte.sgml, glib/tmpl/arrays_pointer.sgml,
glib/tmpl/caches.sgml, glib/tmpl/completion.sgml,
glib/tmpl/conversions.sgml,
glib/tmpl/datalist.sgml, glib/tmpl/date.sgml,
glib/tmpl/error_reporting.sgml, glib/tmpl/fileutils.sgml,
glib/tmpl/hash_tables.sgml,
glib/tmpl/hooks.sgml, glib/tmpl/macros.sgml,
glib/tmpl/macros_misc.sgml, glib/tmpl/main.sgml, glib/tmpl/markup.sgml,
glib/tmpl/memory.sgml, glib/tmpl/memory_chunks.sgml,
glib/tmpl/messages.sgml, glib/tmpl/misc_utils.sgml,
glib/tmpl/modules.sgml, glib/tmpl/numerical.sgml,
glib/tmpl/patterns.sgml, glib/tmpl/queue.sgml,
glib/tmpl/shell.sgml, glib/tmpl/spawn.sgml,
glib/tmpl/string_utils.sgml, glib/tmpl/thread_pools.sgml,
glib/tmpl/threads.sgml, glib/tmpl/timers.sgml,
glib/tmpl/trees-binary.sgml, glib/tmpl/trees-nary.sgml,
glib/tmpl/type_conversion.sgml, glib/tmpl/unicode.sgml,
glib/tmpl/warnings.sgml, glib/tmpl/windows.sgml:
Improve markup of examples, general consistency improvements.
2001-12-12 20:32:07 +00:00
|
|
|
@flags: flags which are set for this hook. See #GHookFlagMask for
|
2007-11-09 03:21:27 +00:00
|
|
|
predefined flags
|
Documentation fixes.
* glib/gconvert.c, glib/grand.c, glib/ghash.c,
glib/gthreadpool.c, glib/gtree.c: Documentation fixes.
* glib/tmpl/allocators.sgml, glib/tmpl/arrays.sgml,
glib/tmpl/arrays_byte.sgml, glib/tmpl/arrays_pointer.sgml,
glib/tmpl/caches.sgml, glib/tmpl/completion.sgml,
glib/tmpl/conversions.sgml,
glib/tmpl/datalist.sgml, glib/tmpl/date.sgml,
glib/tmpl/error_reporting.sgml, glib/tmpl/fileutils.sgml,
glib/tmpl/hash_tables.sgml,
glib/tmpl/hooks.sgml, glib/tmpl/macros.sgml,
glib/tmpl/macros_misc.sgml, glib/tmpl/main.sgml, glib/tmpl/markup.sgml,
glib/tmpl/memory.sgml, glib/tmpl/memory_chunks.sgml,
glib/tmpl/messages.sgml, glib/tmpl/misc_utils.sgml,
glib/tmpl/modules.sgml, glib/tmpl/numerical.sgml,
glib/tmpl/patterns.sgml, glib/tmpl/queue.sgml,
glib/tmpl/shell.sgml, glib/tmpl/spawn.sgml,
glib/tmpl/string_utils.sgml, glib/tmpl/thread_pools.sgml,
glib/tmpl/threads.sgml, glib/tmpl/timers.sgml,
glib/tmpl/trees-binary.sgml, glib/tmpl/trees-nary.sgml,
glib/tmpl/type_conversion.sgml, glib/tmpl/unicode.sgml,
glib/tmpl/warnings.sgml, glib/tmpl/windows.sgml:
Improve markup of examples, general consistency improvements.
2001-12-12 20:32:07 +00:00
|
|
|
@func: the function to call when this hook is invoked. The possible
|
2007-11-09 03:21:27 +00:00
|
|
|
signatures for this function are #GHookFunc and #GHookCheckFunc
|
Documentation fixes.
* glib/gconvert.c, glib/grand.c, glib/ghash.c,
glib/gthreadpool.c, glib/gtree.c: Documentation fixes.
* glib/tmpl/allocators.sgml, glib/tmpl/arrays.sgml,
glib/tmpl/arrays_byte.sgml, glib/tmpl/arrays_pointer.sgml,
glib/tmpl/caches.sgml, glib/tmpl/completion.sgml,
glib/tmpl/conversions.sgml,
glib/tmpl/datalist.sgml, glib/tmpl/date.sgml,
glib/tmpl/error_reporting.sgml, glib/tmpl/fileutils.sgml,
glib/tmpl/hash_tables.sgml,
glib/tmpl/hooks.sgml, glib/tmpl/macros.sgml,
glib/tmpl/macros_misc.sgml, glib/tmpl/main.sgml, glib/tmpl/markup.sgml,
glib/tmpl/memory.sgml, glib/tmpl/memory_chunks.sgml,
glib/tmpl/messages.sgml, glib/tmpl/misc_utils.sgml,
glib/tmpl/modules.sgml, glib/tmpl/numerical.sgml,
glib/tmpl/patterns.sgml, glib/tmpl/queue.sgml,
glib/tmpl/shell.sgml, glib/tmpl/spawn.sgml,
glib/tmpl/string_utils.sgml, glib/tmpl/thread_pools.sgml,
glib/tmpl/threads.sgml, glib/tmpl/timers.sgml,
glib/tmpl/trees-binary.sgml, glib/tmpl/trees-nary.sgml,
glib/tmpl/type_conversion.sgml, glib/tmpl/unicode.sgml,
glib/tmpl/warnings.sgml, glib/tmpl/windows.sgml:
Improve markup of examples, general consistency improvements.
2001-12-12 20:32:07 +00:00
|
|
|
@destroy: the default <function>finalize_hook</function> function of a
|
2007-11-09 03:21:27 +00:00
|
|
|
#GHookList calls this member of the hook that is being finalized
|
Documentation fixes.
* glib/gconvert.c, glib/grand.c, glib/ghash.c,
glib/gthreadpool.c, glib/gtree.c: Documentation fixes.
* glib/tmpl/allocators.sgml, glib/tmpl/arrays.sgml,
glib/tmpl/arrays_byte.sgml, glib/tmpl/arrays_pointer.sgml,
glib/tmpl/caches.sgml, glib/tmpl/completion.sgml,
glib/tmpl/conversions.sgml,
glib/tmpl/datalist.sgml, glib/tmpl/date.sgml,
glib/tmpl/error_reporting.sgml, glib/tmpl/fileutils.sgml,
glib/tmpl/hash_tables.sgml,
glib/tmpl/hooks.sgml, glib/tmpl/macros.sgml,
glib/tmpl/macros_misc.sgml, glib/tmpl/main.sgml, glib/tmpl/markup.sgml,
glib/tmpl/memory.sgml, glib/tmpl/memory_chunks.sgml,
glib/tmpl/messages.sgml, glib/tmpl/misc_utils.sgml,
glib/tmpl/modules.sgml, glib/tmpl/numerical.sgml,
glib/tmpl/patterns.sgml, glib/tmpl/queue.sgml,
glib/tmpl/shell.sgml, glib/tmpl/spawn.sgml,
glib/tmpl/string_utils.sgml, glib/tmpl/thread_pools.sgml,
glib/tmpl/threads.sgml, glib/tmpl/timers.sgml,
glib/tmpl/trees-binary.sgml, glib/tmpl/trees-nary.sgml,
glib/tmpl/type_conversion.sgml, glib/tmpl/unicode.sgml,
glib/tmpl/warnings.sgml, glib/tmpl/windows.sgml:
Improve markup of examples, general consistency improvements.
2001-12-12 20:32:07 +00:00
|
|
|
|
1999-08-16 17:58:30 +00:00
|
|
|
<!-- ##### USER_FUNCTION GHookFunc ##### -->
|
|
|
|
<para>
|
2001-10-04 22:26:23 +00:00
|
|
|
Defines the type of a hook function that can be invoked
|
|
|
|
by g_hook_list_invoke().
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@data: the data field of the #GHook is passed to the hook function here
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### USER_FUNCTION GHookCheckFunc ##### -->
|
|
|
|
<para>
|
2001-10-04 22:26:23 +00:00
|
|
|
Defines the type of a hook function that can be invoked
|
|
|
|
by g_hook_list_invoke_check().
|
2001-05-19 05:32:50 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@data: the data field of the #GHook is passed to the hook function here
|
|
|
|
@Returns: %FALSE if the #GHook should be destroyed
|
2001-05-19 05:32:50 +00:00
|
|
|
|
|
|
|
|
1999-08-16 17:58:30 +00:00
|
|
|
<!-- ##### FUNCTION g_hook_list_init ##### -->
|
|
|
|
<para>
|
2000-09-07 16:36:56 +00:00
|
|
|
Initializes a #GHookList.
|
|
|
|
This must be called before the #GHookList is used.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
2000-09-07 16:36:56 +00:00
|
|
|
@hook_size: the size of each element in the #GHookList, typically
|
2007-11-09 03:21:27 +00:00
|
|
|
<literal>sizeof (GHook)</literal>
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_hook_list_invoke ##### -->
|
|
|
|
<para>
|
2000-09-07 16:36:56 +00:00
|
|
|
Calls all of the #GHook functions in a #GHookList.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
2001-10-04 22:26:23 +00:00
|
|
|
@may_recurse: %TRUE if functions which are already running (e.g. in another
|
2007-11-09 03:21:27 +00:00
|
|
|
thread) can be called. If set to %FALSE, these are skipped
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_hook_list_invoke_check ##### -->
|
|
|
|
<para>
|
2000-09-07 16:36:56 +00:00
|
|
|
Calls all of the #GHook functions in a #GHookList.
|
2007-11-09 03:25:50 +00:00
|
|
|
Any function which returns %FALSE is removed from the #GHookList.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
2001-10-04 22:26:23 +00:00
|
|
|
@may_recurse: %TRUE if functions which are already running (e.g. in another
|
2007-11-09 03:21:27 +00:00
|
|
|
thread) can be called. If set to %FALSE, these are skipped
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_hook_list_marshal ##### -->
|
|
|
|
<para>
|
2001-10-04 22:26:23 +00:00
|
|
|
Calls a function on each valid #GHook.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
2001-10-04 22:26:23 +00:00
|
|
|
@may_recurse: %TRUE if hooks which are currently running (e.g. in another
|
2007-11-09 03:21:27 +00:00
|
|
|
thread) are considered valid. If set to %FALSE, these are skipped
|
|
|
|
@marshaller: the function to call for each #GHook
|
|
|
|
@marshal_data: data to pass to @marshaller
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
2001-10-04 22:26:23 +00:00
|
|
|
<!-- ##### USER_FUNCTION GHookMarshaller ##### -->
|
1999-08-16 17:58:30 +00:00
|
|
|
<para>
|
2001-10-04 22:26:23 +00:00
|
|
|
Defines the type of function used by g_hook_list_marshal().
|
|
|
|
</para>
|
1999-08-16 17:58:30 +00:00
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook: a #GHook
|
|
|
|
@marshal_data: user data
|
2001-10-04 22:26:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_hook_list_marshal_check ##### -->
|
|
|
|
<para>
|
|
|
|
Calls a function on each valid #GHook and destroys it if the
|
|
|
|
function returns %FALSE.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
2001-10-04 22:26:23 +00:00
|
|
|
@may_recurse: %TRUE if hooks which are currently running (e.g. in another
|
2007-11-09 03:21:27 +00:00
|
|
|
thread) are considered valid. If set to %FALSE, these are skipped
|
|
|
|
@marshaller: the function to call for each #GHook
|
|
|
|
@marshal_data: data to pass to @marshaller
|
2001-10-04 22:26:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### USER_FUNCTION GHookCheckMarshaller ##### -->
|
|
|
|
<para>
|
|
|
|
Defines the type of function used by g_hook_list_marshal_check().
|
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook: a #GHook
|
|
|
|
@marshal_data: user data
|
|
|
|
@Returns: %FALSE if @hook should be destroyed
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_hook_list_clear ##### -->
|
|
|
|
<para>
|
2000-09-07 16:36:56 +00:00
|
|
|
Removes all the #GHook elements from a #GHookList.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_hook_alloc ##### -->
|
|
|
|
<para>
|
2000-09-07 16:36:56 +00:00
|
|
|
Allocates space for a #GHook and initializes it.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
|
|
|
@Returns: a new #GHook
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO g_hook_append ##### -->
|
|
|
|
<para>
|
2000-09-07 16:36:56 +00:00
|
|
|
Appends a #GHook onto the end of a #GHookList.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
|
|
|
@hook: the #GHook to add to the end of @hook_list
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_hook_prepend ##### -->
|
|
|
|
<para>
|
2000-09-07 16:36:56 +00:00
|
|
|
Prepends a #GHook on the start of a #GHookList.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
|
|
|
@hook: the #GHook to add to the start of @hook_list
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_hook_insert_before ##### -->
|
|
|
|
<para>
|
2000-09-07 16:36:56 +00:00
|
|
|
Inserts a #GHook into a #GHookList, before a given #GHook.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
|
|
|
@sibling: the #GHook to insert the new #GHook before
|
|
|
|
@hook: the #GHook to insert
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_hook_insert_sorted ##### -->
|
|
|
|
<para>
|
2000-09-07 16:36:56 +00:00
|
|
|
Inserts a #GHook into a #GHookList, sorted by the given function.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
|
|
|
@hook: the #GHook to insert
|
|
|
|
@func: the comparison function used to sort the #GHook elements
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### USER_FUNCTION GHookCompareFunc ##### -->
|
|
|
|
<para>
|
2000-09-07 16:36:56 +00:00
|
|
|
Defines the type of function used to compare #GHook elements in
|
|
|
|
g_hook_insert_sorted().
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@new_hook: the #GHook being inserted
|
|
|
|
@sibling: the #GHook to compare with @new_hook
|
|
|
|
@Returns: a value <= 0 if @new_hook should be before @sibling
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_hook_compare_ids ##### -->
|
|
|
|
<para>
|
2000-09-07 16:36:56 +00:00
|
|
|
Compares the ids of two #GHook elements, returning a negative value
|
|
|
|
if the second id is greater than the first.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@new_hook: a #GHook
|
|
|
|
@sibling: a #GHook to compare with @new_hook
|
|
|
|
@Returns: a value <= 0 if the id of @sibling is >= the id of @new_hook
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_hook_get ##### -->
|
|
|
|
<para>
|
2001-10-04 22:26:23 +00:00
|
|
|
Returns the #GHook with the given id, or %NULL if it is not found.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
|
|
|
@hook_id: a hook id
|
|
|
|
@Returns: the #GHook with the given id, or %NULL if it is not found
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_hook_find ##### -->
|
|
|
|
<para>
|
2000-09-07 16:36:56 +00:00
|
|
|
Finds a #GHook in a #GHookList using the given function to test for a match.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
2001-10-04 22:26:23 +00:00
|
|
|
@need_valids: %TRUE if #GHook elements which have been destroyed should be
|
2007-11-09 03:21:27 +00:00
|
|
|
skipped
|
2001-10-04 22:26:23 +00:00
|
|
|
@func: the function to call for each #GHook, which should return %TRUE when
|
2007-11-09 03:21:27 +00:00
|
|
|
the #GHook has been found
|
|
|
|
@data: the data to pass to @func
|
|
|
|
@Returns: the found #GHook or %NULL if no matching #GHook is found
|
2001-10-04 22:26:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### USER_FUNCTION GHookFindFunc ##### -->
|
|
|
|
<para>
|
|
|
|
Defines the type of the function passed to g_hook_find().
|
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook: a #GHook
|
|
|
|
@data: user data passed to g_hook_find_func()
|
|
|
|
@Returns: %TRUE if the required #GHook has been found
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_hook_find_data ##### -->
|
|
|
|
<para>
|
2000-09-07 16:36:56 +00:00
|
|
|
Finds a #GHook in a #GHookList with the given data.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
2001-10-04 22:26:23 +00:00
|
|
|
@need_valids: %TRUE if #GHook elements which have been destroyed should be
|
2007-11-09 03:21:27 +00:00
|
|
|
skipped
|
|
|
|
@data: the data to find
|
2001-10-04 22:26:23 +00:00
|
|
|
@Returns: the #GHook with the given @data or %NULL if no matching
|
2007-11-09 03:21:27 +00:00
|
|
|
#GHook is found
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_hook_find_func ##### -->
|
|
|
|
<para>
|
2000-09-07 16:36:56 +00:00
|
|
|
Finds a #GHook in a #GHookList with the given function.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
2001-10-04 22:26:23 +00:00
|
|
|
@need_valids: %TRUE if #GHook elements which have been destroyed should be
|
2007-11-09 03:21:27 +00:00
|
|
|
skipped
|
|
|
|
@func: the function to find
|
2001-10-04 22:26:23 +00:00
|
|
|
@Returns: the #GHook with the given @func or %NULL if no matching
|
2007-11-09 03:21:27 +00:00
|
|
|
#GHook is found
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_hook_find_func_data ##### -->
|
|
|
|
<para>
|
2000-09-07 16:36:56 +00:00
|
|
|
Finds a #GHook in a #GHookList with the given function and data.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
2001-10-04 22:26:23 +00:00
|
|
|
@need_valids: %TRUE if #GHook elements which have been destroyed should be
|
2007-11-09 03:21:27 +00:00
|
|
|
skipped
|
|
|
|
@func: the function to find
|
|
|
|
@data: the data to find
|
2001-10-04 22:26:23 +00:00
|
|
|
@Returns: the #GHook with the given @func and @data or %NULL if no matching
|
2007-11-09 03:21:27 +00:00
|
|
|
#GHook is found
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_hook_first_valid ##### -->
|
|
|
|
<para>
|
2000-09-07 16:36:56 +00:00
|
|
|
Returns the first #GHook in a #GHookList which has not been destroyed.
|
|
|
|
The reference count for the #GHook is incremented, so you must call
|
|
|
|
g_hook_unref() to restore it when no longer needed. (Or call
|
|
|
|
g_hook_next_valid() if you are stepping through the #GHookList.)
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
2001-10-04 22:26:23 +00:00
|
|
|
@may_be_in_call: %TRUE if hooks which are currently running (e.g. in another
|
2007-11-09 03:21:27 +00:00
|
|
|
thread) are considered valid. If set to %FALSE, these are skipped
|
|
|
|
@Returns: the first valid #GHook, or %NULL if none are valid
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_hook_next_valid ##### -->
|
|
|
|
<para>
|
2000-09-07 16:36:56 +00:00
|
|
|
Returns the next #GHook in a #GHookList which has not been destroyed.
|
|
|
|
The reference count for the #GHook is incremented, so you must call
|
|
|
|
g_hook_unref() to restore it when no longer needed. (Or continue to call
|
2001-10-04 22:26:23 +00:00
|
|
|
g_hook_next_valid() until %NULL is returned.)
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
|
|
|
@hook: the current #GHook
|
2001-10-04 22:26:23 +00:00
|
|
|
@may_be_in_call: %TRUE if hooks which are currently running (e.g. in another
|
2007-11-09 03:21:27 +00:00
|
|
|
thread) are considered valid. If set to %FALSE, these are skipped
|
|
|
|
@Returns: the next valid #GHook, or %NULL if none are valid
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### ENUM GHookFlagMask ##### -->
|
|
|
|
<para>
|
2001-10-04 22:26:23 +00:00
|
|
|
Flags used internally in the #GHook implementation.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@G_HOOK_FLAG_ACTIVE: set if the hook has not been destroyed
|
|
|
|
@G_HOOK_FLAG_IN_CALL: set if the hook is currently being run
|
|
|
|
@G_HOOK_FLAG_MASK: A mask covering all bits reserved for
|
2005-06-30 03:13:35 +00:00
|
|
|
hook flags; see #G_HOOK_FLAGS_USER_SHIFT
|
|
|
|
|
2001-09-10 15:50:02 +00:00
|
|
|
<!-- ##### MACRO G_HOOK_FLAGS ##### -->
|
|
|
|
<para>
|
2001-10-04 22:26:23 +00:00
|
|
|
Returns the flags of a hook.
|
2001-09-10 15:50:02 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook: a #GHook
|
2001-09-10 15:50:02 +00:00
|
|
|
|
|
|
|
|
1999-08-16 17:58:30 +00:00
|
|
|
<!-- ##### MACRO G_HOOK_FLAG_USER_SHIFT ##### -->
|
|
|
|
<para>
|
2001-10-05 20:53:02 +00:00
|
|
|
The position of the first bit which is not reserved for internal
|
|
|
|
use be the #GHook implementation, i.e.
|
Remove references to nonexisting functions
* glib/gmain.c: Remove references to nonexisting functions
g_source_set_callback_closure(), g_source_poll(), g_source_add()
from docs.
* glib/gdir.c (g_dir_open): Typo fix in docs.
* glib/gasyncqueue.c (g_async_queue_lock):
(g_async_queue_unref_and_unlock): Fix markup to avoid erroneous
<link>s in docs.
* glib/gwin32.c: Escape #'s leading to erroneous <link>s in docs.
* glib/gtree.c: Replace some occurances of Gtree by GTree in docs.
* glib/gstring.c (g_string_insert_unichar): Typo fix in docs.
* glib/tmpl/conversions.sgml: Add GIConv.
* glib/tmpl/main.sgml: Fix references to nonexisting functions
g_main_loop_destroy(), g_source_add(), g_source_connect().
* glib/glib-sections.txt: Add GIConv, g_str_has_prefix, g_str_has_suffix.
* glib/tmpl/linked_lists_single.sgml:
* glib/tmpl/linked_lists_double.sgml: GListAllocator doesn't exist.
* glib/glib-docs.sgml: Declare hash entity.
* glib/tmpl/macros.sgml: Escape # in #ifdef to suppress erroneous links.
* gobject/Makefile.am, gobject/gobject-docs.sgml, gobject/tmpl/*:
* glib/Makefile.am, glib/glib-docs.sgml, glib/tmpl/*: Produce XML,
not SGML.
2002-05-26 22:46:28 +00:00
|
|
|
<literal>1 << G_HOOK_FLAG_USER_SHIFT</literal> is the first bit
|
2001-10-05 20:53:02 +00:00
|
|
|
which can be used for application-defined flags.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-09-10 15:50:02 +00:00
|
|
|
<!-- ##### MACRO G_HOOK ##### -->
|
|
|
|
<para>
|
2001-10-04 22:26:23 +00:00
|
|
|
Casts a pointer to a <literal>GHook*</literal>.
|
2001-09-10 15:50:02 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook: a pointer
|
2001-09-10 15:50:02 +00:00
|
|
|
|
|
|
|
|
1999-08-16 17:58:30 +00:00
|
|
|
<!-- ##### MACRO G_HOOK_IS_VALID ##### -->
|
|
|
|
<para>
|
2001-10-04 22:26:23 +00:00
|
|
|
Returns %TRUE if the #GHook is valid, i.e. it is in a #GHookList, it is active
|
2000-09-07 16:36:56 +00:00
|
|
|
and it has not been destroyed.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook: a #GHook
|
|
|
|
@Returns: %TRUE if the #GHook is valid
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO G_HOOK_ACTIVE ##### -->
|
|
|
|
<para>
|
2001-10-04 22:26:23 +00:00
|
|
|
Returns %TRUE if the #GHook is active, which is normally %TRUE until the #GHook
|
2000-09-07 16:36:56 +00:00
|
|
|
is destroyed.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook: a #GHook
|
|
|
|
@Returns: %TRUE if the #GHook is active
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO G_HOOK_IN_CALL ##### -->
|
|
|
|
<para>
|
2001-10-04 22:26:23 +00:00
|
|
|
Returns %TRUE if the #GHook function is currently executing.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook: a #GHook
|
|
|
|
@Returns: %TRUE if the #GHook function is currently executing
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO G_HOOK_IS_UNLINKED ##### -->
|
|
|
|
<para>
|
2001-10-04 22:26:23 +00:00
|
|
|
Returns %TRUE if the #GHook is not in a #GHookList.
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook: a #GHook
|
|
|
|
@Returns: %TRUE if the #GHook is not in a #GHookList
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_hook_ref ##### -->
|
|
|
|
<para>
|
2000-09-07 16:36:56 +00:00
|
|
|
Increments the reference count for a #GHook.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
|
|
|
@hook: the #GHook to increment the reference count of
|
2004-11-12 17:15:54 +00:00
|
|
|
@Returns: the @hook that was passed in (since 2.6)
|
|
|
|
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_hook_unref ##### -->
|
|
|
|
<para>
|
2000-09-07 16:36:56 +00:00
|
|
|
Decrements the reference count of a #GHook.
|
|
|
|
If the reference count falls to 0, the #GHook is removed from the #GHookList
|
|
|
|
and g_hook_free() is called to free it.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
|
|
|
@hook: the #GHook to unref
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_hook_free ##### -->
|
|
|
|
<para>
|
2007-11-09 03:21:27 +00:00
|
|
|
Calls the #GHookList @finalize_hook function if it exists, and frees the memory
|
2000-09-07 16:36:56 +00:00
|
|
|
allocated for the #GHook.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
|
|
|
@hook: the #GHook to free
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_hook_destroy ##### -->
|
|
|
|
<para>
|
2000-09-07 16:36:56 +00:00
|
|
|
Destroys a #GHook, given its ID.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
|
|
|
@hook_id: a hook ID
|
|
|
|
@Returns: %TRUE if the #GHook was found in the #GHookList and destroyed
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_hook_destroy_link ##### -->
|
|
|
|
<para>
|
2001-10-04 22:26:23 +00:00
|
|
|
Removes one #GHook from a #GHookList, marking it inactive and calling
|
|
|
|
g_hook_unref() on it.
|
1999-08-16 17:58:30 +00:00
|
|
|
</para>
|
|
|
|
|
2007-11-09 03:21:27 +00:00
|
|
|
@hook_list: a #GHookList
|
|
|
|
@hook: the #GHook to remove
|
1999-08-16 17:58:30 +00:00
|
|
|
|
|
|
|
|