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