dav/sync.h

changeset 372
2e15ff88a0ab
parent 369
4322b8953bd5
child 377
d6d7c16dd066
--- a/dav/sync.h	Sun Feb 04 15:58:07 2018 +0100
+++ b/dav/sync.h	Sun Apr 01 12:40:48 2018 +0200
@@ -51,6 +51,11 @@
 
 #define STDIN_BUF_SIZE 2048
 
+typedef struct SyncFile {
+    SyncDirectory *dir;
+    char *path;
+} SyncFile;
+    
 void print_usage(char *cmd);
 
 pthread_t start_sighandler(pthread_mutex_t *mutex) ;
@@ -87,6 +92,7 @@
 UcxList* sync_get_file_tags(SyncDirectory *dir, LocalResource *res, DavBool *changed);
 UcxList* sync_merge_tags(UcxList *tags1, UcxList *tags2);
 int sync_store_tags(SyncDirectory *dir, const char *path, LocalResource *local, DavResource *res);
+int sync_store_tags_local(SyncDirectory *dir, LocalResource *local, const char *path, UcxList *tags);
 int sync_put_resource(
         SyncDirectory *dir,
         DavResource *res,
@@ -103,6 +109,25 @@
 
 int cmd_trash_info(CmdArgs *args);
 int cmd_empty_trash(CmdArgs *args);
+
+int cmd_add_tag(CmdArgs *args);
+int cmd_remove_tag(CmdArgs *args);
+int cmd_update_tags(CmdArgs *args);
+int cmd_tagopt(CmdArgs *args, int cmd);
+
+/*
+ * gets the syncdir and resource path for a given file path
+ * 
+ * returns 0 or error code:
+ * 1: file not found
+ * 2: file permission error
+ * 3: stat error
+ * 4: file is not in any syncdir
+ * 5: file is in multiple syncdirs
+ * 6: syncdir not found
+ */
+int sync_get_file(CmdArgs *args, const char *path, const char *dir, SyncFile *f);
+
 int cmd_add_directory(CmdArgs *args);
 int cmd_list_dirs();
 int cmd_check_repositories();

mercurial