summaryrefslogtreecommitdiff
path: root/bin/sqfs2tar/sqfs2tar.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-05-24 16:56:53 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-05-30 17:49:40 +0200
commit8aa0366b85ce621ec54637ab4f9d37ad1e636e8f (patch)
treee92f60bbb761211363005386f16d254d46a19120 /bin/sqfs2tar/sqfs2tar.h
parent59631ccfde23d175e97bda016923bf9cbabbd92a (diff)
Cleanup: try to split sqfs2tar.c in a reasonable way
This comit breaks sqfs2tar into multiple files: - options.c contains the command line argument processing - write_tree.c contains the code for generating the actual tar archive - sqfs2tar.c contains what is left - A header is added for glueing it all together. No actual code is changed. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'bin/sqfs2tar/sqfs2tar.h')
-rw-r--r--bin/sqfs2tar/sqfs2tar.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/bin/sqfs2tar/sqfs2tar.h b/bin/sqfs2tar/sqfs2tar.h
new file mode 100644
index 0000000..afd267e
--- /dev/null
+++ b/bin/sqfs2tar/sqfs2tar.h
@@ -0,0 +1,48 @@
+/* SPDX-License-Identifier: GPL-3.0-or-later */
+/*
+ * sqfs2tar.h
+ *
+ * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
+ */
+#ifndef SQFS2TAR_H
+#define SQFS2TAR_H
+
+#include "config.h"
+#include "common.h"
+#include "tar.h"
+
+#include <getopt.h>
+#include <string.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+
+/* options.c */
+extern bool dont_skip;
+extern bool keep_as_dir;
+extern bool no_xattr;
+extern bool no_links;
+
+extern char *root_becomes;
+extern char **subdirs;
+extern size_t num_subdirs;
+
+extern const char *filename;
+
+void process_args(int argc, char **argv);
+
+/* tar2sqfs.c */
+extern sqfs_xattr_reader_t *xr;
+extern sqfs_data_reader_t *data;
+extern sqfs_super_t super;
+extern sqfs_hard_link_t *links;
+extern FILE *out_file;
+
+char *assemble_tar_path(char *name, bool is_dir);
+
+/* write_tree.c */
+int write_tree_dfs(const sqfs_tree_node_t *n);
+
+#endif /* SQFS2TAR_H */