xref: /minix3/external/bsd/mdocml/dist/test-ohash.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc #include <stdint.h>
2*0a6a1f1dSLionel Sambuc #include <stddef.h>
3*0a6a1f1dSLionel Sambuc #include <stdlib.h>
4*0a6a1f1dSLionel Sambuc #include <ohash.h>
5*0a6a1f1dSLionel Sambuc 
xalloc(size_t sz,void * arg)6*0a6a1f1dSLionel Sambuc void *xalloc(size_t sz, void *arg) { return(calloc(sz,1)); }
xfree(void * p,size_t sz,void * arg)7*0a6a1f1dSLionel Sambuc void xfree(void *p, size_t sz, void *arg) { free(p); }
8*0a6a1f1dSLionel Sambuc 
9*0a6a1f1dSLionel Sambuc int
main(void)10*0a6a1f1dSLionel Sambuc main(void)
11*0a6a1f1dSLionel Sambuc {
12*0a6a1f1dSLionel Sambuc 	struct ohash h;
13*0a6a1f1dSLionel Sambuc 	struct ohash_info i;
14*0a6a1f1dSLionel Sambuc 	i.halloc = i.alloc = xalloc;
15*0a6a1f1dSLionel Sambuc 	i.hfree = xfree;
16*0a6a1f1dSLionel Sambuc 	ohash_init(&h, 2, &i);
17*0a6a1f1dSLionel Sambuc 	ohash_delete(&h);
18*0a6a1f1dSLionel Sambuc 	return 0;
19*0a6a1f1dSLionel Sambuc }
20