summaryrefslogtreecommitdiffstats
path: root/util.h
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2023-07-25 00:47:01 +0200
committerLouis Burda <quent.burda@gmail.com>2023-07-25 00:47:01 +0200
commit40d8eb449ed072b47bfbe953a191708f761c53a0 (patch)
tree63ed15404eb3acd99a9ca0f77654b2c97efe54d9 /util.h
parent29894d56e144223629e558070cbc52080e21342e (diff)
downloadtis100-40d8eb449ed072b47bfbe953a191708f761c53a0.tar.gz
tis100-40d8eb449ed072b47bfbe953a191708f761c53a0.zip
Reimplement value passing and improve curses ui
Diffstat (limited to 'util.h')
-rw-r--r--util.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/util.h b/util.h
index 7382cc1..37e0795 100644
--- a/util.h
+++ b/util.h
@@ -1,7 +1,17 @@
#pragma once
+#include <stddef.h>
+
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#define MAX(a, b) ((a) < (b) ? (b) : (a))
+#define ABS(a) ((a) > 0 ? (a) : -(a))
+
__attribute__((noreturn))
__attribute__((format(printf, 1, 2)))
void die(const char *fmt, ...);
+size_t strdcpy(char *dst, const char *src, size_t n);
+size_t strdcat(char *dst, const char *src, size_t n);
+
extern const char *progname;
+extern void (*cleanup)(void);