summaryrefslogtreecommitdiff
path: root/src/apk_io.h
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-07-13 20:37:03 +0300
committerTimo Teras <timo.teras@iki.fi>2009-07-13 20:37:03 +0300
commite69b81f5259f532d5f5ae9c0a0f9bbd81240fbaf (patch)
tree37e35c615adedc9ab0d0ead39dd2156340f4f1d4 /src/apk_io.h
parent6b3444ed38c7367d3e0c0ae170ca69fb362a8d89 (diff)
downloadapk-tools-e69b81f5259f532d5f5ae9c0a0f9bbd81240fbaf.tar.gz
apk-tools-e69b81f5259f532d5f5ae9c0a0f9bbd81240fbaf.tar.bz2
apk-tools-e69b81f5259f532d5f5ae9c0a0f9bbd81240fbaf.tar.xz
apk-tools-e69b81f5259f532d5f5ae9c0a0f9bbd81240fbaf.zip
io: move csumming away from bstream to gunzip
in future we want to checksum on gzip boundary basis, not the full file.
Diffstat (limited to 'src/apk_io.h')
-rw-r--r--src/apk_io.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/apk_io.h b/src/apk_io.h
index b5e984a..629729a 100644
--- a/src/apk_io.h
+++ b/src/apk_io.h
@@ -36,7 +36,7 @@ struct apk_istream {
struct apk_bstream {
size_t (*read)(void *stream, void **ptr);
- void (*close)(void *stream, csum_p csum, size_t *size);
+ void (*close)(void *stream, size_t *size);
};
struct apk_ostream {
@@ -44,7 +44,20 @@ struct apk_ostream {
void (*close)(void *stream);
};
-struct apk_istream *apk_bstream_gunzip(struct apk_bstream *, int);
+#define APK_MPART_BEGIN 0
+#define APK_MPART_BOUNDARY 1
+#define APK_MPART_END 2
+
+typedef int (*apk_multipart_cb)(void *ctx, EVP_MD_CTX *mdctx, int part);
+
+struct apk_istream *apk_bstream_gunzip_mpart(struct apk_bstream *, int,
+ apk_multipart_cb cb, void *ctx);
+static inline struct apk_istream *apk_bstream_gunzip(struct apk_bstream *bs,
+ int autoclose)
+{
+ return apk_bstream_gunzip_mpart(bs, autoclose, NULL, NULL);
+}
+
struct apk_ostream *apk_ostream_gzip(struct apk_ostream *);
struct apk_istream *apk_istream_from_fd(int fd);