diff options
author | Bert <ber.t@gmx.com> | 2011-04-11 08:52:07 +0200 |
---|---|---|
committer | Bert <ber.t@gmx.com> | 2011-04-11 08:52:07 +0200 |
commit | bac610ddc486fba1f6d40cd5a9a95fbb2bc6c8e5 (patch) | |
tree | c8f678d0a0926c30cd211807b1aa2f3c612304fc /util.h | |
parent | b2f1b997ed60a40ffb9c0964ed0716c375b30072 (diff) | |
parent | dd9e5dabb155fb9bb06d5a8e5fd6717df1751762 (diff) | |
download | nsxiv-bac610ddc486fba1f6d40cd5a9a95fbb2bc6c8e5.tar.zst |
Merge branch 'tcache'
Conflicts:
main.c
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -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 */ |