summaryrefslogtreecommitdiffstats
path: root/src/util.h
blob: 23004f0b950c3c83dcfce011e3818cf3930c5795 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef fooutilhfoo
#define fooutilhfoo

#include <db.h>
#include <stdint.h>

void statistics(DB *db);
char* normalize_path(char *s);
void rotdash(void);
const char* get_attached_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 copy_or_link_file(const char *src, const char *dst, int c);

/* Remove all directories between path and root if they are empty. */
int prune_empty_directories(const char *path, const char *root);

/* Same as /bin/mkdir -p in the shell */
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);

#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
#endif

#endif