test-ohash.c revision 1.1.1.2
1#include <stdint.h> 2#include <stddef.h> 3#include <stdlib.h> 4#include <ohash.h> 5 6void *xmalloc(size_t sz, void *arg) { return(calloc(1,sz)); } 7void *xcalloc(size_t nmemb, size_t sz, void *arg) { return(calloc(nmemb,sz)); } 8void xfree(void *p, void *arg) { free(p); } 9 10int 11main(void) 12{ 13 struct ohash h; 14 struct ohash_info i; 15 i.alloc = xmalloc; 16 i.calloc = xcalloc; 17 i.free = xfree; 18 ohash_init(&h, 2, &i); 19 ohash_delete(&h); 20 return 0; 21} 22