util.h (528B)
1 /* See LICENSE file for copyright and license details. */ 2 3 #define MAX(A, B) ((A) > (B) ? (A) : (B)) 4 #define MIN(A, B) ((A) < (B) ? (A) : (B)) 5 #define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B)) 6 #define LEN(x) ((int)(sizeof (x) / sizeof *(x))) 7 8 #define DUMPD(x) printf("%s: %d\n", #x, x) 9 #define DUMPS(x) printf("%s: %s\n", #x, x) 10 11 void *ecalloc(size_t nmemb, size_t size); 12 void *emalloc(size_t size); 13 void *erealloc(void *p, size_t size); 14 char *estrdup(char *s); 15 16 void die(const char *errstr, ...);