[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.3, Fri Jun 20 02:55:49 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_3, VERSION_1_13_2, VERSION_1_13_1
Changes since 1.2: +6 -4 lines

let the build system cope with the recent ohash changes

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

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

int
main(void)
{
	struct ohash h;
	struct ohash_info i;
	i.alloc = xmalloc;
	i.calloc = xcalloc;
	i.free = xfree;
	ohash_init(&h, 2, &i);
	ohash_delete(&h);
	return 0;
}