summaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorBear <bear@bengtsson.win>2021-12-27 09:29:58 +0000
committerBear <bear@bengtsson.win>2021-12-27 09:29:58 +0000
commit69262b01ced79c2d776fab9b889926d1816a1e7a (patch)
treef304cd6fa8734e83a7772d07dc9b484781565155 /util.h
Added DWM
Diffstat (limited to 'util.h')
-rw-r--r--util.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/util.h b/util.h
new file mode 100644
index 0000000..1e3cf9a
--- /dev/null
+++ b/util.h
@@ -0,0 +1,19 @@
+/* See LICENSE file for copyright and license details. */
+
+#ifndef MAX
+#define MAX(A, B) ((A) > (B) ? (A) : (B))
+#endif
+#ifndef MIN
+#define MIN(A, B) ((A) < (B) ? (A) : (B))
+#endif
+#define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B))
+
+#ifdef _DEBUG
+#define DEBUG(...) fprintf(stderr, __VA_ARGS__)
+#else
+#define DEBUG(...)
+#endif
+
+void die(const char *fmt, ...);
+void *ecalloc(size_t nmemb, size_t size);
+