1274876Sbapt#include <stdint.h> 2274876Sbapt#include <stddef.h> 3274876Sbapt#include <stdlib.h> 4274876Sbapt#include <ohash.h> 5274876Sbapt 6316420Sbaptstatic void *xmalloc(size_t, void *); 7316420Sbaptstatic void *xcalloc(size_t, size_t, void *); 8316420Sbaptstatic void xfree(void *, void *); 9274876Sbapt 10316420Sbapt 11316420Sbaptstatic void * 12316420Sbaptxmalloc(size_t sz, void *arg) { 13316420Sbapt return calloc(1,sz); 14316420Sbapt} 15316420Sbapt 16316420Sbaptstatic void * 17316420Sbaptxcalloc(size_t nmemb, size_t sz, void *arg) 18316420Sbapt{ 19316420Sbapt return calloc(nmemb,sz); 20316420Sbapt} 21316420Sbapt 22316420Sbaptstatic void 23316420Sbaptxfree(void *p, void *arg) 24316420Sbapt{ 25316420Sbapt free(p); 26316420Sbapt} 27316420Sbapt 28274876Sbaptint 29274876Sbaptmain(void) 30274876Sbapt{ 31274876Sbapt struct ohash h; 32274876Sbapt struct ohash_info i; 33274876Sbapt i.alloc = xmalloc; 34274876Sbapt i.calloc = xcalloc; 35274876Sbapt i.free = xfree; 36274876Sbapt ohash_init(&h, 2, &i); 37274876Sbapt ohash_delete(&h); 38274876Sbapt return 0; 39274876Sbapt} 40