* $Id: hook.c 712 2006-02-06 04:42:14Z gxti $
*/
#include "stdinc.h"
-#include "memory.h"
-#include "tools.h"
#include "hook.h"
#include "irc_string.h"
void
init_hook(void)
{
- hooks = MyMalloc(sizeof(hook) * HOOK_INCREMENT);
+ hooks = rb_malloc(sizeof(hook) * HOOK_INCREMENT);
#ifdef USE_IODEBUG_HOOKS
h_iosend_id = register_hook("iosend");
{
hook *newhooks;
- newhooks = MyMalloc(sizeof(hook) * (max_hooks + HOOK_INCREMENT));
+ newhooks = rb_malloc(sizeof(hook) * (max_hooks + HOOK_INCREMENT));
memcpy(newhooks, hooks, sizeof(hook) * num_hooks);
- MyFree(hooks);
+ rb_free(hooks);
hooks = newhooks;
max_hooks += HOOK_INCREMENT;
}
i = register_hook(name);
- dlinkAddAlloc(fn, &hooks[i].hooks);
+ rb_dlinkAddAlloc(fn, &hooks[i].hooks);
}
/* remove_hook()
if((i = find_hook(name)) < 0)
return;
- dlinkFindDestroy(fn, &hooks[i].hooks);
+ rb_dlinkFindDestroy(fn, &hooks[i].hooks);
}
/* call_hook()
call_hook(int id, void *arg)
{
hookfn fn;
- dlink_node *ptr;
+ rb_dlink_node *ptr;
/* The ID we were passed is the position in the hook table of this
* hook
*/
- DLINK_FOREACH(ptr, hooks[id].hooks.head)
+ RB_DLINK_FOREACH(ptr, hooks[id].hooks.head)
{
fn = ptr->data;
fn(arg);