aboutsummaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorPhilip Wittamore <philip@wittamore.com>2026-05-04 06:22:25 +0200
committerPhilip Wittamore <philip@wittamore.com>2026-05-04 06:22:25 +0200
commitd55ed0c98536f1648ade005c8cb0c8da4101b6a3 (patch)
tree021adcc2fe4a37e1c24dbad8e7c3571df4795b6f /util.h
Diffstat (limited to 'util.h')
-rwxr-xr-xutil.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/util.h b/util.h
new file mode 100755
index 0000000..c0a50d4
--- /dev/null
+++ b/util.h
@@ -0,0 +1,9 @@
+/* See LICENSE file for copyright and license details. */
+
+#define MAX(A, B) ((A) > (B) ? (A) : (B))
+#define MIN(A, B) ((A) < (B) ? (A) : (B))
+#define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B))
+#define LENGTH(X) (sizeof (X) / sizeof (X)[0])
+
+void die(const char *fmt, ...);
+void *ecalloc(size_t nmemb, size_t size);