aboutsummaryrefslogtreecommitdiffstats
path: root/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'util.h')
-rw-r--r--util.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/util.h b/util.h
index 34e9b18..8e8a20d 100644
--- a/util.h
+++ b/util.h
@@ -21,6 +21,7 @@
#include <stdio.h>
#include <stdarg.h>
+#include <dirent.h>
#define ABS(a) ((a) < 0 ? (-(a)) : (a))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
@@ -35,6 +36,16 @@
(tv)->tv_usec = (ts)->tv_nsec / 1000; \
}
+typedef struct {
+ DIR *dir;
+ char *name;
+ int d;
+
+ char **stack;
+ int stcap;
+ int stlen;
+} r_dir_t;
+
void* s_malloc(size_t);
void* s_realloc(void*, size_t);
@@ -45,8 +56,10 @@ void size_readable(float*, const char**);
char* absolute_path(const char*);
-int create_dir_rec(const char*);
-char** read_dir_rec(const char*);
+int r_opendir(r_dir_t*, const char*);
+int r_closedir(r_dir_t*);
+char* r_readdir(r_dir_t*);
+int r_mkdir(const char *);
char* readline(FILE*);