aboutsummaryrefslogtreecommitdiff
path: root/bin/tar2sqfs/tar2sqfs.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-05-27 14:52:08 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-05-30 17:49:40 +0200
commit4332c116b303e0f86aaac4ae0bf699db5744769d (patch)
tree045d3ec030ec16862c114ed31994c6cfd6bf9bb9 /bin/tar2sqfs/tar2sqfs.h
parent8aa0366b85ce621ec54637ab4f9d37ad1e636e8f (diff)
Cleanup: try to split tar2sqfs.c in a reasonable way
This commit breaks tar2sqfs.c into multiple files: - options.c contains the command line argument processing - process_tarball.c contains the main tar repacking code - tar2sqfs.c contains what is left (the main function) - A header is added for gluing it all together. No actual code is changed. The tar repacking code is slightly modified to pass the sqfs writer and input file pointer around as argument rather than using a global variable. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'bin/tar2sqfs/tar2sqfs.h')
-rw-r--r--bin/tar2sqfs/tar2sqfs.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/bin/tar2sqfs/tar2sqfs.h b/bin/tar2sqfs/tar2sqfs.h
new file mode 100644
index 0000000..a27a50b
--- /dev/null
+++ b/bin/tar2sqfs/tar2sqfs.h
@@ -0,0 +1,37 @@
+/* SPDX-License-Identifier: GPL-3.0-or-later */
+/*
+ * tar2sqfs.h
+ *
+ * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
+ */
+#ifndef TAR2SQFS_H
+#define TAR2SQFS_H
+
+#include "config.h"
+#include "common.h"
+#include "compat.h"
+#include "tar.h"
+
+#include <stdlib.h>
+#include <getopt.h>
+#include <string.h>
+#include <stdio.h>
+#include <fcntl.h>
+
+#ifdef _WIN32
+#include <io.h>
+#endif
+
+/* options.c */
+extern bool dont_skip;
+extern bool keep_time;
+extern bool no_tail_pack;
+extern sqfs_writer_cfg_t cfg;
+extern char *root_becomes;
+
+void process_args(int argc, char **argv);
+
+/* process_tarball.c */
+int process_tarball(FILE *input_file, sqfs_writer_t *sqfs);
+
+#endif /* TAR2SQFS_H */