summaryrefslogtreecommitdiffstats
path: root/util.h
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-04-11 08:52:07 +0200
committerBert <ber.t@gmx.com>2011-04-11 08:52:07 +0200
commitbac610ddc486fba1f6d40cd5a9a95fbb2bc6c8e5 (patch)
treec8f678d0a0926c30cd211807b1aa2f3c612304fc /util.h
parentb2f1b997ed60a40ffb9c0964ed0716c375b30072 (diff)
parentdd9e5dabb155fb9bb06d5a8e5fd6717df1751762 (diff)
downloadnsxiv-bac610ddc486fba1f6d40cd5a9a95fbb2bc6c8e5.tar.zst
Merge branch 'tcache'
Conflicts: main.c
Diffstat (limited to 'util.h')
-rw-r--r--util.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/util.h b/util.h
index f1db6b8..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))
@@ -30,6 +31,21 @@
#define TV_TO_DOUBLE(x) ((double) ((x).tv_sec) + 0.000001 * \
(double) ((x).tv_usec))
+#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
+ (tv)->tv_sec = (ts)->tv_sec; \
+ (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);
@@ -38,6 +54,13 @@ void die(const char*, ...);
void size_readable(float*, const char**);
+char* absolute_path(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*);
#endif /* UTIL_H */