Struct
GLibHook
Description [src]
struct GHook {
gpointer data;
GHook* next;
GHook* prev;
guint ref_count;
gulong hook_id;
guint flags;
gpointer func;
GDestroyNotify destroy;
}
The GHook
struct represents a single hook function in a GHookList
.
Structure members
data:
gpointer
Data which is passed to func when this hook is invoked.
next:
GHook
Pointer to the next hook in the list.
prev:
GHook
Pointer to the previous hook in the list.
ref_count:
guint
The reference count of this hook.
hook_id:
gulong
The id of this hook, which is unique within its list.
flags:
guint
Flags which are set for this hook. See
GHookFlagMask
for predefined flags.func:
gpointer
The function to call when this hook is invoked. The possible signatures for this function are
GHookFunc
andGHookCheckFunc
.destroy:
GDestroyNotify
The default
finalize_hook
function of aGHookList
calls this member of the hook that is being finalized.
Functions
g_hook_destroy_link
Removes one GHook
from a GHookList
, marking it
inactive and calling g_hook_unref()
on it.
g_hook_first_valid
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
.).
g_hook_free
Calls the GHookList
finalize_hook
function if it exists,
and frees the memory allocated for the GHook
.
g_hook_next_valid
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
g_hook_next_valid()
until NULL
is returned.).
g_hook_unref
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.
Instance methods
g_hook_compare_ids
Compares the ids of two GHook
elements, returning a negative value
if the second id is greater than the first.