dav/scfg.h

changeset 648
fefe4b6f1048
parent 647
8bf1d9688698
child 649
0f4c59ac8c74
equal deleted inserted replaced
647:8bf1d9688698 648:fefe4b6f1048
62 #define SYNC_STORE_HASH(dir) ((dir)->store_hash) 62 #define SYNC_STORE_HASH(dir) ((dir)->store_hash)
63 63
64 typedef struct TagConfig TagConfig; 64 typedef struct TagConfig TagConfig;
65 typedef struct Versioning Versioning; 65 typedef struct Versioning Versioning;
66 typedef struct SplitConfig SplitConfig; 66 typedef struct SplitConfig SplitConfig;
67 typedef struct Filter Filter;
67 68
68 enum PushStrategy { 69 enum PushStrategy {
69 PUSH_STRATEGY_METADATA = 0, 70 PUSH_STRATEGY_METADATA = 0,
70 PUSH_STRATEGY_HASH 71 PUSH_STRATEGY_HASH
71 }; 72 };
72 typedef enum PushStrategy PushStrategy; 73 typedef enum PushStrategy PushStrategy;
74
75 struct Filter {
76 UcxList *include;
77 UcxList *exclude;
78 UcxList *tags;
79 };
73 80
74 typedef struct SyncDirectory { 81 typedef struct SyncDirectory {
75 char *name; 82 char *name;
76 char *path; 83 char *path;
77 char *trash; 84 char *trash;
78 char *collection; 85 char *collection;
79 char *repository; 86 char *repository;
80 char *database; 87 char *database;
81 TagConfig *tagconfig; 88 TagConfig *tagconfig;
82 Versioning *versioning; 89 Versioning *versioning;
83 UcxList *include; 90 Filter filter;
84 UcxList *exclude;
85 UcxList *tagfilter;
86 UcxList *splitconfig; 91 UcxList *splitconfig;
87 uint32_t metadata; 92 uint32_t metadata;
88 int max_retry; 93 int max_retry;
89 int allow_cmd; 94 int allow_cmd;
90 uint32_t symlink; 95 uint32_t symlink;
98 uint32_t db_settings; 103 uint32_t db_settings;
99 } SyncDirectory; 104 } SyncDirectory;
100 105
101 struct SplitConfig { 106 struct SplitConfig {
102 /* 107 /*
103 * path regex pattern or NULL 108 * resource filter or NULL
104 */ 109 */
105 regex_t *pattern; 110 Filter *filter;
106
107 /* 111 /*
108 * minimum file size for activating file splitting 112 * minimum file size for activating file splitting
109 * a value of -1 means no size restriction 113 * a value of -1 means no size restriction
110 */ 114 */
111 int64_t minsize; 115 int64_t minsize;
112
113 /* 116 /*
114 * split files into blocks with this size 117 * split files into blocks with this size
115 */ 118 */
116 size_t blocksize; 119 size_t blocksize;
117 }; 120 };
121
118 122
119 enum TagFormat { 123 enum TagFormat {
120 TAG_FORMAT_TEXT = 0, 124 TAG_FORMAT_TEXT = 0,
121 TAG_FORMAT_CSV, 125 TAG_FORMAT_CSV,
122 TAG_FORMAT_XML, 126 TAG_FORMAT_XML,
171 175
172 int add_directory(SyncDirectory *dir); 176 int add_directory(SyncDirectory *dir);
173 177
174 char* generate_db_name(char *basename); 178 char* generate_db_name(char *basename);
175 179
180 void free_filter(Filter filter);
181
176 void free_sync_config(); 182 void free_sync_config();
177 183
178 184
179 #ifdef __cplusplus 185 #ifdef __cplusplus
180 } 186 }

mercurial