1 #ifndef MERGE_NEW_H
2 #define MERGE_NEW_H
3 
4 #include "common.h"
5 
6 #include "fs-mgr.h"
7 
8 struct MergeOptions;
9 
10 typedef int (*MergeCallback) (const char *basedir,
11                               SeafDirent *dirents[],
12                               struct MergeOptions *opt);
13 
14 typedef struct MergeOptions {
15     int                 n_ways; /* only 2 and 3 way merges are supported. */
16 
17     MergeCallback       callback;
18     void *              data;
19 
20     /* options only used in 3-way merge. */
21     char                remote_repo_id[37];
22     char                remote_head[41];
23     gboolean            do_merge;    /* really merge the contents
24                                       * and handle conflicts */
25     char                merged_tree_root[41]; /* merge result */
26     int                 visit_dirs;
27     gboolean            conflict;
28 } MergeOptions;
29 
30 int
31 seaf_merge_trees (const char *store_id, int version,
32                   int n, const char *roots[], MergeOptions *opt);
33 
34 #endif
35