hook.c

00001 #include <stdlib.h>
00002 #include <u/libu.h>
00003 #include <klone/hook.h>
00004 #include <klone/hookprv.h>
00005 
00006 int hook_create(hook_t **phook)
00007 {
00008     hook_t *h = NULL;
00009 
00010     dbg_err_if(phook == NULL);
00011 
00012     h = u_zalloc(sizeof(hook_t));
00013     dbg_err_if(h == NULL);
00014 
00015     *phook = h;
00016 
00017     return 0;
00018 err:
00019     return ~0;
00020 }
00021 
00022 int hook_free(hook_t *hook)
00023 {
00024     dbg_err_if(hook == NULL);
00025 
00026     u_free(hook);
00027 
00028     return 0;
00029 err:
00030     return ~0;
00031 }
00032 

←Products
Copyright © 2005-2012 - KoanLogic S.r.l. - All rights reserved