summaryrefslogtreecommitdiff
path: root/src/apk_tar.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2021-07-26 16:25:03 +0300
committerTimo Teräs <timo.teras@iki.fi>2021-07-27 14:09:38 +0300
commit9c843e4ecdfee916ec835b5d35c10b3818aba9e3 (patch)
treed2c703035bbdaa1f21ce0e8ed0cf121b7388f656 /src/apk_tar.h
parent2d4e88aeb1690220ce57420e8d1d9de327ae901d (diff)
downloadapk-tools-9c843e4ecdfee916ec835b5d35c10b3818aba9e3.tar.gz
apk-tools-9c843e4ecdfee916ec835b5d35c10b3818aba9e3.tar.bz2
apk-tools-9c843e4ecdfee916ec835b5d35c10b3818aba9e3.tar.xz
apk-tools-9c843e4ecdfee916ec835b5d35c10b3818aba9e3.zip
Refactor .apk extraction code
This moves and isolates the tar code to tar.c. And the actual file extraction to disk is moved to extract.c. A new API is introduced and used for v2 file extraction. This essentially moves and isolates the apk_sign_ctx_* beast into extract_v2.c and offers a saner interface to handling packages. A place holder is added for v3 extraction.
Diffstat (limited to 'src/apk_tar.h')
-rw-r--r--src/apk_tar.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/apk_tar.h b/src/apk_tar.h
new file mode 100644
index 0000000..c3d951c
--- /dev/null
+++ b/src/apk_tar.h
@@ -0,0 +1,22 @@
+/* apk_tar.h - Alpine Package Keeper (APK)
+ *
+ * Copyright (C) 2005-2008 Natanael Copa <n@tanael.org>
+ * Copyright (C) 2008-2011 Timo Teräs <timo.teras@iki.fi>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: GPL-2.0-only
+ */
+
+#ifndef APK_TAR
+#define APK_TAR
+
+#include "apk_io.h"
+
+int apk_tar_parse(struct apk_istream *,
+ apk_archive_entry_parser parser, void *ctx,
+ struct apk_id_cache *);
+int apk_tar_write_entry(struct apk_ostream *, const struct apk_file_info *ae,
+ const char *data);
+int apk_tar_write_padding(struct apk_ostream *, const struct apk_file_info *ae);
+
+#endif