diff options
author | Timo Teras <timo.teras@iki.fi> | 2009-07-17 15:56:09 +0300 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2009-07-17 15:56:09 +0300 |
commit | e30834fdcbaf8b273f6e6eed411dec580bfbb4dd (patch) | |
tree | b546145cd915eb8233ece0b8effed56ff111fff1 /src/apk_io.h | |
parent | 0942832325f8e81d9e3cc7019cf1b1016d226533 (diff) | |
download | apk-tools-e30834fdcbaf8b273f6e6eed411dec580bfbb4dd.tar.gz apk-tools-e30834fdcbaf8b273f6e6eed411dec580bfbb4dd.tar.bz2 apk-tools-e30834fdcbaf8b273f6e6eed411dec580bfbb4dd.tar.xz apk-tools-e30834fdcbaf8b273f6e6eed411dec580bfbb4dd.zip |
digest: use oneshot context flag where approriate
speeds up digest calculation on some cases.
Diffstat (limited to 'src/apk_io.h')
-rw-r--r-- | src/apk_io.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/apk_io.h b/src/apk_io.h index e547668..fe6baac 100644 --- a/src/apk_io.h +++ b/src/apk_io.h @@ -35,7 +35,10 @@ struct apk_istream { void (*close)(void *stream); }; +#define APK_BSTREAM_SINGLE_READ 0x0001 + struct apk_bstream { + unsigned int flags; apk_blob_t (*read)(void *stream, apk_blob_t token); void (*close)(void *stream, size_t *size); }; @@ -45,11 +48,11 @@ struct apk_ostream { void (*close)(void *stream); }; -#define APK_MPART_BEGIN 0 -#define APK_MPART_BOUNDARY 1 -#define APK_MPART_END 2 +#define APK_MPART_DATA 1 /* data processed so far */ +#define APK_MPART_BOUNDARY 2 /* final part of data, before boundary */ +#define APK_MPART_END 3 /* signals end of stream */ -typedef int (*apk_multipart_cb)(void *ctx, EVP_MD_CTX *mdctx, int part); +typedef int (*apk_multipart_cb)(void *ctx, int part, apk_blob_t data); struct apk_istream *apk_bstream_gunzip_mpart(struct apk_bstream *, apk_multipart_cb cb, void *ctx); |