diff options
author | Timo Teräs <timo.teras@iki.fi> | 2020-01-11 09:38:06 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2020-01-11 11:32:21 +0200 |
commit | 1de9ef422c087ee8fc302c9d889dd373dc6dde58 (patch) | |
tree | 52ba9a433b0b754f5b93a970292f2cfb0502e42b /src/apk_io.h | |
parent | 7caa21773160f9be4d095ce0489d05e8d0131312 (diff) | |
download | apk-tools-1de9ef422c087ee8fc302c9d889dd373dc6dde58.tar.gz apk-tools-1de9ef422c087ee8fc302c9d889dd373dc6dde58.tar.bz2 apk-tools-1de9ef422c087ee8fc302c9d889dd373dc6dde58.tar.xz apk-tools-1de9ef422c087ee8fc302c9d889dd373dc6dde58.zip |
io: convert bstream mmap to istream, remove the now obsolete bstream machinery
Diffstat (limited to 'src/apk_io.h')
-rw-r--r-- | src/apk_io.h | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/apk_io.h b/src/apk_io.h index 1760e72..e943a8c 100644 --- a/src/apk_io.h +++ b/src/apk_io.h @@ -56,7 +56,6 @@ struct apk_file_info { extern size_t apk_io_bufsize; struct apk_istream; -struct apk_bstream; struct apk_ostream; struct apk_istream_ops { @@ -133,20 +132,6 @@ struct apk_istream *apk_istream_segment(struct apk_segment_istream *sis, struct struct apk_istream *apk_istream_tee(struct apk_istream *from, int atfd, const char *to, int copy_meta, apk_progress_cb cb, void *cb_ctx); -#define APK_BSTREAM_SINGLE_READ 0x0001 -#define APK_BSTREAM_EOF 0x0002 - -struct apk_bstream_ops { - void (*get_meta)(struct apk_bstream *bs, struct apk_file_meta *meta); - apk_blob_t (*read)(struct apk_bstream *bs, apk_blob_t token); - void (*close)(struct apk_bstream *bs); -}; - -struct apk_bstream { - unsigned int flags; - const struct apk_bstream_ops *ops; -}; - struct apk_ostream_ops { ssize_t (*write)(struct apk_ostream *os, const void *buf, size_t size); int (*close)(struct apk_ostream *os); @@ -158,38 +143,6 @@ struct apk_ostream { struct apk_ostream *apk_ostream_gzip(struct apk_ostream *); struct apk_ostream *apk_ostream_counter(off_t *); - - -struct apk_bstream *apk_bstream_from_istream(struct apk_istream *istream); -struct apk_bstream *apk_bstream_from_file(int atfd, const char *file); -struct apk_bstream *apk_bstream_from_fd(int fd); -struct apk_bstream *apk_bstream_from_fd_url_if_modified(int atfd, const char *url, time_t since); - -static inline struct apk_bstream *apk_bstream_from_url(const char *url) -{ - return apk_bstream_from_fd_url_if_modified(AT_FDCWD, url, 0); -} -static inline struct apk_bstream *apk_bstream_from_fd_url(int fd, const char *url) -{ - return apk_bstream_from_fd_url_if_modified(fd, url, 0); -} -static inline struct apk_bstream *apk_bstream_from_url_if_modified(const char *url, time_t since) -{ - return apk_bstream_from_fd_url_if_modified(AT_FDCWD, url, since); -} -static inline void apk_bstream_get_meta(struct apk_bstream *bs, struct apk_file_meta *meta) -{ - bs->ops->get_meta(bs, meta); -} -static inline apk_blob_t apk_bstream_read(struct apk_bstream *bs, apk_blob_t token) -{ - return bs->ops->read(bs, token); -} -static inline void apk_bstream_close(struct apk_bstream *bs) -{ - bs->ops->close(bs); -} - struct apk_ostream *apk_ostream_to_fd(int fd); struct apk_ostream *apk_ostream_to_file(int atfd, const char *file, const char *tmpfile, mode_t mode); struct apk_ostream *apk_ostream_to_file_gz(int atfd, const char *file, const char *tmpfile, mode_t mode); |