summaryrefslogtreecommitdiff
path: root/farbfeld/util.h
diff options
context:
space:
mode:
authorstkhan <personal@slickd.xyz>2022-03-18 08:09:07 -0800
committerstkhan <personal@slickd.xyz>2022-03-18 08:09:07 -0800
commite20a439f0de08052fad50669fd005dee14d40cae (patch)
tree8ffed60a1dce40ae64fd8f336a4d1b5d103683f1 /farbfeld/util.h
parenta33351c3345f7b8657e6415878a73b5fedb09d72 (diff)
Update dwm, added farbfeld, sent, and wmname plus more
Diffstat (limited to 'farbfeld/util.h')
-rw-r--r--farbfeld/util.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/farbfeld/util.h b/farbfeld/util.h
new file mode 100644
index 0000000..f6e32c6
--- /dev/null
+++ b/farbfeld/util.h
@@ -0,0 +1,28 @@
+/* See LICENSE file for copyright and license details. */
+#include <stdint.h>
+#include <stdio.h>
+
+#define LEN(x) (sizeof (x) / sizeof *(x))
+
+extern char *argv0;
+
+void warn(const char *, ...);
+void die(const char *, ...);
+
+void ff_read_header(uint32_t *width, uint32_t *height);
+void ff_write_header(uint32_t width, uint32_t height);
+
+int parse_mask(const char *, uint16_t mask[3]);
+
+int fshut(FILE *, const char *);
+
+void efread(void *, size_t, size_t, FILE *);
+void efwrite(const void *, size_t, size_t, FILE *);
+
+#undef reallocarray
+void *reallocarray(void *, size_t, size_t);
+void *ereallocarray(void *optr, size_t nmemb, size_t size);
+
+#undef strtonum
+long long strtonum(const char *, long long, long long, const char **);
+long long estrtonum(const char *, long long, long long);