38 |
39 |
39 #ifdef __cplusplus |
40 #ifdef __cplusplus |
40 extern "C" { |
41 extern "C" { |
41 #endif |
42 #endif |
42 |
43 |
|
44 #define DB_STORE_MODE 1 |
|
45 #define DB_STORE_USER 2 |
|
46 |
43 typedef struct LocalResource LocalResource; |
47 typedef struct LocalResource LocalResource; |
44 typedef struct SyncDatabase SyncDatabase; |
48 typedef struct SyncDatabase SyncDatabase; |
45 |
49 |
46 struct LocalResource { |
50 struct LocalResource { |
47 char *name; |
51 char *name; |
48 char *path; |
52 char *path; |
49 char *etag; |
53 char *etag; |
50 time_t last_modified; |
54 time_t last_modified; |
|
55 mode_t mode; |
|
56 uid_t uid; |
|
57 gid_t gid; |
51 off_t size; |
58 off_t size; |
52 DavBool isdirectory; |
59 DavBool isdirectory; |
53 DavBool skipped; |
60 DavBool skipped; |
54 DavBool tags_updated; |
61 DavBool tags_updated; |
55 UcxBuffer *cached_tags; |
62 UcxBuffer *cached_tags; |
56 char *tags_hash; |
63 char *tags_hash; |
|
64 char *xattr_hash; |
57 |
65 |
58 DavBool keep; |
66 DavBool keep; |
59 DavBool restore; |
67 DavBool restore; |
60 }; |
68 }; |
61 |
69 |
63 UcxMap *resources; |
71 UcxMap *resources; |
64 UcxMap *conflict; |
72 UcxMap *conflict; |
65 }; |
73 }; |
66 |
74 |
67 SyncDatabase* load_db(char *name); |
75 SyncDatabase* load_db(char *name); |
68 int store_db(SyncDatabase *db, char *name); |
76 int store_db(SyncDatabase *db, char *name, uint32_t settings); |
69 void destroy_db(SyncDatabase *db); |
77 void destroy_db(SyncDatabase *db); |
70 |
78 |
71 void local_resource_free(LocalResource *res); |
79 void local_resource_free(LocalResource *res); |
72 |
80 |
73 LocalResource* process_resource(xmlTextReaderPtr reader); |
81 LocalResource* process_resource(xmlTextReaderPtr reader); |