diff options
author | Timo Teras <timo.teras@iki.fi> | 2008-11-28 16:28:54 +0200 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2008-11-28 16:28:54 +0200 |
commit | dc2ffc30e812fc52ad2bf4c11f36a69940f8d1ea (patch) | |
tree | 4fc16f961139f7e4b06c33ffdcc7dd7ce81a9567 /src/apk_io.h | |
parent | 4bafa681feb2b902553e26fd88df0f06b0c0778a (diff) | |
download | apk-tools-dc2ffc30e812fc52ad2bf4c11f36a69940f8d1ea.tar.gz apk-tools-dc2ffc30e812fc52ad2bf4c11f36a69940f8d1ea.tar.bz2 apk-tools-dc2ffc30e812fc52ad2bf4c11f36a69940f8d1ea.tar.xz apk-tools-dc2ffc30e812fc52ad2bf4c11f36a69940f8d1ea.zip |
io: apk_ostream stuff
Diffstat (limited to 'src/apk_io.h')
-rw-r--r-- | src/apk_io.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/apk_io.h b/src/apk_io.h index d9522f6..833257d 100644 --- a/src/apk_io.h +++ b/src/apk_io.h @@ -35,13 +35,20 @@ struct apk_istream { struct apk_bstream { size_t (*read)(void *stream, void **ptr); - void (*close)(void *stream, csum_p csum); + void (*close)(void *stream, csum_p csum, size_t *size); }; -struct apk_istream *apk_gunzip_bstream(struct apk_bstream *); +struct apk_ostream { + size_t (*write)(void *stream, const void *buf, size_t size); + void (*close)(void *stream); +}; + +struct apk_istream *apk_bstream_gunzip(struct apk_bstream *); +struct apk_ostream *apk_ostream_gzip(struct apk_ostream *); struct apk_istream *apk_istream_from_fd(int fd); struct apk_istream *apk_istream_from_file(const char *file); +struct apk_istream *apk_istream_from_file_gz(const char *file); struct apk_istream *apk_istream_from_url(const char *url); size_t apk_istream_skip(struct apk_istream *istream, size_t size); size_t apk_istream_splice(void *stream, int fd, size_t size); @@ -51,7 +58,9 @@ struct apk_bstream *apk_bstream_from_fd(int fd); struct apk_bstream *apk_bstream_from_file(const char *file); struct apk_bstream *apk_bstream_from_url(const char *url); -struct apk_istream *apk_istream_from_file_gz(const char *file); +struct apk_ostream *apk_ostream_to_fd(int fd); +struct apk_ostream *apk_ostream_to_file(const char *file, mode_t mode); +struct apk_ostream *apk_ostream_to_file_gz(const char *file, mode_t mode); apk_blob_t apk_blob_from_istream(struct apk_istream *istream, size_t size); apk_blob_t apk_blob_from_file(const char *file); |