dav/db.h

changeset 521
c5bbae4b3cca
parent 444
761dc4867208
child 522
46f96dcd6eab
equal deleted inserted replaced
520:da2b0cc44e4f 521:c5bbae4b3cca
27 */ 27 */
28 28
29 #ifndef DB_H 29 #ifndef DB_H
30 #define DB_H 30 #define DB_H
31 31
32 #include <inttypes.h>
32 #include <libidav/webdav.h> 33 #include <libidav/webdav.h>
33 #include <ucx/map.h> 34 #include <ucx/map.h>
34 #include <ucx/buffer.h> 35 #include <ucx/buffer.h>
35 #include <time.h> 36 #include <time.h>
36 37
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);

mercurial