dav/sync.h

changeset 503
f84e64afee61
parent 492
7bde663719dc
child 523
923a4528a2ae
equal deleted inserted replaced
502:a23fedac340c 503:f84e64afee61
57 57
58 typedef struct SyncFile { 58 typedef struct SyncFile {
59 SyncDirectory *dir; 59 SyncDirectory *dir;
60 char *path; 60 char *path;
61 } SyncFile; 61 } SyncFile;
62
63 enum RemoteChangeType {
64 REMOTE_NO_CHANGE = 0,
65 REMOTE_CHANGE_MODIFIED,
66 REMOTE_CHANGE_NEW,
67 REMOTE_CHANGE_DELETED,
68 REMOTE_CHANGE_CONFLICT_LOCAL_MODIFIED,
69 REMOTE_CHANGE_METADATA,
70 REMOTE_CHANGE_MKDIR
71 };
72 typedef enum RemoteChangeType RemoteChangeType;
73
74 typedef struct RemoteChange {
75 DavResource *resource;
76 RemoteChangeType type;
77 } RemoteChange;
62 78
63 void print_usage(char *cmd); 79 void print_usage(char *cmd);
64 80
65 pthread_t start_sighandler(pthread_mutex_t *mutex) ; 81 pthread_t start_sighandler(pthread_mutex_t *mutex) ;
66 void stop_sighandler(pthread_mutex_t *mutex, pthread_t tid); 82 void stop_sighandler(pthread_mutex_t *mutex, pthread_t tid);
69 85
70 int cmd_pull(CmdArgs *args); 86 int cmd_pull(CmdArgs *args);
71 int cmd_push(CmdArgs *args, DavBool archive); 87 int cmd_push(CmdArgs *args, DavBool archive);
72 int cmd_restore(CmdArgs *args); 88 int cmd_restore(CmdArgs *args);
73 89
90 RemoteChangeType resource_get_remote_change(
91 CmdArgs *a,
92 DavResource *res,
93 SyncDirectory *dir,
94 SyncDatabase *db);
95
74 int sync_get_resource( 96 int sync_get_resource(
75 CmdArgs *a, 97 CmdArgs *a,
76 SyncDirectory *dir, 98 SyncDirectory *dir,
77 DavResource *res, 99 DavResource *res,
78 SyncDatabase *db, 100 SyncDatabase *db,
79 DavBool force,
80 int *counter); 101 int *counter);
81 int sync_remove_local_resource(SyncDirectory *dir, LocalResource *res); 102 int sync_remove_local_resource(SyncDirectory *dir, LocalResource *res);
82 void sync_remove_local_directory(SyncDirectory *dir, LocalResource *res); 103 int sync_remove_local_directory(SyncDirectory *dir, LocalResource *res);
83 void rename_conflict_file(SyncDirectory *dir, SyncDatabase *db, char *path); 104 void rename_conflict_file(SyncDirectory *dir, SyncDatabase *db, char *path);
84 char* create_tmp_download_path(char *path); 105 char* create_tmp_download_path(char *path);
85 void move_to_trash(SyncDirectory *dir, char *path); 106 void move_to_trash(SyncDirectory *dir, char *path);
86 UcxList* local_scan(SyncDirectory *dir, SyncDatabase *db); 107 UcxList* local_scan(SyncDirectory *dir, SyncDatabase *db);
87 UcxList* read_changes(SyncDirectory *dir, SyncDatabase *db); 108 UcxList* read_changes(SyncDirectory *dir, SyncDatabase *db);

mercurial