aboutsummaryrefslogtreecommitdiffstats
path: root/util.h
diff options
context:
space:
mode:
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 c0a50d4..eb3affb 100644
--- a/util.h
+++ b/util.h
@@ -5,5 +5,15 @@
#define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B))
#define LENGTH(X) (sizeof (X) / sizeof (X)[0])
+#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);
+int normalizepath(const char *path, char **normal);
+int mkdirp(const char *path);
+int parentdir(const char *path, char **parent);
+int nullterminate(char **str, size_t *len);