From f1f80696ebe87520de0c857371e0ca109fce68cb Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 22 Sep 2007 13:32:42 +0000 Subject: Create a library of utility functions for the testsuite to use Make test/binding.c include stdio.h itself rather than relying on other things to include it. svn path=/trunk/dom/; revision=3568 --- test/lib/utils.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 test/lib/utils.h (limited to 'test/lib/utils.h') diff --git a/test/lib/utils.h b/test/lib/utils.h new file mode 100644 index 0000000..b57db36 --- /dev/null +++ b/test/lib/utils.h @@ -0,0 +1,35 @@ +/* + * This file is part of libdom test suite. + * Licensed under the MIT License, + * http://www.opensource.org/licenses/mit-license.php + * Copyright 2007 John-Mark Bell + */ + +#ifndef utils_h_ +#define utils_h_ + +#include +#include + +#ifndef max +#define max(a,b) ((a)>(b)?(a):(b)) +#endif + +#ifndef min +#define min(a,b) ((a)<(b)?(a):(b)) +#endif + +#ifndef SLEN +/* Calculate length of a string constant */ +#define SLEN(s) (sizeof((s)) - 1) /* -1 for '\0' */ +#endif + +#ifndef UNUSED +#define UNUSED(x) ((x) = (x)) +#endif + +void *myrealloc(void *ptr, size_t len, void *pw); +void mymsg(uint32_t severity, void *ctx, const char *msg, ...); + +#endif + -- cgit v1.2.3