diff options
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -24,13 +24,19 @@ #include <db.h> #include <stdint.h> +#ifndef MIN +#define MIN(a,b) ((a)<(b)?(a):(b)) +#endif + void statistics(DB *db); char* normalize_path(char *s); void rotdash(void); -const char* get_attached_filename(const char *path, const char *fn); +void rotdash_hide(void); +const char* get_snapshot_filename(const char *path, const char *fn); int isdirectory(const char *path); int copy_fd(int sfd, int dfd, uint32_t l); int copy_file(const char *src, const char *dst, int c); +int move_file(const char *src, const char *dst, int c); int copy_or_link_file(const char *src, const char *dst, int c); /* Remove all directories between path and root if they are empty. */ @@ -42,10 +48,10 @@ int mkdir_p(const char *path, mode_t m); /* Create all leading directories in path */ int makeprefixpath(const char *path, mode_t m); -int move_file(const char *src, const char *dst, int c); +int question(const char *q, const char *resp); + +/* Same as /bin/rm -rf in the shell */ +int rm_rf(const char *root, int rec); -#ifndef MIN -#define MIN(a,b) ((a)<(b)?(a):(b)) -#endif #endif |