[BACK]Return to test-ohash.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / external / bsd / mdocml / dist

File: [cvs.NetBSD.org] / src / external / bsd / mdocml / dist / test-ohash.c (download)

Revision 1.1.1.2 (vendor branch), Thu Dec 17 21:58:48 2015 UTC (8 years, 4 months ago) by christos
Branch: MAIN, KRISTAPS
CVS Tags: pgoyette-localcount-base, mdocml-1-13-3
Branch point for: pgoyette-localcount
Changes since 1.1.1.1: +6 -4 lines

import mdocml 1.13.3

#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;
}