-
Notifications
You must be signed in to change notification settings - Fork 3
/
headers.h
66 lines (47 loc) · 1.36 KB
/
headers.h
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef _HEADERS_H_
#define _HEADERS_H_
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <dirent.h>
#include <zlib.h>
#include <stdarg.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
#define pass(val) printf("Passed point %d\n", val);
#define single(type) calloc(1, sizeof(type))
#define DEBUG
#define PROGRAM_NAME "rdiff-backup-fs"
#define TMP_DIR_NAME PROGRAM_NAME "-XXXXXX"
#define MIRROR_PREFIX "mirror_metadata."
// strlen("mirror_metadata.XXXX-XX-XXTXX:XX:XX");
#define GMT_TYPE_POSITION 35
#define DIR_SIZE 4096
#define STRUCTURE_FULL 1
#define STRUCTURE_NECESSARY 2
#define LAYOUT_ALL 1
#define LAYOUT_LAST 2
/* type of policy used in caching files */
#define POLICY_SIMPLE 1
#define POLICY_LIMIT 2
#define ARCHFS_DIR_FORMAT "%4d-%02d-%02dT%02d:%02d:%02d"
#define ARCHFS_DIR_FORMAT_LENGTH "XXXX-XX-XXTXX:XX:XX"
#define MAX_FUSE_OPTIONS 1024
#define lock(mutex) pthread_mutex_lock(&mutex)
#define unlock(mutex) pthread_mutex_unlock(&mutex)
#define REV_LOCAL_TIME 1
#define REV_GMT_TIME 2
struct file_system_info {
int repo_count;
int *rev_count;
char **repos;
char **repo_names;
// TODO: this must be fixed; it doesn't hold actual information about revs,
// but only the most recent revs for multiple repos
char **revs;
int rev_dir_time;
};
#endif