dav/db.h

changeset 536
877f7c4a203b
parent 535
d814ee31c04f
child 541
e59a989d890d
equal deleted inserted replaced
535:d814ee31c04f 536:877f7c4a203b
44 #endif 44 #endif
45 45
46 #define DB_STORE_MODE 1 46 #define DB_STORE_MODE 1
47 #define DB_STORE_OWNER 2 47 #define DB_STORE_OWNER 2
48 48
49 typedef struct LocalResource LocalResource; 49 typedef struct LocalResource LocalResource;
50 typedef struct FilePart FilePart;
50 typedef struct SyncDatabase SyncDatabase; 51 typedef struct SyncDatabase SyncDatabase;
51 52
52 struct LocalResource { 53 struct LocalResource {
53 char *name; 54 char *name;
54 char *path; 55 char *path;
64 XAttributes *xattr; 65 XAttributes *xattr;
65 char *tags_hash; 66 char *tags_hash;
66 char *xattr_hash; 67 char *xattr_hash;
67 char *remote_tags_hash; 68 char *remote_tags_hash;
68 69
70 FilePart *parts;
71 size_t numparts;
72
69 int64_t blocksize; 73 int64_t blocksize;
70 74
71 DavBool tags_updated; 75 DavBool tags_updated;
72 DavBool finfo_updated; 76 DavBool finfo_updated;
73 DavBool xattr_updated; 77 DavBool xattr_updated;
74 DavBool metadata_updated; 78 DavBool metadata_updated;
75 79
76 DavBool keep; 80 DavBool keep;
77 DavBool restore; 81 DavBool restore;
82 };
83
84 struct FilePart {
85 uint64_t block;
86 char *hash;
87 char *etag;
78 }; 88 };
79 89
80 struct SyncDatabase { 90 struct SyncDatabase {
81 UcxMap *resources; 91 UcxMap *resources;
82 UcxMap *conflict; 92 UcxMap *conflict;
86 int store_db(SyncDatabase *db, char *name, uint32_t settings); 96 int store_db(SyncDatabase *db, char *name, uint32_t settings);
87 void destroy_db(SyncDatabase *db); 97 void destroy_db(SyncDatabase *db);
88 98
89 void local_resource_free(LocalResource *res); 99 void local_resource_free(LocalResource *res);
90 100
101 void filepart_free(FilePart *part);
102
91 LocalResource* process_resource(xmlTextReaderPtr reader); 103 LocalResource* process_resource(xmlTextReaderPtr reader);
92 LocalResource* process_conflict(xmlTextReaderPtr reader); 104 LocalResource* process_conflict(xmlTextReaderPtr reader);
93 105
94 106
95 #ifdef __cplusplus 107 #ifdef __cplusplus

mercurial