remove_hook

remove_hook — removes a hooked function.

Syntax

remove_hook (hook_sym, function_sym)
		

Arguments

hook_sym

One of several symbols used to identify a hook, as listed below.

function_sym

The function that is to be removed.

Returns

The hooked function (function_sym) that was removed.

Description

This function removes a hook that was previously set up with add_hook. The currently available hooks are:

taskstarted_hook
taskdied_hook
exception_hook
echo_hook
gc_hook
trace_symbol_hook
trace_entry_hook
trace_exit_hook
breakpoint_hook

Example

Modifying the example in add_hook by adding one line:

...

add_hook (#taskstarted_hook, #hook_started);
add_hook (#taskdied_hook, #hook_died);

run_hooks (#taskstarted_hook, "testing start");
run_hooks (#taskdied_hook, "testing died");

/* Remove the hook */
remove_hook (#taskstarted_hook, #hook_started);

while(t)
...

would remove the taskstarted_hook.

See Also

add_hook, run_hooks, init_ipc