diff options
Diffstat (limited to 'src/hooks.cc')
-rw-r--r-- | src/hooks.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/hooks.cc b/src/hooks.cc index 0d89586a..e1dff3ce 100644 --- a/src/hooks.cc +++ b/src/hooks.cc @@ -100,6 +100,34 @@ void del_hook(int h_idx, hook_type hook) } } +void del_hook_new(int h_idx, bool_ (*hook_f)(void *, void *, void *)) +{ + hooks_chain *c = hooks_heads[h_idx], *p = NULL; + + /* Find it */ + while ((c != NULL) && (c->hook_f != hook_f)) + { + p = c; + c = c->next; + } + + /* Remove it */ + if (c != NULL) + { + if (p == NULL) + { + hooks_heads[h_idx] = c->next; + delete c; + } + else + { + p->next = c->next; + delete c; + } + } +}; + + /* get the next argument */ static hook_return param_pile[MAX_ARGS]; static int get_next_arg_pos = 0; |