From aef0f036f08f8949e4e2a5b84c9199ef8ec40595 Mon Sep 17 00:00:00 2001 From: Timo Teras Date: Fri, 7 Nov 2008 17:11:08 +0200 Subject: use zlib internally to decompress --- src/apk_archive.h | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/apk_archive.h') diff --git a/src/apk_archive.h b/src/apk_archive.h index 2e8d274..b51aee5 100644 --- a/src/apk_archive.h +++ b/src/apk_archive.h @@ -13,8 +13,8 @@ #define APK_ARCHIVE #include -#include #include "apk_blob.h" +#include "apk_io.h" struct apk_archive_entry { char *name; @@ -27,16 +27,19 @@ struct apk_archive_entry { mode_t mode; time_t mtime; dev_t device; - int read_fd; }; -typedef int (*apk_archive_entry_parser)(struct apk_archive_entry *entry, void *ctx); +typedef int (*apk_archive_entry_parser)(void *ctx, + const struct apk_archive_entry *ae, + struct apk_istream *istream); -pid_t apk_open_gz(int *fd); -int apk_parse_tar(int fd, apk_archive_entry_parser parser, void *ctx); -int apk_parse_tar_gz(int fd, apk_archive_entry_parser parser, void *ctx); -apk_blob_t apk_archive_entry_read(struct apk_archive_entry *ae); -int apk_archive_entry_extract(struct apk_archive_entry *ae, const char *to); -pthread_t apk_checksum_and_tee(int *fd, void *ptr); +struct apk_istream *apk_gunzip_bstream(struct apk_bstream *); + +int apk_parse_tar(struct apk_istream *, apk_archive_entry_parser parser, void *ctx); +int apk_parse_tar_gz(struct apk_bstream *, apk_archive_entry_parser parser, void *ctx); + +int apk_archive_entry_extract(const struct apk_archive_entry *ae, + struct apk_istream *is, + const char *to); #endif -- cgit v1.2.3