summaryrefslogtreecommitdiff
path: root/misc.h
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2022-07-31 17:43:23 -0300
committermrb0nk500 <b0nk@b0nk.xyz>2022-07-31 17:43:23 -0300
commitae71a09d376d4b435e2290cda48dffa96d54b16b (patch)
tree282a550f86b5b05bcb66ece3ed1f15e1210718c9 /misc.h
parent300d834e9151637962d36df1ba650fbf1666c722 (diff)
misc: Add `is_dir()`, and `mkdirp()`
`is_dir()` checks if the supplied path is a directory, and returns 1 if it's a directory, 0 if it isn't a directory, and -1 if it doesn't exist. `mkdirp()` works like `mkdir()` except that it also creates parent directories if needed.
Diffstat (limited to 'misc.h')
-rw-r--r--misc.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/misc.h b/misc.h
index 0ad5fba..3a653e2 100644
--- a/misc.h
+++ b/misc.h
@@ -17,4 +17,6 @@ extern char *create_num_str(const char *str, int num);
extern int is_empty(const char *str);
extern char *skip_whitespace(const char *str);
extern int format_len(const char *fmt, ...);
+extern int is_dir(const char *path);
+extern void mkdirp(const char *path, int mode);
#endif