util.h (view raw)
1/*
2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3 * See LICENSE file for license details.
4 */
5
6extern void error(char *errstr, ...);
7extern void *emallocz(unsigned int size);
8extern void *emalloc(unsigned int size);
9extern void *erealloc(void *ptr, unsigned int size);
10extern char *estrdup(const char *str);
11#define eassert(a) do { \
12 if(!(a)) \
13 failed_assert(#a, __FILE__, __LINE__); \
14 } while (0)
15void failed_assert(char *a, char *file, int line);
16void swap(void **p1, void **p2);