aboutsummaryrefslogtreecommitdiff
path: root/difftool/sqfsdiff.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-21 14:04:43 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-21 14:04:43 +0200
commit4ff2b4f689f4e530b6c6f3eed17a595f7ccf56fb (patch)
tree1e453c616d34a1547eb8e62949337e8361c6b31e /difftool/sqfsdiff.h
parent5cbc1267e5dc42149eeb07883f5f6239d22388e9 (diff)
Isolate sqfsdiff global state and split off option processing
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'difftool/sqfsdiff.h')
-rw-r--r--difftool/sqfsdiff.h28
1 files changed, 18 insertions, 10 deletions
diff --git a/difftool/sqfsdiff.h b/difftool/sqfsdiff.h
index f7d5139..ce6929f 100644
--- a/difftool/sqfsdiff.h
+++ b/difftool/sqfsdiff.h
@@ -23,13 +23,17 @@
#define MAX_WINDOW_SIZE (1024 * 1024 * 4)
-extern const char *old_path;
-extern const char *new_path;
-extern int compare_flags;
-extern sqfs_reader_t sqfs_old;
-extern sqfs_reader_t sqfs_new;
-extern bool old_is_dir;
-extern bool new_is_dir;
+typedef struct {
+ const char *old_path;
+ const char *new_path;
+ int compare_flags;
+ sqfs_reader_t sqfs_old;
+ sqfs_reader_t sqfs_new;
+ bool old_is_dir;
+ bool new_is_dir;
+ bool compare_super;
+ const char *extract_dir;
+} sqfsdiff_t;
enum {
COMPARE_NO_PERM = 0x01,
@@ -44,12 +48,16 @@ int compare_dir_entries(tree_node_t *a, tree_node_t *b);
char *node_path(tree_node_t *n);
-int compare_files(file_info_t *a, file_info_t *b, const char *path);
+int compare_files(sqfsdiff_t *sd, file_info_t *a, file_info_t *b,
+ const char *path);
-int node_compare(tree_node_t *a, tree_node_t *b);
+int node_compare(sqfsdiff_t *sd, tree_node_t *a, tree_node_t *b);
int compare_super_blocks(const sqfs_super_t *a, const sqfs_super_t *b);
-int extract_files(file_info_t *a, file_info_t *b, const char *path);
+int extract_files(sqfsdiff_t *sd, file_info_t *old, file_info_t *new,
+ const char *path);
+
+void process_options(sqfsdiff_t *sd, int argc, char **argv);
#endif /* DIFFTOOL_H */