[BACK]Return to test-ohash.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

File: [cvsweb.bsd.lv] / mandoc / test-ohash.c (download)

Revision 1.2, Sat Jun 9 11:02:55 2012 UTC (11 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.1: +1 -1 lines

Make test-ohash.c work on OpenBSD (it now works on have/havenots of OpenBSD
and OSX).

#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
#include <ohash.h>

void *xalloc(size_t sz, void *arg) { return(calloc(sz,1)); }
void xfree(void *p, size_t sz, void *arg) { free(p); }

int
main(void)
{
	struct ohash h;
	struct ohash_info i;
	i.halloc = i.alloc = xalloc;
	i.hfree = xfree;
	ohash_init(&h, 2, &i);
	ohash_delete(&h);
	return 0;
}